in "4.Access to IPv6 and Extension Headers" there is
--------
First, to receive any of this optional information (other than the
next hop address, which can only be set), the application must call
setsockopt() to turn on the corresponding flag:
int on = 1;
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on,
sizeof(on));
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on,
sizeof(on));
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVRTHDR, &on,
sizeof(on));
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVHOPOPTS, &on,
sizeof(on));
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVDSTOPTS, &on,
sizeof(on));
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVTCLASS, &on, sizeof(on));
---------
I have said it before, but I repeat it once more: above is wrong
design because:
- api has to be redefined every time a new extension header is
introduced,
- and if that extension header can appear in multiple places, you
have to define multiple options for each possible combination.
A much better API would be some definition similar to "struct
icmp6_filter", which would use the protocol numbers.
If a header occurs multiple times, application would receive all of
them.
If application needs to care whether some header occurs before
another (like DST OPT before Routing), then it would ask both and it
can easily find out what it needs (and for common case, like dstopt
vs. routing, a small library routine might be provided).
--
Markku Savela <[EMAIL PROTECTED]>
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page: http://playground.sun.com/ipng
FTP archive: ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [EMAIL PROTECTED]
--------------------------------------------------------------------