Lines Matching defs:error_label

66 static SNMP_pdu *snmp_pdu_decode(u_char *packet, int length, char *error_label);
67 static SNMP_variable *snmp_pdu_decode_variable(u_char **data, int *length, char *error_label);
68 static int snmp_pdu_encode(SNMP_pdu *pdu, u_char *packet, int *length, char *error_label);
69 static u_char *snmp_pdu_encode_variable(SNMP_variable *variable, u_char *data, int *length, char *error_label);
76 SNMP_variable *snmp_variable_new(char *error_label)
81 error_label[0] = '\0';
86 sprintf(error_label, ERR_MSG_ALLOC);
97 SNMP_variable *snmp_typed_variable_new(Oid *name, u_char type, SNMP_value *value, char *error_label)
102 error_label[0] = '\0';
106 sprintf(error_label, "BUG: snmp_typed_variable_new(): name is NULL");
112 sprintf(error_label, "BUG: snmp_typed_variable_new(): value is NULL");
116 new = snmp_variable_new(error_label);
123 if(SSAOidCpy(&(new->name), name, error_label))
142 sprintf(error_label, ERR_MSG_ALLOC);
159 sprintf(error_label, ERR_MSG_ALLOC);
176 sprintf(error_label, ERR_MSG_ALLOC);
191 sprintf(error_label, "BUG: snmp_typed_variable_new(): unsupported type (0x%x)", type);
203 SNMP_variable *snmp_typed_variable_append(SNMP_variable *list, Oid *name, u_char type, SNMP_value *value, char *error_label)
208 error_label[0] = '\0';
210 new = snmp_typed_variable_new(name, type, value, error_label);
242 SNMP_pdu *snmp_pdu_new(char *error_label)
247 error_label[0] = '\0';
252 sprintf(error_label, ERR_MSG_ALLOC);
280 SNMP_pdu *snmp_pdu_receive(int sd, Address *address, char *error_label)
289 error_label[0] = '\0';
293 sprintf(error_label, ERR_MSG_ALLOC);
302 sprintf(error_label, ERR_MSG_RECVFROM, errno_string());
321 pdu = snmp_pdu_decode(packet, length, error_label);
342 int snmp_pdu_send(int sd, Address *address, SNMP_pdu *pdu, char *error_label)
352 sprintf(error_label, ERR_MSG_ALLOC);
355 error_label[0] = '\0';
359 sprintf(error_label, "BUG: snmp_pdu_send(): pdu is NULL");
365 sprintf(error_label, "BUG: snmp_pdu_send(): address is NULL");
375 if(snmp_pdu_encode(pdu, packet, &length, error_label))
396 sprintf(error_label, ERR_MSG_SENDTO);
630 static SNMP_pdu *snmp_pdu_decode(u_char *packet, int packet_length, char *error_label)
642 error_label[0] = '\0';
644 pdu = snmp_pdu_new(error_label);
654 sprintf(error_label, "Decode the header of message failed: %s",
661 sprintf(error_label, "The message has a wrong header type (0x%x)", type);
671 sprintf(error_label, "Decode the version failed: %s",
678 sprintf(error_label, "The message has a wrong version (%d)",
690 sprintf(error_label, "Decode the community failed: %s",
699 sprintf(error_label, ERR_MSG_ALLOC);
708 sprintf(error_label, "Decode the header of pdu failed: %s",
728 sprintf(error_label, "Decode the request id failed: %s",
739 sprintf(error_label, "Decode the error status failed: %s",
750 sprintf(error_label, "Decode the error index failed: %s",
767 sprintf(error_label, "Decode the enterprise failed: %s",
775 sprintf(error_label, ERR_MSG_ALLOC);
787 sprintf(error_label, "Decode the agent address failed: %s",
798 sprintf(error_label, "Decode the generic trap failed: %s",
809 sprintf(error_label, "Decode the specific trap failed: %s",
820 sprintf(error_label, "Decode the time stamp failed: %s",
830 sprintf(error_label, "The type of the pdu is wrong (%d)", pdu->type);
840 sprintf(error_label, "Decode the header of the variables failed: %s",
847 sprintf(error_label, "The header of the variables has a wrong type (%x)", type);
859 variable = snmp_pdu_decode_variable(&data , &length, error_label);
885 static SNMP_variable *snmp_pdu_decode_variable(u_char **data, int *length, char *error_label)
895 error_label[0] = '\0';
897 variable = snmp_variable_new(error_label);
908 sprintf(error_label, "Decode the header of a variable failed: %s",
915 sprintf(error_label, "The header of a variable has a wrong type (%x)", type);
926 sprintf(error_label, "Decode the name of a variable failed: %s",
933 sprintf(error_label, "The name of a variable has wrong type (%x)", type);
940 sprintf(error_label, ERR_MSG_ALLOC);
953 sprintf(error_label, "Decode the type of a variable failed: %s",
968 sprintf(error_label, ERR_MSG_ALLOC);
977 sprintf(error_label, "Decode a variable of type integer failed: %s",
990 sprintf(error_label, ERR_MSG_ALLOC);
998 sprintf(error_label, "Decode a variable of type octet string failed: %s",
1011 sprintf(error_label, "Decode a variable of type object identifier failed: %s",
1020 sprintf(error_label, ERR_MSG_ALLOC);
1031 sprintf(error_label, "A variable has a wrong type (%x)", variable->type);
1054 static int snmp_pdu_encode(SNMP_pdu *pdu, u_char *packet, int *packet_length, char *error_label)
1066 sprintf(error_label, ERR_MSG_ALLOC);
1069 error_label[0] = '\0';
1077 cp = snmp_pdu_encode_variable(variable, cp, &len, error_label);
1092 sprintf(error_label, "Encode the header of the variables failed: %s",
1119 sprintf(error_label, "Encode the request id failed: %s",
1131 sprintf(error_label, "Encode the error status failed: %s",
1143 sprintf(error_label, "Encode the error index failed: %s",
1160 sprintf(error_label, "Encode the enterprise failed: %s",
1173 sprintf(error_label, "Encode the agent address failed: %s",
1185 sprintf(error_label, "Encode the generic trap failed: %s",
1197 sprintf(error_label, "Encode the specific trap failed: %s",
1209 sprintf(error_label, "Encode the time stamp failed: %s",
1219 sprintf(error_label, "The pdu has a wrong type (%x)", pdu->type);
1229 sprintf(error_label, "The buffer is too small");
1245 sprintf(error_label, "Encode the header of the pdu failed: %s",
1255 sprintf(error_label, "The buffer is too small");
1268 sprintf(error_label, "BUG: snmp_pdu_encode(): community is NULL");
1279 sprintf(error_label, "Encode the header of the message failed: %s",
1291 sprintf(error_label, "Encode the version failed: %s",
1304 sprintf(error_label, "Encode the community failed: %s",
1314 sprintf(error_label, "The buffer is too small");
1331 static u_char *snmp_pdu_encode_variable(SNMP_variable *variable, u_char *data, int *length, char *error_label)
1337 error_label[0] = '\0';
1344 sprintf(error_label, "Encode the header of a variable failed: %s",
1356 sprintf(error_label, "Encode the name of a variable failed: %s",
1376 sprintf(error_label, "Encode a variable of type integer failed: %s",
1389 sprintf(error_label, "Encode a variable of type octet string failed: %s",
1400 sprintf(error_label, "Encode a variable of type object identifier failed: %s",
1410 sprintf(error_label, "Encode a variable of type null failed: %s",
1417 sprintf(error_label, "A variable has a wrong type (%x)", variable->type);
1440 sprintf(error_label, "The buffer is too small");
1453 sprintf(error_label, "Encode the header of a variable failed: %s",
1494 SNMP_pdu *snmp_pdu_dup(SNMP_pdu *pdu, char *error_label)
1499 error_label[0] = '\0';
1501 new = snmp_pdu_new(error_label);
1511 sprintf(error_label, ERR_MSG_ALLOC);
1522 if(SSAOidCpy(&(new->enterprise), &(pdu->enterprise), error_label))
1541 snmp_variable_dup(SNMP_variable *variable, char *error_label)
1546 error_label[0] = '\0';
1548 new = snmp_variable_new(error_label);
1553 if (SSAOidCpy(&(new->name), &(variable->name), error_label)) {
1562 sprintf(error_label, ERR_MSG_ALLOC);
1581 SNMP_variable *snmp_pdu_append_null_variable(SNMP_pdu *pdu, Oid *name, char *error_label)
1587 error_label[0] = '\0';
1591 sprintf(error_label, "BUG: snmp_pdu_append_null_variable(): pdu is NULL");
1597 sprintf(error_label, "BUG: snmp_pdu_append_null_variable(): pdu is NULL");
1601 new = snmp_variable_new(error_label);
1607 if(SSAOidCpy(&(new->name), name, error_label))
1634 SNMP_variable *ssa_append_integer_variable(SNMP_variable *list, Oid *oid, int num,char *error_label,u_char asn1_type)
1639 list = snmp_typed_variable_append(list,oid,asn1_type,&value,error_label);
1649 char *error_label)
1658 error_label);
1666 SNMP_variable *ssa_append_oid_variable(SNMP_variable *list, Oid *oid, Oid name, char *error_label)
1673 list = snmp_typed_variable_append(list,oid,OBJID,&value,error_label);