Comments (3)
We are willing to accept small/isolated pull requests to fix issues like
these. :)
On Sun, Jul 10, 2016 at 9:20 PM, Patrick Hemmer [email protected]
wrote:
The code has several places where a struct has a method which takes
arguments that are also struct members.For example:
https://github.com/soniah/gosnmp/blob/f6904fd235070fe56e2c2d799ac5f5862fc32543/marshal.go#L253packetOut.marshalMsg(pdus, packetOut.PDUType, msgID, reqID)
The obvious one is packetOut.PDUType. The marshalMsg method already has
access to packetOut.PDUType because they are both members of the same
struct (SnmpPacket).
However all the others can be removed as well.
- pdus - SnmpPacket has a Variables member which should be used
instead.- msgID - SnmpPacket has a MsgID member
- reqID - SnmpPacket has a RequestID member
Numerous other methods are used the same way:
- marshalSnmpV3ScopedPDU
- prepareSnmpV3ScopedPDU
- marshalPDU
- marshalVBL
Another example, (*GoSNMP).GetBulk(oids []string, nonRepeaters uint8,
maxRepetitions uint8).
The GoSNMP struct has NonRepeaters and MaxRepetitions members. Why, if
we're not going to use them?Aside from not being proper go, these make the code very confusing to
follow. And in that last case, confusing to use.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#71, or mute the thread
https://github.com/notifications/unsubscribe/AApLwad8CtsCSW9xQuK_vggnQAxCsHioks5qUdKwgaJpZM4JJChO
.
Whitham D. Reeve II
907-764-5263
from gosnmp.
Hi Patrick @phemmer thanks for your great suggestions. Would you be able to have a go at this? It seems a smaller task than #70 :-)
from gosnmp.
Many instances of this has been fixed. If you see others please let us know.
from gosnmp.
Related Issues (20)
- VULNERABILITY [CWE-347] CVE-2020-9283] golang.org/x/crypto Improper Signature Verification HOT 1
- Sometimes a previous privacy passphrase is reused instead of the specified one
- usmStatsUnknownUserNames as terminating error? HOT 3
- Chinese coding is garbled HOT 2
- How to configure read/write community? HOT 1
- marshal: marshalPDU: unable to marshal varbind list: unable to marshal OID: Value out of range HOT 2
- Should cancelling a context interrupt an ongoing operation?
- out of bounds error when parsing AuthNoPriv packet HOT 4
- msgMaxSize to be supported in SNMP v3 bulkwalk requests
- V3 feat needed: Load keys manually if the passphrases are not allowed be saved locally HOT 1
- Connect function in gosnmp always returns nil even if the credentials are not valid HOT 1
- Panic in unmarshalV3Header
- Compatibility with GoSNMPServer HOT 7
- `net-snmp` based validation testing HOT 5
- Request ID size too large
- Not handling `0` values correctly for `OpaqueDouble` or `OpaqueFloat`
- Using SnmpDecodePacket for Encrypted/Authenticated Packets in GoSNMP HOT 5
- Retry netConnect() on resolution failure HOT 2
- bulkwalk can omit OIDs that snmpwalk does show HOT 1
- Unable to receive SNMP response message, but the other party confirmed that it has been sent.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gosnmp.