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 |
struct snmp_pdu * |
struct snmp_pdu * |
30 |
snmp_pdu_create(type) |
snmp_pdu_create(int type) |
|
int type; |
|
31 |
{ |
{ |
32 |
struct snmp_pdu *pdu; |
struct snmp_pdu *pdu; |
33 |
|
|
42 |
} |
} |
43 |
|
|
44 |
void |
void |
45 |
snmp_pdu_free(pdu) |
snmp_pdu_free(struct snmp_pdu *pdu) |
|
struct snmp_pdu *pdu; |
|
46 |
{ |
{ |
47 |
if (!pdu) |
if (!pdu) |
48 |
return; |
return; |
51 |
} |
} |
52 |
|
|
53 |
void |
void |
54 |
snmp_pdu_add_var(pdu, var) |
snmp_pdu_add_var(struct snmp_pdu *pdu, struct snmp_var *var) |
|
struct snmp_pdu *pdu; |
|
|
struct snmp_var *var; |
|
55 |
{ |
{ |
56 |
var->next = pdu->var; |
var->next = pdu->var; |
57 |
pdu->var = var; |
pdu->var = var; |
58 |
} |
} |
59 |
|
|
60 |
u_char * |
u_char * |
61 |
snmp_pdu_decode(data, length, pdu) |
snmp_pdu_decode(u_char *data, int *length, struct snmp_pdu *pdu) |
|
u_char *data; |
|
|
int *length; |
|
|
struct snmp_pdu *pdu; |
|
62 |
{ |
{ |
63 |
u_char *buf = data; |
u_char *buf = data; |
64 |
u_char type; |
u_char type; |
94 |
|
|
95 |
|
|
96 |
u_char * |
u_char * |
97 |
snmp_pdu_encode(data, length, pdu) |
snmp_pdu_encode(u_char *data, int *length, struct snmp_pdu *pdu) |
|
u_char *data; |
|
|
int *length; |
|
|
struct snmp_pdu *pdu; |
|
98 |
{ |
{ |
99 |
u_char *buf = data; |
u_char *buf = data; |
100 |
|
|