IP Address Fields

IP Addresses

class pcapkit.corekit.fields.ipaddress.IPv4AddressField(default=<pcapkit.corekit.fields.field.NoValueType object>, callback=<function IPv4AddressField.<lambda>>)[source]

Bases: _IPAddressField[IPv4Address]

IPv4 address value for protocol fields.

Parameters:
property version: Literal[4]

IP version number.

class pcapkit.corekit.fields.ipaddress.IPv6AddressField(default=<pcapkit.corekit.fields.field.NoValueType object>, callback=<function IPv6AddressField.<lambda>>)[source]

Bases: _IPAddressField[IPv6Address]

IPv6 address value for protocol fields.

Parameters:
property version: Literal[6]

IP version number.

IP Interface

class pcapkit.corekit.fields.ipaddress.IPv4InterfaceField(default=<pcapkit.corekit.fields.field.NoValueType object>, callback=<function IPv4InterfaceField.<lambda>>)[source]

Bases: _IPInterfaceField[IPv4Interface]

IPv4 interface value for protocol fields.

Parameters:
property version: Literal[4]

IP version number.

pre_process(value, packet)[source]

Process field value before packing.

Parameters:
Return type:

bytes

Returns:

Processed field value.

post_process(value, packet)[source]

Process field value after parsing (unpacking).

Parameters:
Return type:

IPv4Interface

Returns:

Processed field value.

class pcapkit.corekit.fields.ipaddress.IPv6InterfaceField(default=<pcapkit.corekit.fields.field.NoValueType object>, callback=<function IPv6InterfaceField.<lambda>>)[source]

Bases: _IPInterfaceField[IPv6Interface]

IPv6 interface value for protocol fields.

Parameters:
property version: Literal[6]

IP version number.

pre_process(value, packet)[source]

Process field value before packing.

Parameters:
Return type:

bytes

Returns:

Processed field value.

post_process(value, packet)[source]

Process field value after parsing (unpacking).

Parameters:
Return type:

IPv6Interface

Returns:

Processed field value.

Internal Definitions

class pcapkit.corekit.fields.ipaddress._IPField(length, default=<pcapkit.corekit.fields.field.NoValueType object>, callback=<function Field.<lambda>>)[source]

Bases: Field[_T], Generic[_T]

Internal IP related value for protocol fields.

Parameters:
abstract property version: int

IP version number.

class pcapkit.corekit.fields.ipaddress._IPAddressField(length, default=<pcapkit.corekit.fields.field.NoValueType object>, callback=<function Field.<lambda>>)[source]

Bases: _IPField[_AT]

Internal IP address value for protocol fields.

Parameters:
pre_process(value, packet)[source]

Process field value before packing.

Parameters:
Return type:

bytes

Returns:

Processed field value.

post_process(value, packet)[source]

Process field value after parsing (unpacking).

Parameters:
Return type:

TypeVar(_AT, IPv4Address, IPv6Address)

Returns:

Processed field value.

class pcapkit.corekit.fields.ipaddress._IPInterfaceField(length, default=<pcapkit.corekit.fields.field.NoValueType object>, callback=<function Field.<lambda>>)[source]

Bases: _IPField[_IT]

Internal IP interface value for protocol fields.

Parameters:

Type Variables

pcapkit.corekit.fields.ipaddress._T: ipaddress.IPv4Address | ipaddress.IPv6Address | ipaddress.IPv4Interface | ipaddress.IPv6Interface
pcapkit.corekit.fields.ipaddress._AT: ipaddress.IPv4Address | ipaddress.IPv6Address
pcapkit.corekit.fields.ipaddress._IT: ipaddress.IPv4Interface | ipaddress.IPv6Interface