Bug 1091242 - Part 5.1: Whitespace-only modifications to sipcc sdp code. r=ehugg

This commit is contained in:
Byron Campen [:bwc] 2014-11-14 17:37:26 -08:00
parent 6f209817c8
commit 1ad35746ef
10 changed files with 820 additions and 820 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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 {

File diff suppressed because it is too large Load Diff

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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 <port>/<num of ports>. 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");

View File

@ -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 <master_key_salt> 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:<crypto_suite_name> inline:<master_key_salt>||
* Where <master_key_salt> 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;