fix ip address presentation
This commit is contained in:
parent
ac2a71ea11
commit
71f077b869
@ -55,9 +55,9 @@ LOCAL_SERVER_KEYS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
PEER_KEYS = [
|
PEER_KEYS = [
|
||||||
['srcadr', pyagentx3.TYPE_IPADDRESS, pass_value],
|
['srcadr', pyagentx3.TYPE_OCTETSTRING, pass_value],
|
||||||
['srcport', pyagentx3.TYPE_INTEGER, pass_value],
|
['srcport', pyagentx3.TYPE_INTEGER, pass_value],
|
||||||
['dstadr', pyagentx3.TYPE_IPADDRESS, pass_value],
|
['dstadr', pyagentx3.TYPE_OCTETSTRING, pass_value],
|
||||||
['dstport', pyagentx3.TYPE_INTEGER, pass_value],
|
['dstport', pyagentx3.TYPE_INTEGER, pass_value],
|
||||||
['leap', pyagentx3.TYPE_INTEGER, pass_value],
|
['leap', pyagentx3.TYPE_INTEGER, pass_value],
|
||||||
['hmode', pyagentx3.TYPE_INTEGER, pass_value],
|
['hmode', pyagentx3.TYPE_INTEGER, pass_value],
|
||||||
@ -159,6 +159,7 @@ class NtpsecDataUpdater(pyagentx3.Updater):
|
|||||||
if ds.data:
|
if ds.data:
|
||||||
try:
|
try:
|
||||||
for index, data_spec in enumerate(LOCAL_SERVER_KEYS):
|
for index, data_spec in enumerate(LOCAL_SERVER_KEYS):
|
||||||
|
logger.debug(f"local: {index=} {data_spec=}")
|
||||||
CURRENT_NAME_OID_BASE = f"0.0.{index}"
|
CURRENT_NAME_OID_BASE = f"0.0.{index}"
|
||||||
CURRENT_VALUE_OID_BASE = f"0.1.{index}"
|
CURRENT_VALUE_OID_BASE = f"0.1.{index}"
|
||||||
self._data[CURRENT_NAME_OID_BASE] = {
|
self._data[CURRENT_NAME_OID_BASE] = {
|
||||||
@ -172,7 +173,9 @@ class NtpsecDataUpdater(pyagentx3.Updater):
|
|||||||
'value': data_spec[2](ds.data['local'][data_spec[0]])
|
'value': data_spec[2](ds.data['local'][data_spec[0]])
|
||||||
}
|
}
|
||||||
for associd, peer in ds.data['peers'].items():
|
for associd, peer in ds.data['peers'].items():
|
||||||
|
logger.debug(f"peer: {peer}")
|
||||||
for index, data_spec in enumerate(PEER_KEYS):
|
for index, data_spec in enumerate(PEER_KEYS):
|
||||||
|
logger.debug(f"peer: {associd=} {index=} {data_spec=}")
|
||||||
CURRENT_NAME_OID_BASE = str(associd) + '.' + str(index) + '.0'
|
CURRENT_NAME_OID_BASE = str(associd) + '.' + str(index) + '.0'
|
||||||
CURRENT_VALUE_OID_BASE = str(associd) + '.' + str(index) + '.1'
|
CURRENT_VALUE_OID_BASE = str(associd) + '.' + str(index) + '.1'
|
||||||
self._data[CURRENT_NAME_OID_BASE] = {
|
self._data[CURRENT_NAME_OID_BASE] = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user