From 1a2a480021c3f6f48fdc423cd41e2c63009300f5 Mon Sep 17 00:00:00 2001 From: "Byron Campen [:bwc]" Date: Fri, 14 Nov 2014 17:37:26 -0800 Subject: [PATCH] Bug 1091242 - Part 5.1: Whitespace-only modifications to sipcc sdp code. r=ehugg --- media/webrtc/signaling/src/sdp/sipcc/ccsdp.h | 4 +- media/webrtc/signaling/src/sdp/sipcc/sdp.h | 120 +- .../signaling/src/sdp/sipcc/sdp_access.c | 2 +- .../webrtc/signaling/src/sdp/sipcc/sdp_attr.c | 1088 ++++++++--------- .../signaling/src/sdp/sipcc/sdp_attr_access.c | 12 +- .../signaling/src/sdp/sipcc/sdp_config.c | 8 +- .../webrtc/signaling/src/sdp/sipcc/sdp_main.c | 2 +- .../signaling/src/sdp/sipcc/sdp_private.h | 12 +- .../signaling/src/sdp/sipcc/sdp_token.c | 128 +- .../signaling/src/sdp/sipcc/sdp_utils.c | 264 ++-- 10 files changed, 820 insertions(+), 820 deletions(-) diff --git a/media/webrtc/signaling/src/sdp/sipcc/ccsdp.h b/media/webrtc/signaling/src/sdp/sipcc/ccsdp.h index 8e0f1d44342..e3ce6901da7 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/ccsdp.h +++ b/media/webrtc/signaling/src/sdp/sipcc/ccsdp.h @@ -410,7 +410,7 @@ int ccsdpGetBandwidthValue (void *sdp_handle, uint16_t level, uint16_t inst_num) * @param[in] inst_num Pointer to a uint16_t in which to return the instance number of the newly added attribute. * * @return sdp_result_e - * SDP_SUCCESS Attribute was added successfully. + * SDP_SUCCESS Attribute was added successfully. * SDP_NO_RESOURCE No memory avail for new attribute. * SDP_INVALID_PARAMETER Specified media line is not defined. */ @@ -427,7 +427,7 @@ sdp_result_e ccsdpAddNewAttr (void *sdp_handle, uint16_t level, uint8_t cap_num, * @param[out] *val max-dpb value. * * @return sdp_result_e - * SDP_SUCCESS Attribute was added successfully. + * SDP_SUCCESS Attribute was added successfully. */ sdp_result_e ccsdpAttrGetFmtpMaxDpb (void *sdp_handle, uint16_t level, diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp.h b/media/webrtc/signaling/src/sdp/sipcc/sdp.h index 837e3396e7e..1353991056d 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp.h +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp.h @@ -135,8 +135,8 @@ typedef enum { /* Connection Network Type */ typedef enum { SDP_NT_INTERNET = 0, /* 0 -> IP - In SDP "IN" is defined */ - /* to mean "Internet" */ - SDP_NT_ATM, /* 1 -> ATM */ + /* to mean "Internet" */ + SDP_NT_ATM, /* 1 -> ATM */ SDP_NT_FR, /* 2 -> FRAME RELAY */ SDP_NT_LOCAL, /* 3 -> local */ SDP_MAX_NETWORK_TYPES, @@ -489,7 +489,7 @@ typedef enum sdp_srtp_fec_order_t_ { SDP_SRTP_THEN_FEC, /* upon sending perform SRTP then FEC */ SDP_FEC_THEN_SRTP, /* upon sending perform FEC then SRTP */ SDP_SRTP_FEC_SPLIT /* upon sending perform SRTP Encryption, - * then FEC, the SRTP Authentication */ + * then FEC, the SRTP Authentication */ } sdp_srtp_fec_order_t; @@ -1097,13 +1097,13 @@ extern void sdp_require_session_name(void *config_p, tinybool sess_name_required); extern void sdp_require_timespec(void *config_p, tinybool timespec_required); extern void sdp_media_supported(void *config_p, sdp_media_e media_type, - tinybool media_supported); + tinybool media_supported); extern void sdp_nettype_supported(void *config_p, sdp_nettype_e nettype, - tinybool nettype_supported); + tinybool nettype_supported); extern void sdp_addrtype_supported(void *config_p, sdp_addrtype_e addrtype, - tinybool addrtype_supported); + tinybool addrtype_supported); extern void sdp_transport_supported(void *config_p, sdp_transport_e transport, - tinybool transport_supported); + tinybool transport_supported); extern void sdp_allow_choose(void *config_p, sdp_choose_param_e param, tinybool choose_allowed); @@ -1176,7 +1176,7 @@ extern sdp_result_e sdp_set_conn_addrtype(void *sdp_p, u16 level, extern sdp_result_e sdp_set_conn_address(void *sdp_p, u16 level, const char *address); extern sdp_result_e sdp_set_mcast_addr_fields(void *sdp_ptr, u16 level, - u16 ttl, u16 num_addr); + u16 ttl, u16 num_addr); extern tinybool sdp_media_line_valid(void *sdp_ptr, u16 level); extern u16 sdp_get_num_media_lines(void *sdp_ptr); @@ -1380,7 +1380,7 @@ extern u16 sdp_attr_get_fmtp_payload_type(void *sdp_ptr, u16 level, extern sdp_ne_res_e sdp_attr_fmtp_is_range_set(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u8 low_val, u8 high_val); extern tinybool sdp_attr_fmtp_valid(void *sdp_ptr, u16 level, u8 cap_num, - u16 inst_num, u16 appl_maxval, u32* evt_array); + u16 inst_num, u16 appl_maxval, u32* evt_array); extern sdp_result_e sdp_attr_set_fmtp_payload_type(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 payload_num); @@ -1515,22 +1515,22 @@ extern sdp_result_e sdp_attr_set_fmtp_level_asymmetry_allowed (void *sdp_ptr, u16 level_asymmetry_allowed); extern sdp_result_e sdp_attr_set_fmtp_redundant_pic_cap (void *sdp_ptr, - u16 level, - u8 cap_num, - u16 inst_num, - tinybool redundant_pic_cap); + u16 level, + u8 cap_num, + u16 inst_num, + tinybool redundant_pic_cap); extern sdp_result_e sdp_attr_set_fmtp_max_mbps (void *sdp_ptr, - u16 level, - u8 cap_num, - u16 inst_num, - u32 max_mbps); + u16 level, + u8 cap_num, + u16 inst_num, + u32 max_mbps); extern sdp_result_e sdp_attr_set_fmtp_max_fs (void *sdp_ptr, - u16 level, - u8 cap_num, - u16 inst_num, - u32 max_fs); + u16 level, + u8 cap_num, + u16 inst_num, + u32 max_fs); extern sdp_result_e sdp_attr_set_fmtp_max_fr (void *sdp_ptr, u16 level, @@ -1539,30 +1539,30 @@ extern sdp_result_e sdp_attr_set_fmtp_max_fr (void *sdp_ptr, u32 max_fr); extern sdp_result_e sdp_attr_set_fmtp_max_cpb (void *sdp_ptr, - u16 level, - u8 cap_num, - u16 inst_num, - u32 max_cpb); + u16 level, + u8 cap_num, + u16 inst_num, + u32 max_cpb); extern sdp_result_e sdp_attr_set_fmtp_max_dpb (void *sdp_ptr, - u16 level, - u8 cap_num, - u16 inst_num, - u32 max_dpb); + u16 level, + u8 cap_num, + u16 inst_num, + u32 max_dpb); extern sdp_result_e sdp_attr_set_fmtp_max_br (void *sdp_ptr, - u16 level, - u8 cap_num, - u16 inst_num, - u32 max_br); + u16 level, + u8 cap_num, + u16 inst_num, + u32 max_br); extern sdp_result_e sdp_attr_set_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, - u32 max_rcmd_nalu_size); + u32 max_rcmd_nalu_size); extern sdp_result_e sdp_attr_set_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, - u32 deint_buf_cap); + u32 deint_buf_cap); extern sdp_result_e sdp_attr_set_fmtp_h264_parameter_add (void *sdp_ptr, u16 level, @@ -1706,8 +1706,8 @@ extern sdp_result_e sdp_attr_get_fmtp_init_buf_time (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32 *val); extern sdp_result_e sdp_attr_get_fmtp_max_rcmd_nalu_size (void *sdp_ptr, - u16 level, u8 cap_num, - u16 inst_num, u32 *val); + u16 level, u8 cap_num, + u16 inst_num, u32 *val); extern sdp_result_e sdp_attr_get_fmtp_max_mbps (void *sdp_ptr, u16 level, @@ -1857,7 +1857,7 @@ extern sdp_result_e sdp_set_bw(void *sdp_ptr, u16 level, u16 inst_num, sdp_bw_modifier_e value, u32 bw_val); extern sdp_group_attr_e sdp_get_group_attr(void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num); + u8 cap_num, u16 inst_num); extern sdp_result_e sdp_set_group_attr(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, sdp_group_attr_e value); @@ -1941,63 +1941,63 @@ extern int32 sdp_attr_get_sdescriptions_tag(void *sdp_ptr, u16 level, u8 cap_num, - u16 inst_num); + u16 inst_num); extern sdp_srtp_crypto_suite_t sdp_attr_get_sdescriptions_crypto_suite(void *sdp_ptr, u16 level, u8 cap_num, - u16 inst_num); + u16 inst_num); extern const char* sdp_attr_get_sdescriptions_key(void *sdp_ptr, u16 level, u8 cap_num, - u16 inst_num); + u16 inst_num); extern const char* sdp_attr_get_sdescriptions_salt(void *sdp_ptr, u16 level, u8 cap_num, - u16 inst_num); + u16 inst_num); extern const char* sdp_attr_get_sdescriptions_lifetime(void *sdp_ptr, u16 level, u8 cap_num, - u16 inst_num); + u16 inst_num); extern sdp_result_e sdp_attr_get_sdescriptions_mki(void *sdp_ptr, u16 level, u8 cap_num, - u16 inst_num, - const char **mki_value, - u16 *mki_length); + u16 inst_num, + const char **mki_value, + u16 *mki_length); extern const char* sdp_attr_get_sdescriptions_session_params(void *sdp_ptr, u16 level, u8 cap_num, - u16 inst_num); + u16 inst_num); extern unsigned char sdp_attr_get_sdescriptions_key_size(void *sdp_ptr, u16 level, - u8 cap_num, - u16 inst_num); + u8 cap_num, + u16 inst_num); extern unsigned char sdp_attr_get_sdescriptions_salt_size(void *sdp_ptr, u16 level, - u8 cap_num, - u16 inst_num); + u8 cap_num, + u16 inst_num); extern unsigned long sdp_attr_get_srtp_crypto_selection_flags(void *sdp_ptr, u16 level, - u8 cap_num, - u16 inst_num); + u8 cap_num, + u16 inst_num); extern sdp_result_e sdp_attr_set_sdescriptions_tag(void *sdp_ptr, u16 level, @@ -2028,21 +2028,21 @@ extern sdp_result_e sdp_attr_set_sdescriptions_mki(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, char *mki_value, - u16 mki_length); + u16 mki_length); extern sdp_result_e sdp_attr_set_sdescriptions_key_size(void *sdp_ptr, u16 level, - u8 cap_num, - u16 inst_num, - unsigned char key_size); + u8 cap_num, + u16 inst_num, + unsigned char key_size); extern sdp_result_e sdp_attr_set_sdescriptions_salt_size(void *sdp_ptr, u16 level, - u8 cap_num, - u16 inst_num, - unsigned char salt_size); + u8 cap_num, + u16 inst_num, + unsigned char salt_size); sdp_result_e sdp_attr_get_ice_attribute (void *sdp_ptr, u16 level, diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c index 2143f2eae84..20e5b51e61f 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c @@ -1745,7 +1745,7 @@ u32 sdp_get_media_payload_type (void *sdp_ptr, u16 level, u16 payload_num, } if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_H264) == 0) { int fmtp_inst = sdp_find_fmtp_inst(sdp_p, level, - mca_p->payload_type[payload_num-1]); + mca_p->payload_type[payload_num-1]); if (fmtp_inst < 0) { return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_H264_P0)); } else { diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c index 5ace5c6dc7d..95bfaf298ae 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c @@ -149,7 +149,7 @@ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) /* If this is an X-cpar or cpar attribute, set the flag. The attribute * type will be changed by the parse. */ if ((attr_p->type == SDP_ATTR_X_CPAR) || - (attr_p->type == SDP_ATTR_CPAR)) { + (attr_p->type == SDP_ATTR_CPAR)) { xcpar_flag = TRUE; } @@ -505,76 +505,76 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "= \t", &result1); if (result1 == SDP_SUCCESS) { if (cpr_strncasecmp(tmp, sdp_fmtp_codec_param[1].name, - sdp_fmtp_codec_param[1].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + sdp_fmtp_codec_param[1].strlen) == 0) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "annexb"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } + } + } tok = tmp; - tok++; - if (cpr_strncasecmp(tok,sdp_fmtp_codec_param_val[0].name, - sdp_fmtp_codec_param_val[0].strlen) == 0) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annexb_required = TRUE; - fmtp_p->annexb = TRUE; - } else if (cpr_strncasecmp(tok,sdp_fmtp_codec_param_val[1].name, - sdp_fmtp_codec_param_val[1].strlen) == 0) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annexb_required = TRUE; - fmtp_p->annexb = FALSE; - } else { + tok++; + if (cpr_strncasecmp(tok,sdp_fmtp_codec_param_val[0].name, + sdp_fmtp_codec_param_val[0].strlen) == 0) { + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->annexb_required = TRUE; + fmtp_p->annexb = TRUE; + } else if (cpr_strncasecmp(tok,sdp_fmtp_codec_param_val[1].name, + sdp_fmtp_codec_param_val[1].strlen) == 0) { + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->annexb_required = TRUE; + fmtp_p->annexb = FALSE; + } else { sdp_attr_fmtp_invalid_value(sdp_p, "annexb", tok); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - codec_info_found = TRUE; + } + codec_info_found = TRUE; - } else if (cpr_strncasecmp(tmp, sdp_fmtp_codec_param[0].name, - sdp_fmtp_codec_param[0].strlen) == 0) { + } else if (cpr_strncasecmp(tmp, sdp_fmtp_codec_param[0].name, + sdp_fmtp_codec_param[0].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "annexa"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; - if (cpr_strncasecmp(tok,sdp_fmtp_codec_param_val[0].name, - sdp_fmtp_codec_param_val[0].strlen) == 0) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annexa = TRUE; - fmtp_p->annexa_required = TRUE; - } else if (cpr_strncasecmp(tok,sdp_fmtp_codec_param_val[1].name, - sdp_fmtp_codec_param_val[1].strlen) == 0) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->annexa = FALSE; - fmtp_p->annexa_required = TRUE; - } else { + } + } + tok = tmp; + tok++; + if (cpr_strncasecmp(tok,sdp_fmtp_codec_param_val[0].name, + sdp_fmtp_codec_param_val[0].strlen) == 0) { + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->annexa = TRUE; + fmtp_p->annexa_required = TRUE; + } else if (cpr_strncasecmp(tok,sdp_fmtp_codec_param_val[1].name, + sdp_fmtp_codec_param_val[1].strlen) == 0) { + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->annexa = FALSE; + fmtp_p->annexa_required = TRUE; + } else { sdp_attr_fmtp_invalid_value(sdp_p, "annexa", tok); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - codec_info_found = TRUE; + } + codec_info_found = TRUE; - } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[2].name, + } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[2].name, sdp_fmtp_codec_param[2].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "bitrate"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } } tok = tmp; tok++; @@ -619,10 +619,10 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->mode = (u32) strtoul_result; codec_info_found = TRUE; - } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[3].name, + } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[3].name, sdp_fmtp_codec_param[3].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "qcif"); @@ -641,15 +641,15 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "qcif", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->qcif = (u16) strtoul_result; - codec_info_found = TRUE; - } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[4].name, + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->qcif = (u16) strtoul_result; + codec_info_found = TRUE; + } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[4].name, sdp_fmtp_codec_param[4].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "cif"); @@ -668,51 +668,51 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "cif", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->cif = (u16) strtoul_result; - codec_info_found = TRUE; - } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[5].name, + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->cif = (u16) strtoul_result; + codec_info_found = TRUE; + } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[5].name, sdp_fmtp_codec_param[5].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "maxbr"); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } } tok = tmp; - tok++; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || + if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > USHRT_MAX) { sdp_attr_fmtp_invalid_value(sdp_p, "maxbr", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->maxbr = (u16) strtoul_result; - codec_info_found = TRUE; - } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[6].name, + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->maxbr = (u16) strtoul_result; + codec_info_found = TRUE; + } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[6].name, sdp_fmtp_codec_param[6].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "sqcif"); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } - } - tok = tmp; - tok++; + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); @@ -724,22 +724,22 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, return SDP_INVALID_PARAMETER; } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->sqcif = (u16) strtoul_result; - codec_info_found = TRUE; - } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[7].name, + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->sqcif = (u16) strtoul_result; + codec_info_found = TRUE; + } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[7].name, sdp_fmtp_codec_param[7].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "cif4"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); @@ -749,24 +749,24 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "cif4", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->cif4 = (u16) strtoul_result; - codec_info_found = TRUE; - } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[8].name, + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->cif4 = (u16) strtoul_result; + codec_info_found = TRUE; + } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[8].name, sdp_fmtp_codec_param[8].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "cif16"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); @@ -776,25 +776,25 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "cif16", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->cif16 = (u16) strtoul_result; - codec_info_found = TRUE; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->cif16 = (u16) strtoul_result; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[9].name, sdp_fmtp_codec_param[9].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "custom"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; temp=PL_strtok_r(tok, ",", &strtok_state); - iter++; + } + } + tok = tmp; + tok++; temp=PL_strtok_r(tok, ",", &strtok_state); + iter++; if (temp) { iter=1; while (temp != NULL) { @@ -819,29 +819,29 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } /* custom x,y and mpi values from tmp */ - if (!custom_x || !custom_y || !custom_mpi) { + if (!custom_x || !custom_y || !custom_mpi) { sdp_attr_fmtp_invalid_value(sdp_p, "x/y/MPI", temp); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->custom_x = custom_x; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->custom_x = custom_x; fmtp_p->custom_y = custom_y; fmtp_p->custom_mpi = custom_mpi; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[10].name, sdp_fmtp_codec_param[10].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "par"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; temp=PL_strtok_r(tok, ":", &strtok_state); + } + } + tok = tmp; + tok++; temp=PL_strtok_r(tok, ":", &strtok_state); if (temp) { iter=1; /* get par width and par height for the aspect ratio */ @@ -863,28 +863,28 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, iter++; } } - if (!par_width || !par_height) { + if (!par_width || !par_height) { sdp_attr_fmtp_invalid_value(sdp_p, "par_width or par_height", temp); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->par_width = par_width; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->par_width = par_width; fmtp_p->par_height = par_height; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[11].name, sdp_fmtp_codec_param[11].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "cpcf"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; temp=PL_strtok_r(tok, ".", &strtok_state); + } + } + tok = tmp; + tok++; temp=PL_strtok_r(tok, ".", &strtok_state); if ( temp != NULL ) { errno = 0; strtoul_result = strtoul(temp, &strtoul_end, 10); @@ -896,27 +896,27 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } } - if (!cpcf) { + if (!cpcf) { sdp_attr_fmtp_invalid_value(sdp_p, "cpcf", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->cpcf = cpcf; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[12].name, sdp_fmtp_codec_param[12].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "bpp"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); @@ -925,24 +925,24 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "bpp", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->bpp = (u16) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[13].name, sdp_fmtp_codec_param[13].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "hrd"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); @@ -951,24 +951,24 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "hrd", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->hrd = (u16) strtoul_result; - codec_info_found = TRUE; - } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[14].name, + codec_info_found = TRUE; + } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[14].name, sdp_fmtp_codec_param[14].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "profile"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); @@ -978,146 +978,146 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "profile", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->profile = (short) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[15].name, sdp_fmtp_codec_param[15].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "level"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || + if (errno || tok == strtoul_end || strtoul_result > SDP_MAX_LEVEL_VALUE) { sdp_attr_fmtp_invalid_value(sdp_p, "level", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->level = (short) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[16].name, sdp_fmtp_codec_param[16].strlen) == 0) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->is_interlace = TRUE; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[17].name, sdp_fmtp_codec_param[17].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "profile_level_id"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + } + } + tok = tmp; + tok++; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; sstrncpy(fmtp_p->profile_level_id , tok, sizeof(fmtp_p->profile_level_id)); - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[18].name, sdp_fmtp_codec_param[18].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "parameter_sets"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + } + } + tok = tmp; + tok++; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; sstrncpy(fmtp_p->parameter_sets , tok, sizeof(fmtp_p->parameter_sets)); - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[19].name, sdp_fmtp_codec_param[19].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "packetization_mode"); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result > 2) { + if (errno || tok == strtoul_end || strtoul_result > 2) { sdp_attr_fmtp_invalid_value(sdp_p, "packetization_mode", tok); sdp_p->conf_p->num_invalid_param++; SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->packetization_mode = (int16) strtoul_result; codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[20].name, sdp_fmtp_codec_param[20].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "interleaving_depth"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > USHRT_MAX) { + if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > USHRT_MAX) { sdp_attr_fmtp_invalid_value(sdp_p, "interleaving_depth", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->interleaving_depth = (u16) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[21].name, sdp_fmtp_codec_param[21].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "deint_buf"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; if (sdp_checkrange(sdp_p, tok, &l_val) == TRUE) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->deint_buf_req = (u32) l_val; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->deint_buf_req = (u32) l_val; fmtp_p->flag |= SDP_DEINT_BUF_REQ_FLAG; - codec_info_found = TRUE; + codec_info_found = TRUE; } else { sdp_attr_fmtp_invalid_value(sdp_p, "deint_buf_req", tok); SDP_FREE(temp_ptr); @@ -1125,48 +1125,48 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[22].name, sdp_fmtp_codec_param[22].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "max_don_diff"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > UINT_MAX) { + if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > UINT_MAX) { sdp_attr_fmtp_invalid_value(sdp_p, "max_don_diff", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_don_diff = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[23].name, sdp_fmtp_codec_param[23].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "init_buf_time"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; if (sdp_checkrange(sdp_p, tok, &l_val) == TRUE) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->init_buf_time = (u32) l_val; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->init_buf_time = (u32) l_val; fmtp_p->flag |= SDP_INIT_BUF_TIME_FLAG; - codec_info_found = TRUE; + codec_info_found = TRUE; } else { sdp_attr_fmtp_invalid_value(sdp_p, "init_buf_time", tok); SDP_FREE(temp_ptr); @@ -1174,43 +1174,43 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[24].name, sdp_fmtp_codec_param[24].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "max_mbps"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > UINT_MAX) { + if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > UINT_MAX) { sdp_attr_fmtp_invalid_value(sdp_p, "max_mbps", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } + } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_mbps = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[25].name, sdp_fmtp_codec_param[25].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "max-fs"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); @@ -1219,98 +1219,98 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "max-fs", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_fs = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[26].name, sdp_fmtp_codec_param[26].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "max_cbp"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > UINT_MAX) { + if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > UINT_MAX) { sdp_attr_fmtp_invalid_value(sdp_p, "max_cpb", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_cpb = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[27].name, sdp_fmtp_codec_param[27].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "max_dpb"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > UINT_MAX) { + if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > UINT_MAX) { sdp_attr_fmtp_invalid_value(sdp_p, "max_dpb", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_dpb = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[28].name, sdp_fmtp_codec_param[28].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "max_br"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > UINT_MAX) { + if (errno || tok == strtoul_end || strtoul_result == 0 || strtoul_result > UINT_MAX) { sdp_attr_fmtp_invalid_value(sdp_p, "max_br", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->max_br = (u32) strtoul_result; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[29].name, sdp_fmtp_codec_param[29].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "redundant_pic_cap"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); @@ -1321,25 +1321,25 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_p->redundant_pic_cap = FALSE; } - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[30].name, sdp_fmtp_codec_param[30].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "deint_buf_cap"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; if (sdp_checkrange(sdp_p, tok, &l_val) == TRUE) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->deint_buf_cap = (u32) l_val; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->deint_buf_cap = (u32) l_val; fmtp_p->flag |= SDP_DEINT_BUF_CAP_FLAG; - codec_info_found = TRUE; + codec_info_found = TRUE; } else { sdp_attr_fmtp_invalid_value(sdp_p, "deint_buf_cap", tok); SDP_FREE(temp_ptr); @@ -1347,22 +1347,22 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[31].name, sdp_fmtp_codec_param[31].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "max_rcmd_nalu_size"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; + } + } + tok = tmp; + tok++; if (sdp_checkrange(sdp_p, tok, &l_val) == TRUE) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->max_rcmd_nalu_size = (u32) l_val; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->max_rcmd_nalu_size = (u32) l_val; fmtp_p->flag |= SDP_MAX_RCMD_NALU_SIZE_FLAG; - codec_info_found = TRUE; + codec_info_found = TRUE; } else { sdp_attr_fmtp_invalid_value(sdp_p, "max_rcmd_nalu_size", tok); SDP_FREE(temp_ptr); @@ -1394,29 +1394,29 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[33].name, sdp_fmtp_codec_param[33].strlen) == 0) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->annex_d = TRUE; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[34].name, sdp_fmtp_codec_param[34].strlen) == 0) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->annex_f = TRUE; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[35].name, sdp_fmtp_codec_param[35].strlen) == 0) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->annex_i = TRUE; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[36].name, sdp_fmtp_codec_param[36].strlen) == 0) { fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->annex_j = TRUE; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[37].name, sdp_fmtp_codec_param[36].strlen) == 0) { - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; fmtp_p->annex_t = TRUE; - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[38].name, sdp_fmtp_codec_param[38].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); @@ -1424,7 +1424,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "annex_k"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } } @@ -1449,7 +1449,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "annex_n"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } } @@ -1474,7 +1474,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "annex_p"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } } @@ -1531,17 +1531,17 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[43].name, sdp_fmtp_codec_param[43].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "maxaveragebitrate"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } } tok = tmp; - tok++; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); @@ -1549,131 +1549,131 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_attr_fmtp_invalid_value(sdp_p, "maxaveragebitrate", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->maxaveragebitrate = (u32) strtoul_result; - codec_info_found = TRUE; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->maxaveragebitrate = (u32) strtoul_result; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[44].name, sdp_fmtp_codec_param[44].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "usedtx"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } } tok = tmp; - tok++; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result > 1) { + if (errno || tok == strtoul_end || strtoul_result > 1) { sdp_attr_fmtp_invalid_value(sdp_p, "usedtx", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->usedtx = (u16) strtoul_result; - codec_info_found = TRUE; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->usedtx = (u16) strtoul_result; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[45].name, sdp_fmtp_codec_param[45].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "stereo"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } } tok = tmp; - tok++; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result > 1) { + if (errno || tok == strtoul_end || strtoul_result > 1) { sdp_attr_fmtp_invalid_value(sdp_p, "stereo", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->stereo = (u16) strtoul_result; - codec_info_found = TRUE; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->stereo = (u16) strtoul_result; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[46].name, sdp_fmtp_codec_param[46].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "useinbandfec"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } } tok = tmp; - tok++; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result > 1) { + if (errno || tok == strtoul_end || strtoul_result > 1) { sdp_attr_fmtp_invalid_value(sdp_p, "useinbandfec", tok); SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->useinbandfec = (u16) strtoul_result; - codec_info_found = TRUE; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->useinbandfec = (u16) strtoul_result; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[47].name, sdp_fmtp_codec_param[47].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "maxcodedaudiobandwidth"); sdp_p->conf_p->num_invalid_param++; - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - } - tok = tmp; - tok++; - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + } + } + tok = tmp; + tok++; + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; sstrncpy(fmtp_p->maxcodedaudiobandwidth , tok, sizeof(fmtp_p->maxcodedaudiobandwidth)); - codec_info_found = TRUE; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[48].name, sdp_fmtp_codec_param[48].strlen) == 0) { - fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); - if (result1 != SDP_SUCCESS) { + fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", &result1); + if (result1 != SDP_SUCCESS) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), " \t", &result1); - if (result1 != SDP_SUCCESS) { + if (result1 != SDP_SUCCESS) { sdp_attr_fmtp_no_value(sdp_p, "cbr"); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; } } tok = tmp; - tok++; + tok++; errno = 0; strtoul_result = strtoul(tok, &strtoul_end, 10); - if (errno || tok == strtoul_end || strtoul_result > 1) { + if (errno || tok == strtoul_end || strtoul_result > 1) { sdp_attr_fmtp_invalid_value(sdp_p, "cbr", tok); - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return SDP_INVALID_PARAMETER; - } - fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; - fmtp_p->cbr = (u16) strtoul_result; - codec_info_found = TRUE; + } + fmtp_p->fmtp_format = SDP_FMTP_CODEC_INFO; + fmtp_p->cbr = (u16) strtoul_result; + codec_info_found = TRUE; } else if (cpr_strncasecmp(tmp,sdp_fmtp_codec_param[49].name, sdp_fmtp_codec_param[49].strlen) == 0) { fmtp_ptr = sdp_getnextstrtok(fmtp_ptr, tmp, sizeof(tmp), "; \t", @@ -1771,7 +1771,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.fmtp.cpcf, attr_p->attr.fmtp.bpp, attr_p->attr.fmtp.hrd - ); + ); } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { @@ -1784,7 +1784,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.fmtp.is_interlace ? "YES":"NO"); } - if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed H.264 attributes: profile-level-id=%s, parameter-sets=%s, packetization-mode=%d level-asymmetry-allowed=%d interleaving-depth=%d deint-buf-req=%u max-don-diff=%u, init_buf-time=%u\n", sdp_p->debug_str, attr_p->attr.fmtp.profile_level_id, @@ -1795,10 +1795,10 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.fmtp.deint_buf_req, attr_p->attr.fmtp.max_don_diff, attr_p->attr.fmtp.init_buf_time - ); + ); } - if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("\n%s Parsed H.264 opt attributes: max-mbps=%u, max-fs=%u, max-cpb=%u max-dpb=%u max-br=%u redundant-pic-cap=%d, deint-buf-cap=%u, max-rcmd-nalu-size=%u , parameter-add=%d\n", sdp_p->debug_str, attr_p->attr.fmtp.max_mbps, @@ -1819,16 +1819,16 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.fmtp.annex_f, attr_p->attr.fmtp.annex_i, attr_p->attr.fmtp.annex_j, attr_p->attr.fmtp.annex_t, attr_p->attr.fmtp.annex_k_val, - attr_p->attr.fmtp.annex_n_val, + attr_p->attr.fmtp.annex_n_val, attr_p->attr.fmtp.annex_p_val_picture_resize, attr_p->attr.fmtp.annex_p_val_warp); } - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return (SDP_SUCCESS); } else { done = FALSE; - fmtp_ptr = src_ptr; + fmtp_ptr = src_ptr; tmp[0] = '\0'; } @@ -1856,7 +1856,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, "%s Warning: Invalid named events specified for fmtp attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return (SDP_INVALID_PARAMETER); } @@ -1875,7 +1875,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, "%s Warning: No named events specified for fmtp attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; - SDP_FREE(temp_ptr); + SDP_FREE(temp_ptr); return (SDP_INVALID_PARAMETER); } @@ -2073,7 +2073,7 @@ sdp_result_e sdp_build_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string /* crossed a bitmap word boundary */ mask = SDP_NE_BIT_0; if (!range_start && !range_end && !fmtp_p->bmap[mapword]) { - /* no events in this word, skip to the last event id + /* no events in this word, skip to the last event id * in this bitmap word. */ event_id += SDP_NE_BITS_PER_WORD - 1; continue; @@ -2110,9 +2110,9 @@ sdp_result_e sdp_build_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string } } - flex_string_append(fs, "\r\n"); + flex_string_append(fs, "\r\n"); - return SDP_SUCCESS; + return SDP_SUCCESS; } sdp_result_e sdp_parse_attr_sctpmap(sdp_t *sdp_p, sdp_attr_t *attr_p, @@ -2609,7 +2609,7 @@ sdp_result_e sdp_build_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string * rtpmap field in the sdp_attr_t is used to store both mappings. */ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, - const char *ptr) + const char *ptr) { sdp_result_e result; @@ -2642,7 +2642,7 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the clockrate. */ attr_p->attr.transport_map.clockrate = - sdp_getnextnumtok(ptr, &ptr, "/ \t", &result); + sdp_getnextnumtok(ptr, &ptr, "/ \t", &result); if (result != SDP_SUCCESS) { sdp_parse_error(sdp_p->peerconnection, "%s Warning: No clockrate specified for " @@ -2655,7 +2655,7 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, if (*ptr == '/') { /* If a '/' exists, expect something valid beyond it. */ attr_p->attr.transport_map.num_chan = - (u16)sdp_getnextnumtok(ptr, &ptr, "/ \t", &result); + (u16)sdp_getnextnumtok(ptr, &ptr, "/ \t", &result); if (result != SDP_SUCCESS) { sdp_parse_error(sdp_p->peerconnection, "%s Warning: Invalid number of channels parameter" @@ -2686,7 +2686,7 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, * rtpmap field in the sdp_attr_t is used for both mappings. */ sdp_result_e sdp_build_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, - flex_string *fs) + flex_string *fs) { if (attr_p->attr.transport_map.num_chan == 1) { flex_string_sprintf(fs, "a=%s:%u %s/%u\r\n", @@ -3136,7 +3136,7 @@ sdp_result_e sdp_build_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, (cap_p->transport >= SDP_MAX_TRANSPORT_TYPES)) { CSFLogDebug(logTag, logTag, "%s Media or transport type invalid for %s " "attribute, unable to build.", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type)); + sdp_get_attr_name(attr_p->type)); sdp_p->conf_p->num_invalid_param++; /* Return success so build won't fail. */ return (SDP_SUCCESS); @@ -3205,14 +3205,14 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Make sure we've processed a valid X-cap/cdsc attr prior to this and * if so, get the cap pointer. */ if (sdp_p->cap_valid == TRUE) { - sdp_attr_e cap_type; + sdp_attr_e cap_type; - if (attr_p->type == SDP_ATTR_CPAR) { - cap_type = SDP_ATTR_CDSC; - } else { - /* Default to X-CAP for everything else */ - cap_type = SDP_ATTR_X_CAP; - } + if (attr_p->type == SDP_ATTR_CPAR) { + cap_type = SDP_ATTR_CDSC; + } else { + /* Default to X-CAP for everything else */ + cap_type = SDP_ATTR_X_CAP; + } if (sdp_p->mca_count == 0) { cap_attr_p = sdp_find_attr(sdp_p, SDP_SESSION_LEVEL, 0, @@ -3226,10 +3226,10 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_parse_error(sdp_p->peerconnection, "%s Warning: %s attribute specified with no " "prior %s attribute", sdp_p->debug_str, - sdp_get_attr_name(attr_p->type), - (attr_p->type == SDP_ATTR_CPAR)? - (sdp_get_attr_name(SDP_ATTR_CDSC)) : - (sdp_get_attr_name(SDP_ATTR_X_CAP)) ); + sdp_get_attr_name(attr_p->type), + (attr_p->type == SDP_ATTR_CPAR)? + (sdp_get_attr_name(SDP_ATTR_CDSC)) : + (sdp_get_attr_name(SDP_ATTR_X_CAP)) ); sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } @@ -3348,17 +3348,17 @@ sdp_result_e sdp_build_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) { sdp_result_e result; - const char *cpar_name; + const char *cpar_name; /* Determine whether to use cpar or X-cpar */ if (sdp_p->last_cap_type == SDP_ATTR_CDSC) { - cpar_name = sdp_get_attr_name(SDP_ATTR_CPAR); + cpar_name = sdp_get_attr_name(SDP_ATTR_CPAR); } else { - /* - * Default to X-CPAR if anything else. This is the backward - * compatible value. - */ - cpar_name = sdp_get_attr_name(SDP_ATTR_X_CPAR); + /* + * Default to X-CPAR if anything else. This is the backward + * compatible value. + */ + cpar_name = sdp_get_attr_name(SDP_ATTR_X_CPAR); } while (attr_p != NULL) { @@ -3766,13 +3766,13 @@ tinybool sdp_parse_context_crypto_suite(char * str, sdp_attr_t *attr_p, sdp_t * /* Check crypto suites */ for(i=0; iattr.srtp_context.suite = sdp_srtp_crypto_suite_array[i].crypto_suite_val; - attr_p->attr.srtp_context.master_key_size_bytes = - sdp_srtp_crypto_suite_array[i].key_size_bytes; - attr_p->attr.srtp_context.master_salt_size_bytes = - sdp_srtp_crypto_suite_array[i].salt_size_bytes; - return TRUE; /* There is a succesful match so exit */ - } + attr_p->attr.srtp_context.suite = sdp_srtp_crypto_suite_array[i].crypto_suite_val; + attr_p->attr.srtp_context.master_key_size_bytes = + sdp_srtp_crypto_suite_array[i].key_size_bytes; + attr_p->attr.srtp_context.master_salt_size_bytes = + sdp_srtp_crypto_suite_array[i].salt_size_bytes; + return TRUE; /* There is a succesful match so exit */ + } } /* couldn't find a matching crypto suite */ sdp_parse_error(sdp_p->peerconnection, @@ -3788,8 +3788,8 @@ sdp_result_e sdp_build_attr_srtpcontext (sdp_t *sdp_p, sdp_attr_t *attr_p, { #define MAX_BASE64_ENCODE_SIZE_BYTES 60 int output_len = MAX_BASE64_ENCODE_SIZE_BYTES; - int key_size = attr_p->attr.srtp_context.master_key_size_bytes; - int salt_size = attr_p->attr.srtp_context.master_salt_size_bytes; + int key_size = attr_p->attr.srtp_context.master_key_size_bytes; + int salt_size = attr_p->attr.srtp_context.master_salt_size_bytes; unsigned char base64_encoded_data[MAX_BASE64_ENCODE_SIZE_BYTES]; unsigned char base64_encoded_input[MAX_BASE64_ENCODE_SIZE_BYTES]; base64_result_t status; @@ -3798,17 +3798,17 @@ sdp_result_e sdp_build_attr_srtpcontext (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Append master and salt keys */ bcopy(attr_p->attr.srtp_context.master_key, base64_encoded_input, - key_size ); + key_size ); bcopy(attr_p->attr.srtp_context.master_salt, base64_encoded_input + key_size, salt_size ); if ((status = base64_encode(base64_encoded_input, key_size + salt_size, - base64_encoded_data, &output_len)) != BASE64_SUCCESS) { + base64_encoded_data, &output_len)) != BASE64_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Error: Failure to Base64 Encoded data (%s) ", sdp_p->debug_str, BASE64_RESULT_TO_STRING(status)); } - return (SDP_INVALID_PARAMETER); + return (SDP_INVALID_PARAMETER); } *(base64_encoded_data + output_len) = '\0'; @@ -4357,18 +4357,18 @@ store_sdescriptions_mki_or_lifetime (char *buf, sdp_attr_t *attr_p) /* MKI has a colon */ if (strstr(buf, ":")) { result = verify_sdescriptions_mki(buf, mkiValue, &mkiLen); - if (result) { - attr_p->attr.srtp_context.mki_size_bytes = mkiLen; - sstrncpy((char*)attr_p->attr.srtp_context.mki, mkiValue, - SDP_SRTP_MAX_MKI_SIZE_BYTES); - } + if (result) { + attr_p->attr.srtp_context.mki_size_bytes = mkiLen; + sstrncpy((char*)attr_p->attr.srtp_context.mki, mkiValue, + SDP_SRTP_MAX_MKI_SIZE_BYTES); + } } else { result = verify_sdescriptions_lifetime(buf); - if (result) { - sstrncpy((char*)attr_p->attr.srtp_context.master_key_lifetime, buf, - SDP_SRTP_MAX_LIFETIME_BYTES); - } + if (result) { + sstrncpy((char*)attr_p->attr.srtp_context.master_key_lifetime, buf, + SDP_SRTP_MAX_LIFETIME_BYTES); + } } return result; @@ -4410,7 +4410,7 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, tinybool keyFound = FALSE; int len, keySize, - saltSize; + saltSize; base64_result_t status; ptr = str; @@ -4427,13 +4427,13 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, while (result == SDP_SUCCESS) { /* the fist time this loop executes, the key is gotten */ if (keyFound == FALSE) { - keyFound = TRUE; - len = SDP_MAX_STRING_LEN; - /* The key is base64 encoded composed of the master key concatenated with the - * master salt. - */ - status = base64_decode((unsigned char *)buf, strlen(buf), - (unsigned char *)base64decodeData, &len); + keyFound = TRUE; + len = SDP_MAX_STRING_LEN; + /* The key is base64 encoded composed of the master key concatenated with the + * master salt. + */ + status = base64_decode((unsigned char *)buf, strlen(buf), + (unsigned char *)base64decodeData, &len); if (status != BASE64_SUCCESS) { sdp_parse_error(sdp_p->peerconnection, @@ -4457,11 +4457,11 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, bcopy(base64decodeData + keySize, attr_p->attr.srtp_context.master_salt, saltSize); - /* Used only for MGCP */ - SDP_SRTP_CONTEXT_SET_MASTER_KEY - (attr_p->attr.srtp_context.selection_flags); - SDP_SRTP_CONTEXT_SET_MASTER_SALT - (attr_p->attr.srtp_context.selection_flags); + /* Used only for MGCP */ + SDP_SRTP_CONTEXT_SET_MASTER_KEY + (attr_p->attr.srtp_context.selection_flags); + SDP_SRTP_CONTEXT_SET_MASTER_SALT + (attr_p->attr.srtp_context.selection_flags); } else if (store_sdescriptions_mki_or_lifetime(buf, attr_p) == FALSE) { return FALSE; @@ -4503,7 +4503,7 @@ sdp_build_attr_sdescriptions (sdp_t *sdp_p, sdp_attr_t *attr_p, unsigned char base64_encoded_input[MAX_BASE64_STRING_LEN]; int keySize, saltSize, - outputLen; + outputLen; base64_result_t status; keySize = attr_p->attr.srtp_context.master_key_size_bytes; @@ -4518,14 +4518,14 @@ sdp_build_attr_sdescriptions (sdp_t *sdp_p, sdp_attr_t *attr_p, outputLen = MAX_BASE64_STRING_LEN; status = base64_encode(base64_encoded_input, keySize + saltSize, - base64_encoded_data, &outputLen); + base64_encoded_data, &outputLen); if (status != BASE64_SUCCESS) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Error: Failure to Base64 Encoded data (%s) ", sdp_p->debug_str, BASE64_RESULT_TO_STRING(status)); } - return (SDP_INVALID_PARAMETER); + return (SDP_INVALID_PARAMETER); } @@ -4647,7 +4647,7 @@ sdp_parse_attr_srtp (sdp_t *sdp_p, sdp_attr_t *attr_p, if (!sdp_parse_context_crypto_suite(tmp, attr_p, sdp_p)) { sdp_parse_error(sdp_p->peerconnection, "%s Unsupported crypto suite", sdp_p->debug_str); - return (SDP_INVALID_PARAMETER); + return (SDP_INVALID_PARAMETER); } ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); @@ -5205,11 +5205,11 @@ sdp_result_e sdp_parse_attr_extmap(sdp_t *sdp_p, sizeof(direction), " \t", &result); if (result != SDP_SUCCESS) { sdp_parse_error(sdp_p->peerconnection, - "%s Warning: No uri specified in %s attribute.", - sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } + "%s Warning: No uri specified in %s attribute.", + sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); + sdp_p->conf_p->num_invalid_param++; + return (SDP_INVALID_PARAMETER); + } } ptr = sdp_getnextstrtok(ptr, attr_p->attr.extmap.uri, diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c index 737421d78e3..8b4603bc2ff 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c @@ -636,11 +636,11 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) bcopy(src_attr_p->attr.srtp_context.master_key, dst_attr_p->attr.srtp_context.master_key, - SDP_SRTP_MAX_KEY_SIZE_BYTES); + SDP_SRTP_MAX_KEY_SIZE_BYTES); bcopy(src_attr_p->attr.srtp_context.master_salt, dst_attr_p->attr.srtp_context.master_salt, - SDP_SRTP_MAX_SALT_SIZE_BYTES); + SDP_SRTP_MAX_SALT_SIZE_BYTES); sstrncpy((char*)dst_attr_p->attr.srtp_context.master_key_lifetime, @@ -1049,11 +1049,11 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, bcopy(src_attr_p->attr.srtp_context.master_key, new_attr_p->attr.srtp_context.master_key, - SDP_SRTP_MAX_KEY_SIZE_BYTES); + SDP_SRTP_MAX_KEY_SIZE_BYTES); bcopy(src_attr_p->attr.srtp_context.master_salt, new_attr_p->attr.srtp_context.master_salt, - SDP_SRTP_MAX_SALT_SIZE_BYTES); + SDP_SRTP_MAX_SALT_SIZE_BYTES); sstrncpy((char*)new_attr_p->attr.srtp_context.master_key_lifetime, @@ -11931,7 +11931,7 @@ sdp_attr_set_sdescriptions_key (void *sdp_ptr, u16 level, } bcopy(key, attr_p->attr.srtp_context.master_key, - SDP_SRTP_MAX_KEY_SIZE_BYTES); + SDP_SRTP_MAX_KEY_SIZE_BYTES); return SDP_SUCCESS; @@ -11989,7 +11989,7 @@ sdp_attr_set_sdescriptions_salt (void *sdp_ptr, u16 level, } bcopy(salt, attr_p->attr.srtp_context.master_salt, - SDP_SRTP_MAX_SALT_SIZE_BYTES); + SDP_SRTP_MAX_SALT_SIZE_BYTES); return SDP_SUCCESS; } diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_config.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_config.c index a6d4c4539f2..4c788f36f37 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_config.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_config.c @@ -199,7 +199,7 @@ void sdp_require_timespec (void *config_p, tinybool timespec_required) * Returns: Nothing. */ void sdp_media_supported (void *config_p, sdp_media_e media_type, - tinybool media_supported) + tinybool media_supported) { sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; @@ -223,7 +223,7 @@ void sdp_media_supported (void *config_p, sdp_media_e media_type, * Returns: Nothing. */ void sdp_nettype_supported (void *config_p, sdp_nettype_e nettype, - tinybool nettype_supported) + tinybool nettype_supported) { sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; @@ -247,7 +247,7 @@ void sdp_nettype_supported (void *config_p, sdp_nettype_e nettype, * Returns: Nothing. */ void sdp_addrtype_supported (void *config_p, sdp_addrtype_e addrtype, - tinybool addrtype_supported) + tinybool addrtype_supported) { sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; @@ -271,7 +271,7 @@ void sdp_addrtype_supported (void *config_p, sdp_addrtype_e addrtype, * Returns: Nothing. */ void sdp_transport_supported (void *config_p, sdp_transport_e transport, - tinybool transport_supported) + tinybool transport_supported) { sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_main.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_main.c index 0f2931939df..58de4df58a2 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_main.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_main.c @@ -969,7 +969,7 @@ sdp_result_e sdp_parse (sdp_t *sdp_p, char **bufp, u16 len) char *next_ptr = NULL; char *line_end; sdp_token_e last_token = SDP_TOKEN_V; - sdp_result_e result=SDP_SUCCESS; + sdp_result_e result = SDP_SUCCESS; tinybool parse_done = FALSE; tinybool end_found = FALSE; tinybool first_line = TRUE; diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h b/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h index dcc9d617a9c..975aa9492bc 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h @@ -94,9 +94,9 @@ extern sdp_result_e sdp_parse_attr_conf(sdp_t *sdp_p, sdp_attr_t *attr_p, extern sdp_result_e sdp_build_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_transport_map(sdp_t *sdp_p, - sdp_attr_t *attr_p, const char *ptr); + sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_transport_map(sdp_t *sdp_p, - sdp_attr_t *attr_p, flex_string *fs); + sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_subnet(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_subnet(sdp_t *sdp_p, sdp_attr_t *attr_p, @@ -208,9 +208,9 @@ extern sdp_result_e sdp_build_attr_rtcp_unicast( sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_build_attr_ice_attr ( - sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_ice_attr ( - sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); + sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_simple_flag ( sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); @@ -218,9 +218,9 @@ extern sdp_result_e sdp_parse_attr_simple_flag ( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_rtcp_mux_attr ( - sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); + sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); extern sdp_result_e sdp_parse_attr_rtcp_mux_attr ( - sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); + sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_parse_attr_fingerprint_attr ( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c index 3508d54872d..2dd6981d4c4 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c @@ -545,79 +545,79 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) /* multicast addr check */ sstrncpy (mcast_str, conn_p->conn_addr, MCAST_STRING_LEN); - errno = 0; - strtoul_result = strtoul(mcast_str, &strtoul_end, 10); + errno = 0; + strtoul_result = strtoul(mcast_str, &strtoul_end, 10); - if (errno || mcast_str == strtoul_end || strtoul_result > 255) { + if (errno || mcast_str == strtoul_end || strtoul_result > 255) { sdp_parse_error(sdp_p->peerconnection, - "%s Error parsing address %s for mcast.", - sdp_p->debug_str, mcast_str); - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } + "%s Error parsing address %s for mcast.", + sdp_p->debug_str, mcast_str); + sdp_p->conf_p->num_invalid_param++; + return SDP_INVALID_PARAMETER; + } - mcast_bits = (int) strtoul_result; - if ((mcast_bits >= SDP_MIN_MCAST_ADDR_HI_BIT_VAL ) && - (mcast_bits <= SDP_MAX_MCAST_ADDR_HI_BIT_VAL)) { - SDP_PRINT("%s Parsed to be a multicast address with mcast bits %d", - sdp_p->debug_str, mcast_bits); - conn_p->is_multicast = TRUE; - } + mcast_bits = (int) strtoul_result; + if ((mcast_bits >= SDP_MIN_MCAST_ADDR_HI_BIT_VAL ) && + (mcast_bits <= SDP_MAX_MCAST_ADDR_HI_BIT_VAL)) { + SDP_PRINT("%s Parsed to be a multicast address with mcast bits %d", + sdp_p->debug_str, mcast_bits); + conn_p->is_multicast = TRUE; + } if (conn_p->addrtype != SDP_AT_EPN) { slash_ptr = sdp_findchar(conn_p->conn_addr, "/"); if (slash_ptr[0] != '\0') { if (conn_p->is_multicast) { SDP_PRINT("%s A multicast address with slash %s", - sdp_p->debug_str, conn_p->conn_addr); - slash_ptr++; + sdp_p->debug_str, conn_p->conn_addr); + slash_ptr++; slash_ptr = sdp_getnextstrtok(slash_ptr, tmp, sizeof(tmp), "/", &result); - if (result != SDP_SUCCESS) { + if (result != SDP_SUCCESS) { sdp_parse_error(sdp_p->peerconnection, - "%s No ttl value specified for this multicast addr with a slash", - sdp_p->debug_str); - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } + "%s No ttl value specified for this multicast addr with a slash", + sdp_p->debug_str); + sdp_p->conf_p->num_invalid_param++; + return (SDP_INVALID_PARAMETER); + } + + errno = 0; + strtoul_result = strtoul(tmp, &strtoul_end, 10); + + if (errno || tmp == strtoul_end || conn_p->ttl > SDP_MAX_TTL_VALUE) { + sdp_parse_error(sdp_p->peerconnection, + "%s Invalid TTL: Value must be in the range 0-255 ", + sdp_p->debug_str); + sdp_p->conf_p->num_invalid_param++; + return (SDP_INVALID_PARAMETER); + } + + conn_p->ttl = (int) strtoul_result; + + /* search for num of addresses */ + /*sa_ignore NO_NULL_CHK + {ptr is valid since the pointer was checked earlier and the + function would have exited if NULL.}*/ + slash_ptr = sdp_findchar(slash_ptr, "/"); + if (slash_ptr != NULL && + slash_ptr[0] != '\0') { + SDP_PRINT("%s Found a num addr field for multicast addr %s ", + sdp_p->debug_str,slash_ptr); + slash_ptr++; errno = 0; - strtoul_result = strtoul(tmp, &strtoul_end, 10); + strtoul_result = strtoul(slash_ptr, &strtoul_end, 10); - if (errno || tmp == strtoul_end || conn_p->ttl > SDP_MAX_TTL_VALUE) { - sdp_parse_error(sdp_p->peerconnection, - "%s Invalid TTL: Value must be in the range 0-255 ", - sdp_p->debug_str); - sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_PARAMETER); - } - - conn_p->ttl = (int) strtoul_result; - - /* search for num of addresses */ - /*sa_ignore NO_NULL_CHK - {ptr is valid since the pointer was checked earlier and the - function would have exited if NULL.}*/ - slash_ptr = sdp_findchar(slash_ptr, "/"); - if (slash_ptr != NULL && - slash_ptr[0] != '\0') { - SDP_PRINT("%s Found a num addr field for multicast addr %s ", - sdp_p->debug_str,slash_ptr); - slash_ptr++; - - errno = 0; - strtoul_result = strtoul(slash_ptr, &strtoul_end, 10); - - if (errno || slash_ptr == strtoul_end || strtoul_result == 0) { + if (errno || slash_ptr == strtoul_end || strtoul_result == 0) { sdp_parse_error(sdp_p->peerconnection, - "%s Invalid Num of addresses: Value must be > 0 ", - sdp_p->debug_str); - sdp_p->conf_p->num_invalid_param++; - return SDP_INVALID_PARAMETER; - } - - conn_p->num_of_addresses = (int) strtoul_result; + "%s Invalid Num of addresses: Value must be > 0 ", + sdp_p->debug_str); + sdp_p->conf_p->num_invalid_param++; + return SDP_INVALID_PARAMETER; } + + conn_p->num_of_addresses = (int) strtoul_result; + } } else { sdp_p->conf_p->num_invalid_param++; SDP_PRINT("%s Only multicast addresses allowed with slashes", @@ -814,7 +814,7 @@ sdp_result_e sdp_parse_bandwidth (sdp_t *sdp_p, u16 level, const char *ptr) if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed bw type %s, value %d", sdp_p->debug_str, sdp_get_bw_modifier_name(new_bw_data_p->bw_modifier), - new_bw_data_p->bw_val); + new_bw_data_p->bw_val); } return (SDP_SUCCESS); @@ -1224,8 +1224,8 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) switch (num_port_params) { case 1: if ((mca_p->transport == SDP_TRANSPORT_RTPAVP) || - (mca_p->transport == SDP_TRANSPORT_RTPSAVP) || - (mca_p->transport == SDP_TRANSPORT_RTPSAVPF) || + (mca_p->transport == SDP_TRANSPORT_RTPSAVP) || + (mca_p->transport == SDP_TRANSPORT_RTPSAVPF) || (mca_p->transport == SDP_TRANSPORT_UDP) || (mca_p->transport == SDP_TRANSPORT_TCP) || (mca_p->transport == SDP_TRANSPORT_UDPTL) || @@ -1263,8 +1263,8 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) break; case 2: if ((mca_p->transport == SDP_TRANSPORT_RTPAVP) || - (mca_p->transport == SDP_TRANSPORT_RTPSAVP) || - (mca_p->transport == SDP_TRANSPORT_RTPSAVPF) || + (mca_p->transport == SDP_TRANSPORT_RTPSAVP) || + (mca_p->transport == SDP_TRANSPORT_RTPSAVPF) || (mca_p->transport == SDP_TRANSPORT_UDP) || (mca_p->transport == SDP_TRANSPORT_LOCAL)) { /* Port format is /. Make sure choose @@ -1392,9 +1392,9 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) port_ptr = port; if (sdp_getchoosetok(port_ptr, &port_ptr, "/ \t", &result)) { - sctp_port = SDP_CHOOSE_PARAM; + sctp_port = SDP_CHOOSE_PARAM; } else { - sctp_port = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr, + sctp_port = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr, "/ \t", &result); if (result != SDP_SUCCESS) { return (SDP_INVALID_PARAMETER); @@ -1578,7 +1578,7 @@ sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, flex_string *fs) } } else { /* Add port to SDP if transport is DTLS/SCTP */ - flex_string_sprintf(fs, " %u", (u32)mca_p->sctpport); + flex_string_sprintf(fs, " %u", (u32)mca_p->sctpport); } flex_string_sprintf(fs, "\r\n"); diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c index ff8cc177b3a..66407abc3f3 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c @@ -141,7 +141,7 @@ verify_sdescriptions_mki (char *buf, char *mkiVal, u16 *mkiLen) char *ptr, mkiValBuf[SDP_SRTP_MAX_MKI_SIZE_BYTES], - mkiLenBuf[MKI_BUF_LEN]; + mkiLenBuf[MKI_BUF_LEN]; int idx = 0; unsigned long strtoul_result; char *strtoul_end; @@ -155,17 +155,17 @@ verify_sdescriptions_mki (char *buf, char *mkiVal, u16 *mkiLen) /* scan until we reach a non-digit or colon */ while (*ptr) { if (*ptr == ':') { - /* terminate the MKI value */ - mkiValBuf[idx] = 0; - ptr++; - break; - } else if ((isdigit((int) *ptr) && (idx < SDP_SRTP_MAX_MKI_SIZE_BYTES-1))) { - mkiValBuf[idx++] = *ptr; - } else { - return FALSE; - } + /* terminate the MKI value */ + mkiValBuf[idx] = 0; + ptr++; + break; + } else if ((isdigit((int) *ptr) && (idx < SDP_SRTP_MAX_MKI_SIZE_BYTES-1))) { + mkiValBuf[idx++] = *ptr; + } else { + return FALSE; + } - ptr++; + ptr++; } /* there has to be a mki length */ @@ -178,12 +178,12 @@ verify_sdescriptions_mki (char *buf, char *mkiVal, u16 *mkiLen) /* verify the mki length (max 3 digits) */ while (*ptr) { if (isdigit((int) *ptr) && (idx < 3)) { - mkiLenBuf[idx++] = *ptr; - } else { - return FALSE; - } + mkiLenBuf[idx++] = *ptr; + } else { + return FALSE; + } - ptr++; + ptr++; } mkiLenBuf[idx] = 0; @@ -231,21 +231,21 @@ verify_sdescriptions_lifetime (char *buf) while (*ptr) { if (*ptr == '^') { - if (tokenFound) { - /* make sure we don't have multiple ^ */ + if (tokenFound) { + /* make sure we don't have multiple ^ */ return FALSE; } else { tokenFound = TRUE; /* Lifetime is in power of 2 format, make sure first and second - * chars are 2^ - */ + * chars are 2^ + */ if (buf[0] != '2' || buf[1] != '^') { - return FALSE; + return FALSE; } } } else if (!isdigit((int) *ptr)) { - return FALSE; + return FALSE; } ptr++; @@ -255,8 +255,8 @@ verify_sdescriptions_lifetime (char *buf) /* Make sure if the format is 2^ that there is a number after the ^. */ if (tokenFound) { if (strlen(buf) <= 2) { - return FALSE; - } + return FALSE; + } } return TRUE; @@ -301,11 +301,11 @@ char *sdp_findchar (const char *ptr, char *char_list) int i; for (;*ptr != '\0'; ptr++) { - for (i=0; char_list[i] != '\0'; i++) { - if (*ptr == char_list[i]) { - return ((char *)ptr); - } - } + for (i=0; char_list[i] != '\0'; i++) { + if (*ptr == char_list[i]) { + return ((char *)ptr); + } + } } return ((char *)ptr); } @@ -547,16 +547,16 @@ static const int star_strlen = sizeof(star_string) - 1; #define CHAR_IS_WHITESPACE(_test_char) \ ((((_test_char)==' ')||((_test_char)=='\t'))?1:0) -#define SKIP_WHITESPACE(_cptr, _max_cptr) \ - while ((_cptr)<=(_max_cptr)) { \ - if (!CHAR_IS_WHITESPACE(*(_cptr))) break; \ - (_cptr)++; \ +#define SKIP_WHITESPACE(_cptr, _max_cptr) \ + while ((_cptr)<=(_max_cptr)) { \ + if (!CHAR_IS_WHITESPACE(*(_cptr))) break; \ + (_cptr)++; \ } -#define FIND_WHITESPACE(_cptr, _max_cptr) \ - while ((_cptr)<=(_max_cptr)) { \ - if (CHAR_IS_WHITESPACE(*(_cptr))) break; \ - (_cptr)++; \ +#define FIND_WHITESPACE(_cptr, _max_cptr) \ + while ((_cptr)<=(_max_cptr)) { \ + if (CHAR_IS_WHITESPACE(*(_cptr))) break; \ + (_cptr)++; \ } /* Function: sdp_crypto_debug @@ -582,59 +582,59 @@ void sdp_crypto_debug (char *buffer, ulong length_bytes) * Where is the data to elide (filter). */ for (start=current=buffer; - current<=last-MIN_CRYPTO_STRING_SIZE_BYTES; - current++) { - if ((*current == 'x') || (*current == 'X')) { - result = cpr_strncasecmp(current, crypto_string, crypto_strlen); - if (!result) { - current += crypto_strlen; - if (current > last) break; + current<=last-MIN_CRYPTO_STRING_SIZE_BYTES; + current++) { + if ((*current == 'x') || (*current == 'X')) { + result = cpr_strncasecmp(current, crypto_string, crypto_strlen); + if (!result) { + current += crypto_strlen; + if (current > last) break; - /* Skip over crypto suite name */ - FIND_WHITESPACE(current, last); + /* Skip over crypto suite name */ + FIND_WHITESPACE(current, last); - /* Skip over whitespace */ - SKIP_WHITESPACE(current, last); + /* Skip over whitespace */ + SKIP_WHITESPACE(current, last); - /* identify inline keyword */ - result = cpr_strncasecmp(current, inline_string, inline_strlen); - if (!result) { - int star_count = 0; + /* identify inline keyword */ + result = cpr_strncasecmp(current, inline_string, inline_strlen); + if (!result) { + int star_count = 0; - current += inline_strlen; - if (current > last) break; + current += inline_strlen; + if (current > last) break; - sdp_dump_buffer(start, current - start); + sdp_dump_buffer(start, current - start); - /* Hide sensitive key/salt data */ - while (current<=last) { - if (*current == '|' || *current == '\n') { - /* Done, print the stars */ - while (star_count > star_strlen) { - /* - * This code is only for the case where - * too much base64 data was supplied - */ - sdp_dump_buffer((char*)star_string, star_strlen); - star_count -= star_strlen; - } - sdp_dump_buffer((char*)star_string, star_count); - break; - } else { - star_count++; - current++; - } - } - /* Update start pointer */ - start=current; - } - } - } + /* Hide sensitive key/salt data */ + while (current<=last) { + if (*current == '|' || *current == '\n') { + /* Done, print the stars */ + while (star_count > star_strlen) { + /* + * This code is only for the case where + * too much base64 data was supplied + */ + sdp_dump_buffer((char*)star_string, star_strlen); + star_count -= star_strlen; + } + sdp_dump_buffer((char*)star_string, star_count); + break; + } else { + star_count++; + current++; + } + } + /* Update start pointer */ + start=current; + } + } + } } if (last > start) { - /* Display remainder of buffer */ - sdp_dump_buffer(start, last - start); + /* Display remainder of buffer */ + sdp_dump_buffer(start, last - start); } } @@ -661,46 +661,46 @@ char * sdp_debug_msg_filter (char *buffer, ulong length_bytes) int result; SDP_PRINT("\n%s:%d: Eliding sensitive data from debug output", - __FILE__, __LINE__); + __FILE__, __LINE__); /* * For SRTP Master Key/Salt has the form: * X-crypto: inline:|| * Where is the data to elide (filter). */ for (current=buffer; - current<=last-MIN_CRYPTO_STRING_SIZE_BYTES; - current++) { - if ((*current == 'x') || (*current == 'X')) { - result = cpr_strncasecmp(current, crypto_string, crypto_strlen); - if (!result) { - current += crypto_strlen; - if (current > last) break; + current<=last-MIN_CRYPTO_STRING_SIZE_BYTES; + current++) { + if ((*current == 'x') || (*current == 'X')) { + result = cpr_strncasecmp(current, crypto_string, crypto_strlen); + if (!result) { + current += crypto_strlen; + if (current > last) break; - /* Skip over crypto suite name */ - FIND_WHITESPACE(current, last); + /* Skip over crypto suite name */ + FIND_WHITESPACE(current, last); - /* Skip over whitespace */ - SKIP_WHITESPACE(current, last); + /* Skip over whitespace */ + SKIP_WHITESPACE(current, last); - /* identify inline keyword */ - result = cpr_strncasecmp(current, inline_string, inline_strlen); - if (!result) { - current += inline_strlen; - if (current > last) break; + /* identify inline keyword */ + result = cpr_strncasecmp(current, inline_string, inline_strlen); + if (!result) { + current += inline_strlen; + if (current > last) break; - /* Hide sensitive key/salt data */ - while (current<=last) { - if (*current == '|' || *current == '\n') { - /* Done */ - break; - } else { - *current = '*'; - current++; - } - } - } - } - } + /* Hide sensitive key/salt data */ + while (current<=last) { + if (*current == '|' || *current == '\n') { + /* Done */ + break; + } else { + *current = '*'; + current++; + } + } + } + } + } } return buffer; @@ -741,28 +741,28 @@ tinybool sdp_checkrange (sdp_t *sdp_p, char *num, ulong *u_val) if (*endP == '\0') { if (l_val > 4294967295UL) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s ERROR: Parameter value: %s is greater than 4294967295", - sdp_p->debug_str, num); - } - return FALSE; - } + if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { + CSFLogError(logTag, "%s ERROR: Parameter value: %s is greater than 4294967295", + sdp_p->debug_str, num); + } + return FALSE; + } - if (l_val == 4294967295UL) { - /* - * On certain platforms where ULONG_MAX is equivalent to - * 4294967295, strtoul will return ULONG_MAX even if the the - * value of the string is greater than 4294967295. To detect - * that scenario we make an explicit check here. - */ - if (strcmp("4294967295", num)) { - if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s ERROR: Parameter value: %s is greater than 4294967295", - sdp_p->debug_str, num); - } - return FALSE; - } - } + if (l_val == 4294967295UL) { + /* + * On certain platforms where ULONG_MAX is equivalent to + * 4294967295, strtoul will return ULONG_MAX even if the the + * value of the string is greater than 4294967295. To detect + * that scenario we make an explicit check here. + */ + if (strcmp("4294967295", num)) { + if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { + CSFLogError(logTag, "%s ERROR: Parameter value: %s is greater than 4294967295", + sdp_p->debug_str, num); + } + return FALSE; + } + } } *u_val = l_val; return TRUE;