Пример #1
0
        /// <summary>
        /// Creates a new instance of this class by parsing the given data
        /// </summary>
        /// <param name="bOptionBytes">The data to parse</param>
        public IPv4Options(byte[] bOptionBytes)
        {
            lOptions = new List <IPOption>();
            int      iOffset = 0;
            IPOption oOption;

            while (iOffset < bOptionBytes.Length)
            {
                byte[] bSubBytes = new byte[bOptionBytes.Length - iOffset];
                for (int iC1 = iOffset; iC1 < bOptionBytes.Length; iC1++)
                {
                    bSubBytes[iC1 - iOffset] = bOptionBytes[iC1];
                }
                oOption  = new IPOption(bSubBytes);
                iOffset += oOption.OptionLength;
                lOptions.Add(oOption);
            }
        }
Пример #2
0
 /// <summary>
 /// Removes an option from this structure
 /// </summary>
 /// <param name="oOption">The option to remove</param>
 public void RemoveOption(IPOption oOption)
 {
     lOptions.Remove(oOption);
 }
Пример #3
0
 /// <summary>
 /// Adds an option to this structure
 /// </summary>
 /// <param name="oOption">The option to add</param>
 public void AddOption(IPOption oOption)
 {
     lOptions.Add(oOption);
 }