OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python311
/
lib
/
python3.11
/
site-packages
/
pyroute2
/
ndb
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/08/2024 06:42:21 PM
rwxr-xr-x
📄
__init__.py
0 bytes
05/08/2024 06:42:21 PM
rw-r--r--
📁
__pycache__
-
05/08/2024 06:42:21 PM
rwxr-xr-x
📄
auth_manager.py
2.58 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
cli.py
2.25 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
cluster.py
1003 bytes
05/08/2024 06:42:21 PM
rw-r--r--
📄
compat.py
2.2 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
events.py
2.02 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
main.py
20.96 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
messages.py
246 bytes
05/08/2024 06:42:21 PM
rw-r--r--
📄
noipdb.py
5.03 KB
05/08/2024 06:42:21 PM
rw-r--r--
📁
objects
-
05/08/2024 06:42:21 PM
rwxr-xr-x
📄
query.py
4.75 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
report.py
11.86 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
schema.py
32.04 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
source.py
16.56 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
task_manager.py
9.58 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
transaction.py
11.05 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
transport.py
6.2 KB
05/08/2024 06:42:21 PM
rw-r--r--
📄
view.py
16.5 KB
05/08/2024 06:42:21 PM
rw-r--r--
Editing: compat.py
Close
def ipdb_interfaces_view(ndb): '''Provide read-only interfaces view with IPDB layout. In addition to standard NDB fields provides some IPDB specific fields. The method returns a simple dict structure, no background updates or system changes are supported. Please open a ticket on the project page if you are missing any attribute used in your project: https://github.com/svinota/pyroute2/issues ''' ret = {} for record in ndb.interfaces.dump(): interface = record._as_dict() interface['ipdb_scope'] = 'system' interface['ipdb_priority'] = 0 try: interface['ipaddr'] = tuple( ( (x.address, x.prefixlen) for x in ( ndb.addresses.dump().select_records(index=record.index) ) ) ) except: with ndb.addresses.summary() as report: report.select_records(ifname=f"{record.ifname}") interface['ipaddr'] = tuple( ((x.address, x.prefixlen) for x in report) ) try: interface['ports'] = tuple( ( x.index for x in ( ndb.interfaces.dump().select_records( master=record.index ) ) ) ) except: with ndb.interfaces.dump() as report: report.select_records(ifname=f"{record.ifname}") interface['ports'] = tuple((x.index for x in report)) try: interface['neighbours'] = tuple( ( x.dst for x in ( ndb.neighbours.dump().select_records( ifindex=record.index ) ) ) ) except: with ndb.neighbours.dump() as report: report.select_records(ifindex=record.index) interface['neighbours'] = tuple((x.dst for x in report)) ret[record.ifname] = interface return ret