用snmp++发送get请求示例
来源:互联网 发布:软件商城开发 编辑:程序博客网 时间:2024/04/29 13:41
#include “snmp_pp.h”
#define SYSDESCR “1.3.6.1.2.1.1.1.0” // Object ID for System Descriptor
void get_system_descriptor()
{
int status; // return status
CTarget ctarget( (IpAddress) “10.4.8.5”);// SNMP++ v1 target
Vb vb( SYSDESCR); // SNMP++ Variable Binding
Pdu pdu; // SNMP++ PDU
//-------[ Construct a SNMP++ SNMP Object ]---------------------------
Snmp snmp( status); // Create a SNMP++ session
if ( status != SNMP_CLASS_SUCCESS)
{ // check creation status
cout << snmp.error_msg( status); // if fail, print error string
return;
}
//-------[ Invoke a SNMP++ Get ]---------------------------------------
pdu += vb; // add the variable binding
if ( (status = snmp.get( pdu, ctarget)) != SNMP_CLASS_SUCCESS)
cout << snmp.error_msg( status);
else
{
pdu.get_vb( vb,0); // extract the variable binding
cout << “System Descriptor = ”<< vb.get_printable_value();
} // print out
};
#define SYSDESCR “1.3.6.1.2.1.1.1.0” // Object ID for System Descriptor
void get_system_descriptor()
{
int status; // return status
CTarget ctarget( (IpAddress) “10.4.8.5”);// SNMP++ v1 target
Vb vb( SYSDESCR); // SNMP++ Variable Binding
Pdu pdu; // SNMP++ PDU
//-------[ Construct a SNMP++ SNMP Object ]---------------------------
Snmp snmp( status); // Create a SNMP++ session
if ( status != SNMP_CLASS_SUCCESS)
{ // check creation status
cout << snmp.error_msg( status); // if fail, print error string
return;
}
//-------[ Invoke a SNMP++ Get ]---------------------------------------
pdu += vb; // add the variable binding
if ( (status = snmp.get( pdu, ctarget)) != SNMP_CLASS_SUCCESS)
cout << snmp.error_msg( status);
else
{
pdu.get_vb( vb,0); // extract the variable binding
cout << “System Descriptor = ”<< vb.get_printable_value();
} // print out
};
- 用snmp++发送get请求示例
- android okHttp 发送post 、get请求示例
- java发送get请求和post请求示例
- Android例子—HttpURLConnection发送POST、GET请求代码示例
- 向指定url发送get、post请求工具类示例
- 用ASIHttpRequest框架发送get请求
- 用流发送get post请求
- android发送get请求
- 发送GET请求
- Ajax发送GET请求
- Ajax发送GET请求
- winhttp 发送 get 请求
- XMLHttpRequset发送GET请求
- httpclient 发送get请求 。
- c#发送get请求
- NNSURLConnection 发送GET请求
- JAVA发送GET请求
- python发送get请求
- C# 文件操作(上传 下载 删除 文件列表...)(转)
- 开发windows ce 程序一定要掌上电脑吗...
- BeyondTrack 项目迁移了
- Windows CE在嵌入式工业控制系统中的应用思考
- listener.ora--sqlnet.ora--tnsnames.ora的关系以及手工配置举例
- 用snmp++发送get请求示例
- 人生的奇妙计算式
- 如何编写Windows CE结构的应用程序
- SQLNET.AUTHENTICATION_SERVICES
- cmd不能识别netstat 命令
- javaScript中URL编码转换,escape() encodeURI() encodeURIComponent
- 不知道是真是假的流量购买---有待考察
- Windows CE WIN32 编程示例
- PHP中$_SERVER的详细用法