package netsnmp

  1. Overview
  2. Docs
An interface to the Net-SNMP client library

Install

Dune Dependency

Authors

Maintainers

Sources

netsnmp-v0.15.0.tar.gz
sha256=4c9b6bae3b61d85d92f80fb5c0fe3fd6db498512eeaa3d332eed284f4693d269

doc/src/netsnmp.raw_monad/session_monad.ml.html

Source file session_monad.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
open! Import

module Session(IO : Io_intf.S) : Session_intf.S with module IO := IO = struct
  include Session

  (** [snmp_sess_open] and [snmp_sess_close] may be called from a thread, but must be
      called from the same thread for some session. [snmp_sess_synch_response] is
      threadsafe. *)

  let snmp_sess_open ~version ~retries ~timeout ~peername ~localname
    ~local_port ~community ~securityName ~securityAuthProto ~securityAuthPassword () =
    IO.wrap_new_thread (fun () ->
      let result =
        Session.snmp_sess_open
          ~version ~retries ~timeout ~peername ~localname ~local_port
          ~community ~securityName ~securityAuthProto
          ~securityAuthPassword ()
      in
      Io_intf.With_thread_id.create ~result ~thread_id:(Session.session_id result))
      ()

  let snmp_sess_close session =
    IO.wrap
      ~thread_id:(Session.session_id session)
      Session.snmp_sess_close
      session

  let snmp_sess_synch_response handle pdu =
    IO.wrap_mt (Session.snmp_sess_synch_response handle) pdu
end
OCaml

Innovation. Community. Security.