repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
JarryShaw/PyPCAPKit
src/reassembly/ip.py
IP_Reassembly.reassembly
def reassembly(self, info): """Reassembly procedure. Positional arguments: * info -- Info, info dict of packets to be reassembled """ BUFID = info.bufid # Buffer Identifier FO = info.fo # Fragment Offset IHL = info.ihl # Internet Header Length ...
python
def reassembly(self, info): """Reassembly procedure. Positional arguments: * info -- Info, info dict of packets to be reassembled """ BUFID = info.bufid # Buffer Identifier FO = info.fo # Fragment Offset IHL = info.ihl # Internet Header Length ...
[ "def", "reassembly", "(", "self", ",", "info", ")", ":", "BUFID", "=", "info", ".", "bufid", "# Buffer Identifier", "FO", "=", "info", ".", "fo", "# Fragment Offset", "IHL", "=", "info", ".", "ihl", "# Internet Header Length", "MF", "=", "info", ".", "mf",...
Reassembly procedure. Positional arguments: * info -- Info, info dict of packets to be reassembled
[ "Reassembly", "procedure", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/reassembly/ip.py#L109-L165
JarryShaw/PyPCAPKit
src/reassembly/ip.py
IP_Reassembly.submit
def submit(self, buf, *, checked=False): """Submit reassembled payload. Positional arguments: * buf -- dict, buffer dict of reassembled packets Keyword arguments: * bufid -- tuple, buffer identifier Returns: * list -- reassembled packets ""...
python
def submit(self, buf, *, checked=False): """Submit reassembled payload. Positional arguments: * buf -- dict, buffer dict of reassembled packets Keyword arguments: * bufid -- tuple, buffer identifier Returns: * list -- reassembled packets ""...
[ "def", "submit", "(", "self", ",", "buf", ",", "*", ",", "checked", "=", "False", ")", ":", "TDL", "=", "buf", "[", "'TDL'", "]", "RCVBT", "=", "buf", "[", "'RCVBT'", "]", "index", "=", "buf", "[", "'index'", "]", "header", "=", "buf", "[", "'h...
Submit reassembled payload. Positional arguments: * buf -- dict, buffer dict of reassembled packets Keyword arguments: * bufid -- tuple, buffer identifier Returns: * list -- reassembled packets
[ "Submit", "reassembled", "payload", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/reassembly/ip.py#L167-L219
JarryShaw/PyPCAPKit
src/protocols/internet/ipv6.py
IPv6.read_ipv6
def read_ipv6(self, length): """Read Internet Protocol version 6 (IPv6). Structure of IPv6 header [RFC 2460]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-...
python
def read_ipv6(self, length): """Read Internet Protocol version 6 (IPv6). Structure of IPv6 header [RFC 2460]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "def", "read_ipv6", "(", "self", ",", "length", ")", ":", "if", "length", "is", "None", ":", "length", "=", "len", "(", "self", ")", "_htet", "=", "self", ".", "_read_ip_hextet", "(", ")", "_plen", "=", "self", ".", "_read_unpack", "(", "2", ")", "...
Read Internet Protocol version 6 (IPv6). Structure of IPv6 header [RFC 2460]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "Internet", "Protocol", "version", "6", "(", "IPv6", ")", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/ipv6.py#L102-L167
JarryShaw/PyPCAPKit
src/protocols/internet/ipv6.py
IPv6._read_ip_hextet
def _read_ip_hextet(self): """Read first four hextets of IPv6.""" _htet = self._read_fileng(4).hex() _vers = _htet[0] # version number (6) _tcls = int(_htet[0:2], base=16) # traffic class _flow = int(_htet[2:], base=16) # flow label return (_ver...
python
def _read_ip_hextet(self): """Read first four hextets of IPv6.""" _htet = self._read_fileng(4).hex() _vers = _htet[0] # version number (6) _tcls = int(_htet[0:2], base=16) # traffic class _flow = int(_htet[2:], base=16) # flow label return (_ver...
[ "def", "_read_ip_hextet", "(", "self", ")", ":", "_htet", "=", "self", ".", "_read_fileng", "(", "4", ")", ".", "hex", "(", ")", "_vers", "=", "_htet", "[", "0", "]", "# version number (6)", "_tcls", "=", "int", "(", "_htet", "[", "0", ":", "2", "]...
Read first four hextets of IPv6.
[ "Read", "first", "four", "hextets", "of", "IPv6", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/ipv6.py#L188-L195
JarryShaw/PyPCAPKit
src/protocols/internet/ipv6.py
IPv6._decode_next_layer
def _decode_next_layer(self, ipv6, proto=None, length=None): """Decode next layer extractor. Positional arguments: * ipv6 -- dict, info buffer * proto -- str, next layer protocol name * length -- int, valid (not padding) length Returns: * dict --...
python
def _decode_next_layer(self, ipv6, proto=None, length=None): """Decode next layer extractor. Positional arguments: * ipv6 -- dict, info buffer * proto -- str, next layer protocol name * length -- int, valid (not padding) length Returns: * dict --...
[ "def", "_decode_next_layer", "(", "self", ",", "ipv6", ",", "proto", "=", "None", ",", "length", "=", "None", ")", ":", "hdr_len", "=", "40", "# header length", "raw_len", "=", "ipv6", "[", "'payload'", "]", "# payload length", "_protos", "=", "list", "(",...
Decode next layer extractor. Positional arguments: * ipv6 -- dict, info buffer * proto -- str, next layer protocol name * length -- int, valid (not padding) length Returns: * dict -- current protocol with next layer extracted
[ "Decode", "next", "layer", "extractor", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/ipv6.py#L238-L286
JarryShaw/PyPCAPKit
src/protocols/internet/internet.py
Internet._read_protos
def _read_protos(self, size): """Read next layer protocol type. Positional arguments: * size -- int, buffer size Returns: * str -- next layer's protocol name """ _byte = self._read_unpack(size) _prot = TP_PROTO.get(_byte) return _prot
python
def _read_protos(self, size): """Read next layer protocol type. Positional arguments: * size -- int, buffer size Returns: * str -- next layer's protocol name """ _byte = self._read_unpack(size) _prot = TP_PROTO.get(_byte) return _prot
[ "def", "_read_protos", "(", "self", ",", "size", ")", ":", "_byte", "=", "self", ".", "_read_unpack", "(", "size", ")", "_prot", "=", "TP_PROTO", ".", "get", "(", "_byte", ")", "return", "_prot" ]
Read next layer protocol type. Positional arguments: * size -- int, buffer size Returns: * str -- next layer's protocol name
[ "Read", "next", "layer", "protocol", "type", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/internet.py#L63-L75
JarryShaw/PyPCAPKit
src/protocols/internet/internet.py
Internet._decode_next_layer
def _decode_next_layer(self, dict_, proto=None, length=None, *, version=4, ipv6_exthdr=None): """Decode next layer extractor. Positional arguments: * dict_ -- dict, info buffer * proto -- str, next layer protocol name * length -- int, valid (not padding) length ...
python
def _decode_next_layer(self, dict_, proto=None, length=None, *, version=4, ipv6_exthdr=None): """Decode next layer extractor. Positional arguments: * dict_ -- dict, info buffer * proto -- str, next layer protocol name * length -- int, valid (not padding) length ...
[ "def", "_decode_next_layer", "(", "self", ",", "dict_", ",", "proto", "=", "None", ",", "length", "=", "None", ",", "*", ",", "version", "=", "4", ",", "ipv6_exthdr", "=", "None", ")", ":", "if", "self", ".", "_onerror", ":", "next_", "=", "beholder"...
Decode next layer extractor. Positional arguments: * dict_ -- dict, info buffer * proto -- str, next layer protocol name * length -- int, valid (not padding) length Keyword Arguments: * version -- int, IP version (4 in default) ...
[ "Decode", "next", "layer", "extractor", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/internet.py#L77-L111
JarryShaw/PyPCAPKit
src/protocols/internet/internet.py
Internet._import_next_layer
def _import_next_layer(self, proto, length=None, *, version=4, extension=False): """Import next layer extractor. Positional arguments: * proto -- str, next layer protocol name * length -- int, valid (not padding) length Keyword Arguments: * version -- int, I...
python
def _import_next_layer(self, proto, length=None, *, version=4, extension=False): """Import next layer extractor. Positional arguments: * proto -- str, next layer protocol name * length -- int, valid (not padding) length Keyword Arguments: * version -- int, I...
[ "def", "_import_next_layer", "(", "self", ",", "proto", ",", "length", "=", "None", ",", "*", ",", "version", "=", "4", ",", "extension", "=", "False", ")", ":", "if", "length", "==", "0", ":", "from", "pcapkit", ".", "protocols", ".", "null", "impor...
Import next layer extractor. Positional arguments: * proto -- str, next layer protocol name * length -- int, valid (not padding) length Keyword Arguments: * version -- int, IP version (4 in default) <keyword> 4 / 6 * extension...
[ "Import", "next", "layer", "extractor", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/internet.py#L113-L170
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP.read_hip
def read_hip(self, length, extension): """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 +-+-+-+-+-+-+-+-+-+-+-...
python
def read_hip(self, length, extension): """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 +-+-+-+-+-+-+-+-+-+-+-...
[ "def", "read_hip", "(", "self", ",", "length", ",", "extension", ")", ":", "if", "length", "is", "None", ":", "length", "=", "len", "(", "self", ")", "_next", "=", "self", ".", "_read_protos", "(", "1", ")", "_hlen", "=", "self", ".", "_read_unpack",...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "Host", "Identity", "Protocol", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L138-L221
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_hip_para
def _read_hip_para(self, length, *, version): """Read HIP parameters. Positional arguments: * length -- int, length of parameters Keyword arguments: * version -- int, HIP version Returns: * dict -- extracted HIP parameters """ count...
python
def _read_hip_para(self, length, *, version): """Read HIP parameters. Positional arguments: * length -- int, length of parameters Keyword arguments: * version -- int, HIP version Returns: * dict -- extracted HIP parameters """ count...
[ "def", "_read_hip_para", "(", "self", ",", "length", ",", "*", ",", "version", ")", ":", "counter", "=", "0", "# length of read parameters", "optkind", "=", "list", "(", ")", "# parameter type list", "options", "=", "dict", "(", ")", "# dict of parameter data", ...
Read HIP parameters. Positional arguments: * length -- int, length of parameters Keyword arguments: * version -- int, HIP version Returns: * dict -- extracted HIP parameters
[ "Read", "HIP", "parameters", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L239-L297
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_unassigned
def _read_para_unassigned(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_unassigned(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_unassigned", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "unassigned", "=", "dict", "(", "type", "=", "desc", ",", "critical", "=", "cbit", ",", "length", "=",...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "unassigned", "parameters", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L299-L333
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_esp_info
def _read_para_esp_info(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_esp_info(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_esp_info", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "!=", "12", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] invalid format'", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "ESP_INFO", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L335-L378
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_r1_counter
def _read_para_r1_counter(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_r1_counter(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_r1_counter", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "!=", "12", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] invalid format'"...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "R1_COUNTER", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L380-L418
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_locator_set
def _read_para_locator_set(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_locator_set(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_locator_set", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "def", "_read_locator", "(", "kind", ",", "size", ")", ":", "if", "kind", "==", "0", "and", "size", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "LOCATOR_SET", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L420-L503
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_puzzle
def _read_para_puzzle(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_puzzle(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_puzzle", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "version", "==", "1", "and", "clen", "!=", "12", ":", "raise", "ProtocolError", "(", "f'HIPv{version}:...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "PUZZLE", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L505-L553
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_seq
def _read_para_seq(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_seq(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_seq", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "!=", "4", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] invalid format'", ")",...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ...
[ "Read", "HIP", "SEQ", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L613-L644
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_ack
def _read_para_ack(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_ack(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_ack", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "%", "4", "!=", "0", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] invalid fo...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ...
[ "Read", "HIP", "ACK", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L646-L681
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_dh_group_list
def _read_para_dh_group_list(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_dh_group_list(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_dh_group_list", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_dhid", "=", "list", "(", ")", "for", "_", "in", "range", "(", "clen", ")", ":", "_dhid", ".", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "DH_GROUP_LIST", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L683-L719
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_diffie_hellman
def _read_para_diffie_hellman(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_diffie_hellman(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_diffie_hellman", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_gpid", "=", "self", ".", "_read_unpack", "(", "1", ")", "_vlen", "=", "self", ".", "_read_unpack",...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "DIFFIE_HELLMAN", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L721-L764
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_hip_transform
def _read_para_hip_transform(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_hip_transform(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_hip_transform", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "version", "!=", "1", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] invalid par...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "HIP_TRANSFORM", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L766-L809
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_hip_cipher
def _read_para_hip_cipher(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_hip_cipher(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_hip_cipher", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "%", "2", "!=", "0", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] inv...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "HIP_CIPHER", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L811-L852
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_nat_traversal_mode
def _read_para_nat_traversal_mode(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_nat_traversal_mode(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_nat_traversal_mode", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "%", "2", "!=", "0", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {co...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "NAT_TRAVERSAL_MODE", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L854-L899
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_transaction_pacing
def _read_para_transaction_pacing(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_transaction_pacing(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_transaction_pacing", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "!=", "4", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] invalid f...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "TRANSACTION_PACING", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L901-L932
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_encrypted
def _read_para_encrypted(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_encrypted(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_encrypted", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_resv", "=", "self", ".", "_read_fileng", "(", "4", ")", "_data", "=", "self", ".", "_read_fileng", "(...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "ENCRYPTED", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L934-L980
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_host_id
def _read_para_host_id(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_host_id(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_host_id", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "def", "_read_host_identifier", "(", "length", ",", "code", ")", ":", "algorithm", "=", "_HI_ALGORITHM", ".",...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "HOST_ID", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L982-L1058
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_hit_suite_list
def _read_para_hit_suite_list(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_hit_suite_list(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_hit_suite_list", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_hsid", "=", "list", "(", ")", "for", "_", "in", "range", "(", "clen", ")", ":", "_hsid", ".", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "HIT_SUITE_LIST", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1060-L1098
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_cert
def _read_para_cert(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_cert(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_cert", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_ctgp", "=", "self", ".", "_read_unpack", "(", "1", ")", "_ctct", "=", "self", ".", "_read_unpack", "(", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "CERT", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1100-L1149
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_notification
def _read_para_notification(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_notification(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_notification", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_resv", "=", "self", ".", "_read_fileng", "(", "2", ")", "_code", "=", "self", ".", "_read_unpack", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "NOTIFICATION", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1151-L1209
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_echo_request_signed
def _read_para_echo_request_signed(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_echo_request_signed(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_echo_request_signed", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_data", "=", "self", ".", "_read_fileng", "(", "clen", ")", "echo_request_signed", "=", "dict", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "ECHO_REQUEST_SIGNED", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1211-L1243
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_reg_failed
def _read_para_reg_failed(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_reg_failed(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_reg_failed", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_life", "=", "collections", ".", "namedtuple", "(", "'Lifetime'", ",", "(", "'min'", ",", "'max'", ")",...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "REG_FAILED", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1419-L1475
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_reg_from
def _read_para_reg_from(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_reg_from(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_reg_from", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "!=", "20", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] invalid format'", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "REG_FROM", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1477-L1521
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_echo_response_signed
def _read_para_echo_response_signed(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_echo_response_signed(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_echo_response_signed", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_data", "=", "self", ".", "_read_fileng", "(", "clen", ")", "echo_response_signed", "=", "dict", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "ECHO_RESPONSE_SIGNED", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1523-L1555
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_transport_format_list
def _read_para_transport_format_list(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_transport_format_list(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_transport_format_list", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "%", "2", "!=", "0", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "TRANSPORT_FORMAT_LIST", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1557-L1598
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_esp_transform
def _read_para_esp_transform(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_esp_transform(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_esp_transform", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "%", "2", "!=", "0", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "ESP_TRANSFORM", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1600-L1645
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_seq_data
def _read_para_seq_data(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_seq_data(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_seq_data", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "!=", "4", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] invalid format'", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "SEQ_DATA", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1647-L1678
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_ack_data
def _read_para_ack_data(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_ack_data(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_ack_data", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "%", "4", "!=", "0", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] inval...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "ACK_DATA", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1680-L1714
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_payload_mic
def _read_para_payload_mic(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_payload_mic(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_payload_mic", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_next", "=", "self", ".", "_read_unpack", "(", "1", ")", "_resv", "=", "self", ".", "_read_fileng", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "ACK_DATA", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1716-L1764
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_transaction_id
def _read_para_transaction_id(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_transaction_id(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_transaction_id", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_tsid", "=", "self", ".", "_read_unpack", "(", "clen", ")", "transaction_id", "=", "dict", "(", "ty...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "TRANSACTION_ID", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1766-L1800
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_overlay_id
def _read_para_overlay_id(self, code, cbit, clen, *, desc, length, version): """Read HIP TRANSACTION_ID parameter. Structure of HIP TRANSACTION_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 ...
python
def _read_para_overlay_id(self, code, cbit, clen, *, desc, length, version): """Read HIP TRANSACTION_ID parameter. Structure of HIP TRANSACTION_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 ...
[ "def", "_read_para_overlay_id", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_olid", "=", "self", ".", "_read_unpack", "(", "clen", ")", "overlay_id", "=", "dict", "(", "type", "...
Read HIP TRANSACTION_ID parameter. Structure of HIP TRANSACTION_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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "TRANSACTION_ID", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1802-L1836
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_route_dst
def _read_para_route_dst(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_route_dst(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_route_dst", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "(", "clen", "-", "4", ")", "%", "16", "!=", "0", ":", "raise", "ProtocolError", "(", "f'HIPv{v...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "ROUTE_DST", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1838-L1895
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_hip_transport_mode
def _read_para_hip_transport_mode(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_hip_transport_mode(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_hip_transport_mode", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "%", "2", "!=", "0", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {co...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "HIP_TRANSPORT_MODE", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1897-L1943
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_hip_mac
def _read_para_hip_mac(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_hip_mac(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_hip_mac", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_hmac", "=", "self", ".", "_read_fileng", "(", "clen", ")", "hip_mac", "=", "dict", "(", "type", "=", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "HIP_MAC", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1945-L1982
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_hip_mac_2
def _read_para_hip_mac_2(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_hip_mac_2(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_hip_mac_2", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_hmac", "=", "self", ".", "_read_fileng", "(", "clen", ")", "hip_mac_2", "=", "dict", "(", "type", "="...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "HIP_MAC_2", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L1984-L2021
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_hip_signature_2
def _read_para_hip_signature_2(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_hip_signature_2(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_hip_signature_2", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_algo", "=", "self", ".", "_read_unpack", "(", "2", ")", "_sign", "=", "self", ".", "_read_fileng"...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "HIP_SIGNATURE_2", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L2023-L2061
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_echo_request_unsigned
def _read_para_echo_request_unsigned(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_echo_request_unsigned(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_echo_request_unsigned", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_data", "=", "self", ".", "_read_fileng", "(", "clen", ")", "echo_request_unsigned", "=", "dict"...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "ECHO_REQUEST_UNSIGNED", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L2103-L2135
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_echo_response_unsigned
def _read_para_echo_response_unsigned(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_echo_response_unsigned(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_echo_response_unsigned", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_data", "=", "self", ".", "_read_fileng", "(", "clen", ")", "echo_response_unsigned", "=", "dic...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "ECHO_RESPONSE_UNSIGNED", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L2137-L2169
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_overlay_ttl
def _read_para_overlay_ttl(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_overlay_ttl(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_overlay_ttl", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "!=", "4", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] invalid format'"...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "Read", "HIP", "OVERLAY_TTL", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L2263-L2295
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_from
def _read_para_from(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_from(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_from", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "!=", "16", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] invalid format'", ")...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "FROM", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L2356-L2390
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_rvs_hmac
def _read_para_rvs_hmac(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_rvs_hmac(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_rvs_hmac", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_hmac", "=", "self", ".", "_read_fileng", "(", "clen", ")", "rvs_hmac", "=", "dict", "(", "type", "=", ...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "RVS_HMAC", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L2392-L2427
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_via_rvs
def _read_para_via_rvs(self, code, cbit, clen, *, desc, length, version): """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...
python
def _read_para_via_rvs(self, code, cbit, clen, *, desc, length, version): """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...
[ "def", "_read_para_via_rvs", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "if", "clen", "%", "16", "!=", "0", ":", "raise", "ProtocolError", "(", "f'HIPv{version}: [Parano {code}] inval...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "VIA_RVS", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L2429-L2474
JarryShaw/PyPCAPKit
src/protocols/internet/hip.py
HIP._read_para_relay_hmac
def _read_para_relay_hmac(self, code, cbit, clen, *, desc, length, version): """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 ...
python
def _read_para_relay_hmac(self, code, cbit, clen, *, desc, length, version): """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 ...
[ "def", "_read_para_relay_hmac", "(", "self", ",", "code", ",", "cbit", ",", "clen", ",", "*", ",", "desc", ",", "length", ",", "version", ")", ":", "_hmac", "=", "self", ".", "_read_fileng", "(", "clen", ")", "relay_hmac", "=", "dict", "(", "type", "...
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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "HIP", "RELAY_HMAC", "parameter", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/hip.py#L2476-L2511
JarryShaw/PyPCAPKit
src/utilities/exceptions.py
stacklevel
def stacklevel(): """Fetch current stack level.""" pcapkit = f'{os.path.sep}pcapkit{os.path.sep}' tb = traceback.extract_stack() for index, tbitem in enumerate(tb): if pcapkit in tbitem[0]: break else: index = len(tb) return (index-1)
python
def stacklevel(): """Fetch current stack level.""" pcapkit = f'{os.path.sep}pcapkit{os.path.sep}' tb = traceback.extract_stack() for index, tbitem in enumerate(tb): if pcapkit in tbitem[0]: break else: index = len(tb) return (index-1)
[ "def", "stacklevel", "(", ")", ":", "pcapkit", "=", "f'{os.path.sep}pcapkit{os.path.sep}'", "tb", "=", "traceback", ".", "extract_stack", "(", ")", "for", "index", ",", "tbitem", "in", "enumerate", "(", "tb", ")", ":", "if", "pcapkit", "in", "tbitem", "[", ...
Fetch current stack level.
[ "Fetch", "current", "stack", "level", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/utilities/exceptions.py#L46-L55
JarryShaw/PyPCAPKit
src/const/misc/linktype.py
LinkType.get
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return LinkType(key) if key not in LinkType._member_map_: extend_enum(LinkType, key, default) return LinkType[key]
python
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return LinkType(key) if key not in LinkType._member_map_: extend_enum(LinkType, key, default) return LinkType[key]
[ "def", "get", "(", "key", ",", "default", "=", "-", "1", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "return", "LinkType", "(", "key", ")", "if", "key", "not", "in", "LinkType", ".", "_member_map_", ":", "extend_enum", "(", "Lin...
Backport support for original codes.
[ "Backport", "support", "for", "original", "codes", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/const/misc/linktype.py#L136-L142
JarryShaw/PyPCAPKit
src/utilities/decorators.py
seekset
def seekset(func): """[ClassMethod] Read file from start then set back to original.""" @functools.wraps(func) def seekcur(self, *args, **kw): seek_cur = self._file.tell() self._file.seek(self._seekset, os.SEEK_SET) return_ = func(self, *args, **kw) self._file.seek(seek_cur, o...
python
def seekset(func): """[ClassMethod] Read file from start then set back to original.""" @functools.wraps(func) def seekcur(self, *args, **kw): seek_cur = self._file.tell() self._file.seek(self._seekset, os.SEEK_SET) return_ = func(self, *args, **kw) self._file.seek(seek_cur, o...
[ "def", "seekset", "(", "func", ")", ":", "@", "functools", ".", "wraps", "(", "func", ")", "def", "seekcur", "(", "self", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "seek_cur", "=", "self", ".", "_file", ".", "tell", "(", ")", "self", "."...
[ClassMethod] Read file from start then set back to original.
[ "[", "ClassMethod", "]", "Read", "file", "from", "start", "then", "set", "back", "to", "original", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/utilities/decorators.py#L21-L30
JarryShaw/PyPCAPKit
src/utilities/decorators.py
seekset_ng
def seekset_ng(func): """Read file from start then set back to original.""" @functools.wraps(func) def seekcur(file, *args, seekset=os.SEEK_SET, **kw): # seek_cur = file.tell() file.seek(seekset, os.SEEK_SET) return_ = func(file, *args, seekset=seekset, **kw) # file.seek(seek...
python
def seekset_ng(func): """Read file from start then set back to original.""" @functools.wraps(func) def seekcur(file, *args, seekset=os.SEEK_SET, **kw): # seek_cur = file.tell() file.seek(seekset, os.SEEK_SET) return_ = func(file, *args, seekset=seekset, **kw) # file.seek(seek...
[ "def", "seekset_ng", "(", "func", ")", ":", "@", "functools", ".", "wraps", "(", "func", ")", "def", "seekcur", "(", "file", ",", "*", "args", ",", "seekset", "=", "os", ".", "SEEK_SET", ",", "*", "*", "kw", ")", ":", "# seek_cur = file.tell()", "fil...
Read file from start then set back to original.
[ "Read", "file", "from", "start", "then", "set", "back", "to", "original", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/utilities/decorators.py#L33-L42
JarryShaw/PyPCAPKit
src/utilities/decorators.py
beholder
def beholder(func): """[ClassMethod] Behold extraction procedure.""" @functools.wraps(func) def behold(self, proto, length, *args, **kwargs): seek_cur = self._file.tell() try: return func(proto, length, *args, **kwargs) except Exception: from pcapkit.protocols...
python
def beholder(func): """[ClassMethod] Behold extraction procedure.""" @functools.wraps(func) def behold(self, proto, length, *args, **kwargs): seek_cur = self._file.tell() try: return func(proto, length, *args, **kwargs) except Exception: from pcapkit.protocols...
[ "def", "beholder", "(", "func", ")", ":", "@", "functools", ".", "wraps", "(", "func", ")", "def", "behold", "(", "self", ",", "proto", ",", "length", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "seek_cur", "=", "self", ".", "_file", "."...
[ClassMethod] Behold extraction procedure.
[ "[", "ClassMethod", "]", "Behold", "extraction", "procedure", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/utilities/decorators.py#L45-L60
JarryShaw/PyPCAPKit
src/utilities/decorators.py
beholder_ng
def beholder_ng(func): """Behold analysis procedure.""" @functools.wraps(func) def behold(file, length, *args, **kwargs): seek_cur = file.tell() try: return func(file, length, *args, **kwargs) except Exception: # from pcapkit.foundation.analysis import analyse...
python
def beholder_ng(func): """Behold analysis procedure.""" @functools.wraps(func) def behold(file, length, *args, **kwargs): seek_cur = file.tell() try: return func(file, length, *args, **kwargs) except Exception: # from pcapkit.foundation.analysis import analyse...
[ "def", "beholder_ng", "(", "func", ")", ":", "@", "functools", ".", "wraps", "(", "func", ")", "def", "behold", "(", "file", ",", "length", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "seek_cur", "=", "file", ".", "tell", "(", ")", "try"...
Behold analysis procedure.
[ "Behold", "analysis", "procedure", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/utilities/decorators.py#L63-L82
JarryShaw/PyPCAPKit
src/protocols/link/l2tp.py
L2TP.read_l2tp
def read_l2tp(self, length): """Read Layer Two Tunnelling Protocol. Structure of L2TP header [RFC 2661]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
python
def read_l2tp(self, length): """Read Layer Two Tunnelling Protocol. Structure of L2TP header [RFC 2661]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "def", "read_l2tp", "(", "self", ",", "length", ")", ":", "if", "length", "is", "None", ":", "length", "=", "len", "(", "self", ")", "_flag", "=", "self", ".", "_read_binary", "(", "1", ")", "_vers", "=", "self", ".", "_read_fileng", "(", "1", ")",...
Read Layer Two Tunnelling Protocol. Structure of L2TP header [RFC 2661]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "Layer", "Two", "Tunnelling", "Protocol", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/link/l2tp.py#L84-L156
JarryShaw/PyPCAPKit
src/const/hip/ecdsa_low_curve.py
ECDSA_LOW_Curve.get
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return ECDSA_LOW_Curve(key) if key not in ECDSA_LOW_Curve._member_map_: extend_enum(ECDSA_LOW_Curve, key, default) return ECDSA_LOW_Curve[key]
python
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return ECDSA_LOW_Curve(key) if key not in ECDSA_LOW_Curve._member_map_: extend_enum(ECDSA_LOW_Curve, key, default) return ECDSA_LOW_Curve[key]
[ "def", "get", "(", "key", ",", "default", "=", "-", "1", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "return", "ECDSA_LOW_Curve", "(", "key", ")", "if", "key", "not", "in", "ECDSA_LOW_Curve", ".", "_member_map_", ":", "extend_enum",...
Backport support for original codes.
[ "Backport", "support", "for", "original", "codes", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/const/hip/ecdsa_low_curve.py#L16-L22
JarryShaw/PyPCAPKit
src/const/arp/hardware.py
Hardware.get
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return Hardware(key) if key not in Hardware._member_map_: extend_enum(Hardware, key, default) return Hardware[key]
python
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return Hardware(key) if key not in Hardware._member_map_: extend_enum(Hardware, key, default) return Hardware[key]
[ "def", "get", "(", "key", ",", "default", "=", "-", "1", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "return", "Hardware", "(", "key", ")", "if", "key", "not", "in", "Hardware", ".", "_member_map_", ":", "extend_enum", "(", "Har...
Backport support for original codes.
[ "Backport", "support", "for", "original", "codes", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/const/arp/hardware.py#L55-L61
JarryShaw/PyPCAPKit
src/protocols/link/vlan.py
VLAN.read_vlan
def read_vlan(self, length): """Read 802.1Q Customer VLAN Tag Type. Structure of 802.1Q Customer VLAN Tag Type [RFC 7042]: Octets Bits Name Description 1 0 vlan.tci Tag Control Information 1 0 ...
python
def read_vlan(self, length): """Read 802.1Q Customer VLAN Tag Type. Structure of 802.1Q Customer VLAN Tag Type [RFC 7042]: Octets Bits Name Description 1 0 vlan.tci Tag Control Information 1 0 ...
[ "def", "read_vlan", "(", "self", ",", "length", ")", ":", "if", "length", "is", "None", ":", "length", "=", "len", "(", "self", ")", "_tcif", "=", "self", ".", "_read_binary", "(", "2", ")", "_type", "=", "self", ".", "_read_protos", "(", "2", ")",...
Read 802.1Q Customer VLAN Tag Type. Structure of 802.1Q Customer VLAN Tag Type [RFC 7042]: Octets Bits Name Description 1 0 vlan.tci Tag Control Information 1 0 vlan.tci.pcp Priority Cod...
[ "Read", "802", ".", "1Q", "Customer", "VLAN", "Tag", "Type", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/link/vlan.py#L83-L113
JarryShaw/PyPCAPKit
src/const/ipv6/tagger_id.py
TaggerId.get
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return TaggerId(key) if key not in TaggerId._member_map_: extend_enum(TaggerId, key, default) return TaggerId[key]
python
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return TaggerId(key) if key not in TaggerId._member_map_: extend_enum(TaggerId, key, default) return TaggerId[key]
[ "def", "get", "(", "key", ",", "default", "=", "-", "1", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "return", "TaggerId", "(", "key", ")", "if", "key", "not", "in", "TaggerId", ".", "_member_map_", ":", "extend_enum", "(", "Tag...
Backport support for original codes.
[ "Backport", "support", "for", "original", "codes", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/const/ipv6/tagger_id.py#L18-L24
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP.read_tcp
def read_tcp(self, length): """Read Transmission Control Protocol (TCP). Structure of TCP header [RFC 793]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
python
def read_tcp(self, length): """Read Transmission Control Protocol (TCP). Structure of TCP header [RFC 793]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...
[ "def", "read_tcp", "(", "self", ",", "length", ")", ":", "if", "length", "is", "None", ":", "length", "=", "len", "(", "self", ")", "_srcp", "=", "self", ".", "_read_unpack", "(", "2", ")", "_dstp", "=", "self", ".", "_read_unpack", "(", "2", ")", ...
Read Transmission Control Protocol (TCP). Structure of TCP header [RFC 793]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "Transmission", "Control", "Protocol", "(", "TCP", ")", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L231-L328
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_tcp_options
def _read_tcp_options(self, size): """Read TCP option list. Positional arguments: * size -- int, length of option list Returns: * tuple -- TCP option list * dict -- extracted TCP option """ counter = 0 # length of read option list ...
python
def _read_tcp_options(self, size): """Read TCP option list. Positional arguments: * size -- int, length of option list Returns: * tuple -- TCP option list * dict -- extracted TCP option """ counter = 0 # length of read option list ...
[ "def", "_read_tcp_options", "(", "self", ",", "size", ")", ":", "counter", "=", "0", "# length of read option list", "optkind", "=", "list", "(", ")", "# option kind list", "options", "=", "dict", "(", ")", "# dict of option data", "while", "counter", "<", "size...
Read TCP option list. Positional arguments: * size -- int, length of option list Returns: * tuple -- TCP option list * dict -- extracted TCP option
[ "Read", "TCP", "option", "list", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L345-L414
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mode_donone
def _read_mode_donone(self, size, kind): """Read options request no process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option with no operation Structure of TCP options: ...
python
def _read_mode_donone(self, size, kind): """Read options request no process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option with no operation Structure of TCP options: ...
[ "def", "_read_mode_donone", "(", "self", ",", "size", ",", "kind", ")", ":", "data", "=", "dict", "(", "kind", "=", "kind", ",", "length", "=", "size", ",", "data", "=", "self", ".", "_read_fileng", "(", "size", ")", ",", ")", "return", "data" ]
Read options request no process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option with no operation Structure of TCP options: Octets Bits Name ...
[ "Read", "options", "request", "no", "process", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L416-L438
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mode_unpack
def _read_mode_unpack(self, size, kind): """Read options request unpack process. Keyword arguments: size - int, length of option kind - int, option kind value Returns: * dict -- extracted option which unpacked Structure of TCP options: O...
python
def _read_mode_unpack(self, size, kind): """Read options request unpack process. Keyword arguments: size - int, length of option kind - int, option kind value Returns: * dict -- extracted option which unpacked Structure of TCP options: O...
[ "def", "_read_mode_unpack", "(", "self", ",", "size", ",", "kind", ")", ":", "data", "=", "dict", "(", "kind", "=", "kind", ",", "length", "=", "size", ",", "data", "=", "self", ".", "_read_unpack", "(", "size", ")", ",", ")", "return", "data" ]
Read options request unpack process. Keyword arguments: size - int, length of option kind - int, option kind value Returns: * dict -- extracted option which unpacked Structure of TCP options: Octets Bits Name Descr...
[ "Read", "options", "request", "unpack", "process", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L440-L462
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mode_tsopt
def _read_mode_tsopt(self, size, kind): """Read Timestamps option. Positional arguments: * size - int, length of option * kind - int, 8 (Timestamps) Returns: * dict -- extracted Timestamps (TS) option Structure of TCP TSopt [RFC 7323]: +...
python
def _read_mode_tsopt(self, size, kind): """Read Timestamps option. Positional arguments: * size - int, length of option * kind - int, 8 (Timestamps) Returns: * dict -- extracted Timestamps (TS) option Structure of TCP TSopt [RFC 7323]: +...
[ "def", "_read_mode_tsopt", "(", "self", ",", "size", ",", "kind", ")", ":", "temp", "=", "struct", ".", "unpack", "(", "'>II'", ",", "self", ".", "_read_fileng", "(", "size", ")", ")", "data", "=", "dict", "(", "kind", "=", "kind", ",", "length", "...
Read Timestamps option. Positional arguments: * size - int, length of option * kind - int, 8 (Timestamps) Returns: * dict -- extracted Timestamps (TS) option Structure of TCP TSopt [RFC 7323]: +-------+-------+---------------------+-------------...
[ "Read", "Timestamps", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L464-L494
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mode_pocsp
def _read_mode_pocsp(self, size, kind): """Read Partial Order Connection Service Profile option. Positional arguments: * size - int, length of option * kind - int, 10 (POC-Serv Profile) Returns: * dict -- extracted Partial Order Connection Service Profile (P...
python
def _read_mode_pocsp(self, size, kind): """Read Partial Order Connection Service Profile option. Positional arguments: * size - int, length of option * kind - int, 10 (POC-Serv Profile) Returns: * dict -- extracted Partial Order Connection Service Profile (P...
[ "def", "_read_mode_pocsp", "(", "self", ",", "size", ",", "kind", ")", ":", "temp", "=", "self", ".", "_read_binary", "(", "size", ")", "data", "=", "dict", "(", "kind", "=", "kind", ",", "length", "=", "size", ",", "start", "=", "True", "if", "int...
Read Partial Order Connection Service Profile option. Positional arguments: * size - int, length of option * kind - int, 10 (POC-Serv Profile) Returns: * dict -- extracted Partial Order Connection Service Profile (POC-SP) option Structure of TCP POC-SP Opti...
[ "Read", "Partial", "Order", "Connection", "Service", "Profile", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L496-L530
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mode_acopt
def _read_mode_acopt(self, size, kind): """Read Alternate Checksum Request option. Positional arguments: size - int, length of option kind - int, 14 (Alt-Chksum Request) Returns: * dict -- extracted Alternate Checksum Request (CHKSUM-REQ) option Str...
python
def _read_mode_acopt(self, size, kind): """Read Alternate Checksum Request option. Positional arguments: size - int, length of option kind - int, 14 (Alt-Chksum Request) Returns: * dict -- extracted Alternate Checksum Request (CHKSUM-REQ) option Str...
[ "def", "_read_mode_acopt", "(", "self", ",", "size", ",", "kind", ")", ":", "temp", "=", "self", ".", "_read_unpack", "(", "size", ")", "algo", "=", "chksum_opt", ".", "get", "(", "temp", ")", "data", "=", "dict", "(", "kind", "=", "kind", ",", "le...
Read Alternate Checksum Request option. Positional arguments: size - int, length of option kind - int, 14 (Alt-Chksum Request) Returns: * dict -- extracted Alternate Checksum Request (CHKSUM-REQ) option Structure of TCP CHKSUM-REQ [RFC 1146][RFC 6247]: ...
[ "Read", "Alternate", "Checksum", "Request", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L532-L562
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mode_qsopt
def _read_mode_qsopt(self, size, kind): """Read Quick-Start Response option. Positional arguments: * size - int, length of option * kind - int, 27 (Quick-Start Response) Returns: * dict -- extracted Quick-Start Response (QS) option Structure of TCP ...
python
def _read_mode_qsopt(self, size, kind): """Read Quick-Start Response option. Positional arguments: * size - int, length of option * kind - int, 27 (Quick-Start Response) Returns: * dict -- extracted Quick-Start Response (QS) option Structure of TCP ...
[ "def", "_read_mode_qsopt", "(", "self", ",", "size", ",", "kind", ")", ":", "rvrr", "=", "self", ".", "_read_binary", "(", "1", ")", "ttld", "=", "self", ".", "_read_unpack", "(", "1", ")", "noun", "=", "self", ".", "_read_fileng", "(", "4", ")", "...
Read Quick-Start Response option. Positional arguments: * size - int, length of option * kind - int, 27 (Quick-Start Response) Returns: * dict -- extracted Quick-Start Response (QS) option Structure of TCP QSopt [RFC 4782]: 0 ...
[ "Read", "Quick", "-", "Start", "Response", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L564-L606
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mode_utopt
def _read_mode_utopt(self, size, kind): """Read User Timeout option. Positional arguments: * size - int, length of option * kind - int, 28 (User Timeout Option) Returns: * dict -- extracted User Timeout (TIMEOUT) option Structure of TCP TIMEOUT [RFC...
python
def _read_mode_utopt(self, size, kind): """Read User Timeout option. Positional arguments: * size - int, length of option * kind - int, 28 (User Timeout Option) Returns: * dict -- extracted User Timeout (TIMEOUT) option Structure of TCP TIMEOUT [RFC...
[ "def", "_read_mode_utopt", "(", "self", ",", "size", ",", "kind", ")", ":", "temp", "=", "self", ".", "_read_fileng", "(", "size", ")", "data", "=", "dict", "(", "kind", "=", "kind", ",", "length", "=", "size", ",", "granularity", "=", "'minutes'", "...
Read User Timeout option. Positional arguments: * size - int, length of option * kind - int, 28 (User Timeout Option) Returns: * dict -- extracted User Timeout (TIMEOUT) option Structure of TCP TIMEOUT [RFC 5482]: 0 1 ...
[ "Read", "User", "Timeout", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L608-L641
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mode_tcpao
def _read_mode_tcpao(self, size, kind): """Read Authentication option. Positional arguments: * size - int, length of option * kind - int, 29 (TCP Authentication Option) Returns: * dict -- extracted Authentication (AO) option Structure of TCP AOopt [...
python
def _read_mode_tcpao(self, size, kind): """Read Authentication option. Positional arguments: * size - int, length of option * kind - int, 29 (TCP Authentication Option) Returns: * dict -- extracted Authentication (AO) option Structure of TCP AOopt [...
[ "def", "_read_mode_tcpao", "(", "self", ",", "size", ",", "kind", ")", ":", "key_", "=", "self", ".", "_read_unpack", "(", "1", ")", "rkey", "=", "self", ".", "_read_unpack", "(", "1", ")", "mac_", "=", "self", ".", "_read_fileng", "(", "size", "-", ...
Read Authentication option. Positional arguments: * size - int, length of option * kind - int, 29 (TCP Authentication Option) Returns: * dict -- extracted Authentication (AO) option Structure of TCP AOopt [RFC 5925]: +------------+------------+-...
[ "Read", "Authentication", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L643-L684
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mode_mptcp
def _read_mode_mptcp(self, size, kind): """Read Multipath TCP option. Positional arguments: * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Multipath TCP (MP-TCP) option Structure of MP-TCP [RFC 6824]: ...
python
def _read_mode_mptcp(self, size, kind): """Read Multipath TCP option. Positional arguments: * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Multipath TCP (MP-TCP) option Structure of MP-TCP [RFC 6824]: ...
[ "def", "_read_mode_mptcp", "(", "self", ",", "size", ",", "kind", ")", ":", "bins", "=", "self", ".", "_read_binary", "(", "1", ")", "subt", "=", "int", "(", "bins", "[", ":", "4", "]", ",", "base", "=", "2", ")", "# subtype number", "bits", "=", ...
Read Multipath TCP option. Positional arguments: * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Multipath TCP (MP-TCP) option Structure of MP-TCP [RFC 6824]: 1 ...
[ "Read", "Multipath", "TCP", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L686-L730
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mptcp_capable
def _read_mptcp_capable(self, bits, size, kind): """Read Multipath Capable option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Multipath Capable (MP_C...
python
def _read_mptcp_capable(self, bits, size, kind): """Read Multipath Capable option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Multipath Capable (MP_C...
[ "def", "_read_mptcp_capable", "(", "self", ",", "bits", ",", "size", ",", "kind", ")", ":", "vers", "=", "int", "(", "bits", ",", "base", "=", "2", ")", "bins", "=", "self", ".", "_read_binary", "(", "1", ")", "skey", "=", "self", ".", "_read_filen...
Read Multipath Capable option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Multipath Capable (MP_CAPABLE) option Structure of MP_CAPABLE [RFC 6824]: ...
[ "Read", "Multipath", "Capable", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L732-L794
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mptcp_join
def _read_mptcp_join(self, bits, size, kind): """Read Join Connection option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join Connection (MP_JOIN) op...
python
def _read_mptcp_join(self, bits, size, kind): """Read Join Connection option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join Connection (MP_JOIN) op...
[ "def", "_read_mptcp_join", "(", "self", ",", "bits", ",", "size", ",", "kind", ")", ":", "if", "self", ".", "_syn", "and", "self", ".", "_ack", ":", "# MP_JOIN-SYN/ACK", "return", "self", ".", "_read_join_synack", "(", "bits", ",", "size", ",", "kind", ...
Read Join Connection option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join Connection (MP_JOIN) option Structure of MP_JOIN [RFC 6824]: ...
[ "Read", "Join", "Connection", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L796-L829
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_join_syn
def _read_join_syn(self, bits, size, kind): """Read Join Connection option for Initial SYN. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join Connectio...
python
def _read_join_syn(self, bits, size, kind): """Read Join Connection option for Initial SYN. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join Connectio...
[ "def", "_read_join_syn", "(", "self", ",", "bits", ",", "size", ",", "kind", ")", ":", "adid", "=", "self", ".", "_read_unpack", "(", "1", ")", "rtkn", "=", "self", ".", "_read_fileng", "(", "4", ")", "srno", "=", "self", ".", "_read_unpack", "(", ...
Read Join Connection option for Initial SYN. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join Connection (MP_JOIN-SYN) option for Initial SYN Structu...
[ "Read", "Join", "Connection", "option", "for", "Initial", "SYN", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L831-L882
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_join_synack
def _read_join_synack(self, bits, size, kind): """Read Join Connection option for Responding SYN/ACK. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join...
python
def _read_join_synack(self, bits, size, kind): """Read Join Connection option for Responding SYN/ACK. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join...
[ "def", "_read_join_synack", "(", "self", ",", "bits", ",", "size", ",", "kind", ")", ":", "adid", "=", "self", ".", "_read_unpack", "(", "1", ")", "hmac", "=", "self", ".", "_read_fileng", "(", "8", ")", "srno", "=", "self", ".", "_read_unpack", "(",...
Read Join Connection option for Responding SYN/ACK. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join Connection (MP_JOIN-SYN/ACK) option for Responding SYN/AC...
[ "Read", "Join", "Connection", "option", "for", "Responding", "SYN", "/", "ACK", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L884-L937
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_join_ack
def _read_join_ack(self, bits, size, kind): """Read Join Connection option for Third ACK. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join Connection ...
python
def _read_join_ack(self, bits, size, kind): """Read Join Connection option for Third ACK. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join Connection ...
[ "def", "_read_join_ack", "(", "self", ",", "bits", ",", "size", ",", "kind", ")", ":", "temp", "=", "self", ".", "_read_fileng", "(", "20", ")", "data", "=", "dict", "(", "kind", "=", "kind", ",", "length", "=", "size", "+", "1", ",", "subtype", ...
Read Join Connection option for Third ACK. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Join Connection (MP_JOIN-ACK) option for Third ACK Structure o...
[ "Read", "Join", "Connection", "option", "for", "Third", "ACK", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L939-L984
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mptcp_dss
def _read_mptcp_dss(self, bits, size, kind): """Read Data Sequence Signal (Data ACK and Data Sequence Mapping) option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict ...
python
def _read_mptcp_dss(self, bits, size, kind): """Read Data Sequence Signal (Data ACK and Data Sequence Mapping) option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict ...
[ "def", "_read_mptcp_dss", "(", "self", ",", "bits", ",", "size", ",", "kind", ")", ":", "bits", "=", "self", ".", "_read_binary", "(", "1", ")", "mflg", "=", "8", "if", "int", "(", "bits", "[", "4", "]", ")", "else", "4", "Mflg", "=", "True", "...
Read Data Sequence Signal (Data ACK and Data Sequence Mapping) option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Data Sequence Signal (DSS) option ...
[ "Read", "Data", "Sequence", "Signal", "(", "Data", "ACK", "and", "Data", "Sequence", "Mapping", ")", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L986-L1072
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mptcp_add
def _read_mptcp_add(self, bits, size, kind): """Read Add Address option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Add Address (ADD_ADDR) option ...
python
def _read_mptcp_add(self, bits, size, kind): """Read Add Address option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Add Address (ADD_ADDR) option ...
[ "def", "_read_mptcp_add", "(", "self", ",", "bits", ",", "size", ",", "kind", ")", ":", "vers", "=", "int", "(", "bits", ",", "base", "=", "2", ")", "adid", "=", "self", ".", "_read_unpack", "(", "1", ")", "ipad", "=", "self", ".", "_read_fileng", ...
Read Add Address option. Positional arguments: * bits - str, 4-bit data * size - int, length of option * kind - int, 30 (Multipath TCP) Returns: * dict -- extracted Add Address (ADD_ADDR) option Structure of ADD_ADDR [RFC 6824]: ...
[ "Read", "Add", "Address", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L1074-L1125
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mptcp_remove
def _read_mptcp_remove(self, bits, size): """Read Remove Address option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Remove Address (REMOVE_ADDR) option Structure of REMOVE_ADDR [RFC 682...
python
def _read_mptcp_remove(self, bits, size): """Read Remove Address option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Remove Address (REMOVE_ADDR) option Structure of REMOVE_ADDR [RFC 682...
[ "def", "_read_mptcp_remove", "(", "self", ",", "bits", ",", "size", ")", ":", "adid", "=", "[", "]", "for", "_", "in", "size", ":", "adid", ".", "append", "(", "self", ".", "_read_unpack", "(", "1", ")", ")", "data", "=", "dict", "(", "subtype", ...
Read Remove Address option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Remove Address (REMOVE_ADDR) option Structure of REMOVE_ADDR [RFC 6824]: 1 ...
[ "Read", "Remove", "Address", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L1173-L1210
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mptcp_prio
def _read_mptcp_prio(self, bits, size): """Read Change Subflow Priority option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Change Subflow Priority (MP_PRIO) option Structure of MP_PRIO ...
python
def _read_mptcp_prio(self, bits, size): """Read Change Subflow Priority option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Change Subflow Priority (MP_PRIO) option Structure of MP_PRIO ...
[ "def", "_read_mptcp_prio", "(", "self", ",", "bits", ",", "size", ")", ":", "temp", "=", "self", ".", "_read_unpack", "(", "1", ")", "if", "size", "else", "None", "data", "=", "dict", "(", "subtype", "=", "'MP_PRIO'", ",", "prio", "=", "dict", "(", ...
Read Change Subflow Priority option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Change Subflow Priority (MP_PRIO) option Structure of MP_PRIO [RFC 6824]: 1 ...
[ "Read", "Change", "Subflow", "Priority", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L1212-L1248
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mptcp_fail
def _read_mptcp_fail(self, bits, size): """Read Fallback option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Fallback (MP_FAIL) option Structure of MP_FAIL [RFC 6824]: ...
python
def _read_mptcp_fail(self, bits, size): """Read Fallback option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Fallback (MP_FAIL) option Structure of MP_FAIL [RFC 6824]: ...
[ "def", "_read_mptcp_fail", "(", "self", ",", "bits", ",", "size", ")", ":", "____", "=", "self", ".", "_read_fileng", "(", "1", ")", "dsn_", "=", "self", ".", "_read_unpack", "(", "8", ")", "data", "=", "dict", "(", "subtype", "=", "'MP_FAIL'", ",", ...
Read Fallback option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Fallback (MP_FAIL) option Structure of MP_FAIL [RFC 6824]: 1 2 ...
[ "Read", "Fallback", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L1250-L1289
JarryShaw/PyPCAPKit
src/protocols/transport/tcp.py
TCP._read_mptcp_fastclose
def _read_mptcp_fastclose(self, bits, size): """Read Fast Close option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Fast Close (MP_FASTCLOSE) option Structure of MP_FASTCLOSE [RFC 6824]:...
python
def _read_mptcp_fastclose(self, bits, size): """Read Fast Close option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Fast Close (MP_FASTCLOSE) option Structure of MP_FASTCLOSE [RFC 6824]:...
[ "def", "_read_mptcp_fastclose", "(", "self", ",", "bits", ",", "size", ")", ":", "____", "=", "self", ".", "_read_fileng", "(", "1", ")", "rkey", "=", "self", ".", "_read_fileng", "(", "8", ")", "data", "=", "dict", "(", "subtype", "=", "'MP_FASTCLOSE'...
Read Fast Close option. Positional arguments: * bits - str, 4-bit data * size - int, length of option Returns: * dict -- extracted Fast Close (MP_FASTCLOSE) option Structure of MP_FASTCLOSE [RFC 6824]: 1 2 ...
[ "Read", "Fast", "Close", "option", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/transport/tcp.py#L1291-L1330
JarryShaw/PyPCAPKit
src/const/hip/esp_transform_suite.py
ESP_TransformSuite.get
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return ESP_TransformSuite(key) if key not in ESP_TransformSuite._member_map_: extend_enum(ESP_TransformSuite, key, default) return ESP_TransformSuite[key]
python
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return ESP_TransformSuite(key) if key not in ESP_TransformSuite._member_map_: extend_enum(ESP_TransformSuite, key, default) return ESP_TransformSuite[key]
[ "def", "get", "(", "key", ",", "default", "=", "-", "1", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "return", "ESP_TransformSuite", "(", "key", ")", "if", "key", "not", "in", "ESP_TransformSuite", ".", "_member_map_", ":", "extend_...
Backport support for original codes.
[ "Backport", "support", "for", "original", "codes", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/const/hip/esp_transform_suite.py#L30-L36
JarryShaw/PyPCAPKit
src/const/ipv4/classification_level.py
ClassificationLevel.get
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return ClassificationLevel(key) if key not in ClassificationLevel._member_map_: extend_enum(ClassificationLevel, key, default) return ClassificationLevel[key]
python
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return ClassificationLevel(key) if key not in ClassificationLevel._member_map_: extend_enum(ClassificationLevel, key, default) return ClassificationLevel[key]
[ "def", "get", "(", "key", ",", "default", "=", "-", "1", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "return", "ClassificationLevel", "(", "key", ")", "if", "key", "not", "in", "ClassificationLevel", ".", "_member_map_", ":", "exten...
Backport support for original codes.
[ "Backport", "support", "for", "original", "codes", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/const/ipv4/classification_level.py#L22-L28
JarryShaw/PyPCAPKit
src/interface/__init__.py
extract
def extract(fin=None, fout=None, format=None, # basic settings auto=True, extension=True, store=True, # internal settings files=False, nofile=False, verbose=False, # output settings engine=None, layer=None, protocol=Non...
python
def extract(fin=None, fout=None, format=None, # basic settings auto=True, extension=True, store=True, # internal settings files=False, nofile=False, verbose=False, # output settings engine=None, layer=None, protocol=Non...
[ "def", "extract", "(", "fin", "=", "None", ",", "fout", "=", "None", ",", "format", "=", "None", ",", "# basic settings", "auto", "=", "True", ",", "extension", "=", "True", ",", "store", "=", "True", ",", "# internal settings", "files", "=", "False", ...
Extract a PCAP file. Keyword arguments: * fin -- str, file name to be read; if file not exist, raise an error * fout -- str, file name to be written * format -- str, file format of output <keyword> 'plist' / 'json' / 'tree' / 'html' * auto -- bool, if auto...
[ "Extract", "a", "PCAP", "file", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/interface/__init__.py#L53-L131
JarryShaw/PyPCAPKit
src/interface/__init__.py
analyse
def analyse(file, length=None): """Analyse application layer packets. Keyword arguments: * file -- bytes or file-like object, packet to be analysed * length -- int, length of the analysing packet Returns: * Analysis -- an Analysis object from `pcapkit.analyser` """ if isin...
python
def analyse(file, length=None): """Analyse application layer packets. Keyword arguments: * file -- bytes or file-like object, packet to be analysed * length -- int, length of the analysing packet Returns: * Analysis -- an Analysis object from `pcapkit.analyser` """ if isin...
[ "def", "analyse", "(", "file", ",", "length", "=", "None", ")", ":", "if", "isinstance", "(", "file", ",", "bytes", ")", ":", "file", "=", "io", ".", "BytesIO", "(", "file", ")", "io_check", "(", "file", ")", "int_check", "(", "length", "or", "sys"...
Analyse application layer packets. Keyword arguments: * file -- bytes or file-like object, packet to be analysed * length -- int, length of the analysing packet Returns: * Analysis -- an Analysis object from `pcapkit.analyser`
[ "Analyse", "application", "layer", "packets", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/interface/__init__.py#L134-L151
JarryShaw/PyPCAPKit
src/interface/__init__.py
reassemble
def reassemble(protocol, strict=False): """Reassemble fragmented datagrams. Keyword arguments: * protocol -- str, protocol to be reassembled * strict -- bool, if return all datagrams (including those not implemented) when submit (default is False) <keyword> True / False ...
python
def reassemble(protocol, strict=False): """Reassemble fragmented datagrams. Keyword arguments: * protocol -- str, protocol to be reassembled * strict -- bool, if return all datagrams (including those not implemented) when submit (default is False) <keyword> True / False ...
[ "def", "reassemble", "(", "protocol", ",", "strict", "=", "False", ")", ":", "if", "isinstance", "(", "protocol", ",", "type", ")", "and", "issubclass", "(", "protocol", ",", "Protocol", ")", ":", "protocol", "=", "protocol", ".", "__index__", "(", ")", ...
Reassemble fragmented datagrams. Keyword arguments: * protocol -- str, protocol to be reassembled * strict -- bool, if return all datagrams (including those not implemented) when submit (default is False) <keyword> True / False Returns: * [if protocol is IPv4] I...
[ "Reassemble", "fragmented", "datagrams", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/interface/__init__.py#L154-L181
JarryShaw/PyPCAPKit
src/interface/__init__.py
trace
def trace(fout=None, format=None, byteorder=sys.byteorder, nanosecond=False): """Trace TCP flows. Keyword arguments: * fout -- str, output path * format -- str, output format * byteorder -- str, output file byte order * nanosecond -- bool, output nanosecond-resolution file flag ...
python
def trace(fout=None, format=None, byteorder=sys.byteorder, nanosecond=False): """Trace TCP flows. Keyword arguments: * fout -- str, output path * format -- str, output format * byteorder -- str, output file byte order * nanosecond -- bool, output nanosecond-resolution file flag ...
[ "def", "trace", "(", "fout", "=", "None", ",", "format", "=", "None", ",", "byteorder", "=", "sys", ".", "byteorder", ",", "nanosecond", "=", "False", ")", ":", "str_check", "(", "fout", "or", "''", ",", "format", "or", "''", ")", "return", "TraceFlo...
Trace TCP flows. Keyword arguments: * fout -- str, output path * format -- str, output format * byteorder -- str, output file byte order * nanosecond -- bool, output nanosecond-resolution file flag
[ "Trace", "TCP", "flows", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/interface/__init__.py#L184-L195
JarryShaw/PyPCAPKit
src/const/misc/transtype.py
TransType.get
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return TransType(key) if key not in TransType._member_map_: extend_enum(TransType, key, default) return TransType[key]
python
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return TransType(key) if key not in TransType._member_map_: extend_enum(TransType, key, default) return TransType[key]
[ "def", "get", "(", "key", ",", "default", "=", "-", "1", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "return", "TransType", "(", "key", ")", "if", "key", "not", "in", "TransType", ".", "_member_map_", ":", "extend_enum", "(", "T...
Backport support for original codes.
[ "Backport", "support", "for", "original", "codes", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/const/misc/transtype.py#L161-L167
JarryShaw/PyPCAPKit
src/protocols/internet/ipv6_frag.py
IPv6_Frag.read_ipv6_frag
def read_ipv6_frag(self, length, extension): """Read Fragment Header for IPv6. Structure of IPv6-Frag header [RFC 8200]: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Reserved | Fragment Offset |Res|M| +-+-+-+-+-+-+-...
python
def read_ipv6_frag(self, length, extension): """Read Fragment Header for IPv6. Structure of IPv6-Frag header [RFC 8200]: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Reserved | Fragment Offset |Res|M| +-+-+-+-+-+-+-...
[ "def", "read_ipv6_frag", "(", "self", ",", "length", ",", "extension", ")", ":", "if", "length", "is", "None", ":", "length", "=", "len", "(", "self", ")", "_next", "=", "self", ".", "_read_protos", "(", "1", ")", "_temp", "=", "self", ".", "_read_fi...
Read Fragment Header for IPv6. Structure of IPv6-Frag header [RFC 8200]: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Reserved | Fragment Offset |Res|M| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "Fragment", "Header", "for", "IPv6", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/ipv6_frag.py#L87-L128
JarryShaw/PyPCAPKit
src/const/hip/hi_algorithm.py
HI_Algorithm.get
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return HI_Algorithm(key) if key not in HI_Algorithm._member_map_: extend_enum(HI_Algorithm, key, default) return HI_Algorithm[key]
python
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return HI_Algorithm(key) if key not in HI_Algorithm._member_map_: extend_enum(HI_Algorithm, key, default) return HI_Algorithm[key]
[ "def", "get", "(", "key", ",", "default", "=", "-", "1", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "return", "HI_Algorithm", "(", "key", ")", "if", "key", "not", "in", "HI_Algorithm", ".", "_member_map_", ":", "extend_enum", "("...
Backport support for original codes.
[ "Backport", "support", "for", "original", "codes", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/const/hip/hi_algorithm.py#L24-L30
JarryShaw/PyPCAPKit
src/const/hip/parameter.py
Parameter.get
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return Parameter(key) if key not in Parameter._member_map_: extend_enum(Parameter, key, default) return Parameter[key]
python
def get(key, default=-1): """Backport support for original codes.""" if isinstance(key, int): return Parameter(key) if key not in Parameter._member_map_: extend_enum(Parameter, key, default) return Parameter[key]
[ "def", "get", "(", "key", ",", "default", "=", "-", "1", ")", ":", "if", "isinstance", "(", "key", ",", "int", ")", ":", "return", "Parameter", "(", "key", ")", "if", "key", "not", "in", "Parameter", ".", "_member_map_", ":", "extend_enum", "(", "P...
Backport support for original codes.
[ "Backport", "support", "for", "original", "codes", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/const/hip/parameter.py#L71-L77
JarryShaw/PyPCAPKit
src/const/hip/parameter.py
Parameter._missing_
def _missing_(cls, value): """Lookup function used when value is not found.""" if not (isinstance(value, int) and 0 <= value <= 65535): raise ValueError('%r is not a valid %s' % (value, cls.__name__)) if 0 <= value <= 64: extend_enum(cls, 'Unassigned [%d]' % value, value)...
python
def _missing_(cls, value): """Lookup function used when value is not found.""" if not (isinstance(value, int) and 0 <= value <= 65535): raise ValueError('%r is not a valid %s' % (value, cls.__name__)) if 0 <= value <= 64: extend_enum(cls, 'Unassigned [%d]' % value, value)...
[ "def", "_missing_", "(", "cls", ",", "value", ")", ":", "if", "not", "(", "isinstance", "(", "value", ",", "int", ")", "and", "0", "<=", "value", "<=", "65535", ")", ":", "raise", "ValueError", "(", "'%r is not a valid %s'", "%", "(", "value", ",", "...
Lookup function used when value is not found.
[ "Lookup", "function", "used", "when", "value", "is", "not", "found", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/const/hip/parameter.py#L80-L214
JarryShaw/PyPCAPKit
src/protocols/internet/ipv4.py
IPv4.read_ipv4
def read_ipv4(self, length): """Read Internet Protocol version 4 (IPv4). Structure of IPv4 header [RFC 791]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+...
python
def read_ipv4(self, length): """Read Internet Protocol version 4 (IPv4). Structure of IPv4 header [RFC 791]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+...
[ "def", "read_ipv4", "(", "self", ",", "length", ")", ":", "if", "length", "is", "None", ":", "length", "=", "len", "(", "self", ")", "_vihl", "=", "self", ".", "_read_fileng", "(", "1", ")", ".", "hex", "(", ")", "_dscp", "=", "self", ".", "_read...
Read Internet Protocol version 4 (IPv4). Structure of IPv4 header [RFC 791]: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
[ "Read", "Internet", "Protocol", "version", "4", "(", "IPv4", ")", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/ipv4.py#L166-L257
JarryShaw/PyPCAPKit
src/protocols/internet/ipv4.py
IPv4._read_opt_type
def _read_opt_type(self, kind): """Read option type field. Positional arguments: * kind -- int, option kind value Returns: * dict -- extracted IPv4 option Structure of option type field [RFC 791]: Octets Bits Name Des...
python
def _read_opt_type(self, kind): """Read option type field. Positional arguments: * kind -- int, option kind value Returns: * dict -- extracted IPv4 option Structure of option type field [RFC 791]: Octets Bits Name Des...
[ "def", "_read_opt_type", "(", "self", ",", "kind", ")", ":", "bin_", "=", "bin", "(", "kind", ")", "[", "2", ":", "]", ".", "zfill", "(", "8", ")", "type_", "=", "{", "'copy'", ":", "bool", "(", "int", "(", "bin_", "[", "0", "]", ",", "base",...
Read option type field. Positional arguments: * kind -- int, option kind value Returns: * dict -- extracted IPv4 option Structure of option type field [RFC 791]: Octets Bits Name Descriptions 0 0 i...
[ "Read", "option", "type", "field", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/ipv4.py#L285-L310
JarryShaw/PyPCAPKit
src/protocols/internet/ipv4.py
IPv4._read_ipv4_options
def _read_ipv4_options(self, size=None): """Read IPv4 option list. Positional arguments: * size -- int, buffer size Returns: * tuple -- IPv4 option list * dict -- extracted IPv4 option """ counter = 0 # length of read option list ...
python
def _read_ipv4_options(self, size=None): """Read IPv4 option list. Positional arguments: * size -- int, buffer size Returns: * tuple -- IPv4 option list * dict -- extracted IPv4 option """ counter = 0 # length of read option list ...
[ "def", "_read_ipv4_options", "(", "self", ",", "size", "=", "None", ")", ":", "counter", "=", "0", "# length of read option list", "optkind", "=", "list", "(", ")", "# option kind list", "options", "=", "dict", "(", ")", "# dict of option data", "while", "counte...
Read IPv4 option list. Positional arguments: * size -- int, buffer size Returns: * tuple -- IPv4 option list * dict -- extracted IPv4 option
[ "Read", "IPv4", "option", "list", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/ipv4.py#L312-L382
JarryShaw/PyPCAPKit
src/protocols/internet/ipv4.py
IPv4._read_mode_donone
def _read_mode_donone(self, size, kind): """Read options request no process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option Structure of IPv4 options: Octets ...
python
def _read_mode_donone(self, size, kind): """Read options request no process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option Structure of IPv4 options: Octets ...
[ "def", "_read_mode_donone", "(", "self", ",", "size", ",", "kind", ")", ":", "if", "size", "<", "3", ":", "raise", "ProtocolError", "(", "f'{self.alias}: [Optno {kind}] invalid format'", ")", "data", "=", "dict", "(", "kind", "=", "kind", ",", "type", "=", ...
Read options request no process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option Structure of IPv4 options: Octets Bits Name Description ...
[ "Read", "options", "request", "no", "process", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/ipv4.py#L384-L414
JarryShaw/PyPCAPKit
src/protocols/internet/ipv4.py
IPv4._read_mode_unpack
def _read_mode_unpack(self, size, kind): """Read options request unpack process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option Structure of IPv4 options: Octets ...
python
def _read_mode_unpack(self, size, kind): """Read options request unpack process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option Structure of IPv4 options: Octets ...
[ "def", "_read_mode_unpack", "(", "self", ",", "size", ",", "kind", ")", ":", "if", "size", "<", "3", ":", "raise", "ProtocolError", "(", "f'{self.alias}: [Optno {kind}] invalid format'", ")", "data", "=", "dict", "(", "kind", "=", "kind", ",", "type", "=", ...
Read options request unpack process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option Structure of IPv4 options: Octets Bits Name Description ...
[ "Read", "options", "request", "unpack", "process", "." ]
train
https://github.com/JarryShaw/PyPCAPKit/blob/c7f0da9aebc2cf210bf8f8b912f7d3cbb98ca10e/src/protocols/internet/ipv4.py#L416-L446