From: prabhum@msys-tech.com (Prabhu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: IPV6 header creation for dhcpv6 packet
Date: Tue, 14 Jun 2011 18:15:04 +0530 [thread overview]
Message-ID: <4DF757D0.7070503@msys-tech.com> (raw)
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
reply other threads:[~2011-06-14 12:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DF757D0.7070503@msys-tech.com \
--to=prabhum@msys-tech.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.