Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d46b568
[change] NetJSON DeviceMonitoring compliance #2
purhan Jun 5, 2021
9168a27
[change] Add monitoring info to OpenWRT backend
purhan Jun 10, 2021
cfa6650
[chores] Fix failing tests
purhan Jun 11, 2021
c9962e2
[chores/qa] Improvements to tests
purhan Jun 13, 2021
8cd7089
[change] Add monitoring info to AirOS backend
purhan Jun 15, 2021
da39965
[chores] Some requested changes
purhan Jun 18, 2021
1800332
[chores] Fix neighbor information when mac address is not found
purhan Jun 25, 2021
cda0295
[change] Add IP to neighbor information
purhan Jul 5, 2021
0edc93a
[chores] Add comment
purhan Jul 6, 2021
acafe93
[change] Add more interfaces, Add RAM_used
purhan Jul 6, 2021
34f05c9
[change] Use one query for neighbors and their states
purhan Jul 7, 2021
034475c
[chores] Fix failing build
purhan Jul 12, 2021
995b703
[change] Implement SNMPDUMP
purhan Jul 16, 2021
83a25de
[change] Add device name, ip to interfaces
purhan Jul 22, 2021
0f37717
[change] Make interface types NetJSON compliant
purhan Jul 22, 2021
5dc3cc6
[change] Change RAM OIDs, add load info, add wireless interfaces
purhan Jul 26, 2021
d746f2d
[change] Use Trie instead of Dict in walk function
purhan Jul 29, 2021
56ea551
[docs] Update docs for AirOS and OpenWRT backends
purhan Aug 19, 2021
4e6f1f1
[chores] Move OpenWRT interface type to match AirOS
purhan Aug 19, 2021
5424532
[change] Add CPU_count to airOS
purhan Aug 23, 2021
621f725
[qa] Reformatted code and docs
nemesifier Jul 31, 2026
9b99213
Merge branch 'master' into netjson-compliance
nemesifier Jul 31, 2026
8f9254a
[fix] Added back jsonschema
nemesifier Jul 31, 2026
7bb97e3
[chores] Added device model, OS
nemesifier Jul 31, 2026
a32bb7c
[chores] Fixed bugs uncovered by Kilobot
nemesifier Jul 31, 2026
e50844e
[fix] Addressed @coderabbitai reviews
nemesifier Jul 31, 2026
4690657
[fix] Fixed more nasty bugs
nemesifier Jul 31, 2026
25db8fb
[fix] Renamed memory "cached" (bogus) to "cache" (correct)
nemesifier Aug 1, 2026
a89c8fe
[chores] Follow up with coderabbit
nemesifier Aug 1, 2026
436b1e3
[chores] Addressed @coderabbitai review comments
nemesifier Aug 1, 2026
c19ceff
Merge remote-tracking branch 'origin/master' into netjson-compliance
nemesifier Aug 1, 2026
6f0e676
[chores] Addressed @coderabbitai review comments
nemesifier Aug 1, 2026
ec706d0
[chores] Addressed @coderabbitai review comments
nemesifier Aug 1, 2026
78c93e1
[chores] Addressed @coderabbitai review comments
nemesifier Aug 1, 2026
f32abd8
[chores] Further cleanup
nemesifier Aug 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions netengine/backends/snmp/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import binascii
import logging

import netaddr

from netengine.backends import BaseBackend
from netengine.exceptions import NetEngineError

Expand Down Expand Up @@ -57,6 +59,20 @@ def _octet_to_mac(self, octet_mac):
)
return mac_address
Comment thread
coderabbitai[bot] marked this conversation as resolved.

def _ascii_blocks_to_ipv6(self, ascii_string):
Comment thread
purhan marked this conversation as resolved.
"""
converts an ascii representation into ipv6 address
"""
blocks = ascii_string.split('.')
for b in range(len(blocks)):
blocks[b] = format(int(blocks[b]), '02x')
res = netaddr.IPAddress(
':'.join(
[''.join(blocks[slice(i, i + 2)]) for i in range(0, len(blocks), 2)]
)
)
return res
Comment thread
purhan marked this conversation as resolved.
Outdated

def _oid(self, oid):
"""
returns valid oid value to be passed to getCmd() or nextCmd()
Expand Down
12 changes: 11 additions & 1 deletion netengine/backends/snmp/openwrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ def neighbors(self):

for index, neighbor in enumerate(neighbors):
try:
oid = neighbor[0][0].getOid()
if oid[12] == 4:
ip = oid[13:]
else:
ip = self._ascii_blocks_to_ipv6(str(oid[13:]))
mac = EUI(
int(neighbor[0][1].prettyPrint(), 16), dialect=mac_unix_expanded
)
Expand All @@ -517,7 +522,12 @@ def neighbors(self):
continue
Comment thread
coderabbitai[bot] marked this conversation as resolved.
result.append(
self._dict(
{'mac': str(mac), 'state': str(state), 'interface': str(interface)}
{
'mac': str(mac),
'state': str(state),
'interface': str(interface),
'ip': str(ip),
}
)
)
return result
Expand Down