Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added snmpwalk convert support for Opaque extra types UInt64 and Int64 #141

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Added snmpwalk convert support for Opaque extra types UInt64 and Int64 #141

wants to merge 3 commits into from

Conversation

landy2005
Copy link
Contributor

@landy2005 landy2005 commented May 11, 2020

Added convertion support for additional Opaque types with integers (only which I have in snmpwalks).
Ie:

.1.3.6.1.4.1.2021.10.1.6.1 = Opaque: Float: 0.340820
.1.3.6.1.4.1.2021.10.1.6.2 = Opaque: UInt64: 18446744073709551614
.1.3.6.1.4.1.2021.10.1.6.3 = Opaque: Int64: 9223372036854775806
.1.3.6.1.4.1.2021.10.1.6.4 = Opaque: Int64: -2

Notes:

  • int to snmp hex convertion probably should be in pyasn1 library or pyasn1.codec.ber should know how convert int to ber serialization
  • really need universally way with BER serialization for any possible subtypes (also possible double)
  • information how detect Opaque subtype tags I founded there https://github.com/delimitry/snmp-server/blob/master/snmp-server.py

Currently I just added hard fix for self snmpwalks received from user.

Added convertion support for additional Opaque types with integers (only which I have in snmpwalks).
Ie:
```
.1.3.6.1.4.1.2021.10.1.6.1 = Opaque: Float: 0.340820
.1.3.6.1.4.1.2021.10.1.6.2 = Opaque: UInt64: 18446744073709551614
.1.3.6.1.4.1.2021.10.1.6.3 = Opaque: Int64: 9223372036854775806
.1.3.6.1.4.1.2021.10.1.6.4 = Opaque: Int64: -2
```
@landy2005 landy2005 marked this pull request as draft May 11, 2020 12:31
Now negative int64 also correctly converted:
```
.1.3.6.1.4.1.2021.10.1.6.4 = Opaque: Int64: -2
```
@landy2005 landy2005 marked this pull request as ready for review May 11, 2020 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant