+;; # GEN-CLASS to use from java environment once we have the standalone library
+;;
+;; ### Defaults:
+;; **TransportMappingProtocol:** UDP
+;;
+;; **UDP-PORT get communication** 161
 (ns ew_snmp.SNMPApi
   (:use [ew_snmp.v2 :only [ getv2]]
         [ew_snmp.v3 :only [ getv3]])

  (-v3all "127.0.0.1" "juanv3" "comomolalagramola" "1.3.6.1.2.1.1.5.0")
  (-v3allb "127.0.0.1" "juanv3" "comomolalagramola" ["1.3.6.1.2.1.1.5.0" "1.3.6.1.2.1.1.6.0"] )
 )

               #^{:static true} [v3allb [String String String "[Ljava.lang.Object;"] "[Ljava.lang.Object;"]
               ]))


;; # SNMP version 2
;; ---


(defn -v2
  "**v2**: usefull in case to have a single oid and want to return single string value
> [host, community-name, object-identifier] => String: first object"
  [h c oid]
  (first (getv2 h c [oid]))
  )

(defn -v2all
  "**v2all**: in case to have a single oid and want to return a array of string values
> [host, community-name, object-identifier] => [String]: all objects
"
  [h c oid]
  (to-array (getv2 h c [oid]))
  )

(defn -v2allb
  "**v2allb**: we pass an array of oids to obtain an array of values according to
> [host, community-name, array object-identifiers] => [String]: objects array"
  [h c oid]
  (to-array (getv2 h c oid))
  )

;; # SNMP version 3
;; ---

(defn -v3
  "**v3**: usefull in case to have a single oid and want to return single string value
> [host, community-name, object-identifier] => String: first object"
  [ip u p oid]
  (first (getv3 ip u p [oid])))

(defn -v3all
    "**v3all**: in case to have a single oid and want to return a array of string values
> [host, community-name, object-identifier] => [String]: all objects
"
  [ip u p oid]
  (to-array (getv3 ip u p [oid])))

 (defn -v3allb
   "**v3allb**: we pass an array of oids to obtain an array of values according to
> [host, community-name, array object-identifiers] => [String]: objects array"
  [ip u p oid]
  (to-array (getv3 ip u p oid)))


(comment
  (-v2 "localhost" "public" "1.3.6.1.2.1.1.5.0")
