Hi,

I am looking for a way to make code between ipv4 and ipv6 having less
ifdef's. What I (think I)  need is a way to find out the PF_xxx of a
socket socket. Much like:


if (do6)
        s = socket(PF_INET6, ...);
else
        s = socket(PF_INET, ...);

setsockopt(s, IPPROTO_IPvX(s), ...);


I want to write the macro IPPROTO_IPvX(s), returning IPPROTO_IP if the
socket's domain is PF_INET and IPPROTO_IPV6 if it's PF_INET6. 

I have been going trhough rfc2553 but couldn't find it. Does anybody
have a clue ?

- Wilbert

---------------------------------------------------------------------
The IPv6 Users Mailing List
Unsubscribe by sending "unsubscribe users" to [EMAIL PROTECTED]

Reply via email to