SNMPpp  v0.0.3-20-7eeb228
Classes, methods, and functions to use net-snmp from C++
Session.hpp
Go to the documentation of this file.
1 // SNMPpp: https://sourceforge.net/p/snmppp/
2 // SNMPpp project uses the MIT license. See LICENSE for details.
3 // Copyright (C) 2013 Stephane Charette <stephanecharette@gmail.com>
4 
5 #pragma once
6 
7 #include <SNMPpp/net-snmppp.hpp>
8 #include <string>
9 
10 
11 namespace SNMPpp
12 {
20  typedef void * SessionHandle;
21 
32  void openSession( SessionHandle &sessionHandle, const std::string &server = "udp:127.0.0.1:161", const std::string &community = "public", const int version = SNMP_VERSION_2c, const int retryAttempts = 3 );
33 
37  void closeSession( SessionHandle &sessionHandle );
38 };
All net-snmp includes needed by SNMPpp can be easily included by using net-snmppp.hpp.
void closeSession(SessionHandle &sessionHandle)
Sessions must be closed when no longer needed.
Definition: Session.cpp:57
Definition: Get.hpp:13
void openSession(SessionHandle &sessionHandle, const std::string &server="udp:127.0.0.1:161", const std::string &community="public", const int version=SNMP_VERSION_2c, const int retryAttempts=3)
Open a net-snmp session and return a session handle.
Definition: Session.cpp:11
std::string version(void)
Return the SNMPpp version number.
Definition: SNMPpp.cpp:9
void * SessionHandle
net-snmp uses a void * for the "Single API" opaque session pointer, but SNMPpp prefers to have an act...
Definition: Session.hpp:20