OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
exabgp
/
bgp
/
message
/
update
/
attribute
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
2.11 KB
03/13/2021 04:30:48 PM
rw-r--r--
📁
__pycache__
-
03/16/2023 12:55:54 PM
rwxr-xr-x
📄
aggregator.py
2.29 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
aigp.py
2.96 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
aspath.py
7.64 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
atomicaggregate.py
1.24 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
attribute.py
9.04 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
attributes.py
17.79 KB
03/13/2021 04:30:48 PM
rw-r--r--
📁
bgpls
-
03/16/2023 12:55:54 PM
rwxr-xr-x
📄
clusterlist.py
1.65 KB
03/13/2021 04:30:48 PM
rw-r--r--
📁
community
-
03/16/2023 12:55:54 PM
rwxr-xr-x
📄
generic.py
1.67 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
localpref.py
1.21 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
med.py
1.18 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
mprnlri.py
7.88 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
mpurnlri.py
3.58 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
nexthop.py
1.84 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
origin.py
1.78 KB
03/13/2021 04:30:48 PM
rw-r--r--
📄
originatorid.py
890 bytes
03/13/2021 04:30:48 PM
rw-r--r--
📄
pmsi.py
4.97 KB
03/13/2021 04:30:48 PM
rw-r--r--
📁
sr
-
03/16/2023 12:55:54 PM
rwxr-xr-x
Editing: aggregator.py
Close
# encoding: utf-8 """ aggregator.py Created by Thomas Mangin on 2012-07-14. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ import sys from exabgp.bgp.message.open.asn import ASN from exabgp.protocol.ip import IPv4 from exabgp.bgp.message.update.attribute.attribute import Attribute # =============================================================== AGGREGATOR (7) # @Attribute.register() class Aggregator(Attribute): ID = Attribute.CODE.AGGREGATOR FLAG = Attribute.Flag.TRANSITIVE | Attribute.Flag.OPTIONAL CACHING = True __slots__ = ['asn', 'speaker', '_str'] def __init__(self, asn, speaker): self.asn = asn self.speaker = speaker self._str = None def __eq__(self, other): return ( self.ID == other.ID and self.FLAG == other.FLAG and self.asn == other.asn and self.speaker == other.speaker ) def __ne__(self, other): return not self.__eq__(other) def pack(self, negotiated): if negotiated.asn4: return self._attribute(self.asn.pack(True) + self.speaker.pack()) elif self.asn.asn4(): return self._attribute(self.asn.trans().pack() + self.speaker.pack()) + Aggregator4( self.asn, self.speaker ).pack(negotiated) else: return self._attribute(self.asn.pack() + self.speaker.pack()) def __len__(self): raise RuntimeError('size can be 6 or 8 - we can not say - or can we ?') def __repr__(self): if not self._str: self._str = '%s:%s' % (self.asn, self.speaker) return self._str def json(self): return '{ "asn" : %d, "speaker" : "%d" }' % (self.asn, self.speaker) @classmethod def unpack(cls, data, negotiated): if negotiated.asn4: return cls(ASN.unpack(data[:4]), IPv4.unpack(data[-4:])) return cls(ASN.unpack(data[:2]), IPv4.unpack(data[-4:])) # ============================================================== AGGREGATOR (18) # @Attribute.register() class Aggregator4(Aggregator): ID = Attribute.CODE.AS4_AGGREGATOR if sys.version_info[0] < 3: __slots__ = ['pack'] def pack(self, negotiated): return self._attribute(self.asn.pack(True) + self.speaker.pack())