OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python311
/
lib
/
python3.11
/
site-packages
/
pyroute2
/
requests
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/14/2024 03:18:01 PM
rwxr-xr-x
📄
__init__.py
0 bytes
05/14/2024 03:18:01 PM
rw-r--r--
📁
__pycache__
-
05/14/2024 03:18:02 PM
rwxr-xr-x
📄
address.py
3.35 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
bridge.py
5.07 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
common.py
4.96 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
link.py
8.96 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
main.py
1.96 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
neighbour.py
1.34 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
netns.py
107 bytes
05/14/2024 03:18:01 PM
rw-r--r--
📄
route.py
19.13 KB
05/14/2024 03:18:01 PM
rw-r--r--
📄
rule.py
1.2 KB
05/14/2024 03:18:01 PM
rw-r--r--
Editing: rule.py
Close
import socket from pyroute2.netlink.rtnl.fibmsg import FR_ACT_NAMES, fibmsg from .common import Index, IPRouteFilter, IPTargets, NLAKeyTransform DEFAULT_FRA_PRIORITY = 32000 class RuleFieldFilter(IPTargets, Index, NLAKeyTransform): _nla_prefix = fibmsg.prefix class RuleIPRouteFilter(IPRouteFilter): def set_action(self, context, value): if isinstance(value, str): return { 'action': FR_ACT_NAMES.get( value, FR_ACT_NAMES.get('FR_ACT_' + value.upper(), value) ) } return {'action': value} def finalize(self, context): if self.command != 'dump': if 'family' not in context: context['family'] = socket.AF_INET if 'priority' not in context: context['priority'] = DEFAULT_FRA_PRIORITY if 'table' in context and 'action' not in context: context['action'] = 'to_tbl' for key in ('src_len', 'dst_len'): if context.get(key, None) is None and key[:3] in context: context[key] = {socket.AF_INET6: 128, socket.AF_INET: 32}[ context['family'] ]