All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH 0/2] Initial IPv6 support
@ 2013-01-16 10:01 Chris Packham
  2013-01-16 10:01 ` [U-Boot] [RFC PATCH 1/2] Initial net6.h Chris Packham
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chris Packham @ 2013-01-16 10:01 UTC (permalink / raw)
  To: u-boot

Here's something simple to get started. IP6addr_t is added as a typedef
(for consistency with IPaddr_t). I ended up borrowing and adapting the
vsprintf code from Linux.

Here is an example of the printf formatting

With this code

  IP6addr_t addr6 = {.u6_addr16[0] = 0x3ffe,
                     .u6_addr16[1] = 0x1234,
                     .u6_addr16[7] = 0x0001};
  IPaddr_t addr4 = 0x7f000001;

  printf("addr6=%pi6\n", &addr6);
  printf("addr6=%pI6\n", &addr6);
  printf("addr6=%pI6c\n", &addr6);
  printf("addr=%pI4\n", &addr4);

We get the output

  addr6=3ffe1234000000000000000000000001
  addr6=3ffe:1234:0000:0000:0000:0000:0000:0001
  addr6=3ffe:1234::1
  addr4=127.0.0.1

My work so far on this has raised a few questions:

1) Presumably the majority of the actual V6 code would be included by a
config option (CONFIG_IPV6). How far should I take that? Should the
vsprintf code be conditional?

2) Our current out of tree code parallels net.c and net.h. Should I
continue this for the final version or integrate it into net.[ch]. 

3) rxhand_f currently takes an IPaddr_t. I haven't looked at the usage
of this yet but to support V6 this may need to be a new union or a void
*.

(note on my split personality, I use a gmail account to post to the
u-boot mailing list but since this work is being done as part of my
$dayjob the author and s-o-b are using my work email address)


#####################################################################################
Scanned by MailMarshal - M86 Security's comprehensive email content security solution. 
#####################################################################################

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-16 22:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 10:01 [U-Boot] [RFC PATCH 0/2] Initial IPv6 support Chris Packham
2013-01-16 10:01 ` [U-Boot] [RFC PATCH 1/2] Initial net6.h Chris Packham
2013-01-16 22:37   ` Kim Phillips
2013-01-16 10:01 ` [U-Boot] [RFC PATCH 2/2] lib/vsprintf.c: add IPv6 compressed format %pI6c Chris Packham
2013-01-16 10:18 ` [U-Boot] [RFC PATCH 0/2] Initial IPv6 support Chris Packham

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.