HIP - Host Identity Protocol

pcapkit.protocols.internet.hip contains HIP only, which implements extractor for Host Identity Protocol (HIP) *, whose structure is described as below:

Octets

Bits

Name

Description

0

0

hip.next

Next Header

1

8

hip.length

Header Length

2

16

Reserved (\x00)

2

17

hip.type

Packet Type

3

24

hip.version

Version

3

28

Reserved

3

31

Reserved (\x01)

4

32

hip.chksum

Checksum

6

48

hip.control

Controls

8

64

hip.shit

Sender’s Host Identity Tag

24

192

hip.rhit

Receiver’s Host Identity Tag

40

320

hip.parameters

HIP Parameters


class pcapkit.protocols.internet.hip.HIP(file=None, length=None, **kwargs)[source]

Bases: Internet[HIP]

This class implements Host Identity Protocol.

This class currently supports parsing of the following HIP parameters, which are directly mapped to the pcapkit.const.hip.parameter.Parameter enumeration:

Parameter Code

Parameter Parser

ESP_INFO

_read_param_esp_info()

R1_COUNTER

_read_param_r1_counter()

LOCATOR_SET

_read_param_locator_set()

PUZZLE

_read_param_puzzle()

SOLUTION

_read_param_solution()

SEQ

_read_param_seq()

ACK

_read_param_ack()

DH_GROUP_LIST

_read_param_dh_group_list()

DIFFIE_HELLMAN

_read_param_diffie_hellman()

HIP_TRANSFORM

_read_param_hip_transform()

HIP_CIPHER

_read_param_hip_cipher()

NAT_TRAVERSAL_MODE

_read_param_nat_traversal_mode()

TRANSACTION_PACING

_read_param_transaction_pacing()

ENCRYPTED

_read_param_encrypted()

HOST_ID

_read_param_host_id()

HIT_SUITE_LIST

_read_param_hit_suite_list()

CERT

_read_param_cert()

NOTIFICATION

_read_param_notification()

ECHO_REQUEST_SIGNED

_read_param_echo_request_signed()

REG_INFO

_read_param_reg_info()

REG_REQUEST

_read_param_reg_request()

REG_RESPONSE

_read_param_reg_response()

REG_FAILED

_read_param_reg_failed()

REG_FROM

_read_param_reg_from()

ECHO_RESPONSE_SIGNEED

_read_param_echo_response_signed()

TRANSPORT_FORMAT_LIST

_read_param_transport_format_list()

ESP_TRANSFORM

_read_param_esp_transform()

SEQ_DATA

_read_param_seq_data()

ACK_DATA

_read_param_ack_data()

PAYLOAD_MIC

_read_param_payload_mic()

TRANSACTION_ID

_read_param_transaction_id()

OVERLAY_ID

_read_param_overlay_id()

ROUTE_DST

_read_param_route_dst()

HIP_TRANSPORT_MODE

_read_param_hip_transport_mode()

HIP_MAC

_read_param_hip_mac()

HIP_MAC_2

_read_param_hip_mac_2()

HIP_SIGNATURE_2

_read_param_hip_signature_2()

HIP_SIGNATURE

_read_param_hip_signature()

ECHO_REQUEST_UNSIGNED

_read_param_echo_request_unsigned()

ECHO_RESPONSE_UNSIGNED

_read_param_echo_response_unsigned()

RELAY_FROM

_read_param_relay_from()

RELAY_TO

_read_param_relay_to()

OVERLAY_TTL

_read_param_overlay_ttl()

ROUTE_VIA

_read_param_route_via()

FROM

_read_param_from()

RVS_HMAC

_read_param_rvs_hmac()

VIA_RVS

_read_param_via_rvs()

RELAY_HMAC

_read_param_relay_hmac()

Parameters
  • *args (Any) – Arbitrary positional arguments.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type

Protocol[PT]

__post_init__(file: BinaryIO, length: Optional[int] = None, *, extension: bool = False, **kwargs: Any) None[source]
__post_init__(**kwargs: Any) None

Post initialisation hook.

Parameters
  • file (Optional[BinaryIO]) – Source packet stream.

  • length (Optional[int]) – Length of packet data.

  • extension (bool) – If the protocol is used as an IPv6 extension header.

  • **kwargs (Any) – Arbitrary keyword arguments.

See also

For construction argument, please refer to make().

Return type

None

classmethod __index__()[source]

Numeral registry index of the protocol.

Return type

TransType

Returns

Numeral registry index of the protocol in IANA.

property name: Literal['Host Identity Protocol']

Name of current protocol.

Return type

Literal[“Host Identity Protocol”]

property alias: str

Acronym of corresponding protocol.

Return type

str

property length: int

Header length of current protocol.

Return type

int

property payload: Protocol | NoReturn

Payload of current instance.

Raises

UnsupportedCall – if the protocol is used as an IPv6 extension header

Return type

pcapkit.protocols.protocol.Protocol

property protocol: Optional[str] | NoReturn

Name of next layer protocol (if any).

Raises

UnsupportedCall – if the protocol is used as an IPv6 extension header

property protochain: ProtoChain | NoReturn

Protocol chain of current instance.

Raises

UnsupportedCall – if the protocol is used as an IPv6 extension header

Return type

ProtoChain | NoReturn

read(length=None, *, extension=False, **kwargs)[source]

Read Host Identity Protocol.

Structure of HIP header [RFC 5201][RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Next Header   | Header Length |0| Packet Type |Version| RES.|1|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Checksum             |           Controls            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                Sender's Host Identity Tag (HIT)               |
|                                                               |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               Receiver's Host Identity Tag (HIT)              |
|                                                               |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
/                        HIP Parameters                         /
/                                                               /
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • length (Optional[int]) – Length of packet data.

  • extension (bool) – If the packet is used as an IPv6 extension header.

  • **kwargs (Any) – Arbitrary keyword arguments.

Return type

HIP

Returns

Parsed packet data.

Raises

ProtocolError – If the packet is malformed.

make(**kwargs)[source]

Make (construct) packet data.

Parameters

**kwargs (Any) – Arbitrary keyword arguments.

Return type

NoReturn

Returns

Constructed packet data.

_read_hip_param(length, *, version)[source]

Read HIP parameters.

Parameters
  • length (int) – length of parameters

  • version (int) – HIP version

Return type

Parameter

Returns

Extracted HIP parameters.

Raises

ProtocolError – if packet length threshold check failed

_read_param_unassigned(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP unassigned parameters.

Structure of HIP unassigned parameters [RFC 5201][RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type            |C|             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
/                          Contents                             /
/                                               +-+-+-+-+-+-+-+-+
|                                               |    Padding    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_UnassignedParameter

Returns

Parsed parameter data.

_read_param_esp_info(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ESP_INFO parameter.

Structure of HIP ESP_INFO parameter [RFC 7402]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Reserved            |         KEYMAT Index          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            OLD SPI                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            NEW SPI                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_ESPInfoParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 12.

_read_param_r1_counter(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP R1_COUNTER parameter.

Structure of HIP R1_COUNTER parameter [RFC 5201][RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Reserved, 4 bytes                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                R1 generation counter, 8 bytes                 |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_R1CounterParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 12 or the parameter is NOT used in HIPv1.

_read_param_locator_set(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP LOCATOR_SET parameter.

Structure of HIP LOCATOR_SET parameter [RFC 8046]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Traffic Type   | Locator Type | Locator Length | Reserved   |P|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Locator Lifetime                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            Locator                            |
|                                                               |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
.                                                               .
.                                                               .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Traffic Type   | Locator Type | Locator Length | Reserved   |P|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Locator Lifetime                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            Locator                            |
|                                                               |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_LocatorSetParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If locator data is malformed.

_read_param_puzzle(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP PUZZLE parameter.

Structure of HIP PUZZLE parameter [RFC 5201][RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  #K, 1 byte   |    Lifetime   |        Opaque, 2 bytes        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Random #I, RHASH_len / 8 bytes           |
/                                                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_PuzzleParameter

Returns

Parsed parameter data.

Raises

ProtocolError – The parameter is ONLY supported in HIPv1.

_read_param_solution(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP SOLUTION parameter.

Structure of HIP SOLUTION parameter [RFC 5201][RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  #K, 1 byte   |    Lifetime   |        Opaque, 2 bytes        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                      Random #I, n bytes                       |
/                                                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Puzzle solution #J, RHASH_len / 8 bytes            |
/                                                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_SolutionParameter

Returns

Parsed parameter data.

Raises

ProtocolError – The parameter is ONLY supported in HIPv1.

_read_param_seq(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP SEQ parameter.

Structure of HIP SEQ parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            Update ID                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_SEQParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 4.

_read_param_ack(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ACK parameter.

Structure of HIP ACK parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       peer Update ID 1                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                       peer Update ID n                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_ACKParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 4 modulo.

_read_param_dh_group_list(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP DH_GROUP_LIST parameter.

Structure of HIP DH_GROUP_LIST parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DH GROUP ID #1| DH GROUP ID #2| DH GROUP ID #3| DH GROUP ID #4|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| DH GROUP ID #n|                Padding                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_DHGroupListParameter

Returns

Parsed parameter data.

_read_param_diffie_hellman(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP DIFFIE_HELLMAN parameter.

Structure of HIP DIFFIE_HELLMAN parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Group ID    |      Public Value Length      | Public Value  /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                               |            Padding            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_DeffieHellmanParameter

Returns

Parsed parameter data.

_read_param_hip_transform(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP HIP_TRANSFORM parameter.

Structure of HIP HIP_TRANSFORM parameter [RFC 5201]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Suite ID #1        |          Suite ID #2          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Suite ID #n        |             Padding           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_HIPTransformParameter

Returns

Parsed parameter data.

Raises

ProtocolError – The parameter is ONLY supported in HIPv1.

_read_param_hip_cipher(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP HIP_CIPHER parameter.

Structure of HIP HIP_CIPHER parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Cipher ID #1         |          Cipher ID #2         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Cipher ID #n         |             Padding           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_HIPCipherParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT a 2 modulo.

_read_param_nat_traversal_mode(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP NAT_TRAVERSAL_MODE parameter.

Structure of HIP NAT_TRAVERSAL_MODE parameter [RFC 5770]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Reserved            |            Mode ID #1         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Mode ID #2          |            Mode ID #3         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Mode ID #n          |             Padding           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_NATTraversalModeParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT a 2 modulo.

_read_param_transaction_pacing(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP TRANSACTION_PACING parameter.

Structure of HIP TRANSACTION_PACING parameter [RFC 5770]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            Min Ta                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_TransactionPacingParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 4.

_read_param_encrypted(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ENCRYPTED parameter.

Structure of HIP ENCRYPTED parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Reserved                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              IV                               /
/                                                               /
/                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               /
/                        Encrypted data                         /
/                                                               /
/                               +-------------------------------+
/                               |            Padding            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_EncryptedParameter

Returns

Parsed parameter data.

_read_param_host_id(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP HOST_ID parameter.

Structure of HIP HOST_ID parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          HI Length            |DI-Type|      DI Length        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Algorithm            |         Host Identity         /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                               |       Domain Identifier       /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                                               |    Padding    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_HostIDParameter

Returns

Parsed parameter data.

_read_param_hit_suite_list(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP HIT_SUITE_LIST parameter.

Structure of HIP HIT_SUITE_LIST parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     ID #1     |     ID #2     |     ID #3     |     ID #4     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     ID #n     |                Padding                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_HITSuiteParameter

Returns

Parsed parameter data.

_read_param_cert(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP CERT parameter.

Structure of HIP CERT parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  CERT group   |  CERT count   |    CERT ID    |   CERT type   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Certificate                          /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                               |   Padding (variable length)   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_CertParameter

Returns

Parsed parameter data.

_read_param_notification(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP NOTIFICATION parameter.

Structure of HIP NOTIFICATION parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Reserved             |      Notify Message Type      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               /
/                   Notification Data                           /
/                                               +---------------+
/                                               |     Padding   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_NotificationParameter

Returns

Parsed parameter data.

_read_param_echo_request_signed(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ECHO_REQUEST_SIGNED parameter.

Structure of HIP ECHO_REQUEST_SIGNED parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Opaque data (variable length)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_EchoRequestSignedParameter

Returns

Parsed parameter data.

_read_param_reg_info(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP REG_INFO parameter.

Structure of HIP REG_INFO parameter [RFC 8003]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Min Lifetime  | Max Lifetime  |  Reg Type #1  |  Reg Type #2  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      ...      |     ...       |  Reg Type #n  |               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    Padding    +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RegInfoParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If the registration type is invalid.

_read_param_reg_request(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP REG_REQUEST parameter.

Structure of HIP REG_REQUEST parameter [RFC 8003]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Lifetime    |  Reg Type #1  |  Reg Type #2  |  Reg Type #3  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      ...      |     ...       |  Reg Type #n  |               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    Padding    +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RegRequestParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If the registration type is invalid.

_read_param_reg_response(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP REG_RESPONSE parameter.

Structure of HIP REG_RESPONSE parameter [RFC 8003]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Lifetime    |  Reg Type #1  |  Reg Type #2  |  Reg Type #3  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      ...      |     ...       |  Reg Type #n  |               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    Padding    +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RegResponseParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If the registration type is invalid.

_read_param_reg_failed(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP REG_FAILED parameter.

Structure of HIP REG_FAILED parameter [RFC 8003]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Lifetime    |  Reg Type #1  |  Reg Type #2  |  Reg Type #3  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      ...      |     ...       |  Reg Type #n  |               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    Padding    +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RegFailedParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If the registration type is invalid.

_read_param_reg_from(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP REG_FROM parameter.

Structure of HIP REG_FROM parameter [RFC 5770]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Port              |    Protocol   |     Reserved  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                            Address                            |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RegFromParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 20.

_read_param_echo_response_signed(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ECHO_RESPONSE_SIGNED parameter.

Structure of HIP ECHO_RESPONSE_SIGNED parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Opaque data (variable length)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_EchoResponseSignedParameter

Returns

Parsed parameter data.

_read_param_transport_format_list(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP TRANSPORT_FORMAT_LIST parameter.

Structure of HIP TRANSPORT_FORMAT_LIST parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          TF type #1           |           TF type #2          /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/          TF type #n           |             Padding           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_TransportFormatListParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 2 modulo.

_read_param_esp_transform(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ESP_TRANSFORM parameter.

Structure of HIP ESP_TRANSFORM parameter [RFC 7402]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Reserved             |           Suite ID #1         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Suite ID #2          |           Suite ID #3         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Suite ID #n          |             Padding           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_ESPTransformParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 2 modulo.

_read_param_seq_data(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP SEQ_DATA parameter.

Structure of HIP SEQ_DATA parameter [RFC 6078]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Sequence number                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_SeqDataParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 4.

_read_param_ack_data(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ACK_DATA parameter.

Structure of HIP ACK_DATA parameter [RFC 6078]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Acked Sequence number                     /
/                                                               /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_AckDataParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 4 modulo.

_read_param_payload_mic(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP PAYLOAD_MIC parameter.

Structure of HIP PAYLOAD_MIC parameter [RFC 6078]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Next Header  |                   Reserved                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Payload Data                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
/                         MIC Value                             /
/                                               +-+-+-+-+-+-+-+-+
|                                               |    Padding    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_PayloadMICParameter

Returns

Parsed parameter data.

_read_param_transaction_id(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP TRANSACTION_ID parameter.

Structure of HIP TRANSACTION_ID parameter [RFC 6078]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Identifier                          /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                                               |    Padding    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_TransactionIDParameter

Returns

Parsed parameter data.

_read_param_overlay_id(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP OVERLAY_ID parameter.

Structure of HIP OVERLAY_ID parameter [RFC 6079]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Identifier                          /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                                               |    Padding    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_OverlayIDParameter

Returns

Parsed parameter data.

_read_param_route_dst(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ROUTE_DST parameter.

Structure of HIP ROUTE_DST parameter [RFC 6028]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Flags             |            Reserved           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                            HIT #1                             |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
.                               .                               .
.                               .                               .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                            HIT #n                             |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RouteDstParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If the parameter is malformed.

_read_param_hip_transport_mode(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP HIP_TRANSPORT_MODE parameter.

Structure of HIP HIP_TRANSPORT_MODE parameter [RFC 6261]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Port              |           Mode ID #1          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Mode ID #2           |           Mode ID #3          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Mode ID #n           |             Padding           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_HIPTransportModeParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 2 modulo.

_read_param_hip_mac(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP HIP_MAC parameter.

Structure of HIP HIP_MAC parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                             HMAC                              |
/                                                               /
/                               +-------------------------------+
|                               |            Padding            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_HIPMACParameter

Returns

Parsed parameter data.

_read_param_hip_mac_2(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP HIP_MAC_2 parameter.

Structure of HIP HIP_MAC_2 parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                             HMAC                              |
/                                                               /
/                               +-------------------------------+
|                               |            Padding            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_HIPMAC2Parameter

Returns

Parsed parameter data.

_read_param_hip_signature_2(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP HIP_SIGNATURE_2 parameter.

Structure of HIP HIP_SIGNATURE_2 parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    SIG alg                    |            Signature          /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                               |             Padding           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_HIPSignature2Parameter

Returns

Parsed parameter data.

_read_param_hip_signature(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP HIP_SIGNATURE parameter.

Structure of HIP HIP_SIGNATURE parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    SIG alg                    |            Signature          /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/                               |             Padding           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_HIPSignatureParameter

Returns

Parsed parameter data.

_read_param_echo_request_unsigned(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ECHO_REQUEST_UNSIGNED parameter.

Structure of HIP ECHO_REQUEST_UNSIGNED parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Opaque data (variable length)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_EchoRequestUnsignedParameter

Returns

Parsed parameter data.

_read_param_echo_response_unsigned(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ECHO_RESPONSE_UNSIGNED parameter.

Structure of HIP ECHO_RESPONSE_UNSIGNED parameter [RFC 7401]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Opaque data (variable length)                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_EchoResponseUnsignedParameter

Returns

Parsed parameter data.

_read_param_relay_from(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP RELAY_FROM parameter.

Structure of HIP RELAY_FROM parameter [RFC 5770]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Port              |    Protocol   |     Reserved  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                            Address                            |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RelayFromParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 20.

_read_param_relay_to(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP RELAY_TO parameter.

Structure of HIP RELAY_TO parameter [RFC 5770]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Port              |    Protocol   |     Reserved  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                            Address                            |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RelayToParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 20.

_read_param_overlay_ttl(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP OVERLAY_TTL parameter.

Structure of HIP OVERLAY_TTL parameter [RFC 6078]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             TTL               |            Reserved           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_OverlayTTLParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 4.

_read_param_route_via(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP ROUTE_VIA parameter.

Structure of HIP ROUTE_VIA parameter [RFC 6028]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Flags             |            Reserved           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                            HIT #1                             |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
.                               .                               .
.                               .                               .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                            HIT #n                             |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RouteViaParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If the parameter is malformed.

_read_param_from(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP FROM parameter.

Structure of HIP FROM parameter [RFC 8004]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                             Address                           |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_FromParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 16.

_read_param_rvs_hmac(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP RVS_HMAC parameter.

Structure of HIP RVS_HMAC parameter [RFC 8004]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                             HMAC                              |
/                                                               /
/                               +-------------------------------+
|                               |            Padding            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RVSHMACParameter

Returns

Parsed parameter data.

_read_param_via_rvs(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP VIA_RVS parameter.

Structure of HIP VIA_RVS parameter [RFC 6028]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Type              |             Length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                            Address                            |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
.                               .                               .
.                               .                               .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                            Address                            |
|                                                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_ViaRVSParameter

Returns

Parsed parameter data.

Raises

ProtocolError – If clen is NOT 16 modulo.

_read_param_relay_hmac(code, cbit, clen, *, desc, length, version, options)[source]

Read HIP RELAY_HMAC parameter.

Structure of HIP RELAY_HMAC parameter [RFC 5770]:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
|                             HMAC                              |
/                                                               /
/                               +-------------------------------+
|                               |            Padding            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Parameters
  • code (int) – parameter code

  • cbit (bool) – critical bit

  • clen (int) – length of contents

  • desc (RegType_Parameter) – parameter type

  • length (int) – remaining packet length

  • version (int) – HIP protocol version

  • options (Parameter) – parsed HIP parameters

Return type

DataType_RelayHMACParameter

Returns

Parsed parameter data.

Data Structures

class pcapkit.protocols.data.internet.hip.HIP(next, length, type, version, chksum, control, shit, rhit)[source]

Bases: Info

Data model for HIP header.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

next: TransType

Next header.

length: int

Header length.

type: Packet

Packet type.

version: int

Version.

chksum: bytes

Checksum.

control: Control

Control

shit: int

Sender’s host identity tag.

rhit: int

Receiver’s host identity tag.

parameters: OrderedMultiDict[RegType_Parameter, Parameter]

HIP parameters.

class pcapkit.protocols.data.internet.hip.Control(anonymous)[source]

Bases: Info

Data model for HIP controls.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

anonymous: bool

Anonymous flag.

class pcapkit.protocols.data.internet.hip.Parameter(type, critical, length)[source]

Bases: Info

Data model for HIP parameter data.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

type: RegType_Parameter

Parameter type.

critical: bool

Critical flag.

length: int

Content length.

class pcapkit.protocols.data.internet.hip.UnassignedParameter(type, critical, length, contents)[source]

Bases: Parameter

Data model for unassigned parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

contents: bytes

Content.

class pcapkit.protocols.data.internet.hip.ESPInfoParameter(type, critical, length, index, old_spi, new_spi)[source]

Bases: Parameter

Data model for HIP ESP_INFO parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

index: int

KEYMAT index.

old_spi: int

Old SDI.

new_spi: int

New SDI.

class pcapkit.protocols.data.internet.hip.R1CounterParameter(type, critical, length, counter)[source]

Bases: Parameter

Data model for HIP R1_COUNTER parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

counter: int

R1 counter.

class pcapkit.protocols.data.internet.hip.LocatorSetParameter(type, critical, length, locator_set)[source]

Bases: Parameter

Data model for HIP LOCATOR_SET parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

locator_set: tuple[Locator, ...]

Locator set.

class pcapkit.protocols.data.internet.hip.Locator(traffic, type, length, preferred, lifetime, locator)[source]

Bases: Info

Data model for HIP locator.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

traffic: int

Traffic.

type: int

Locator type.

length: int

Locator length.

preferred: bool

Preferred flag.

lifetime: timedelta

Locator lifetime.

locator: LocatorData | IPv4Address

Locator data.

class pcapkit.protocols.data.internet.hip.LocatorData(spi, ip)[source]

Bases: Info

Data model for HIP locator data.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

spi: int

SPI.

ip: IPv4Address

IP address.

class pcapkit.protocols.data.internet.hip.PuzzleParameter(type, critical, length, index, lifetime, opaque, random)[source]

Bases: Parameter

Data model for HIP PUZZLE parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

index: int

Numeric index.

lifetime: timedelta

Lifetime.

opaque: bytes

Puzzle data.

random: int

Random number.

class pcapkit.protocols.data.internet.hip.SolutionParameter(type, critical, length, index, lifetime, opaque, random, solution)[source]

Bases: Parameter

Data model for HIP SOLUTION parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

index: int

Numeric index.

lifetime: timedelta

Lifetime.

opaque: bytes

Solution data.

random: int

Random number.

solution: int

Puzzle solution.

class pcapkit.protocols.data.internet.hip.SEQParameter(type, critical, length, id)[source]

Bases: Parameter

Data model for HIP SEQ parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

id: int

Unique ID.

class pcapkit.protocols.data.internet.hip.ACKParameter(type, critical, length, update_id)[source]

Bases: Parameter

Data model for HIP ACK parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

update_id: tuple[int, ...]

Peer update IDs.

class pcapkit.protocols.data.internet.hip.DHGroupListParameter(type, critical, length, group_id)[source]

Bases: Parameter

Data model for HIP DH_GROUP_LIST parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

group_id: tuple[Group, ...]

DH group list.

class pcapkit.protocols.data.internet.hip.DeffieHellmanParameter(type, critical, length, group_id, pub_len, pub_val)[source]

Bases: Parameter

Data model for HIP DEFFIE_HELLMAN parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

group_id: Group

Group ID.

pub_len: int

Public value length.

pub_val: bytes

Public value.

class pcapkit.protocols.data.internet.hip.HIPTransformParameter(type, critical, length, suite_id)[source]

Bases: Parameter

Data model for HIP HIP_TRANSFORM parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

suite_id: tuple[Suite, ...]

Suite IDs.

class pcapkit.protocols.data.internet.hip.HIPCipherParameter(type, critical, length, cipher_id)[source]

Bases: Parameter

Data model for HIP HIP_CIPHER parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

cipher_id: tuple[Cipher, ...]

Cipher IDs.

class pcapkit.protocols.data.internet.hip.NATTraversalModeParameter(type, critical, length, mode_id)[source]

Bases: Parameter

Data model for HIP NAT_TRAVERSAL_MODE parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

mode_id: tuple[NATTraversal, ...]

Mode IDs

class pcapkit.protocols.data.internet.hip.TransactionPacingParameter(type, critical, length, min_ta)[source]

Bases: Parameter

Data model for HIP TRANSACTION_PACING parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

min_ta: int

Min TA.

class pcapkit.protocols.data.internet.hip.EncryptedParameter(type, critical, length, raw)[source]

Bases: Parameter

Data model for HIP ENCRYPTED parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

raw: bytes

Raw data.

class pcapkit.protocols.data.internet.hip.HostIDParameter(type, critical, length, hi_len, di_type, di_len, algorithm, hi, di)[source]

Bases: Parameter

Data model for HIP HOST_ID parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

hi_len: int

Host identity length.

di_type: DITypes

Domain identifier type.

di_len: int

Domain identifier length.

algorithm: HIAlgorithm

Algorithm type.

hi: HostIdentity | bytes

Host identity.

di: bytes

Domain identifier.

class pcapkit.protocols.data.internet.hip.HostIdentity(curve, pubkey)[source]

Bases: Info

Data model for host identity.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

curve: ECDSACurve | ECDSALowCurve

Curve type.

pubkey: bytes

Public key.

class pcapkit.protocols.data.internet.hip.HITSuiteListParameter(type, critical, length, suite_id)[source]

Bases: Parameter

Data model for HIP HIST_SUITE_LIST parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

suite_id: tuple[HITSuite, ...]

Suite IDs.

class pcapkit.protocols.data.internet.hip.CertParameter(type, critical, length, cert_group, cert_count, cert_id, cert_type, cert)[source]

Bases: Parameter

Data model for HIP CERT parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

cert_group: Group

Certificate group.

cert_count: int

Certificate count.

cert_id: int

Certificate ID.

cert_type: Certificate

Certificate type.

cert: bytes

Certificate.

class pcapkit.protocols.data.internet.hip.NotificationParameter(type, critical, length, msg_type, msg)[source]

Bases: Parameter

Data model for HIP NOTIFICATION parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

msg_type: NotifyMessage

Notify message type.

msg: bytes

Notification data.

class pcapkit.protocols.data.internet.hip.EchoRequestSignedParameter(type, critical, length, opaque)[source]

Bases: Parameter

Data model for HIP ECHO_REQUEST_SIGNED parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

opaque: bytes

Opaque data.

class pcapkit.protocols.data.internet.hip.RegInfoParameter(type, critical, length, lifetime, reg_type)[source]

Bases: Parameter

Data model for HIP REG_INFO parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

lifetime: Lifetime

Registration lifetime.

reg_type: tuple[Registration, ...]

Registration type.

class pcapkit.protocols.data.internet.hip.Lifetime(min, max)[source]

Bases: Info

Data model for registration lifetime.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

min: timedelta

Minimum lifetime.

max: timedelta

Maximum lifetime.

class pcapkit.protocols.data.internet.hip.RegRequestParameter(type, critical, length, lifetime, reg_type)[source]

Bases: Parameter

Data model for HIP REG_REQUEST parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

lifetime: Lifetime

Registration lifetime.

reg_type: tuple[Registration, ...]

Registration type.

class pcapkit.protocols.data.internet.hip.RegResponseParameter(type, critical, length, lifetime, reg_type)[source]

Bases: Parameter

Data model for HIP REG_RESPONSE parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

lifetime: Lifetime

Registration lifetime.

reg_type: tuple[Registration, ...]

Registration type.

class pcapkit.protocols.data.internet.hip.RegFailedParameter(type, critical, length, lifetime, reg_type)[source]

Bases: Parameter

Data model for HIP REG_FAILED parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

lifetime: Lifetime

Registration lifetime.

reg_type: tuple[RegistrationFailure, ...]

Registration failure type.

class pcapkit.protocols.data.internet.hip.RegFromParameter(type, critical, length, port, protocol, address)[source]

Bases: Parameter

Data model for HIP REG_FROM parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

port: int

Port.

protocol: TransType

Protocol.

address: IPv6Address

Address.

class pcapkit.protocols.data.internet.hip.EchoResponseSignedParameter(type, critical, length, opaque)[source]

Bases: Parameter

Data model for HIP ECHO_RESPONSE_SIGNED parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

opaque: bytes

Opaque data.

class pcapkit.protocols.data.internet.hip.TransportFormatListParameter(type, critical, length, tf_type)[source]

Bases: Parameter

Data model for HIP TRANSPORT_FORMAT_LIST parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

tf_type: tuple[int, ...]

Transport format list.

class pcapkit.protocols.data.internet.hip.ESPTransformParameter(type, critical, length, suite_id)[source]

Bases: Parameter

Data model for HIP ESP_TRANSFORM parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

suite_id: tuple[ESPTransformSuite, ...]

ESP transform.

class pcapkit.protocols.data.internet.hip.SeqDataParameter(type, critical, length, seq)[source]

Bases: Parameter

Data model for HIP SEQ_DATA parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

seq: int

Sequence number.

class pcapkit.protocols.data.internet.hip.AckDataParameter(type, critical, length, ack)[source]

Bases: Parameter

Data model for HIP ACK_DATA parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

ack: tuple[int, ...]

Acknowledged sequence number.

class pcapkit.protocols.data.internet.hip.PayloadMICParameter(type, critical, length, next, payload, mic)[source]

Bases: Parameter

Data model for HIP PAYLOAD_MIC parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

next: TransType

Next header

payload: bytes

Payload data.

mic: bytes

MIC value.

class pcapkit.protocols.data.internet.hip.TransactionIDParameter(type, critical, length, id)[source]

Bases: Parameter

Data model for HIP TRANSACTION_ID parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

id: int

Identifier.

class pcapkit.protocols.data.internet.hip.OverlayIDParameter(type, critical, length, id)[source]

Bases: Parameter

Data mode HIP OVERLAY_ID parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

id: int

Identifier.

class pcapkit.protocols.data.internet.hip.RouteDstParameter(type, critical, length, flags, hit)[source]

Bases: Parameter

Data model for HIP ROUTE_DST parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

flags: Flags

Flags.

hit: tuple[IPv6Address, ...]

Destination address.

class pcapkit.protocols.data.internet.hip.Flags(symmetric, must_follow)[source]

Bases: Info

Data model for flags in HIP HIP_PARAMETER_FLAGS parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

symmetric: bool

Symmetric flag.

must_follow: bool

Must follow flag.

class pcapkit.protocols.data.internet.hip.HIPTransportModeParameter(type, critical, length, port, mode_id)[source]

Bases: Parameter

Data model for HIP HIP_TRANSPORT_MODE parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

port: int

Port.

mode_id: tuple[Transport, ...]

Mode IDs.

class pcapkit.protocols.data.internet.hip.HIPMACParameter(type, critical, length, hmac)[source]

Bases: Parameter

Data model for HIP HIP_MAC parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

hmac: bytes

HMAC value.

class pcapkit.protocols.data.internet.hip.HIPMAC2Parameter(type, critical, length, hmac)[source]

Bases: Parameter

Data model for HIP HIP_MAC_2 parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

hmac: bytes

HMAC value.

class pcapkit.protocols.data.internet.hip.HIPSignature2Parameter(type, critical, length, algorithm, signature)[source]

Bases: Parameter

Data model for HIP HIP_SIGNATURE_2 parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

algorithm: HIAlgorithm

Signature algorithm.

signature: bytes

Signature value.

class pcapkit.protocols.data.internet.hip.HIPSignatureParameter(type, critical, length, algorithm, signature)[source]

Bases: Parameter

Data model for HIP HIP_SIGNATURE parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

algorithm: HIAlgorithm

Signature algorithm.

signature: bytes

Signature value.

class pcapkit.protocols.data.internet.hip.EchoRequestUnsignedParameter(type, critical, length, opaque)[source]

Bases: Parameter

Data model for HIP ECHO_REQUEST_UNSIGNED parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

opaque: bytes

Opaque data.

class pcapkit.protocols.data.internet.hip.EchoResponseUnsignedParameter(type, critical, length, opaque)[source]

Bases: Parameter

Data model for HIP ECHO_RESPONSE_UNSIGNED parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

opaque: bytes

Opaque data.

class pcapkit.protocols.data.internet.hip.RelayFromParameter(type, critical, length, port, protocol, address)[source]

Bases: Parameter

Data model for HIP RELAY_FROM parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

port: int

Port.

protocol: TransType

Protocol.

address: IPv6Address

Address.

class pcapkit.protocols.data.internet.hip.RelayToParameter(type, critical, length, port, protocol, address)[source]

Bases: Parameter

Data model for HIP RELAY_TO parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

port: int

Port.

protocol: TransType

Protocol.

address: IPv6Address

Address.

class pcapkit.protocols.data.internet.hip.OverlayTTLParameter(type, critical, length, ttl)[source]

Bases: Parameter

Data model for HIP OVERLAY_TTL parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

ttl: timedelta

TTL value.

class pcapkit.protocols.data.internet.hip.RouteViaParameter(type, critical, length, flags, hit)[source]

Bases: Parameter

Data model for HIP ROUTE_VIA parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

flags: Flags

Flags.

hit: tuple[IPv6Address, ...]

HIT addresses.

class pcapkit.protocols.data.internet.hip.FromParameter(type, critical, length, address)[source]

Bases: Parameter

Data model for HIP FROM parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

address: IPv6Address

HIT address.

class pcapkit.protocols.data.internet.hip.RVSHMACParameter(type, critical, length, hmac)[source]

Bases: Parameter

Data model for HIP RVS_HMAC parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

hmac: bytes

HMAC value.

class pcapkit.protocols.data.internet.hip.ViaRVSParameter(type, critical, length, address)[source]

Bases: Parameter

Data model for HIP VIA_RVS parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

address: tuple[IPv6Address, ...]

Addresses.

class pcapkit.protocols.data.internet.hip.RelayHMACParameter(type, critical, length, hmac)[source]

Bases: Parameter

Data model for HIP RELAY_HMAC parameter.

Parameters
  • *args (VT) – Arbitrary positional arguments.

  • **kwargs (VT) – Arbitrary keyword arguments.

Return type

Info

hmac: bytes

HMAC value.


*

https://en.wikipedia.org/wiki/Host_Identity_Protocol