Subject: Re: sockaddr_snprintf
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: mouss <>
List: tech-userlevel
Date: 11/18/2004 02:11:06
der Mouse wrote:

>So if you really want getnameinfo() to not go making gratuitous
>syscalls on you - you want it to be _just_ a purely user-level "format
>this data" call - you have to check the address family for IPv6, and
>then check the scope ID, and if it's nonzero, format it with a zero
>scope ID and attach the scope ID - as a number - yourself?
>Ugh.  What is one _supposed_ to use for debugging output?  Or is there
one is supposed to wait for IPv17 and hope to see it before one dies:)

gone are the days when you could call functions with 1,2, 3 args. Now 
you need 7 args. but be happy, next version of getnameinfo will get more 
args to support future options. Of course, this is for your benefit: you 
can now take a protocol dependent var, convert it to pf independant one, 
call getnameinfo, and then call you pf dependent function do work on it....
(There must be a Dilbert version of this)

gone are the days when you could bind to anyaddr, accept() and fork (or 
call handlers). Now you need to bind both ipv4 and ipv6 addresses... if 
you can think of a pf independent way to do so, tell me:)

gone are the days when numbers were just numbers, be them IPs, ports, 
protocols. Now you need names. now, you need to call functions with a 
lot of args and possibilities. of course, for your happiness, the 
commitee has created some big structs to put your vars in. you don't 
need to say getaddrinfo(var1, var2, ... var19). you "just" need to do
foo.field1. = val1; foo.field2 = val2; ...; getaddrinfo(foo, ...);
This may seem longer, but it's more OO-like, so it's modern. (and of 
course, don't forget to free storage, cos' modern or not, there is no 
garbage collector here)

say what. get*info are massive code sanity destruction functions. the 
code is over;-p