예제 #1
0
 public DHCPv6Packet(IPv6HeaderInformation header, UInt32 transactionId, DHCPv6PacketTypes packetType, IEnumerable <DHCPv6PacketOption> options)
 {
     Header        = header;
     TransactionId = transactionId;
     PacketType    = packetType;
     _options      = new List <DHCPv6PacketOption>(options);
 }
예제 #2
0
        private static DHCPv6Packet ConstructPacketWithHeader(DHCPv6Packet requestPacket, DHCPv6Packet innerResponse)
        {
            DHCPv6Packet response = ConstructPacket(requestPacket, innerResponse);

            response.Header = IPv6HeaderInformation.AsResponse(requestPacket.Header);
            return(response);
        }
예제 #3
0
 public static DHCPv6Packet FromByteArray(Byte[] rawData, IPv6HeaderInformation ipv6Header)
 {
     try
     {
         var result = FromByteArray(rawData);
         result.Header = ipv6Header;
         result._byteRepresentation = rawData;
         return(result);
     }
     catch (Exception)
     {
         return(new DHCPV6UnparsablePacket(ipv6Header, rawData));
     }
 }
예제 #4
0
 public static DHCPv6RelayPacket AsOuterRelay(
     IPv6HeaderInformation header,
     Boolean isForward,
     Byte hopCount,
     IPv6Address linkAddress, IPv6Address peerAddress,
     IEnumerable <DHCPv6PacketOption> options,
     DHCPv6Packet innerPacket
     ) => new DHCPv6RelayPacket(
     isForward == true ? DHCPv6PacketTypes.RELAY_FORW : DHCPv6PacketTypes.RELAY_REPL,
     hopCount,
     linkAddress,
     peerAddress,
     options,
     innerPacket
     )
 {
     Header = header
 };
예제 #5
0
 public static DHCPv6Packet AsOuter(IPv6HeaderInformation header, UInt32 transactionId, DHCPv6PacketTypes packetType, IEnumerable <DHCPv6PacketOption> options) =>
 new DHCPv6Packet(header, transactionId, packetType, options);
예제 #6
0
 public DHCPV6UnparsablePacket(IPv6HeaderInformation ipv6Header, Byte[] data) : base(DHCPv6PacketTypes.Invalid, Array.Empty <DHCPv6PacketOption>())
 {
     Content = data;
     Header  = ipv6Header;
 }