<div>Hi</div> <div> </div> <div>I am going through the radvd src code. In send.c program, i find the send_ra() fn which creates the various options and sends the ra using sendmsg.</div> <div>I suppose the msgs are created in the TLV format. I am wondering how the length filed is calculated. For example, while creating the prefix info option, the length field is set to 4 (pinfo->nd_opt_pi_len = 4;). Can you please let me know how the length field is calculated and how it is 4 for the prefix option</div> <div> </div> <div><FONT size=2>while(prefix)</div> <div>{</div> <div>dlog(LOG_DEBUG, 3, "Adding prefix on %p", prefix);</div> <div>if( prefix->enabled )</div> <div>{</div> <div>struct nd_opt_prefix_info *pinfo;</div> <div></div> <div>pinfo = (struct nd_opt_prefix_info *) (buff + len);</div> <div>pinfo->nd_opt_pi_type = ND_OPT_PREFIX_INFORMATION;</div> <div>pinfo->nd_opt_pi_len = 4;</div> <div>pinfo->nd_opt_pi_prefix_len =
prefix->PrefixLen;</div> <div></div> <div>pinfo->nd_opt_pi_flags_reserved = </div> <div>(prefix->AdvOnLinkFlag)?ND_OPT_PI_FLAG_ONLINK:0;</div> <div>pinfo->nd_opt_pi_flags_reserved |=</div> <div>(prefix->AdvAutonomousFlag)?ND_OPT_PI_FLAG_AUTO:0;</div> <div>/* Mobile IPv6 ext */</div> <div>pinfo->nd_opt_pi_flags_reserved |=</div> <div>(prefix->AdvRouterAddr)?ND_OPT_PI_FLAG_RADDR:0;</div> <div>pinfo->nd_opt_pi_valid_time = htonl(prefix->AdvValidLifetime);</div> <div>pinfo->nd_opt_pi_preferred_time = htonl(prefix->AdvPreferredLifetime);</div> <div>pinfo->nd_opt_pi_reserved2 = 0;</div> <div></div> <div>memcpy(&pinfo->nd_opt_pi_prefix, &prefix->Prefix,</div> <div>sizeof(struct in6_addr));</div> <div>len += sizeof(*pinfo);</div> <div>}</div> <div></FONT> </div> <div> </div> <div>Sorry for troubling with a trivial doubt.</div> <div> </div> <div>Many thanks</div> <div> </div> <div>Magesh</div><p>
                <hr size=1>Yahoo! Mail<br>
Bring photos to life! <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=39174/*http://photomail.mail.yahoo.com">New PhotoMail </a> makes sharing a breeze.