|
str | explicit_address (self, str addr, str type="ipv4") |
|
dict | parse (self, bool is_backward=False, str initiator="src") |
|
None | __init__ (self, dict protocol_data, dict device) |
|
Protocol | init_protocol (c, str protocol_name, dict protocol_data, dict device) |
|
str | format_list (self, list l, func=lambda x:x) |
|
None | add_field (self, str field, dict template_rules, bool is_backward=False, func=lambda x:x, backward_func=lambda x:x) |
|
|
string | protocol_name = "arp" |
|
int | layer = 3 |
|
bool | custom_parser = False |
|
list | supported_keys |
|
dictionary | mac_addrs |
|
dictionary | ip_addrs |
|
|
Union[str, int] | convert_value (str value) |
|
| protocol_data |
|
| device |
|
| rules |
|
◆ explicit_address()
str protocols.arp.arp.explicit_address |
( |
|
self, |
|
|
str |
addr, |
|
|
str |
type = "ipv4" |
|
) |
| |
Return the explicit version of an IPv4 or MAC address alias.
Example: "local" -> "192.168.0.0/16"
:param addr: IPv4 or MAC address alias to explicit.
:param type: Type of address (ipv4 or mac).
:return: Explicit IPv4 or MAC address.
:raises ValueError: If the address is not a well-known alias or an explicit address.
◆ parse()
dict protocols.arp.arp.parse |
( |
|
self, |
|
|
bool |
is_backward = False , |
|
|
str |
initiator = "src" |
|
) |
| |
Parse the ARP protocol.
:param is_backward (optional): Whether the protocol must be parsed for a backward rule.
Default is `False`.
:param initiator (optional): Connection initiator (src or dst).
Default is "src".
:return: Dictionary containing the (forward and backward) nftables and nfqueue rules for this policy.
Reimplemented from protocols.Protocol.Protocol.
◆ ip_addrs
dictionary protocols.arp.arp.ip_addrs |
|
static |
Initial value:= {
"local": "192.168.1.0/24",
"gateway": "192.168.1.1",
"phone": "192.168.1.222"
}
◆ mac_addrs
dictionary protocols.arp.arp.mac_addrs |
|
static |
Initial value:= {
"gateway": "c0:56:27:73:46:0b",
"default": "00:00:00:00:00:00",
"broadcast": "ff:ff:ff:ff:ff:ff",
"phone": "3c:cd:5d:a2:a9:d7"
}
◆ supported_keys
list protocols.arp.arp.supported_keys |
|
static |
Initial value:= [
"type",
"sha",
"tha",
"spa",
"tpa"
]
The documentation for this class was generated from the following file:
- src/translator/protocols/arp.py