OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
exabgp
/
bgp
/
message
/
update
/
nlri
/
qualifier
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/16/2023 12:55:54 PM
rwxr-xr-x
📄
__init__.py
651 bytes
03/13/2021 04:30:48 PM
rw-r--r--
📁
__pycache__
-
03/16/2023 12:55:54 PM
rwxr-xr-x
📄
esi.py
1.88 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
etag.py
1.53 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
labels.py
3.59 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
mac.py
1.76 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
path.py
2.04 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
rd.py
3.11 KB
03/13/2021 04:30:48 PM
rw-r--r--
Editing: path.py
Close
# encoding: utf-8 """ bgp.py Created by Thomas Mangin on 2012-07-08. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ from exabgp.util import character from exabgp.util import ordinal from exabgp.util import concat_bytes_i # ===================================================================== PathInfo # RFC draft-ietf-idr-add-paths-09 class PathInfo(object): __slots__ = ['path_info'] def __init__(self, packed=None, integer=None, ip=None): if packed: self.path_info = packed elif ip: self.path_info = concat_bytes_i(character(int(_)) for _ in ip.split('.')) elif integer: self.path_info = concat_bytes_i(character((integer >> offset) & 0xFF) for offset in [24, 16, 8, 0]) else: self.path_info = b'' # sum(int(a)<<offset for (a,offset) in zip(ip.split('.'), range(24, -8, -8))) def __eq__(self, other): return self.path_info == other.path_info def __neq__(self, other): return self.path_info != other.path_info def __lt__(self, other): raise RuntimeError('comparing PathInfo for ordering does not make sense') def __le__(self, other): raise RuntimeError('comparing PathInfo for ordering does not make sense') def __gt__(self, other): raise RuntimeError('comparing PathInfo for ordering does not make sense') def __ge__(self, other): raise RuntimeError('comparing PathInfo for ordering does not make sense') def __len__(self): return len(self.path_info) def json(self): if self.path_info: return '"path-information": "%s"' % '.'.join([str(ordinal(_)) for _ in self.path_info]) return '' def __repr__(self): if self.path_info: return ' path-information %s' % '.'.join([str(ordinal(_)) for _ in self.path_info]) return '' def pack(self): if self.path_info: return self.path_info return b'\x00\x00\x00\x00' PathInfo.NOPATH = PathInfo()