-
Notifications
You must be signed in to change notification settings - Fork 339
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
refactoring of the constant? #17
Comments
Hey @tehnerd, I think these were set by the original author as sensible defaults, they can of course be changed. If you, and the community at large feel these aren't actually sensible, then I suppose it makes sense to change them. Thoughts @soniah & @codedance? |
I'll have to look at the code in detail...
|
The defaults are there to support the Walk* methods. I agree that Regarding OID: You can of course supply your own base OID (and the API encourages this). The default base is there to simply make it easier to not misuse! e.g. mysnmp.Walk(".1") // Walk from a very higher level
mysnmp.Walk("1.3.6.1.2.1") // Walk a specific table - e.g. RFC 1213 system table
mysnmp.Walk("") // Walk ???? - OK, let's default to the default public space as this should work on every standards compliant device. Better than throwing a panic :-) The design is analogous to net-snmp... from the man page:
|
* The walk function uses default values. It's now possible to change/override the default values via instance variables on GoSNMP. Closes issue gosnmp#17 on soniah/gosnmp.
* The walk function uses default values. It's now possible to change/override the default values via instance variables on GoSNMP. Closes issue gosnmp#17 on soniah/gosnmp.
I've created a pull request of Sonia's master under #18 that should address requirements and close this issue. It's a low risk change but does hit public API surface so a review would be good. Are we happy with the names? As an aside: GoSNMP.Walk.MaxRepetitions but I feel the extra code complexity would offset any public surface area gain. |
This was merged, I think we can close this unless @tehnerd has any other comments? |
sounds good for me. thank you |
do you consider to refactor this part of the code
by moving it to the Default for example.
the reason is:
a lot of networking hardware uses oids from the private space (.1.3.6.1.4...)
(.1.3.6.1.2 is IETF only)
as well as i have found a problem with defaultMaxRepetitions equals to 50 size on some of the networking hardware (so IMO it's better to be configurable instead of hardcoding)
The text was updated successfully, but these errors were encountered: