Lines Matching defs:pdu

43 #include "pdu.h"
95 static int agent_get_next(SNMP_pdu *pdu, char *error_label);
97 static int agent_get(SNMP_pdu *pdu, char *error_label);
98 static int agent_set(int pass, SNMP_pdu *pdu, char *error_label);
104 /* 0 in case of success (the pdu should be sent */
107 /* -1 in case of failure (no pdu should be sent */
110 int agent_process(Address *address, SNMP_pdu *pdu)
116 if(pdu == NULL)
118 error("BUG: agent_process(): pdu is NULL");
152 /* check pdu type */
153 if(pdu->type != GETNEXT_REQ_MSG
154 && (pdu->type != GET_REQ_MSG)
155 && (pdu->type != SET_REQ_MSG) )
157 error("agent_process(): bad PDU type (0x%x)", pdu->type);
163 if(!is_valid_community(pdu->community, pdu->type,mngr))
204 switch(pdu->type)
207 if(agent_get_next(pdu, error_label))
215 if(agent_get(pdu, error_label))
223 switch(agent_set(FIRST_PASS, pdu, error_label))
226 switch(agent_set(SECOND_PASS, pdu, error_label))
259 /* 0 in case of success (the pdu should be sent */
262 /* -1 in case of failure (no pdu should be sent */
265 static int agent_get_next(SNMP_pdu *pdu, char *error_label)
276 pdu->type = GET_RSP_MSG;
278 for(variable = pdu->first_variable; variable; variable = variable->next_variable)
283 pdu->error_status = SNMP_ERR_NOSUCHNAME;
284 pdu->error_index = index;
321 pdu->error_status = snmp_error;
322 pdu->error_index = index;
681 /* 0 in case of success (the pdu should be sent */
684 /* -1 in case of failure (no pdu should be sent */
687 static int agent_get(SNMP_pdu *pdu, char *error_label)
722 pdu->type = GET_RSP_MSG;
724 for(variable = pdu->first_variable; variable; variable = variable->next_variable)
729 pdu->error_status = SNMP_ERR_NOSUCHNAME;
730 pdu->error_index = index_err;
770 pdu->error_status = SNMP_ERR_NOSUCHNAME;
771 pdu->error_index = index_err;
778 pdu->error_status = SNMP_ERR_NOSUCHNAME;
779 pdu->error_index = index_err;
823 pdu->error_status = snmp_error;
824 pdu->error_index = index_err;
884 pdu->error_status = SNMP_ERR_NOSUCHNAME;
885 pdu->error_index = index_err;
891 pdu->error_status = SNMP_ERR_NOSUCHNAME;
892 pdu->error_index = index_err;
955 pdu->error_status = snmp_error;
956 pdu->error_index = index_err;
1004 pdu->error_status = SNMP_ERR_NOSUCHNAME;
1005 pdu->error_index = index_err;
1038 /* second pass and no pdu should be sent back. */
1040 /* to the second pass but a pdu */
1044 static int agent_set(int pass, SNMP_pdu *pdu, char *error_label)
1068 pdu->type = GET_RSP_MSG;
1070 for(variable = pdu->first_variable; variable; variable = variable->next_variable)
1075 pdu->error_status = SNMP_ERR_NOSUCHNAME;
1076 pdu->error_index = index;
1124 pdu->error_status = SNMP_ERR_NOSUCHNAME;
1125 pdu->error_index = index;
1133 pdu->error_status = SNMP_ERR_READONLY;
1134 pdu->error_index = index;
1185 pdu->error_status = SNMP_ERR_BADVALUE;
1186 pdu->error_index = index;
1238 pdu->error_status = snmp_error;
1239 pdu->error_index = index;
1263 pdu->error_status = SNMP_ERR_NOSUCHNAME;
1264 pdu->error_index = index;
1272 pdu->error_status = SNMP_ERR_READONLY;
1273 pdu->error_index = index;
1324 pdu->error_status = SNMP_ERR_BADVALUE;
1325 pdu->error_index = index;
1413 pdu->error_status = snmp_error;
1414 pdu->error_index = index;
1423 pdu->error_status = SNMP_ERR_NOSUCHNAME;
1424 pdu->error_index = index;