|
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) |
|
dict | parse (self, bool is_backward=False, str initiator="src") |
|
|
bool | custom_parser = True |
|
|
| protocol_data |
|
| device |
|
| rules |
|
◆ add_field()
None protocols.Custom.Custom.add_field |
( |
|
self, |
|
|
str |
field, |
|
|
dict |
template_rules, |
|
|
bool |
is_backward = False , |
|
|
|
func = lambda x: x , |
|
|
|
backward_func = lambda x: x |
|
) |
| |
Add a new nfqueue match to the accumulator.
Overrides the nftables version.
:param field: Field to add the rule for.
:param template_rules: Dictionary containing the protocol-specific rules to add.
:param is_backward: Whether the field to add is for a backward rule.
:param func: Function to apply to the field value before writing it.
Optional, default is the identity function.
:param backward_func: Function to apply to the field value in the case of a backwards rule.
Will be applied after `func`.
Optional, default is the identity function.
Args:
field (str): Field to add the rule for.
template_rules (dict): Dictionary containing the protocol-specific rules to add.
is_backward (bool): Whether the field to add is for a backward rule.
func (lambda): Function to apply to the field value before writing it.
Optional, default is the identity function.
backward_func (lambda): Function to apply to the field value in the case of a backwards rule.
Will be applied after `func`.
Optional, default is the identity function.
Reimplemented from protocols.Protocol.Protocol.
◆ build_nfq_list_match()
dict protocols.Custom.Custom.build_nfq_list_match |
( |
list |
l, |
|
|
dict |
template_rules, |
|
|
bool |
is_backward = False , |
|
|
|
func = lambda x: x , |
|
|
|
backward_func = lambda x: x |
|
) |
| |
|
static |
Produce a nfqueue match for a list of values.
:param l: List of values.
:param template_rules: Dictionary containing the protocol-specific rules to add.
:param is_backward: Whether the field to add is for a backward rule.
:param func: Function to apply to the field value before writing it.
Optional, default is the identity function.
:param backward_func: Function to apply to the field value in the case of a backwards rule.
Will be applied after `func`.
Optional, default is the identity function.
The documentation for this class was generated from the following file:
- src/translator/protocols/Custom.py