|
dict | parse (self, bool is_backward=False, str initiator="src") |
|
None | add_field (self, str field, dict template_rules, bool is_backward=False, func=lambda x:x, backward_func=lambda x:x) |
|
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) |
|
|
int | layer = 7 |
|
string | protocol_name = "dns" |
|
string | WILDCARD = "$" |
|
list | supported_keys |
|
bool | custom_parser = True |
|
|
| protocol_data |
|
| device |
|
| rules |
|
◆ get_domain_name_rule()
dict protocols.dns.dns.get_domain_name_rule |
( |
str |
domain_name | ) |
|
|
static |
Retrieves the NFQueue rule to match a given domain name.
:param domain_name: Domain name to match.
:return: Dictionary containing the NFQueue rule to match the given domain name.
◆ parse()
dict protocols.dns.dns.parse |
( |
|
self, |
|
|
bool |
is_backward = False , |
|
|
str |
initiator = "src" |
|
) |
| |
Parse the DNS protocol.
:param is_backward (optional): Whether the protocol must be parsed for a backward rule.
Optional, default is `False`.
:param initiator (optional): Connection initiator (src or dst).
Optional, default is "src".
:return: Dictionary containing the (forward and backward) nftables and nfqueue rules for this policy.
Reimplemented from protocols.Protocol.Protocol.
◆ supported_keys
list protocols.dns.dns.supported_keys |
|
static |
Initial value:= [
"type",
"domain-name"
]
The documentation for this class was generated from the following file:
- src/translator/protocols/dns.py