On Sun, 21 Nov 1999 20:51:25 +0100 venaas@xxxxxxxxxxx wrote:
>You're not supposed to use IP_HDRINCL with IPv6, see RFC 2292. It
>might help to look at some source code, see for instance the ping
>code in the inet6-apps package at http://www.inner.net/pub/ipv6/
Thank you! Venaas.
But what I want to do is to fill the Traffic Class field and
the Flow Label field to do some test. Rfc2292 does not state about it.
Then I used IPPROTO_RAW as the third parameter in call to socket
and set the IP_HDRINCL option. I found I could fill the flow label!
That is:
sockfd=socket(AF_INET6,SOCK_RAW,IPPROTO_RAW);
setsockopt(sockfd,IPPROTO_IPV6,IP_HDRINCL,&on,sizeof(on));
I have still another question here.
I have read rfc2292 several times. Now I want to send a IPv6
packet with some options(such as hop by hop and others).So I use
sendmsg() to do it.But it seems that some of the functions mentioned
in the rfc do not work on my system.I write a very simple programme
to test the functions inet6_option_xxxx():
#include <netinet/in.h>
#include <stdio.h>
main ()
{int len;
struct cmsghdr hdr;
len = inet6_option_space(sizeof(struct cmsghdr));
printf ("len=135705528\n", len);
}
# cc -o hopbyhop hopbyhop.c
/tmp/ccHGMtzn.o: In function `main':
/tmp/ccHGMtzn.o(.text+0x9): undefined reference to inet6_option_space'
collect2: ld returned 1 exit status
What's the problem? Any library need to be included or my system
does not support them at all? I try to find these functions in the
source code but in vain. What can I do?
BTW:The version of my Linux system is 2.2.13.
_____________________________________________
Ê×¶¼ÔÚÏß--ÏȽøÖйúÈ˵ÄÍøÉϼÒÔ° http://www.263.net
Ãâ·ÑÓÊÏä ÓʼþÔÓÖ¾ Ç©ÃûÓʼþ Óʼþ¼ÓÃÜ Óʼþ×·Éíºô
ËÑË÷ÒýÇæ ¸öÈËÕ¾µã ÔÚÏßÓÎÏ· ÍøÉÏÁÄÌì ÍøÉϹҺÅ
½ðÈÚÍõ¹ú ÔÚÏßɱ¶¾ ÌøÔéÊг¡ Èí¼þÏÂÔØ ÐÝÏÐÓéÀÖ
ŵ·½°²È«£¬ÖúÄúe·ƽ°²
|