1 |
/* |
/* |
2 |
Copyright (C) 2001, Sergey Poznyakoff. |
Copyright (C) 2001,2003, Sergey Poznyakoff. |
3 |
|
|
4 |
This file is part of GNU Radius SNMP Library. |
This file is part of GNU Radius SNMP Library. |
5 |
|
|
27 |
#include <snmp.h> |
#include <snmp.h> |
28 |
|
|
29 |
int |
int |
30 |
snmp_send(sess, pdu) |
snmp_send(struct snmp_session *sess, struct snmp_pdu *pdu) |
|
struct snmp_session *sess; |
|
|
struct snmp_pdu *pdu; |
|
31 |
{ |
{ |
32 |
struct snmp_request *req; |
struct snmp_request *req; |
33 |
|
|
64 |
} |
} |
65 |
|
|
66 |
int |
int |
67 |
snmp_request_xmit(sess, req) |
snmp_request_xmit(struct snmp_session *sess, struct snmp_request *req) |
|
struct snmp_session *sess; |
|
|
struct snmp_request *req; |
|
68 |
{ |
{ |
69 |
u_char packet_buf[SNMP_PACKET_LENGTH]; |
u_char packet_buf[SNMP_PACKET_LENGTH]; |
70 |
int length; |
int length; |
98 |
data |
data |
99 |
} */ |
} */ |
100 |
|
|
|
|
|
|
|
|
101 |
int |
int |
102 |
snmp_encode_request(sess, pdu, packet_buf, length) |
snmp_encode_request(struct snmp_session *sess, struct snmp_pdu *pdu, |
103 |
struct snmp_session *sess; |
u_char *packet_buf, int *length) |
|
struct snmp_pdu *pdu; |
|
|
u_char *packet_buf; |
|
|
int *length; |
|
104 |
{ |
{ |
105 |
u_char *buf, *msg_start, *pdu_header_ptr, *pdu_data_start, |
u_char *buf, *msg_start, *pdu_header_ptr, *pdu_data_start, |
106 |
*var_header_ptr, *var_data_start; |
*var_header_ptr, *var_data_start; |
156 |
} |
} |
157 |
|
|
158 |
int |
int |
159 |
snmp_decode_request(sess, pdu, packet, length, comm, comm_len) |
snmp_decode_request(struct snmp_session *sess, struct snmp_pdu *pdu, |
160 |
struct snmp_session *sess; |
u_char *packet, int length, char *comm, int *comm_len) |
|
struct snmp_pdu *pdu; |
|
|
u_char *packet; |
|
|
int length; |
|
|
char *comm; |
|
|
int *comm_len; |
|
161 |
{ |
{ |
162 |
int vers; |
int vers; |
163 |
u_char *buf; |
u_char *buf; |