Lines Matching refs:attr_info

72 static int nr_stun_attr_string_illegal(nr_stun_attr_info *attr_info, size_t len, void *data, size_t…
74 static int nr_stun_attr_error_code_illegal(nr_stun_attr_info *attr_info, size_t attrlen, void *data…
75 static int nr_stun_attr_nonce_illegal(nr_stun_attr_info *attr_info, size_t attrlen, void *data);
76 static int nr_stun_attr_realm_illegal(nr_stun_attr_info *attr_info, size_t attrlen, void *data);
77 static int nr_stun_attr_server_illegal(nr_stun_attr_info *attr_info, size_t attrlen, void *data);
78 static int nr_stun_attr_username_illegal(nr_stun_attr_info *attr_info, size_t attrlen, void *data);
80 nr_stun_attr_codec_fingerprint_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, siz…
237 nr_stun_attr_string_illegal(nr_stun_attr_info *attr_info, size_t len, void *data, size_t max_bytes,… in nr_stun_attr_string_illegal() argument
244 r_log(NR_LOG_STUN, LOG_WARNING, "%s is too large: %d bytes", attr_info->name, len); in nr_stun_attr_string_illegal()
250 r_log(NR_LOG_STUN, LOG_WARNING, "%s is too large: %zd characters", attr_info->name, nchars); in nr_stun_attr_string_illegal()
260 nr_stun_attr_error_code_illegal(nr_stun_attr_info *attr_info, size_t attrlen, void *data) in nr_stun_attr_error_code_illegal() argument
268 …if ((r=nr_stun_attr_string_illegal(attr_info, strlen(ec->reason), ec->reason, NR_STUN_MAX_ERROR_CO… in nr_stun_attr_error_code_illegal()
277 nr_stun_attr_nonce_illegal(nr_stun_attr_info *attr_info, size_t attrlen, void *data) in nr_stun_attr_nonce_illegal() argument
279 …return nr_stun_attr_string_illegal(attr_info, attrlen, data, NR_STUN_MAX_NONCE_BYTES, NR_STUN_MAX_… in nr_stun_attr_nonce_illegal()
283 nr_stun_attr_realm_illegal(nr_stun_attr_info *attr_info, size_t attrlen, void *data) in nr_stun_attr_realm_illegal() argument
285 …return nr_stun_attr_string_illegal(attr_info, attrlen, data, NR_STUN_MAX_REALM_BYTES, NR_STUN_MAX_… in nr_stun_attr_realm_illegal()
289 nr_stun_attr_server_illegal(nr_stun_attr_info *attr_info, size_t attrlen, void *data) in nr_stun_attr_server_illegal() argument
291 …return nr_stun_attr_string_illegal(attr_info, attrlen, data, NR_STUN_MAX_SERVER_BYTES, NR_STUN_MAX… in nr_stun_attr_server_illegal()
295 nr_stun_attr_username_illegal(nr_stun_attr_info *attr_info, size_t attrlen, void *data) in nr_stun_attr_username_illegal() argument
297 return nr_stun_attr_string_illegal(attr_info, attrlen, data, NR_STUN_MAX_USERNAME_BYTES, -1); in nr_stun_attr_username_illegal()
301 nr_stun_attr_codec_UCHAR_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_UCHAR_print() argument
303 r_log(NR_LOG_STUN, LOG_DEBUG, "%s %s: %u", msg, attr_info->name, *(UCHAR*)data); in nr_stun_attr_codec_UCHAR_print()
308 nr_stun_attr_codec_UCHAR_encode(nr_stun_attr_info *attr_info, void *data, size_t offset, size_t buf… in nr_stun_attr_codec_UCHAR_encode() argument
314 if (nr_stun_encode_htons(attr_info->type , buflen, buf, &offset) in nr_stun_attr_codec_UCHAR_encode()
325 nr_stun_attr_codec_UCHAR_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, size_t of… in nr_stun_attr_codec_UCHAR_decode() argument
350 nr_stun_attr_codec_UINT4_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_UINT4_print() argument
352 r_log(NR_LOG_STUN, LOG_DEBUG, "%s %s: %u", msg, attr_info->name, *(UINT4*)data); in nr_stun_attr_codec_UINT4_print()
357 nr_stun_attr_codec_UINT4_encode(nr_stun_attr_info *attr_info, void *data, size_t offset, size_t buf… in nr_stun_attr_codec_UINT4_encode() argument
361 if (nr_stun_encode_htons(attr_info->type , buflen, buf, &offset) in nr_stun_attr_codec_UINT4_encode()
372 nr_stun_attr_codec_UINT4_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, size_t of… in nr_stun_attr_codec_UINT4_decode() argument
393 nr_stun_attr_codec_UINT8_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_UINT8_print() argument
395 r_log(NR_LOG_STUN, LOG_DEBUG, "%s %s: %llu", msg, attr_info->name, *(UINT8*)data); in nr_stun_attr_codec_UINT8_print()
400 nr_stun_attr_codec_UINT8_encode(nr_stun_attr_info *attr_info, void *data, size_t offset, size_t buf… in nr_stun_attr_codec_UINT8_encode() argument
404 if (nr_stun_encode_htons(attr_info->type , buflen, buf, &offset) in nr_stun_attr_codec_UINT8_encode()
415 nr_stun_attr_codec_UINT8_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, size_t of… in nr_stun_attr_codec_UINT8_decode() argument
436 nr_stun_attr_codec_addr_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_addr_print() argument
438 …r_log(NR_LOG_STUN, LOG_DEBUG, "%s %s: %s", msg, attr_info->name, ((nr_transport_addr*)data)->as_st… in nr_stun_attr_codec_addr_print()
443 nr_stun_attr_codec_addr_encode(nr_stun_attr_info *attr_info, void *data, size_t offset, size_t bufl… in nr_stun_attr_codec_addr_encode() argument
451 if ((r=nr_stun_encode_htons(attr_info->type, buflen, buf, &offset))) in nr_stun_attr_codec_addr_encode()
489 nr_stun_attr_codec_addr_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, size_t off… in nr_stun_attr_codec_addr_decode() argument
551 nr_stun_attr_codec_data_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_data_print() argument
554 r_dump(NR_LOG_STUN, LOG_DEBUG, attr_info->name, (char*)d->data, d->length); in nr_stun_attr_codec_data_print()
559 nr_stun_attr_codec_data_encode(nr_stun_attr_info *attr_info, void *data, size_t offset, size_t bufl… in nr_stun_attr_codec_data_encode() argument
564 if (nr_stun_encode_htons(attr_info->type , buflen, buf, &offset) in nr_stun_attr_codec_data_encode()
575 nr_stun_attr_codec_data_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, size_t off… in nr_stun_attr_codec_data_decode() argument
605 nr_stun_attr_codec_error_code_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_error_code_print() argument
609 msg, attr_info->name, error_code->number, in nr_stun_attr_codec_error_code_print()
615 nr_stun_attr_codec_error_code_encode(nr_stun_attr_info *attr_info, void *data, size_t offset, size_… in nr_stun_attr_codec_error_code_encode() argument
624 if (nr_stun_encode_htons(attr_info->type , buflen, buf, &offset) in nr_stun_attr_codec_error_code_encode()
638 nr_stun_attr_codec_error_code_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, size… in nr_stun_attr_codec_error_code_decode() argument
680 nr_stun_attr_codec_fingerprint_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_fingerprint_print() argument
683 r_log(NR_LOG_STUN, LOG_DEBUG, "%s %s: %08x", msg, attr_info->name, fingerprint->checksum); in nr_stun_attr_codec_fingerprint_print()
688 nr_stun_attr_codec_fingerprint_encode(nr_stun_attr_info *attr_info, void *data, size_t offset, size… in nr_stun_attr_codec_fingerprint_encode() argument
710 …return nr_stun_attr_codec_UINT4.encode(attr_info, &fingerprint->checksum, offset, buflen, buf, att… in nr_stun_attr_codec_fingerprint_encode()
714 nr_stun_attr_codec_fingerprint_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, siz… in nr_stun_attr_codec_fingerprint_decode() argument
722 …if ((r=nr_stun_attr_codec_UINT4.decode(attr_info, attrlen, buf, offset, buflen, &fingerprint->chec… in nr_stun_attr_codec_fingerprint_decode()
764 nr_stun_attr_codec_flag_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_flag_print() argument
766 r_log(NR_LOG_STUN, LOG_DEBUG, "%s %s: on", msg, attr_info->name); in nr_stun_attr_codec_flag_print()
771 nr_stun_attr_codec_flag_encode(nr_stun_attr_info *attr_info, void *data, size_t offset, size_t bufl… in nr_stun_attr_codec_flag_encode() argument
775 if (nr_stun_encode_htons(attr_info->type , buflen, buf, &offset) in nr_stun_attr_codec_flag_encode()
785 nr_stun_attr_codec_flag_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, size_t off… in nr_stun_attr_codec_flag_decode() argument
803 nr_stun_attr_codec_message_integrity_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_message_integrity_print() argument
806 … r_dump(NR_LOG_STUN, LOG_DEBUG, attr_info->name, (char*)integrity->hash, sizeof(integrity->hash)); in nr_stun_attr_codec_message_integrity_print()
842 nr_stun_attr_codec_message_integrity_encode(nr_stun_attr_info *attr_info, void *data, size_t offset… in nr_stun_attr_codec_message_integrity_encode() argument
850 if (nr_stun_encode_htons(attr_info->type , buflen, buf, &offset) in nr_stun_attr_codec_message_integrity_encode()
861 nr_stun_attr_codec_message_integrity_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *bu… in nr_stun_attr_codec_message_integrity_decode() argument
871 r_log(NR_LOG_STUN, LOG_WARNING, "%s must be 20 bytes, not %d", attr_info->name, attrlen); in nr_stun_attr_codec_message_integrity_decode()
907 nr_stun_attr_codec_noop_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, size_t off… in nr_stun_attr_codec_noop_decode() argument
920 nr_stun_attr_codec_quoted_string_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_quoted_string_print() argument
923 msg, attr_info->name, (char*)data); in nr_stun_attr_codec_quoted_string_print()
928 nr_stun_attr_codec_quoted_string_encode(nr_stun_attr_info *attr_info, void *data, size_t offset, si… in nr_stun_attr_codec_quoted_string_encode() argument
932 return nr_stun_attr_codec_string.encode(attr_info, data, offset, buflen, buf, attrlen); in nr_stun_attr_codec_quoted_string_encode()
936 nr_stun_attr_codec_quoted_string_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, s… in nr_stun_attr_codec_quoted_string_decode() argument
940 return nr_stun_attr_codec_string.decode(attr_info, attrlen, buf, offset, buflen, data); in nr_stun_attr_codec_quoted_string_decode()
951 nr_stun_attr_codec_string_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_string_print() argument
954 msg, attr_info->name, (char*)data); in nr_stun_attr_codec_string_print()
959 nr_stun_attr_codec_string_encode(nr_stun_attr_info *attr_info, void *data, size_t offset, size_t bu… in nr_stun_attr_codec_string_encode() argument
965 if (nr_stun_encode_htons(attr_info->type , buflen, buf, &offset) in nr_stun_attr_codec_string_encode()
976 nr_stun_attr_codec_string_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *buf, size_t o… in nr_stun_attr_codec_string_decode() argument
1013 nr_stun_attr_codec_unknown_attributes_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_unknown_attributes_print() argument
1020 snprintf(str, sizeof(str), "%s %s:", msg, attr_info->name); in nr_stun_attr_codec_unknown_attributes_print()
1031 nr_stun_attr_codec_unknown_attributes_encode(nr_stun_attr_info *attr_info, void *data, size_t offse… in nr_stun_attr_codec_unknown_attributes_encode() argument
1044 if (nr_stun_encode_htons(attr_info->type , buflen, buf, &offset) in nr_stun_attr_codec_unknown_attributes_encode()
1061 nr_stun_attr_codec_unknown_attributes_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *b… in nr_stun_attr_codec_unknown_attributes_decode() argument
1099 nr_stun_attr_codec_xor_mapped_address_print(nr_stun_attr_info *attr_info, char *msg, void *data) in nr_stun_attr_codec_xor_mapped_address_print() argument
1103 msg, attr_info->name, in nr_stun_attr_codec_xor_mapped_address_print()
1110 nr_stun_attr_codec_xor_mapped_address_encode(nr_stun_attr_info *attr_info, void *data, size_t offse… in nr_stun_attr_codec_xor_mapped_address_encode() argument
1128 …if (nr_stun_attr_codec_addr.encode(attr_info, &xor_mapped_address->masked, offset, buflen, buf, at… in nr_stun_attr_codec_xor_mapped_address_encode()
1135 nr_stun_attr_codec_xor_mapped_address_decode(nr_stun_attr_info *attr_info, size_t attrlen, UCHAR *b… in nr_stun_attr_codec_xor_mapped_address_decode() argument
1142 …if ((r=nr_stun_attr_codec_addr.decode(attr_info, attrlen, buf, offset, buflen, &xor_mapped_address… in nr_stun_attr_codec_xor_mapped_address_decode()
1314 nr_stun_attr_info *attr_info; in nr_stun_encode_message() local
1348 if ((r=nr_stun_find_attr_info(attr->type, &attr_info))) { in nr_stun_encode_message()
1353 attr->name = attr_info->name; in nr_stun_encode_message()
1354 attr->type_name = attr_info->codec->name; in nr_stun_encode_message()
1357 if (attr_info->codec->encode != 0) { in nr_stun_encode_message()
1358 …if ((r=attr_info->codec->encode(attr_info, &attr->u, msg->length, sizeof(msg->buffer), msg->buffer… in nr_stun_encode_message()
1359 r_log(NR_LOG_STUN, LOG_WARNING, "Unable to encode %s", attr_info->name); in nr_stun_encode_message()
1366 if (attr_info->illegal) { in nr_stun_encode_message()
1367 if ((r=attr_info->illegal(attr_info, attr->length, &attr->u))) in nr_stun_encode_message()
1371 attr_info->codec->print(attr_info, "Encoded", &attr->u); in nr_stun_encode_message()
1387 … r_log(NR_LOG_STUN, LOG_WARNING, "Missing encode function for attribute: %s", attr_info->name); in nr_stun_encode_message()
1412 nr_stun_attr_info *attr_info; in nr_stun_decode_message() local
1481 if ((r=nr_stun_find_attr_info(attr->type, &attr_info))) { in nr_stun_decode_message()
1489 attr_info->name = attr_info->name; in nr_stun_decode_message()
1490 attr->type_name = attr_info->codec->name; in nr_stun_decode_message()
1512 …if ((r=attr_info->codec->decode(attr_info, attr->length, msg->buffer, offset+4, msg->length, &attr… in nr_stun_decode_message()
1514 r_log(NR_LOG_STUN, LOG_INFO, "Skipping %s", attr_info->name); in nr_stun_decode_message()
1517 r_log(NR_LOG_STUN, LOG_WARNING, "Unable to parse %s", attr_info->name); in nr_stun_decode_message()
1523 attr_info->codec->print(attr_info, "Parsed", &attr->u); in nr_stun_decode_message()
1527 if (attr_info->illegal) { in nr_stun_decode_message()
1528 if ((r=attr_info->illegal(attr_info, attr->length, &attr->u))) { in nr_stun_decode_message()