Lines Matching refs:bufptr

931   unsigned char	*bufptr,		/* Pointer into the data */  in asn1_decode_snmp()  local
943 bufptr = buffer; in asn1_decode_snmp()
946 if (asn1_get_type(&bufptr, bufend) != CUPS_ASN1_SEQUENCE) in asn1_decode_snmp()
948 else if (asn1_get_length(&bufptr, bufend) == 0) in asn1_decode_snmp()
950 else if (asn1_get_type(&bufptr, bufend) != CUPS_ASN1_INTEGER) in asn1_decode_snmp()
952 else if ((length = asn1_get_length(&bufptr, bufend)) == 0) in asn1_decode_snmp()
954 else if ((packet->version = asn1_get_integer(&bufptr, bufend, length)) in asn1_decode_snmp()
957 else if (asn1_get_type(&bufptr, bufend) != CUPS_ASN1_OCTET_STRING) in asn1_decode_snmp()
959 else if ((length = asn1_get_length(&bufptr, bufend)) == 0) in asn1_decode_snmp()
963 asn1_get_string(&bufptr, bufend, length, packet->community, in asn1_decode_snmp()
966 if ((packet->request_type = (cups_asn1_t)asn1_get_type(&bufptr, bufend)) in asn1_decode_snmp()
969 else if (asn1_get_length(&bufptr, bufend) == 0) in asn1_decode_snmp()
971 else if (asn1_get_type(&bufptr, bufend) != CUPS_ASN1_INTEGER) in asn1_decode_snmp()
973 else if ((length = asn1_get_length(&bufptr, bufend)) == 0) in asn1_decode_snmp()
977 packet->request_id = (unsigned)asn1_get_integer(&bufptr, bufend, length); in asn1_decode_snmp()
979 if (asn1_get_type(&bufptr, bufend) != CUPS_ASN1_INTEGER) in asn1_decode_snmp()
981 else if ((length = asn1_get_length(&bufptr, bufend)) == 0) in asn1_decode_snmp()
985 packet->error_status = asn1_get_integer(&bufptr, bufend, length); in asn1_decode_snmp()
987 if (asn1_get_type(&bufptr, bufend) != CUPS_ASN1_INTEGER) in asn1_decode_snmp()
989 else if ((length = asn1_get_length(&bufptr, bufend)) == 0) in asn1_decode_snmp()
993 packet->error_index = asn1_get_integer(&bufptr, bufend, length); in asn1_decode_snmp()
995 if (asn1_get_type(&bufptr, bufend) != CUPS_ASN1_SEQUENCE) in asn1_decode_snmp()
997 else if (asn1_get_length(&bufptr, bufend) == 0) in asn1_decode_snmp()
1000 else if (asn1_get_type(&bufptr, bufend) != CUPS_ASN1_SEQUENCE) in asn1_decode_snmp()
1002 else if (asn1_get_length(&bufptr, bufend) == 0) in asn1_decode_snmp()
1004 else if (asn1_get_type(&bufptr, bufend) != CUPS_ASN1_OID) in asn1_decode_snmp()
1006 else if ((length = asn1_get_length(&bufptr, bufend)) == 0) in asn1_decode_snmp()
1010 asn1_get_oid(&bufptr, bufend, length, packet->object_name, in asn1_decode_snmp()
1013 packet->object_type = (cups_asn1_t)asn1_get_type(&bufptr, bufend); in asn1_decode_snmp()
1015 if ((length = asn1_get_length(&bufptr, bufend)) == 0 && in asn1_decode_snmp()
1025 asn1_get_integer(&bufptr, bufend, length); in asn1_decode_snmp()
1030 asn1_get_integer(&bufptr, bufend, length); in asn1_decode_snmp()
1040 asn1_get_string(&bufptr, bufend, length, in asn1_decode_snmp()
1046 asn1_get_oid(&bufptr, bufend, length, in asn1_decode_snmp()
1052 asn1_get_integer(&bufptr, bufend, length); in asn1_decode_snmp()
1057 (unsigned)asn1_get_integer(&bufptr, bufend, length); in asn1_decode_snmp()
1062 (unsigned)asn1_get_integer(&bufptr, bufend, length); in asn1_decode_snmp()
1089 unsigned char *bufptr; /* Pointer into buffer */ in asn1_encode_snmp() local
1157 bufptr = buffer; in asn1_encode_snmp()
1159 *bufptr++ = CUPS_ASN1_SEQUENCE; /* SNMPv1 message header */ in asn1_encode_snmp()
1160 asn1_set_length(&bufptr, msglen); in asn1_encode_snmp()
1162 asn1_set_integer(&bufptr, packet->version); in asn1_encode_snmp()
1165 *bufptr++ = CUPS_ASN1_OCTET_STRING; /* community */ in asn1_encode_snmp()
1166 asn1_set_length(&bufptr, commlen); in asn1_encode_snmp()
1167 memcpy(bufptr, packet->community, commlen); in asn1_encode_snmp()
1168 bufptr += commlen; in asn1_encode_snmp()
1170 *bufptr++ = (unsigned char)packet->request_type; /* Get-Request-PDU/Get-Next-Request-PDU */ in asn1_encode_snmp()
1171 asn1_set_length(&bufptr, reqlen); in asn1_encode_snmp()
1173 asn1_set_integer(&bufptr, (int)packet->request_id); in asn1_encode_snmp()
1175 asn1_set_integer(&bufptr, packet->error_status); in asn1_encode_snmp()
1177 asn1_set_integer(&bufptr, packet->error_index); in asn1_encode_snmp()
1179 *bufptr++ = CUPS_ASN1_SEQUENCE; /* variable-bindings */ in asn1_encode_snmp()
1180 asn1_set_length(&bufptr, listlen); in asn1_encode_snmp()
1182 *bufptr++ = CUPS_ASN1_SEQUENCE; /* variable */ in asn1_encode_snmp()
1183 asn1_set_length(&bufptr, varlen); in asn1_encode_snmp()
1185 asn1_set_oid(&bufptr, packet->object_name); in asn1_encode_snmp()
1191 *bufptr++ = CUPS_ASN1_NULL_VALUE; in asn1_encode_snmp()
1193 *bufptr++ = 0; /* Length */ in asn1_encode_snmp()
1197 asn1_set_integer(&bufptr, packet->object_value.boolean); in asn1_encode_snmp()
1201 asn1_set_integer(&bufptr, packet->object_value.integer); in asn1_encode_snmp()
1205 *bufptr++ = CUPS_ASN1_OCTET_STRING; in asn1_encode_snmp()
1206 asn1_set_length(&bufptr, valuelen); in asn1_encode_snmp()
1207 memcpy(bufptr, packet->object_value.string.bytes, valuelen); in asn1_encode_snmp()
1208 bufptr += valuelen; in asn1_encode_snmp()
1212 asn1_set_oid(&bufptr, packet->object_value.oid); in asn1_encode_snmp()
1219 return ((int)(bufptr - buffer)); in asn1_encode_snmp()