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: nexthop.py
Close
# encoding: utf-8 """ nexthop.py Created by Thomas Mangin on 2009-11-05. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ from exabgp.protocol.family import AFI from exabgp.protocol.ip import IP from exabgp.protocol.ip import NoNextHop from exabgp.bgp.message.update.attribute.attribute import Attribute # ================================================================== NextHop (3) # The inheritance order is important and attribute MUST be first for the righ register to be called # At least until we rename them to be more explicit @Attribute.register() class NextHop(Attribute, IP): ID = Attribute.CODE.NEXT_HOP FLAG = Attribute.Flag.TRANSITIVE CACHING = True SELF = False # XXX: This is a bad API, as it works on non-raw data def __init__(self, string, packed=None): self.init(string, packed) def __eq__(self, other): return self.ID == other.ID and self.FLAG == other.FLAG and self._packed == other.ton() def __ne__(self, other): return not self.__eq__(other) def ton(self, negotiated=None, afi=AFI.undefined): return self._packed def pack(self, negotiated=None): return self._attribute(self.ton()) @classmethod def unpack(cls, data, negotiated=None): if not data: return NoNextHop return IP.unpack(data, NextHop) def __repr__(self): return IP.__repr__(self) class NextHopSelf(NextHop): SELF = True def __init__(self, afi): self.afi = afi def __repr__(self): return 'self' def ipv4(self): return self.afi == AFI.ipv4 def pack(self, negotiated): return self._attribute(negotiated.nexthopself(self.afi).ton()) def ton(self, negotiated=None, afi=AFI.undefined): return negotiated.nexthopself(afi).ton()