/// <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); } }
/// <summary> /// Removes an option from this structure /// </summary> /// <param name="oOption">The option to remove</param> public void RemoveOption(IPOption oOption) { lOptions.Remove(oOption); }
/// <summary> /// Adds an option to this structure /// </summary> /// <param name="oOption">The option to add</param> public void AddOption(IPOption oOption) { lOptions.Add(oOption); }