1 Star 0 Fork 0

202108010516-曾蕴焘/oflops

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
oflops_snmp.h 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef OFLOPS_SNMP_H
#define OFLOPS_SNMP_H
struct snmp_channel;
struct snmp_event;
#include "context.h"
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
/** Structure to hold SNMP reply.
*
* @date December, 2009
* @author ykk (Stanford University)
*/
typedef struct snmp_event
{
/** SNMP variable list
*/
struct variable_list* reply;
/** Pointer to SNMP reply
*/
struct snmp_pdu* pdu;
} snmp_event;
/** Structure to hold SNMP channel information.
*
* @date December 2009
* @author ykk (Stanford University)
*/
typedef struct snmp_channel
{
/** Hostname of SNMP agent.
*/
char* hostname;
/** SNMP community string.
*/
char* community_string;
/** Reference to session.
*/
struct snmp_session session;
/** Reference to packet
*/
struct snmp_pdu* req;
} snmp_channel;
/** Initialize SNMP channel.
* @param host IP address of SNPM agent
* @param community_string
* @return 0
*/
int snmp_channel_init(struct snmp_channel* channel,
char* host, char* community_string);
/** Setup SNMP session.
* @param ctx context (includes reference to SNMP session/setup)
*/
void setup_snmp_channel(struct oflops_context* ctx);
/** Callback function for SNMP
* @param operation type of SNMP operation
* @param sp pointer to SNMP session
* @param reqid required id
* @param pdu pointer to SNMP PDU
* @param magic magic object with request
* @return 0
*/
int snmp_response(int operation, struct snmp_session *sp, int reqid,
struct snmp_pdu *pdu, void *magic);
/** Teardown SNMP session.
* @param ctx context (includes reference to SNMP session/setup)
*/
void teardown_snmp_channel(struct oflops_context* ctx);
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zeng-yuntao/oflops.git
git@gitee.com:zeng-yuntao/oflops.git
zeng-yuntao
oflops
oflops
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385