kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* IPV6 header creation for dhcpv6 packet
@ 2011-06-14 12:45 Prabhu
  0 siblings, 0 replies; only message in thread
From: Prabhu @ 2011-06-14 12:45 UTC (permalink / raw)
  To: kernelnewbies

HI all,

I am writing  simple dhcpv6 client. I gone through the rfc of dhcp and 
ipv6 and understand basic. With the understanding i started to implement 
SOLICIT request option.
I have created a packet with the below structure.

struct udp_dhcp6_packet {

         struct ip6_hdr ip;

         struct udphdr udp;

         struct dhcp6_Message data;

} PACKED;

In the above structure i am able to assign the value for udp and 
data(i.e struct udphdr, struct dhcp6_Message). But i could not able to 
set the value for ip. Below is the structure of ip6_hdr.

struct ip6_hdr
   {
     union   {

         struct ip6_hdrctl
           {
             uint32_t ip6_un1_flow;   /* 4 bits version, 8 bits TC,
                                         20 bits flow-ID */
             uint16_t ip6_un1_plen;   /* payload length */
             uint8_t  ip6_un1_nxt;    /* next header */
             uint8_t  ip6_un1_hlim;   /* hop limit */
           } ip6_un1;
         uint8_t ip6_un2_vfc;       /* 4 bits version, top 4 bits tclass */
       } ip6_ctlun;
     struct in6_addr ip6_src;      /* source address */
     struct in6_addr ip6_dst;      /* destination address */
   };

I want to set the ip6_dst value as ff02::1:2 and the ip6_src address as 
fe80::220:4aff:fea8:8e4a and remaining options. But i dont have any idea 
how to set these values. I googled many times and not able to get the 
idea to creat ipv6 header.

Kindly help me to solve my problem?

Note :

I don't know whether this is right place to ask this question . If i am 
wrong , i am sorry.

Thanks in advance ,


Prabhu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110614/313c475a/attachment-0001.html 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-14 12:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14 12:45 IPV6 header creation for dhcpv6 packet Prabhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).