olaf@bigred.inka.de (Olaf Titz) writes:
> > > Still too much code duplication (and it reeks of the SMALLBUF, BIGBUF
> > > things found in too many apps).
> >
> > No, just one type, "netaddrstring_t" or something like that, for
> > exactly this purpose.
>
> You mean, define that to a suitable array? Like
> __u32 x;
> addrstr_ipv4_t adr;
> addrstr_ipv4_ntoa(&adr, x);
> printk("%s", adr);
Yes, that's the idea.
> (note the "ipv4" as name component; we're going to need an ipv6 one too)
addrstr_t is sufficient if it's large enough to accommodate the
printable representation of all addresses.
> That would probably be OK, although I don't think we _need_ the
> explicit buffers.
If you add code for all the address types to prinkt(), no.
> > > This is _perfect_ stuff for writing a suitable library function.
> >
> > What is a suitable library function in this case, IYO?
>
> printk(). Need to find a suitable syntax for different address
> families though.
printk() has to be in every kernel, and you don't want to have all
this address formatting code inside it, do you? ;) (You can't make it
a compile-time option because modules won't work properly.)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:12 EST