private T GetIdentiyAssocation <T>(DHCPv6PacketOptionTypes optionType, UInt32 identityAssocationId) where T : DHCPv6PacketIdentityAsociationOption { var result = _options.Where(x => x.Code == (UInt16)optionType) .Cast <T>() .Where(x => x.Id == identityAssocationId).FirstOrDefault(); return(result); }
private UInt32?GetIdentityAssocationId(DHCPv6PacketOptionTypes optionType) { var option = _options.Where(x => x.Code == (UInt16)optionType) .Cast <DHCPv6PacketIdentityAsociationOption>().FirstOrDefault(); if (option == null) { return(null); } return(option.Id); }
public DUID GetIdentifier(DHCPv6PacketOptionTypes optionType) { var option = _options.FirstOrDefault(x => x.Code == (UInt16)optionType); if (option == null || option is DHCPv6PacketIdentifierOption == false) { return(DUID.Empty); } var casedOption = (DHCPv6PacketIdentifierOption)option; return(casedOption.DUID); }
public DHCPv6PacketIdentifierOption(DHCPv6PacketOptionTypes code, DUID duid) : this((UInt16)code, duid) { }
public DHCPv6PacketByteArrayOption(DHCPv6PacketOptionTypes type, Byte[] content, Int32 contentLength) : this(type, ByteHelper.CopyData(content, 0, contentLength)) { }
public DHCPv6PacketByteArrayOption(DHCPv6PacketOptionTypes type, Byte[] content) : this((UInt16)type, content) { }
public DHCPv6PacketUInt32Option(DHCPv6PacketOptionTypes code, UInt32 value) : this((UInt16)code, value) { }
public DHCPv6PacketIPAddressOption(DHCPv6PacketOptionTypes code, IPv6Address address) : this((UInt16)code, address) { }
public DHCPv6PacketIPAddressListOption(DHCPv6PacketOptionTypes code, IEnumerable <IPv6Address> addresses) : this((UInt16)code, addresses) { }
public Boolean HasOption(DHCPv6PacketOptionTypes type) => HasOption((UInt16)type);
public T GetOption <T>(DHCPv6PacketOptionTypes optionType) where T : DHCPv6PacketOption => GetOption <T>((UInt16)optionType);
public DHCPv6PacketBooleanOption(DHCPv6PacketOptionTypes type, Boolean value) : this((UInt16)type, value) { }
public DHCPv6PacketTrueOption(DHCPv6PacketOptionTypes type) : this((UInt16)type) { }
public DHCPv6PacketByteOption(DHCPv6PacketOptionTypes code, Byte value) : this((UInt16)code, value) { }
public DHCPv6PacketTimeOption(DHCPv6PacketOptionTypes code, UInt32 timeValue, DHCPv6PacketTimeOptionUnits unit) : this((UInt16)code, timeValue, unit) { }