NetSNMP 0.3.2.4 → 0.3.2.5
raw patch · 3 files changed
+15/−9 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- NetSNMP.cabal +1/−2
- changes +9/−1
- src/Network/Protocol/NetSNMP.hsc +5/−6
NetSNMP.cabal view
@@ -1,5 +1,5 @@ name: NetSNMP-version: 0.3.2.4+version: 0.3.2.5 synopsis: Bindings for net-snmp's C API for clients description: Network.Protocol.NetSNMP is a partial binding to the library portion of the net-snmp package. It uses the@@ -14,7 +14,6 @@ license-file: license author: Pavlo Kerestey and Humane Software for Global Access Internet Services GmbH maintainer: Pavlo Kerestey <pavlo@kerestey.net>-stability: alpha build-type: Simple homepage: https://github.com/ptek/netsnmp bug-reports: https://github.com/ptek/netsnmp/issues
changes view
@@ -1,5 +1,13 @@+0.3.2.5 - 01. December 2016+ * Taking out the duplcate checking to mkSnmpBulkGet was a total mistake+ snmpbulkget reads beyond the needed parts whereas bulkwalk stays within+ the subtree of the requested OID. Thus snmpbulkget is actually returning+ duplicate results which is ok. They will be filtered in the bulkWalk+ part+ Will deprecate the 0.3.2.4 on hackage.+ 0.3.2.4 - 14. November 2016- * Throw an error on duplicate OIDs in the bulkGet response+ * Throw an error on duplicate OIDs in the mkSnmpBulkGet response 0.3.2.3 - 14. November 2016 * Throw an error on duplicate OIDs in the bulkWalk response
src/Network/Protocol/NetSNMP.hsc view
@@ -394,9 +394,12 @@ bulkWalk :: RawOID -> RawOID -> Session -> Trouble [SnmpResult] bulkWalk rootoid startoid session = do res <- filter (onlySubIds rootoid) <$> mkSnmpBulkGet 0 maxReps startoid session+ let resOids = map oid res case res of [] -> return []- rs -> (res ++) <$> bulkWalk rootoid (oid (last rs)) session+ rs -> if (nub resOids == resOids)+ then (res ++) <$> bulkWalk rootoid (oid (last rs)) session+ else throwT "OID do not increase. The server responds in a loop." onlySubIds :: RawOID -> SnmpResult -> Bool onlySubIds rootoid res = rootoid `isPrefixOf` oid res @@ -410,11 +413,7 @@ pdu_req <- buildPDU snmp_msg_getbulk oid' oids version pokePDUNonRepeaters pdu_req non_repeaters pokePDUMaxRepetitions pdu_req max_repetitions- res <- dispatchSnmpReq pdu_req session- let resOids = map oid res- unless (nub(resOids) == resOids)- (throwT "OID do not increase. The server responds in a loop.")- return res+ dispatchSnmpReq pdu_req session -- get or getnext, using session info from a 'data Session' and -- the supplied oid