Пример #1
0
 /// <summary>
 /// Decode any options sent by the client inside this IA_NA.  Mostly, we are
 /// a hint to which address(es) it may want.RFC 3315 does not specify if
 /// a client can actually provide any options other than IA_ADDR options in
 /// inside the IA_NA, but it does not say that the client cannot do so, and
 /// the IA_NA option definition supports any type of sub-options.
 /// </summary>
 /// <param name="buf">buf ByteBuffer positioned at the start of the options in the packet</param>
 /// <param name="eof">eof the eof</param>
 protected void DecodeOptions(ByteBuffer buf, long eof)
 {
     while (buf.position() < eof)
     {
         int code = Util.GetUnsignedShort(buf);
         log.Debug("Option code=" + code);
         DhcpOption option = DhcpV6OptionFactory.GetDhcpOption(code);
         if (option != null)
         {
             option.Decode(buf);
             if (option is DhcpV6IaAddrOption)
             {
                 iaAddrOptions.Add((DhcpV6IaAddrOption)option);
             }
             else
             {
                 PutDhcpOption(option);
             }
         }
         else
         {
             break;  // no more options, or one is malformed, so we're done
         }
     }
 }
 protected void DecodeOptions(ByteBuffer buf)
 {
     while (buf.hasRemaining())
     {
         int code = Util.GetUnsignedShort(buf);
         log.Debug("Option code=" + code);
         DhcpOption option = DhcpV6OptionFactory.GetDhcpOption(code);
         if (option != null)
         {
             option.Decode(buf);
             dhcpOptions[option.GetCode()] = option;
         }
         else
         {
             break;  // no more options, or one is malformed, so we're done
         }
     }
 }