From 3a2e44d3e2457eef7f4daa507d4be41fac7cafcc Mon Sep 17 00:00:00 2001 From: "Byron Campen [:bwc]" Date: Fri, 14 Nov 2014 17:37:40 -0800 Subject: [PATCH] Bug 1091242 - Part 5.2: Functionality changes to sipcc sdp code. r=ehugg r=pkerr --- media/webrtc/signaling/src/sdp/sipcc/ccsdp.h | 6 + .../signaling/src/sdp/sipcc/ccsdp_rtcp_fb.h | 36 - .../src/sdp/sipcc/cpr_android_types.h | 157 --- .../src/sdp/sipcc/cpr_darwin_types.h | 47 - .../signaling/src/sdp/sipcc/cpr_linux_types.h | 53 - .../signaling/src/sdp/sipcc/cpr_string.c | 50 +- .../signaling/src/sdp/sipcc/cpr_string.h | 28 +- .../signaling/src/sdp/sipcc/cpr_strings.h | 56 +- .../signaling/src/sdp/sipcc/cpr_types.h | 6 +- .../signaling/src/sdp/sipcc/cpr_win_types.h | 39 +- media/webrtc/signaling/src/sdp/sipcc/sdp.h | 72 +- .../signaling/src/sdp/sipcc/sdp_access.c | 227 ++-- .../webrtc/signaling/src/sdp/sipcc/sdp_attr.c | 444 ++++--- .../signaling/src/sdp/sipcc/sdp_attr_access.c | 1133 +++++++---------- .../signaling/src/sdp/sipcc/sdp_config.c | 23 +- .../webrtc/signaling/src/sdp/sipcc/sdp_main.c | 86 +- .../signaling/src/sdp/sipcc/sdp_os_defs.h | 10 +- .../signaling/src/sdp/sipcc/sdp_private.h | 20 +- .../src/sdp/sipcc/sdp_services_unix.c | 1 + .../signaling/src/sdp/sipcc/sdp_token.c | 204 +-- .../signaling/src/sdp/sipcc/sdp_utils.c | 7 +- 21 files changed, 1211 insertions(+), 1494 deletions(-) delete mode 100644 media/webrtc/signaling/src/sdp/sipcc/cpr_android_types.h diff --git a/media/webrtc/signaling/src/sdp/sipcc/ccsdp.h b/media/webrtc/signaling/src/sdp/sipcc/ccsdp.h index e3ce6901da7f..45335d95759f 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/ccsdp.h +++ b/media/webrtc/signaling/src/sdp/sipcc/ccsdp.h @@ -150,6 +150,7 @@ typedef enum { SDP_UNRECOGNIZED_TOKEN, SDP_NULL_BUF_PTR, SDP_POTENTIAL_SDP_OVERFLOW, + SDP_EMPTY_TOKEN, SDP_MAX_RC } sdp_result_e; @@ -249,6 +250,11 @@ typedef enum { SDP_ATTR_CONNECTION, SDP_ATTR_EXTMAP, /* RFC 5285 */ SDP_ATTR_IDENTITY, + SDP_ATTR_MSID, + SDP_ATTR_MSID_SEMANTIC, + SDP_ATTR_BUNDLE_ONLY, + SDP_ATTR_END_OF_CANDIDATES, + SDP_ATTR_ICE_OPTIONS, SDP_MAX_ATTR_TYPES, SDP_ATTR_INVALID } sdp_attr_e; diff --git a/media/webrtc/signaling/src/sdp/sipcc/ccsdp_rtcp_fb.h b/media/webrtc/signaling/src/sdp/sipcc/ccsdp_rtcp_fb.h index 3a732ca4a259..caf556df3563 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/ccsdp_rtcp_fb.h +++ b/media/webrtc/signaling/src/sdp/sipcc/ccsdp_rtcp_fb.h @@ -57,40 +57,4 @@ static_assert(SDP_MAX_RTCP_FB_NACK + "rtcp-fb Bitmap is larger than 32 bits"); #endif -static int32_t -sdp_rtcp_fb_nack_to_bitmap(sdp_rtcp_fb_nack_type_e type) -{ - int bitnumber = type; - - if (type < 0 || type >= SDP_MAX_RTCP_FB_NACK) { - return 0; - } - - return (1 << bitnumber); -} - -static int32_t -sdp_rtcp_fb_ack_to_bitmap(sdp_rtcp_fb_ack_type_e type) -{ - int bitnumber = type + SDP_MAX_RTCP_FB_NACK; - - if (type < 0 || type >= SDP_MAX_RTCP_FB_ACK) { - return 0; - } - - return (1 << bitnumber); -} - -static int32_t -sdp_rtcp_fb_ccm_to_bitmap(sdp_rtcp_fb_ccm_type_e type) -{ - int bitnumber = type + SDP_MAX_RTCP_FB_NACK + SDP_MAX_RTCP_FB_ACK; - - if (type < 0 || type >= SDP_MAX_RTCP_FB_CCM) { - return 0; - } - - return (1 << bitnumber); -} - #endif diff --git a/media/webrtc/signaling/src/sdp/sipcc/cpr_android_types.h b/media/webrtc/signaling/src/sdp/sipcc/cpr_android_types.h deleted file mode 100644 index 699461c65d29..000000000000 --- a/media/webrtc/signaling/src/sdp/sipcc/cpr_android_types.h +++ /dev/null @@ -1,157 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _CPR_ANDROID_TYPES_H_ -#define _CPR_ANDROID_TYPES_H_ - -#include "sys/types.h" -#include "stddef.h" -#include "inttypes.h" - -/** - * @typedef boolean - * - * Define boolean as an unsigned byte - * - * @note There are differences within TNP header files - * @li curses.h: bool => char - * @li types.h: boolean_t => enum - * @li dki_lock.h: bool_t => int - */ -typedef uint8_t boolean; - -/* - * Define size_t - * defined in numerous header files - */ -/* DONE (sys/types.h => unsigned int) */ - -/* - * Define ssize_t - */ -/* DONE (sys/types.h => int) */ - -/* - * Define MIN/MAX - * defined in param.h - * - * The GNU versions of the MAX and MIN macros do two things better than - * the old versions: - * 1. they are more optimal as they only evaluate a & b once by creating a - * a variable of each type on the local stack. - * 2. they fix potential errors due to side-effects where a and b were - * evaluated twice, i.e. MIN(i++,j++) - * - * @note b could be cast to a's type, to help with usage where the code - * compares signed and unsigned types. - */ -#ifndef MIN -#ifdef __GNUC__ -#define MIN(a,b) ({ typeof(a) _a = (a); typeof(b) _b = (b); _a < _b ? _a : _b; }) -#else -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif -#endif - -#ifndef MAX -#ifdef __GNUC__ -#define MAX(a,b) ({ typeof(a) _a = (a); typeof(b) _b = (b); _a > _b ? _a : _b; }) -#else -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif -#endif - - -/* - * Define NULL - * defined in numerous header files - */ -/* DONE (stddef.h) */ - -/** - * @def NUL - * - * Define NUL for string termination - */ -#ifndef NUL -#define NUL '\0' -#endif - -/** - * @def RESTRICT - * - * If suppoprting the ISO/IEC 9899:1999 standard, - * use the '__restrict' keyword - */ -#if defined(_POSIX_C_SOURCE) && defined(__GNUC__) -#define RESTRICT __restrict -#else -#define RESTRICT -#endif - -/** - * @def CONST - * - * Define CONST as @c const, if supported - */ -#define CONST const - -/** - * @def INLINE - * - * Define the appropriate setting for inlining functions - */ -#ifdef __STRICT_ANSI__ -#define INLINE -#else -#define INLINE __inline__ -#endif - -/** - * __BEGIN_DECLS and __END_DECLS - * - * Define macros for compilation by C++ compiler - */ -#ifndef __BEGIN_DECLS -#ifdef __cplusplus -#define __BEGIN_DECLS extern "C" { -#else -#define __BEGIN_DECLS -#endif -#endif - -#ifndef __END_DECLS -#ifdef __cplusplus -#define __END_DECLS } -#else -#define __END_DECLS -#endif -#endif - -/** - * Define TRUE/FALSE - * defined in several header files - */ -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -/* - * Define offsetof - */ -/* DONE (stddef.h) */ - -/** - * @def FIELDOFFSET(struct name, field name) - * - * Macro to generate offset from a given field in a structure - */ -#define FIELDOFFSET(struct_name, field_name) (size_t)(&(((struct_name *)0)->field_name)) - - -#endif diff --git a/media/webrtc/signaling/src/sdp/sipcc/cpr_darwin_types.h b/media/webrtc/signaling/src/sdp/sipcc/cpr_darwin_types.h index 1e72d9f3d5cb..6bcce4fca555 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/cpr_darwin_types.h +++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_darwin_types.h @@ -53,45 +53,6 @@ typedef uint8_t boolean; #endif #endif -/** - * @def NUL - * - * Define NUL for string termination - */ -#ifndef NUL -#define NUL '\0' -#endif - -/** - * @def RESTRICT - * - * If suppoprting the ISO/IEC 9899:1999 standard, - * use the '__restrict' keyword - */ -#if defined(_POSIX_C_SOURCE) && defined(__GNUC__) -#define RESTRICT __restrict -#else -#define RESTRICT -#endif - -/** - * @def CONST - * - * Define CONST as @c const, if supported - */ -#define CONST const - -/** - * @def INLINE - * - * Define the appropriate setting for inlining functions - */ -#ifdef __STRICT_ANSI__ -#define INLINE -#else -#define INLINE __inline__ -#endif - /** * __BEGIN_DECLS and __END_DECLS * @@ -125,12 +86,4 @@ typedef uint8_t boolean; #define FALSE 0 #endif -/** - * @def FIELDOFFSET(struct name, field name) - * - * Macro to generate offset from a given field in a structure - */ -#define FIELDOFFSET(struct_name, field_name) (long)(&(((struct_name *)0)->field_name)) - - #endif diff --git a/media/webrtc/signaling/src/sdp/sipcc/cpr_linux_types.h b/media/webrtc/signaling/src/sdp/sipcc/cpr_linux_types.h index 6eca4a1d6841..1180143c08e8 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/cpr_linux_types.h +++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_linux_types.h @@ -63,50 +63,6 @@ typedef uint8_t boolean; #endif -/* - * Define NULL - * defined in numerous header files - */ -/* DONE (stddef.h) */ - -/** - * @def NUL - * - * Define NUL for string termination - */ -#ifndef NUL -#define NUL '\0' -#endif - -/** - * @def RESTRICT - * - * If suppoprting the ISO/IEC 9899:1999 standard, - * use the '__restrict' keyword - */ -#if defined(_POSIX_C_SOURCE) && defined(__GNUC__) -#define RESTRICT __restrict -#else -#define RESTRICT -#endif - -/** - * @def CONST - * - * Define CONST as @c const, if supported - */ -#define CONST const - -/** - * @def INLINE - * - * Define the appropriate setting for inlining functions - */ -#ifdef __STRICT_ANSI__ -#define INLINE -#else -#define INLINE __inline__ -#endif /** * __BEGIN_DECLS and __END_DECLS @@ -128,7 +84,6 @@ typedef uint8_t boolean; #define __END_DECLS #endif #endif - /** * Define TRUE/FALSE * defined in several header files @@ -146,12 +101,4 @@ typedef uint8_t boolean; */ /* DONE (stddef.h) */ -/** - * @def FIELDOFFSET(struct name, field name) - * - * Macro to generate offset from a given field in a structure - */ -#define FIELDOFFSET(struct_name, field_name) (size_t)(&(((struct_name *)0)->field_name)) - - #endif diff --git a/media/webrtc/signaling/src/sdp/sipcc/cpr_string.c b/media/webrtc/signaling/src/sdp/sipcc/cpr_string.c index f8e828b36446..819d8656fe6e 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/cpr_string.c +++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_string.c @@ -6,10 +6,18 @@ #include "mozilla/Assertions.h" #include "cpr_types.h" -#include "cpr_stdlib.h" #include "cpr_string.h" #include "cpr_strings.h" +/* From cpr_stdlib.h */ +#include "mozilla/mozalloc.h" + +#define cpr_malloc(a) moz_xmalloc(a) +#define cpr_calloc(a, b) moz_xcalloc(a, b) +#define cpr_realloc(a, b) moz_xrealloc(a, b) +#define cpr_free(a) moz_free(a) + + /** * sstrncpy * @@ -222,3 +230,43 @@ void flex_string_sprintf(flex_string *fs, const char *format, ...) { va_end(ap); } + + +/* From cpr_linux_string.c */ +/** + * cpr_strdup + * + * @brief The CPR wrapper for strdup + + * The cpr_strdup shall return a pointer to a new string, which is a duplicate + * of the string pointed to by "str" argument. A null pointer is returned if the + * new string cannot be created. + * + * @param[in] str - The string that needs to be duplicated + * + * @return The duplicated string or NULL in case of no memory + * + */ +char * +cpr_strdup (const char *str) +{ + char *dup; + size_t len; + + if (!str) { + return (char *) NULL; + } + + len = strlen(str); + if (len == 0) { + return (char *) NULL; + } + len++; + + dup = cpr_malloc(len * sizeof(char)); + if (!dup) { + return (char *) NULL; + } + (void) memcpy(dup, str, len); + return dup; +} diff --git a/media/webrtc/signaling/src/sdp/sipcc/cpr_string.h b/media/webrtc/signaling/src/sdp/sipcc/cpr_string.h index aa76e1d50b60..5011792daf6a 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/cpr_string.h +++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_string.h @@ -12,15 +12,6 @@ __BEGIN_DECLS -#if defined SIP_OS_LINUX -#include "../linux/cpr_linux_string.h" -#elif defined SIP_OS_WINDOWS -#include "../win32/cpr_win_string.h" -#define cpr_strdup _strdup -#elif defined SIP_OS_OSX -#include "../darwin/cpr_darwin_string.h" -#endif - /** * sstrncpy * @@ -65,6 +56,7 @@ sstrncpy(char *dst, const char *src, unsigned long max); char * sstrncat(char *s1, const char *s2, unsigned long max); + /* * flex_string */ @@ -120,6 +112,24 @@ void flex_string_vsprintf(flex_string *fs, const char *format, va_list original_ */ void flex_string_sprintf(flex_string *fs, const char *format, ...); + +/* From cpr_linux_string.h */ +/* cpr_strdup + * + * @brief The CPR wrapper for strdup + + * The cpr_strdup shall return a pointer to a new string, which is a duplicate + * of the string pointed to by "str" argument. A null pointer is returned if the + * new string cannot be created. + * + * @param[in] str - The string that needs to be duplicated + * + * @return The duplicated string or NULL in case of no memory + * + */ +char * +cpr_strdup(const char *str); + __END_DECLS #endif diff --git a/media/webrtc/signaling/src/sdp/sipcc/cpr_strings.h b/media/webrtc/signaling/src/sdp/sipcc/cpr_strings.h index 4f5fac9c8ac4..bf004037112c 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/cpr_strings.h +++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_strings.h @@ -9,55 +9,21 @@ __BEGIN_DECLS -#if defined SIP_OS_LINUX -#include "../linux/cpr_linux_strings.h" -#elif defined SIP_OS_WINDOWS -#include "../win32/cpr_win_strings.h" -#elif defined SIP_OS_OSX -#include "../darwin/cpr_darwin_strings.h" -#endif -#ifdef CPR_USE_OS_STRCASECMP -/* Use standard library types, but use the OS's name for the functions */ -#ifndef cpr_strcasecmp +#include + +#ifdef _MSC_VER + +#define cpr_strcasecmp _stricmp +#define cpr_strncasecmp _strnicmp +#define snprintf _snprintf + +#else // _MSC_VER + #define cpr_strcasecmp strcasecmp -#endif -#ifndef cpr_strncasecmp #define cpr_strncasecmp strncasecmp -#endif -#else -/* Prototypes */ -/** - * cpr_strcasecmp - * - * @brief The CPR wrapper for strcasecmp - * - * The cpr_strcasecmp performs case insensitive string comparison of the "s1" - * and the "s2" strings. - * - * @param[in] s1 - The first string - * @param[in] s2 - The second string - * - * @return integer <,=,> 0 depending on whether s1 is <,=,> s2 - */ -int cpr_strcasecmp(const char *s1, const char *s2); -/** - * cpr_strncasecmp - * - * @brief The CPR wrapper for strncasecmp - * - * The cpr_strncasecmp performs case insensitive string comparison for specific - * length "len". - * - * @param[in] s1 - The first string - * @param[in] s2 - The second string - * @param[in] len - The length to be compared - * - * @return integer <,=,> 0 depending on whether s1 is <,=,> s2 - */ -int cpr_strncasecmp(const char *s1, const char *s2, size_t len); -#endif +#endif // _MSC_VER __END_DECLS diff --git a/media/webrtc/signaling/src/sdp/sipcc/cpr_types.h b/media/webrtc/signaling/src/sdp/sipcc/cpr_types.h index 87a7b238a82b..b995e3fae19e 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/cpr_types.h +++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_types.h @@ -6,11 +6,11 @@ #define _CPR_TYPES_H_ #if defined SIP_OS_LINUX -#include "../linux/cpr_linux_types.h" +#include "cpr_linux_types.h" #elif defined SIP_OS_WINDOWS -#include "../win32/cpr_win_types.h" +#include "cpr_win_types.h" #elif defined SIP_OS_OSX -#include "../darwin/cpr_darwin_types.h" +#include "cpr_darwin_types.h" #endif __BEGIN_DECLS diff --git a/media/webrtc/signaling/src/sdp/sipcc/cpr_win_types.h b/media/webrtc/signaling/src/sdp/sipcc/cpr_win_types.h index 8db2dca58325..1108700cf6a3 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/cpr_win_types.h +++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_win_types.h @@ -100,32 +100,6 @@ typedef int pid_t; */ /* DONE defined in windef.h */ -/* - * Define NUL - */ -#ifndef NUL -#define NUL '\0' -#endif - -/* - * Define RESTRICT - * - * If supporting the ISO/IEC 9899:1999 standard, - * use the 'restrict' keyword - */ -#if defined(_POSIX_C_SOURCE) -#define RESTRICT restrict -#else -#define RESTRICT -#endif - -/* - * Define CONST - */ -#ifndef CONST -#define CONST const -#endif - /* * Define __BEGIN_DECLS and __END_DECLS */ @@ -137,16 +111,5 @@ typedef int pid_t; #define __END_DECLS #endif -/* Not sure what this is, but we need it */ -#define MSG_ECHO_EVENT 0xF001 +#endif // _CPR_WIN_TYPES_H_ -/* - * Define alternate punctuation token spellings - * Added 'equals' which is not part of the standard iso646.h - */ -#ifndef __cplusplus -#include "iso646.h" -#endif -#define equals == - -#endif diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp.h b/media/webrtc/signaling/src/sdp/sipcc/sdp.h index 1353991056d1..f801b825a127 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp.h +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp.h @@ -2,10 +2,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _SDP_H_ -#define _SDP_H_ +#ifndef _SIPCC_SDP_H_ +#define _SIPCC_SDP_H_ -#include "cc_constants.h" #include "sdp_os_defs.h" #include "ccsdp.h" @@ -24,6 +23,10 @@ #define AES_CM_128_HMAC_SHA1_80 "AES_CM_128_HMAC_SHA1_80" #define F8_128_HMAC_SHA1_80 "F8_128_HMAC_SHA1_80" +/* Pulled in from rtp_defs.h. */ +#define GET_DYN_PAYLOAD_TYPE_VALUE(a) ((a & 0XFF00) ? ((a & 0XFF00) >> 8) : a) +#define SET_PAYLOAD_TYPE_WITH_DYNAMIC(a,b) ((a << 8) | b) + /* * SDP_SRTP_MAX_KEY_SIZE_BYTES * Maximum size for a SRTP Master Key in bytes. @@ -179,6 +182,11 @@ typedef enum { SDP_TRANSPORT_TCP, SDP_TRANSPORT_RTPSAVPF, SDP_TRANSPORT_DTLSSCTP, + SDP_TRANSPORT_RTPAVPF, + SDP_TRANSPORT_UDPTLSRTPSAVP, + SDP_TRANSPORT_UDPTLSRTPSAVPF, + SDP_TRANSPORT_TCPTLSRTPSAVP, + SDP_TRANSPORT_TCPTLSRTPSAVPF, SDP_MAX_TRANSPORT_TYPES, SDP_TRANSPORT_UNSUPPORTED, SDP_TRANSPORT_INVALID @@ -454,6 +462,7 @@ typedef enum { SDP_GROUP_ATTR_FID, SDP_GROUP_ATTR_LS, SDP_GROUP_ATTR_ANAT, + SDP_GROUP_ATTR_BUNDLE, SDP_MAX_GROUP_ATTR_VAL, SDP_GROUP_ATTR_UNSUPPORTED } sdp_group_attr_e; @@ -542,7 +551,7 @@ typedef enum sdp_srtp_crypto_suite_t_ { #define SDP_INVALID_PACKETIZATION_MODE_VALUE 255 #define SDP_MAX_LEVEL_ASYMMETRY_ALLOWED_VALUE 1 /* max level asymmetry allowed value for H.264 */ -#define SDP_DEFAULT_LEVEL_ASYMMETRY_ALLOWED_VALUE 1 /* default level asymmetry allowed value for H.264 */ +#define SDP_DEFAULT_LEVEL_ASYMMETRY_ALLOWED_VALUE 0 /* default level asymmetry allowed value for H.264 */ #define SDP_INVALID_LEVEL_ASYMMETRY_ALLOWED_VALUE 2 /* invalid value for level-asymmetry-allowed param for H.264 */ @@ -718,6 +727,12 @@ typedef struct sdp_sctpmap { char protocol[SDP_MAX_STRING_LEN+1]; } sdp_sctpmap_t; +#define SDP_MAX_MSID_LEN 64 + +typedef struct sdp_msid { + char identifier[SDP_MAX_MSID_LEN+1]; + char appdata[SDP_MAX_MSID_LEN+1]; +} sdp_msid_t; /* a=qos|secure|X-pc-qos|X-qos info */ typedef struct sdp_qos { @@ -823,7 +838,7 @@ typedef struct sdp_stream_data { char x_confid[SDP_MAX_STRING_LEN+1]; sdp_group_attr_e group_attr; /* FID or LS */ u16 num_group_id; - u16 group_id_arr[SDP_MAX_GROUP_STREAM_ID]; + char * group_ids[SDP_MAX_GROUP_STREAM_ID]; } sdp_stream_data_t; /* @@ -899,6 +914,7 @@ typedef struct sdp_media_profiles { typedef struct sdp_extmap { u16 id; sdp_direction_e media_direction; + tinybool media_direction_specified; char uri[SDP_MAX_STRING_LEN+1]; char extension_attributes[SDP_MAX_STRING_LEN+1]; } sdp_extmap_t; @@ -955,6 +971,7 @@ typedef struct sdp_mca { sdp_attr_e media_direction; /* Either INACTIVE, SENDONLY, RECVONLY, or SENDRECV */ u32 mid; + u32 line_number; struct sdp_attr *media_attrs_p; struct sdp_mca *next_p; } sdp_mca_t; @@ -963,6 +980,7 @@ typedef struct sdp_mca { /* generic a= line info */ typedef struct sdp_attr { sdp_attr_e type; + u32 line_number; union { tinybool boolean_val; u32 u32_val; @@ -970,6 +988,7 @@ typedef struct sdp_attr { char ice_attr[SDP_MAX_STRING_LEN+1]; sdp_fmtp_t fmtp; sdp_sctpmap_t sctpmap; + sdp_msid_t msid; sdp_qos_t qos; sdp_curr_t curr; sdp_des_t des; @@ -1002,6 +1021,10 @@ typedef struct sdp_srtp_crypto_suite_list_ { unsigned char salt_size_bytes; } sdp_srtp_crypto_suite_list; +typedef void (*sdp_parse_error_handler)(void *context, + uint32_t line, + const char *message); + /* Application configuration options */ typedef struct sdp_conf_options { u32 magic_num; @@ -1023,6 +1046,8 @@ typedef struct sdp_conf_options { u32 num_invalid_param; u32 num_no_resource; struct sdp_conf_options *next_p; + sdp_parse_error_handler error_handler; + void *error_handler_context; } sdp_conf_options_t; @@ -1030,7 +1055,6 @@ typedef struct sdp_conf_options { /* Elements here that can only be one of are included directly. Elements */ /* that can be more than one are pointers. */ typedef struct { - char peerconnection[PC_HANDLE_SIZE]; u32 magic_num; sdp_conf_options_t *conf_p; tinybool debug_flag[SDP_MAX_DEBUG_TYPES]; @@ -1061,6 +1085,9 @@ typedef struct { /* Info to help building X-cpar/cpar attrs. */ sdp_attr_e last_cap_type; + /* Facilitates reporting line number for SDP errors */ + u32 parse_line; + /* MCA - Media, connection, and attributes */ sdp_mca_t *mca_p; ushort mca_count; @@ -1088,7 +1115,8 @@ typedef struct { /* Prototypes */ /* sdp_config.c */ -extern void *sdp_init_config(void); +extern sdp_conf_options_t *sdp_init_config(void); +extern void sdp_free_config(sdp_conf_options_t *config_p); extern void sdp_appl_debug(void *config_p, sdp_debug_e debug_type, tinybool debug_flag); extern void sdp_require_version(void *config_p, tinybool version_required); @@ -1106,15 +1134,18 @@ extern void sdp_transport_supported(void *config_p, sdp_transport_e transport, tinybool transport_supported); extern void sdp_allow_choose(void *config_p, sdp_choose_param_e param, tinybool choose_allowed); +extern void sdp_config_set_error_handler(void *config_p, + sdp_parse_error_handler handler, + void *context); /* sdp_main.c */ -extern sdp_t *sdp_init_description(const char *peerconnection, void *config_p); +extern sdp_t *sdp_init_description(sdp_conf_options_t *config_p); extern void sdp_debug(sdp_t *sdp_ptr, sdp_debug_e debug_type, tinybool debug_flag); extern void sdp_set_string_debug(sdp_t *sdp_ptr, const char *debug_str); -extern sdp_result_e sdp_parse(sdp_t *sdp_ptr, char **bufp, u16 len); +extern sdp_result_e sdp_parse(sdp_t *sdp_ptr, const char *buf, size_t len); extern sdp_result_e sdp_build(sdp_t *sdp_ptr, flex_string *fs); extern sdp_result_e sdp_free_description(sdp_t *sdp_ptr); -extern void sdp_parse_error(const char *peerconnection, const char *format, ...); +extern void sdp_parse_error(sdp_t *sdp, const char *format, ...); extern const char *sdp_get_result_name(sdp_result_e rc); @@ -1181,6 +1212,7 @@ extern sdp_result_e sdp_set_mcast_addr_fields(void *sdp_ptr, u16 level, extern tinybool sdp_media_line_valid(void *sdp_ptr, u16 level); extern u16 sdp_get_num_media_lines(void *sdp_ptr); extern sdp_media_e sdp_get_media_type(void *sdp_ptr, u16 level); +extern u32 sdp_get_media_line_number(void *sdp_ptr, u16 level); extern sdp_port_format_e sdp_get_media_port_format(void *sdp_ptr, u16 level); extern int32 sdp_get_media_portnum(void *sdp_ptr, u16 level); extern int32 sdp_get_media_portcount(void *sdp_ptr, u16 level); @@ -1195,6 +1227,9 @@ extern sdp_transport_e sdp_get_media_profile(void *sdp_ptr, u16 level, extern u16 sdp_get_media_num_payload_types(void *sdp_ptr, u16 level); extern u16 sdp_get_media_profile_num_payload_types(void *sdp_ptr, u16 level, u16 profile_num); +extern rtp_ptype sdp_get_known_payload_type(void *sdp_ptr, + u16 level, + u16 payload_type_raw); extern u32 sdp_get_media_payload_type(void *sdp_ptr, u16 level, u16 payload_num, sdp_payload_ind_e *indicator); extern u32 sdp_get_media_profile_payload_type(void *sdp_ptr, u16 level, @@ -1225,6 +1260,9 @@ extern sdp_result_e sdp_add_media_profile_payload_type(void *sdp_ptr, sdp_payload_ind_e indicator); /* sdp_attr_access.c */ +extern sdp_attr_t *sdp_find_attr (sdp_t *sdp_p, u16 level, u8 cap_num, + sdp_attr_e attr_type, u16 inst_num); + extern int sdp_find_fmtp_inst(sdp_t *sdp_ptr, u16 level, u16 payload_num); extern sdp_result_e sdp_add_new_attr(void *sdp_ptr, u16 level, u8 cap_num, sdp_attr_e attr_type, u16 *inst_num); @@ -1245,6 +1283,8 @@ extern sdp_result_e sdp_delete_attr(void *sdp_ptr, u16 level, u8 cap_num, extern sdp_result_e sdp_delete_all_attrs(void *sdp_ptr, u16 level, u8 cap_num); extern tinybool sdp_attr_valid(void *sdp_ptr, sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num); +extern u32 sdp_attr_line_number(void *sdp_ptr, sdp_attr_e attr_type, + u16 level, u8 cap_num, u16 inst_num); extern const char *sdp_attr_get_simple_string(void *sdp_ptr, sdp_attr_e attr_type, u16 level, u8 cap_num, u16 inst_num); extern sdp_result_e sdp_attr_set_simple_string(void *sdp_ptr, @@ -1333,6 +1373,8 @@ extern sdp_result_e sdp_attr_set_subnet_addr(void *sdp_ptr, u16 level, extern sdp_result_e sdp_attr_set_subnet_prefix(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, int32 prefix); +extern rtp_ptype sdp_attr_get_rtpmap_known_codec(void *sdp_ptr, u16 level, + u8 cap_num, u16 inst_num); extern tinybool sdp_attr_rtpmap_payload_valid(void *sdp_ptr, u16 level, u8 cap_num, u16 *inst_num, u16 payload_type); extern u16 sdp_attr_get_rtpmap_payload_type(void *sdp_ptr, u16 level, @@ -1674,6 +1716,11 @@ extern sdp_result_e sdp_attr_set_sctpmap_streams (void *sdp_ptr, u16 level, extern sdp_result_e sdp_attr_get_sctpmap_streams (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u32* val); +extern const char *sdp_attr_get_msid_identifier(sdp_t *sdp_p, u16 level, + u8 cap_num, u16 inst_num); +extern const char *sdp_attr_get_msid_appdata(sdp_t *sdp_p, u16 level, + u8 cap_num, u16 inst_num); + /* H.264 codec specific params */ extern const char *sdp_attr_get_fmtp_profile_id(void *sdp_ptr, u16 level, @@ -1848,6 +1895,7 @@ extern sdp_result_e sdp_copy_all_bw_lines(void *src_sdp_ptr, void *dst_sdp_ptr, u16 src_level, u16 dst_level); extern sdp_bw_modifier_e sdp_get_bw_modifier(void *sdp_ptr, u16 level, u16 inst_num); +extern const char *sdp_get_bw_modifier_name(sdp_bw_modifier_e bw_modifier); extern int32 sdp_get_bw_value(void *sdp_ptr, u16 level, u16 inst_num); extern int32 sdp_get_num_bw_lines (void *sdp_ptr, u16 level); @@ -1892,10 +1940,10 @@ extern sdp_result_e sdp_set_group_num_id(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 group_num_id); -extern int32 sdp_get_group_id(void *sdp_ptr, u16 level, +extern const char* sdp_get_group_id(void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 id_num); extern sdp_result_e sdp_set_group_id (void *sdp_ptr, u16 level, - u8 cap_num, u16 inst_num, u16 group_id); + u8 cap_num, u16 inst_num, char* group_id); extern int32 sdp_get_mid_value(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 20e5b51e61f3..176854c429dd 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c @@ -5,12 +5,30 @@ #include "sdp_os_defs.h" #include "sdp.h" #include "sdp_private.h" -#include "ccsip_sdp.h" -#include "rtp_defs.h" + #include "CSFLog.h" static const char* logTag = "sdp_access"; +/* Pulled in from ccsip_sdp.h */ +/* Possible encoding names of static payload types*/ +#define SIPSDP_ATTR_ENCNAME_PCMU "PCMU" +#define SIPSDP_ATTR_ENCNAME_PCMA "PCMA" +#define SIPSDP_ATTR_ENCNAME_G729 "G729" +#define SIPSDP_ATTR_ENCNAME_G723 "G723" +#define SIPSDP_ATTR_ENCNAME_G726 "G726-32" +#define SIPSDP_ATTR_ENCNAME_G728 "G728" +#define SIPSDP_ATTR_ENCNAME_GSM "GSM" +#define SIPSDP_ATTR_ENCNAME_CN "CN" +#define SIPSDP_ATTR_ENCNAME_G722 "G722" +#define SIPSDP_ATTR_ENCNAME_ILBC "iLBC" +#define SIPSDP_ATTR_ENCNAME_H263v2 "H263-1998" +#define SIPSDP_ATTR_ENCNAME_H264 "H264" +#define SIPSDP_ATTR_ENCNAME_VP8 "VP8" +#define SIPSDP_ATTR_ENCNAME_L16_256K "L16" +#define SIPSDP_ATTR_ENCNAME_ISAC "ISAC" +#define SIPSDP_ATTR_ENCNAME_OPUS "opus" + /* Function: sdp_find_media_level * Description: Find and return a pointer to the specified media level, * if it exists. @@ -1275,6 +1293,31 @@ sdp_media_e sdp_get_media_type (void *sdp_ptr, u16 level) return (mca_p->media); } +/* Function: sdp_get_media_line_number + * Description: Returns the line number in the SDP the media + * section starts on. Only set if SDP has been parsed + * (rather than built). + * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. + * level The level to of the m= media line. Will be 1-n. + * Returns: Line number (0 if not found or if locally built) + */ +u32 sdp_get_media_line_number (void *sdp_ptr, u16 level) +{ + sdp_t *sdp_p = (sdp_t *)sdp_ptr; + sdp_mca_t *mca_p; + + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { + return 0; + } + + mca_p = sdp_find_media_level(sdp_p, level); + if (mca_p == NULL) { + return 0; + } + + return (mca_p->line_number); +} + /* Function: sdp_get_media_port_format * Description: Returns the port format type associated with the m= * media token line. If port format type has not been @@ -1329,7 +1372,7 @@ int32 sdp_get_media_portnum (void *sdp_ptr, u16 level) (mca_p->port_format != SDP_PORT_NUM_VPI_VCI_CID)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Port num not valid for media line %u", - sdp_p->debug_str, level); + sdp_p->debug_str, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -1364,7 +1407,7 @@ int32 sdp_get_media_portcount (void *sdp_ptr, u16 level) if (mca_p->port_format != SDP_PORT_NUM_COUNT) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Port count not valid for media line %u", - sdp_p->debug_str, level); + sdp_p->debug_str, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -1401,7 +1444,7 @@ int32 sdp_get_media_vpi (void *sdp_ptr, u16 level) (mca_p->port_format != SDP_PORT_NUM_VPI_VCI_CID)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s VPI not valid for media line %u", - sdp_p->debug_str, level); + sdp_p->debug_str, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -1438,7 +1481,7 @@ u32 sdp_get_media_vci (void *sdp_ptr, u16 level) (mca_p->port_format != SDP_PORT_NUM_VPI_VCI_CID)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s VCI not valid for media line %u", - sdp_p->debug_str, level); + sdp_p->debug_str, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -1474,7 +1517,7 @@ int32 sdp_get_media_vcci (void *sdp_ptr, u16 level) (mca_p->port_format != SDP_PORT_VCCI_CID)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s VCCI not valid for media line %u", - sdp_p->debug_str, level); + sdp_p->debug_str, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -1510,7 +1553,7 @@ int32 sdp_get_media_cid (void *sdp_ptr, u16 level) (mca_p->port_format != SDP_PORT_NUM_VPI_VCI_CID)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s CID not valid for media line %u", - sdp_p->debug_str, level); + sdp_p->debug_str, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -1675,6 +1718,93 @@ u16 sdp_get_media_profile_num_payload_types (void *sdp_ptr, u16 level, } } +rtp_ptype sdp_get_known_payload_type(void *sdp_ptr, + u16 level, + u16 payload_type_raw) { + sdp_t *sdp_p = (sdp_t *)sdp_ptr; + sdp_attr_t *attr_p; + sdp_transport_map_t *rtpmap; + uint16_t pack_mode = 0; /*default 0, if remote did not provide any */ + const char *encname = NULL; + uint16_t num_a_lines = 0; + int i; + + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { + return (RTP_NONE); + } + + /* + * Get number of RTPMAP attributes for the media line + */ + (void) sdp_attr_num_instances(sdp_p, level, 0, SDP_ATTR_RTPMAP, + &num_a_lines); + + /* + * Loop through media line RTPMAP attributes. + */ + for (i = 0; i < num_a_lines; i++) { + attr_p = sdp_find_attr(sdp_p, level, 0, SDP_ATTR_RTPMAP, (i + 1)); + if (attr_p == NULL) { + if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { + CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " + "not found.", + sdp_p->debug_str, + (unsigned)level, + (unsigned)(i + 1)); + } + sdp_p->conf_p->num_invalid_param++; + return (RTP_NONE); + } + + rtpmap = &(attr_p->attr.transport_map); + + if (rtpmap->payload_num == payload_type_raw) { + encname = rtpmap->encname; + if (encname) { + if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_ILBC) == 0) { + return (RTP_ILBC); + } + if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_L16_256K) == 0) { + return (RTP_L16); + } + if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_ISAC) == 0) { + return (RTP_ISAC); + } + if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_OPUS) == 0) { + return (RTP_OPUS); + } + if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_PCMU) == 0) { + return (RTP_PCMU); + } + if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_PCMA) == 0) { + return (RTP_PCMA); + } + if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_G722) == 0) { + return (RTP_G722); + } + if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_H264) == 0) { + int fmtp_inst = sdp_find_fmtp_inst(sdp_p, level, rtpmap->payload_num); + if (fmtp_inst < 0) { + return (RTP_H264_P0); + } else { + sdp_attr_get_fmtp_pack_mode(sdp_p, level, 0, (uint16_t) fmtp_inst, &pack_mode); + if (pack_mode == SDP_DEFAULT_PACKETIZATION_MODE_VALUE) { + return (RTP_H264_P0); + } else { + return (RTP_H264_P1); + } + } + } + if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_VP8) == 0) { + return (RTP_VP8); + } + } + } + } + + return (RTP_NONE); +} + /* Function: sdp_get_media_payload_type * Description: Returns the payload type of the specified payload for the m= * media token line. If the media line or payload number is @@ -1693,12 +1823,7 @@ u32 sdp_get_media_payload_type (void *sdp_ptr, u16 level, u16 payload_num, { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_mca_t *mca_p; - uint16_t num_a_lines = 0; - int i; - uint16_t ptype; - uint16_t pack_mode = 0; /*default 0, if remote did not provide any */ - const char *encname = NULL; - + rtp_ptype ptype; if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (0); } @@ -1715,54 +1840,14 @@ u32 sdp_get_media_payload_type (void *sdp_ptr, u16 level, u16 payload_num, *indicator = mca_p->payload_indicator[payload_num-1]; if ((mca_p->payload_type[payload_num-1] >= SDP_MIN_DYNAMIC_PAYLOAD) && (mca_p->payload_type[payload_num-1] <= SDP_MAX_DYNAMIC_PAYLOAD)) { - /* - * Get number of RTPMAP attributes for the AUDIO line - */ - (void) sdp_attr_num_instances(sdp_p, level, 0, SDP_ATTR_RTPMAP, - &num_a_lines); - /* - * Loop through AUDIO media line RTPMAP attributes. - * NET dynamic payload type will be returned. - */ - for (i = 0; i < num_a_lines; i++) { - ptype = sdp_attr_get_rtpmap_payload_type(sdp_p, level, 0, - (uint16_t) (i + 1)); - if (ptype == mca_p->payload_type[payload_num-1] ) { - encname = sdp_attr_get_rtpmap_encname(sdp_p, level, 0, - (uint16_t) (i + 1)); - if (encname) { - if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_ILBC) == 0) { - return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_ILBC)); - } - if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_L16_256K) == 0) { - return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_L16)); - } - if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_ISAC) == 0) { - return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_ISAC)); - } - if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_OPUS) == 0) { - return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_OPUS)); - } - if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_H264) == 0) { - int fmtp_inst = sdp_find_fmtp_inst(sdp_p, level, + ptype = sdp_get_known_payload_type(sdp_ptr, + level, mca_p->payload_type[payload_num-1]); - if (fmtp_inst < 0) { - return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_H264_P0)); - } else { - sdp_attr_get_fmtp_pack_mode(sdp_p, level, 0, (uint16_t) fmtp_inst, &pack_mode); - if (pack_mode == SDP_DEFAULT_PACKETIZATION_MODE_VALUE) { - return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_H264_P0)); - } else { - return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_H264_P1)); - } - } - } - if (cpr_strcasecmp(encname, SIPSDP_ATTR_ENCNAME_VP8) == 0) { - return (SET_PAYLOAD_TYPE_WITH_DYNAMIC(ptype, RTP_VP8)); - } - } - } + if (ptype != RTP_NONE) { + return (SET_PAYLOAD_TYPE_WITH_DYNAMIC( + mca_p->payload_type[payload_num-1], ptype)); } + } return (mca_p->payload_type[payload_num-1]); } @@ -1832,14 +1917,14 @@ sdp_result_e sdp_insert_media_line (void *sdp_ptr, u16 level) if ((level < 1) || (level > (sdp_p->mca_count+1))) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Invalid media line (%u) to insert, max is " - "(%u).", sdp_p->debug_str, level, sdp_p->mca_count); + "(%u).", sdp_p->debug_str, (unsigned)level, (unsigned)sdp_p->mca_count); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } /* Allocate resource for new media stream. */ - new_mca_p = sdp_alloc_mca(); + new_mca_p = sdp_alloc_mca(0); if (new_mca_p == NULL) { sdp_p->conf_p->num_no_resource++; return (SDP_NO_RESOURCE); @@ -2264,7 +2349,7 @@ sdp_result_e sdp_add_media_profile (void *sdp_ptr, u16 level, if (mca_p->media_profiles_p->num_profiles >= SDP_MAX_PROFILES) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Max number of media profiles already specified" - " for media level %u", sdp_p->debug_str, level); + " for media level %u", sdp_p->debug_str, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2307,7 +2392,7 @@ sdp_result_e sdp_add_media_payload_type (void *sdp_ptr, u16 level, if (mca_p->num_payloads == SDP_MAX_PAYLOAD_TYPES) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Max number of payload types already defined " - "for media line %u", sdp_p->debug_str, level); + "for media line %u", sdp_p->debug_str, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2352,7 +2437,7 @@ sdp_result_e sdp_add_media_profile_payload_type (void *sdp_ptr, u16 level, (prof_num > mca_p->media_profiles_p->num_profiles)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Invalid profile number (%u) for set profile " - " payload type", sdp_p->debug_str, level); + " payload type", sdp_p->debug_str, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2363,7 +2448,7 @@ sdp_result_e sdp_add_media_profile_payload_type (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Max number of profile payload types already " "defined profile %u on media line %u", - sdp_p->debug_str, prof_num, level); + sdp_p->debug_str, (unsigned)prof_num, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2464,7 +2549,7 @@ sdp_result_e sdp_copy_all_bw_lines (void *src_sdp_ptr, void *dst_sdp_ptr, if (mca_p == NULL) { if (src_sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Invalid src media level (%u) for copy all " - "attrs ", src_sdp_p->debug_str, src_level); + "attrs ", src_sdp_p->debug_str, (unsigned)src_level); } return (SDP_INVALID_PARAMETER); } @@ -2479,7 +2564,7 @@ sdp_result_e sdp_copy_all_bw_lines (void *src_sdp_ptr, void *dst_sdp_ptr, if (mca_p == NULL) { if (src_sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Invalid dst media level (%u) for copy all " - "attrs ", src_sdp_p->debug_str, dst_level); + "attrs ", src_sdp_p->debug_str, (unsigned)dst_level); } return (SDP_INVALID_PARAMETER); } @@ -2759,8 +2844,8 @@ sdp_result_e sdp_delete_bw_line (void *sdp_ptr, u16 level, u16 inst_num) if (bw_data_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s bw line instance %d not found.", - sdp_p->debug_str, inst_num); + CSFLogError(logTag, "%s bw line instance %u not found.", + sdp_p->debug_str, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2817,7 +2902,7 @@ sdp_result_e sdp_set_bw (void *sdp_ptr, u16 level, u16 inst_num, if (bw_data_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s The %u instance of a b= line was not found at level %u.", - sdp_p->debug_str, inst_num, level); + sdp_p->debug_str, (unsigned)inst_num, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c index 95bfaf298ae6..a1e89c552b60 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr.c @@ -4,15 +4,15 @@ #include #include +#include #include "plstr.h" #include "sdp_os_defs.h" #include "sdp.h" #include "sdp_private.h" #include "sdp_base64.h" -#include "mozilla/Assertions.h" + #include "CSFLog.h" -#include "DataChannelProtocol.h" static const char* logTag = "sdp_attr"; @@ -109,7 +109,7 @@ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the attribute type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), ": \t", &result); if (ptr == NULL) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No attribute type specified, parse failed.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -119,7 +119,7 @@ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) ptr++; } if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No attribute type specified, parse failed.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -130,6 +130,7 @@ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) sdp_p->conf_p->num_no_resource++; return (SDP_NO_RESOURCE); } + attr_p->line_number = sdp_p->parse_line; attr_p->type = SDP_ATTR_INVALID; attr_p->next_p = NULL; for (i=0; i < SDP_MAX_ATTR_TYPES; i++) { @@ -139,7 +140,7 @@ sdp_result_e sdp_parse_attribute (sdp_t *sdp_p, u16 level, const char *ptr) } } if (attr_p->type == SDP_ATTR_INVALID) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Unrecognized attribute (%s) ", sdp_p->debug_str, tmp); sdp_free_attr(attr_p); @@ -223,7 +224,7 @@ sdp_result_e sdp_build_attribute (sdp_t *sdp_p, u16 level, flex_string *fs) if (attr_p->type >= SDP_MAX_ATTR_TYPES) { if (sdp_p->debug_flag[SDP_DEBUG_WARNINGS]) { CSFLogDebug(logTag, "%s Invalid attribute type to build (%u)", - sdp_p->debug_str, attr_p->type); + sdp_p->debug_str, (unsigned)attr_p->type); } } else { result = sdp_attr[attr_p->type].build_func(sdp_p, attr_p, fs); @@ -253,7 +254,7 @@ sdp_result_e sdp_parse_attr_simple_string (sdp_t *sdp_p, sdp_attr_t *attr_p, sizeof(attr_p->attr.string_val), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No string token found for %s attribute", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); sdp_p->conf_p->num_invalid_param++; @@ -285,7 +286,7 @@ sdp_result_e sdp_parse_attr_simple_u32 (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.u32_val = sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Numeric token for %s attribute not found", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); sdp_p->conf_p->num_invalid_param++; @@ -320,7 +321,7 @@ sdp_result_e sdp_parse_attr_simple_bool (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Boolean token for %s attribute not found", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); sdp_p->conf_p->num_invalid_param++; @@ -372,14 +373,14 @@ sdp_result_e sdp_parse_attr_maxprate (sdp_t *sdp_p, sdp_attr_t *attr_p, sizeof(attr_p->attr.string_val), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No string token found for %s attribute", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } else { if (!sdp_validate_maxprate(attr_p->attr.string_val)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s is not a valid maxprate value.", attr_p->attr.string_val); sdp_p->conf_p->num_invalid_param++; @@ -403,7 +404,7 @@ sdp_result_e sdp_parse_attr_maxprate (sdp_t *sdp_p, sdp_attr_t *attr_p, */ static void sdp_attr_fmtp_no_value(sdp_t *sdp, char *param_name) { - sdp_parse_error(sdp->peerconnection, + sdp_parse_error(sdp, "%s Warning: No %s value specified for fmtp attribute", sdp->debug_str, param_name); sdp->conf_p->num_invalid_param++; @@ -419,7 +420,7 @@ static void sdp_attr_fmtp_no_value(sdp_t *sdp, char *param_name) static void sdp_attr_fmtp_invalid_value(sdp_t *sdp, char *param_name, char* param_value) { - sdp_parse_error(sdp->peerconnection, + sdp_parse_error(sdp, "%s Warning: Invalid %s: %s specified for fmtp attribute", sdp->debug_str, param_name, param_value); sdp->conf_p->num_invalid_param++; @@ -1852,7 +1853,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } if ((result1 != SDP_SUCCESS) || (result2 != SDP_SUCCESS)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid named events specified for fmtp attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -1871,7 +1872,7 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (fmtp_p->maxval == 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No named events specified for fmtp attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -1888,7 +1889,8 @@ sdp_result_e sdp_parse_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, return (SDP_SUCCESS); } -sdp_result_e sdp_build_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) +sdp_result_e +sdp_build_attr_fmtp_params (sdp_t *sdp_p, sdp_fmtp_t *fmtp_p, flex_string *fs) { u16 event_id; u32 mask; @@ -1898,13 +1900,7 @@ sdp_result_e sdp_build_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string tinybool range_start = FALSE; tinybool range_end = FALSE; tinybool semicolon = FALSE; - sdp_fmtp_t *fmtp_p; - flex_string_sprintf(fs, "a=%s:%u ", - sdp_attr[attr_p->type].name, - attr_p->attr.fmtp.payload_num); - - fmtp_p = &(attr_p->attr.fmtp); switch (fmtp_p->fmtp_format) { case SDP_FMTP_MODE: sdp_append_name_and_unsigned(fs, "mode", fmtp_p->mode, FALSE); @@ -2109,6 +2105,25 @@ sdp_result_e sdp_build_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string } } } + return SDP_SUCCESS; +} + +sdp_result_e sdp_build_attr_fmtp (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) +{ + sdp_fmtp_t *fmtp_p; + sdp_result_e result; + + flex_string_sprintf(fs, "a=%s:%u ", + sdp_attr[attr_p->type].name, + attr_p->attr.fmtp.payload_num); + + fmtp_p = &(attr_p->attr.fmtp); + + result = sdp_build_attr_fmtp_params(sdp_p, fmtp_p, fs); + + if (result != SDP_SUCCESS) { + return result; + } flex_string_append(fs, "\r\n"); @@ -2126,7 +2141,7 @@ sdp_result_e sdp_parse_attr_sctpmap(sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.sctpmap.port = (u16)sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: no sctpmap port number", sdp_p->debug_str); return SDP_INVALID_PARAMETER; @@ -2134,7 +2149,7 @@ sdp_result_e sdp_parse_attr_sctpmap(sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No sctpmap protocol specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2145,19 +2160,13 @@ sdp_result_e sdp_parse_attr_sctpmap(sdp_t *sdp_p, sdp_attr_t *attr_p, streams = sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No sctpmap streams specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; } - /* streams value should be kept in the range 1..MAX_NUM_STREAMS */ - if (streams < 1) { - streams = 1; - } else if (streams > MAX_NUM_STREAMS) { - streams = MAX_NUM_STREAMS; - } attr_p->attr.sctpmap.streams = streams; return SDP_SUCCESS; @@ -2166,8 +2175,6 @@ sdp_result_e sdp_parse_attr_sctpmap(sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_result_e sdp_build_attr_sctpmap(sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) { - MOZ_ASSERT(strlen(attr_p->attr.sctpmap.protocol) > 0); - flex_string_sprintf(fs, "a=%s:%u %s %u\r\n", sdp_attr[attr_p->type].name, attr_p->attr.sctpmap.port, @@ -2206,7 +2213,7 @@ sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the strength tag. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No qos strength tag specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2220,7 +2227,7 @@ sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.qos.strength == SDP_QOS_STRENGTH_UNKNOWN) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: QOS strength tag unrecognized (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -2230,7 +2237,7 @@ sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the qos direction. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No qos direction specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2244,7 +2251,7 @@ sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.qos.direction == SDP_QOS_DIR_UNKNOWN) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: QOS direction unrecognized (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -2259,7 +2266,7 @@ sdp_result_e sdp_parse_attr_qos (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.qos.confirm = TRUE; } if (attr_p->attr.qos.confirm == FALSE) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: QOS confirm parameter invalid (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -2298,7 +2305,7 @@ sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the curr type tag. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No curr attr type specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2313,7 +2320,7 @@ sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.curr.type != SDP_CURR_QOS_TYPE) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Unknown curr type.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2323,7 +2330,7 @@ sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Check qos status type */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No curr attr type specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2341,7 +2348,7 @@ sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the qos direction. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No qos direction specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2355,7 +2362,7 @@ sdp_result_e sdp_parse_attr_curr (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.curr.direction == SDP_QOS_DIR_UNKNOWN) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: QOS direction unrecognized (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -2394,7 +2401,7 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the curr type tag. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No des attr type specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2409,7 +2416,7 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.des.type != SDP_DES_QOS_TYPE) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Unknown conf type.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2419,7 +2426,7 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the strength tag. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No qos strength tag specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2433,7 +2440,7 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.des.strength == SDP_QOS_STRENGTH_UNKNOWN) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: QOS strength tag unrecognized (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -2443,7 +2450,7 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Check qos status type */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No des attr type specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2461,7 +2468,7 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the qos direction. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No qos direction specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2475,7 +2482,7 @@ sdp_result_e sdp_parse_attr_des (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.des.direction == SDP_QOS_DIR_UNKNOWN) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: QOS direction unrecognized (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -2517,7 +2524,7 @@ sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the curr type tag. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No conf attr type specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2532,7 +2539,7 @@ sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.conf.type != SDP_CONF_QOS_TYPE) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Unknown conf type.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2542,7 +2549,7 @@ sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Check qos status type */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No conf attr type specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2560,7 +2567,7 @@ sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the qos direction. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No qos direction specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2574,7 +2581,7 @@ sdp_result_e sdp_parse_attr_conf (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.conf.direction == SDP_QOS_DIR_UNKNOWN) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: QOS direction unrecognized (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -2622,7 +2629,7 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.transport_map.payload_num = (u16)sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid payload type specified for %s attribute.", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); sdp_p->conf_p->num_invalid_param++; @@ -2633,7 +2640,7 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, attr_p->attr.transport_map.encname, sizeof(attr_p->attr.transport_map.encname), "/ \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No encoding name specified in %s attribute.", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); sdp_p->conf_p->num_invalid_param++; @@ -2644,7 +2651,7 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.transport_map.clockrate = sdp_getnextnumtok(ptr, &ptr, "/ \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No clockrate specified for " "%s attribute, set to default of 8000.", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); @@ -2657,7 +2664,7 @@ sdp_result_e sdp_parse_attr_transport_map (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.transport_map.num_chan = (u16)sdp_getnextnumtok(ptr, &ptr, "/ \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid number of channels parameter" " for rtpmap attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2718,7 +2725,7 @@ sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the subnet network type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No network type specified in subnet attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2738,7 +2745,7 @@ sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.subnet.nettype == SDP_NT_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Subnet network type unsupported (%s).", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -2748,7 +2755,7 @@ sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the subnet address type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No address type specified in subnet attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2768,7 +2775,7 @@ sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.subnet.addrtype == SDP_AT_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Subnet address type unsupported (%s).", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -2779,7 +2786,7 @@ sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, attr_p->attr.subnet.addr, sizeof(attr_p->attr.subnet.addr), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No subnet address specified in " "subnet attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2793,7 +2800,7 @@ sdp_result_e sdp_parse_attr_subnet (sdp_t *sdp_p, sdp_attr_t *attr_p, (const char **)&slash_ptr, " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid subnet prefix specified in " "subnet attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2848,7 +2855,7 @@ sdp_result_e sdp_parse_attr_t38_ratemgmt (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the rate mgmt. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No t38 rate management specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2891,7 +2898,7 @@ sdp_result_e sdp_parse_attr_t38_udpec (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the udpec. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No t38 udpEC specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -2940,7 +2947,7 @@ sdp_result_e sdp_parse_attr_pc_codec (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.pccodec.num_payloads == 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No payloads specified for %s attr.", sdp_p->debug_str, sdp_attr[attr_p->type].name); sdp_p->conf_p->num_invalid_param++; @@ -2996,7 +3003,7 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Allocate resource for new capability. Note that the capability * uses the same structure used for media lines. */ - cap_p = sdp_alloc_mca(); + cap_p = sdp_alloc_mca(sdp_p->parse_line); if (cap_p == NULL) { sdp_p->conf_p->num_no_resource++; return (SDP_NO_RESOURCE); @@ -3006,7 +3013,7 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, * calculate it for ourselves as we need to. But it must be specified. */ (void)sdp_getnextnumtok(ptr, &ptr, "/ \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Capability not specified for %s, " "unable to parse.", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); @@ -3018,7 +3025,7 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the media type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No media type specified for %s attribute, " "unable to parse.", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); @@ -3034,7 +3041,7 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (cap_p->media == SDP_MEDIA_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Media type unsupported (%s).", sdp_p->debug_str, tmp); SDP_FREE(cap_p); @@ -3045,7 +3052,7 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the transport protocol type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No transport protocol type specified, " "unable to parse.", sdp_p->debug_str); SDP_FREE(cap_p); @@ -3061,7 +3068,7 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (cap_p->transport == SDP_TRANSPORT_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Transport protocol type unsupported (%s).", sdp_p->debug_str, tmp); SDP_FREE(cap_p); @@ -3077,7 +3084,7 @@ sdp_result_e sdp_parse_attr_cap (sdp_t *sdp_p, sdp_attr_t *attr_p, (cap_p->transport == SDP_TRANSPORT_AAL2_CUSTOM)) { /* Capability processing is not currently defined for AAL2 types * with multiple profiles. We don't process. */ - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: AAL2 profiles unsupported with " "%s attributes.", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); @@ -3223,7 +3230,7 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if ((cap_attr_p == NULL) || (cap_attr_p->attr.cap_p == NULL)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: %s attribute specified with no " "prior %s attribute", sdp_p->debug_str, sdp_get_attr_name(attr_p->type), @@ -3242,7 +3249,7 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, (attr_p->type == SDP_ATTR_X_CPAR)) || ( (cap_attr_p->type == SDP_ATTR_X_CAP) && (attr_p->type == SDP_ATTR_CPAR)) ) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: %s attribute inconsistent with " "prior %s attribute", sdp_p->debug_str, sdp_get_attr_name(attr_p->type), @@ -3256,7 +3263,7 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), "= \t", &result); if ((result != SDP_SUCCESS) || (tmp[0] != 'a') || (tmp[1] != '\0')) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid token type (%s) in %s " "attribute, unable to parse", sdp_p->debug_str, tmp, sdp_get_attr_name(attr_p->type)); @@ -3282,7 +3289,7 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr++; } if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No attribute type specified for %s attribute, unable to parse.", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); @@ -3300,7 +3307,7 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->type == SDP_ATTR_INVALID) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Unrecognized attribute (%s) for %s attribute, unable to parse.", sdp_p->debug_str, tmp, sdp_get_attr_name(attr_p->type)); @@ -3315,7 +3322,7 @@ sdp_result_e sdp_parse_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, (attr_p->type == SDP_ATTR_SQN) || (attr_p->type == SDP_ATTR_CDSC) || (attr_p->type == SDP_ATTR_CPAR)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid attribute (%s) for %s" " attribute, unable to parse.", sdp_p->debug_str, tmp, sdp_get_attr_name(attr_p->type)); @@ -3364,7 +3371,7 @@ sdp_result_e sdp_build_attr_cpar (sdp_t *sdp_p, sdp_attr_t *attr_p, while (attr_p != NULL) { if (attr_p->type >= SDP_MAX_ATTR_TYPES) { CSFLogDebug(logTag, "%s Invalid attribute type to build (%u)", - sdp_p->debug_str, attr_p->type); + sdp_p->debug_str, (unsigned)attr_p->type); } else { flex_string_sprintf(fs, "a=%s: ", cpar_name); @@ -3407,7 +3414,7 @@ sdp_result_e sdp_parse_attr_rtr (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.rtr.confirm = TRUE; } if (attr_p->attr.rtr.confirm == FALSE) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: RTR confirm parameter invalid (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -3449,7 +3456,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), ": \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No role parameter specified for " "comediadir attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3465,7 +3472,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.comediadir.role == SDP_MEDIADIR_ROLE_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid role type specified for " "comediadir attribute (%s).", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -3485,7 +3492,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, /* parse to get the nettype */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No network type specified in comediadir " "attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3505,7 +3512,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.comediadir.conn_info.nettype == SDP_NT_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: ConnInfo in Comediadir: network type " "unsupported (%s).", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -3514,7 +3521,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the comedia address type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No address type specified in comediadir" " attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3533,7 +3540,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.comediadir.conn_info.addrtype == SDP_AT_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Conninfo address type unsupported " "(%s).", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -3543,7 +3550,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, attr_p->attr.comediadir.conn_info.conn_addr, sizeof(attr_p->attr.comediadir.conn_info.conn_addr), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No conninfo address specified in " "comediadir attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3553,7 +3560,7 @@ sdp_result_e sdp_parse_attr_comediadir (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.comediadir.src_port = sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No src port specified in " "comediadir attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3597,7 +3604,7 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No silenceSupp enable value specified, parse failed.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3611,7 +3618,7 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, } else if (cpr_strncasecmp(tmp, "-", sizeof("-")) == 0) { attr_p->attr.silencesupp.enabled = FALSE; } else { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: silenceSuppEnable parameter invalid (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -3625,7 +3632,7 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, &attr_p->attr.silencesupp.timer_null, &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid timer value specified for " "silenceSupp attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3635,7 +3642,7 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find suppPref */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No silenceSupp pref specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3649,7 +3656,7 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.silencesupp.pref == SDP_SILENCESUPP_PREF_UNKNOWN) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: silenceSupp pref unrecognized (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -3659,7 +3666,7 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find sidUse */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No silenceSupp sidUse specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3673,7 +3680,7 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.silencesupp.siduse == SDP_SILENCESUPP_SIDUSE_UNKNOWN) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: silenceSupp sidUse unrecognized (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -3687,7 +3694,7 @@ sdp_result_e sdp_parse_attr_silencesupp (sdp_t *sdp_p, sdp_attr_t *attr_p, &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid fxnslevel value specified for " "silenceSupp attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3765,7 +3772,7 @@ 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; @@ -3775,7 +3782,7 @@ tinybool sdp_parse_context_crypto_suite(char * str, sdp_attr_t *attr_p, sdp_t * } } /* couldn't find a matching crypto suite */ - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No Matching crypto suite for SRTP Context(%s)-'X-crypto:v1' expected", sdp_p->debug_str, str); @@ -3797,10 +3804,12 @@ sdp_result_e sdp_build_attr_srtpcontext (sdp_t *sdp_p, sdp_attr_t *attr_p, output_len = MAX_BASE64_ENCODE_SIZE_BYTES; /* Append master and salt keys */ - bcopy(attr_p->attr.srtp_context.master_key, base64_encoded_input, + memcpy(base64_encoded_input, + attr_p->attr.srtp_context.master_key, key_size ); - bcopy(attr_p->attr.srtp_context.master_salt, - base64_encoded_input + key_size, salt_size ); + memcpy(base64_encoded_input + key_size, + attr_p->attr.srtp_context.master_salt, + salt_size ); if ((status = base64_encode(base64_encoded_input, key_size + salt_size, base64_encoded_data, &output_len)) != BASE64_SUCCESS) { @@ -3857,7 +3866,7 @@ sdp_result_e sdp_parse_attr_mptime ( * and optionally log the failure. */ if (attr_p->attr.mptime.num_intervals == 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No intervals specified for %s attr.", sdp_p->debug_str, sdp_attr[attr_p->type].name); sdp_p->conf_p->num_invalid_param++; @@ -3933,7 +3942,7 @@ sdp_result_e sdp_parse_attr_x_sidin (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, attr_p->attr.stream_data.x_sidin, sizeof(attr_p->attr.stream_data.x_sidin), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No Stream Id incoming specified for X-sidin attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -3973,7 +3982,7 @@ sdp_result_e sdp_parse_attr_x_sidout (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, attr_p->attr.stream_data.x_sidout, sizeof(attr_p->attr.stream_data.x_sidout), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No Stream Id outgoing specified for X-sidout attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4014,7 +4023,7 @@ sdp_result_e sdp_parse_attr_x_confid (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, attr_p->attr.stream_data.x_confid, sizeof(attr_p->attr.stream_data.x_confid), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No Conf Id incoming specified for " "X-confid attribute.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4052,7 +4061,7 @@ sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; - char tmp[10]; + char tmp[64]; int i=0; if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { @@ -4063,7 +4072,7 @@ sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the a=group: < id2> ... values */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No group attribute value specified for " "a=group line", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4080,7 +4089,7 @@ sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.stream_data.group_attr == SDP_GROUP_ATTR_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Group attribute type unsupported (%s).", sdp_p->debug_str, tmp); } @@ -4093,11 +4102,16 @@ sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.stream_data.num_group_id =0; for (i=0; iattr.stream_data.group_id_arr[i] = - (u16)sdp_getnextnumtok(ptr,&ptr," \t", &result); + ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); + if (result != SDP_SUCCESS) { break; } + attr_p->attr.stream_data.group_ids[i] = cpr_strdup(tmp); + if (!attr_p->attr.stream_data.group_ids[i]) { + break; + } + attr_p->attr.stream_data.num_group_id++; } @@ -4106,8 +4120,8 @@ sdp_result_e sdp_parse_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_get_attr_name(attr_p->type), sdp_get_group_attr_name (attr_p->attr.stream_data.group_attr)); for (i=0; i < attr_p->attr.stream_data.num_group_id; i++) { - SDP_PRINT("%s Parsed group line id : %d\n", sdp_p->debug_str, - attr_p->attr.stream_data.group_id_arr[i]); + SDP_PRINT("%s Parsed group line id : %s\n", sdp_p->debug_str, + attr_p->attr.stream_data.group_ids[i]); } } return (SDP_SUCCESS); @@ -4123,9 +4137,9 @@ sdp_result_e sdp_build_attr_group (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_get_group_attr_name(attr_p->attr.stream_data.group_attr)); for (i=0; i < attr_p->attr.stream_data.num_group_id; i++) { - if (attr_p->attr.stream_data.group_id_arr[i] > 0) { - flex_string_sprintf(fs, " %u", - attr_p->attr.stream_data.group_id_arr[i]); + if (attr_p->attr.stream_data.group_ids[i]) { + flex_string_sprintf(fs, " %s", + attr_p->attr.stream_data.group_ids[i]); } } @@ -4154,7 +4168,7 @@ sdp_result_e sdp_parse_attr_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, /* Find the filter mode */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No src filter attribute value specified for " "a=source-filter line", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4169,7 +4183,7 @@ sdp_result_e sdp_parse_attr_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, } if (attr_p->attr.source_filter.mode == SDP_FILTER_MODE_NOT_PRESENT) { /* No point continuing */ - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid src filter mode for a=source-filter " "line", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4191,7 +4205,7 @@ sdp_result_e sdp_parse_attr_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.source_filter.nettype == SDP_NT_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Network type unsupported " "(%s) for a=source-filter", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -4216,7 +4230,7 @@ sdp_result_e sdp_parse_attr_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, if (strncmp(tmp, "*", 1) == 0) { attr_p->attr.source_filter.addrtype = SDP_AT_FQDN; } else { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Address type unsupported " "(%s) for a=source-filter", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -4228,7 +4242,7 @@ sdp_result_e sdp_parse_attr_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, attr_p->attr.source_filter.dest_addr, sizeof(attr_p->attr.source_filter.dest_addr), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No filter destination address specified for " "a=source-filter", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4245,7 +4259,7 @@ sdp_result_e sdp_parse_attr_source_filter (sdp_t *sdp_p, sdp_attr_t *attr_p, attr_p->attr.source_filter.num_src_addr++; } if (attr_p->attr.source_filter.num_src_addr == 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No source list provided " "for a=source-filter", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4293,7 +4307,7 @@ sdp_result_e sdp_parse_attr_rtcp_unicast (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No rtcp unicast mode specified for " "a=rtcp-unicast line", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4307,7 +4321,7 @@ sdp_result_e sdp_parse_attr_rtcp_unicast (sdp_t *sdp_p, sdp_attr_t *attr_p, } } if (attr_p->attr.u32_val == SDP_RTCP_UNICAST_MODE_NOT_PRESENT) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid rtcp unicast mode for " "a=rtcp-unicast line", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4415,7 +4429,7 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, ptr = str; if (cpr_strncasecmp(ptr, "inline:", 7) != 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Could not find keyword inline", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; return FALSE; @@ -4436,7 +4450,7 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, (unsigned char *)base64decodeData, &len); if (status != BASE64_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s key-salt error decoding buffer: %s", sdp_p->debug_str, BASE64_RESULT_TO_STRING(status)); return FALSE; @@ -4446,16 +4460,19 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, saltSize = attr_p->attr.srtp_context.master_salt_size_bytes; if (len != keySize + saltSize) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s key-salt size doesn't match: (%d, %d, %d)", sdp_p->debug_str, len, keySize, saltSize); return(FALSE); } - bcopy(base64decodeData, attr_p->attr.srtp_context.master_key, keySize); + memcpy(attr_p->attr.srtp_context.master_key, + base64decodeData, + keySize); - bcopy(base64decodeData + keySize, - attr_p->attr.srtp_context.master_salt, saltSize); + memcpy(attr_p->attr.srtp_context.master_salt, + base64decodeData + keySize, + saltSize); /* Used only for MGCP */ SDP_SRTP_CONTEXT_SET_MASTER_KEY @@ -4473,7 +4490,7 @@ sdp_parse_sdescriptions_key_param (const char *str, sdp_attr_t *attr_p, /* if we didn't find the key, error out */ if (keyFound == FALSE) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Could not find sdescriptions key", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; return FALSE; @@ -4510,11 +4527,13 @@ sdp_build_attr_sdescriptions (sdp_t *sdp_p, sdp_attr_t *attr_p, saltSize = attr_p->attr.srtp_context.master_salt_size_bytes; /* concatenate the master key + salt then base64 encode it */ - bcopy(attr_p->attr.srtp_context.master_key, - base64_encoded_input, keySize); + memcpy(base64_encoded_input, + attr_p->attr.srtp_context.master_key, + keySize); - bcopy(attr_p->attr.srtp_context.master_salt, - base64_encoded_input + keySize, saltSize); + memcpy(base64_encoded_input + keySize, + attr_p->attr.srtp_context.master_salt, + saltSize); outputLen = MAX_BASE64_STRING_LEN; status = base64_encode(base64_encoded_input, keySize + saltSize, @@ -4626,7 +4645,7 @@ sdp_parse_attr_srtp (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Could not find sdescriptions tag", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4638,28 +4657,28 @@ sdp_parse_attr_srtp (sdp_t *sdp_p, sdp_attr_t *attr_p, /* get the crypto suite */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Could not find sdescriptions crypto suite", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } if (!sdp_parse_context_crypto_suite(tmp, attr_p, sdp_p)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Unsupported crypto suite", sdp_p->debug_str); return (SDP_INVALID_PARAMETER); } ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Could not find sdescriptions key params", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } if (!sdp_parse_sdescriptions_key_param(tmp, attr_p, sdp_p)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Failed to parse key-params", sdp_p->debug_str); return (SDP_INVALID_PARAMETER); } @@ -4717,7 +4736,9 @@ sdp_result_e sdp_parse_attr_srtpcontext (sdp_t *sdp_p, sdp_attr_t *attr_p, sdp_result_e sdp_build_attr_ice_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) { - flex_string_sprintf(fs, "a=%s\r\n", attr_p->attr.ice_attr); + flex_string_sprintf(fs, "a=%s:%s\r\n", + sdp_get_attr_name(attr_p->type), + attr_p->attr.ice_attr); return SDP_SUCCESS; } @@ -4729,15 +4750,13 @@ sdp_result_e sdp_parse_attr_ice_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, const ch ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), "\r\n", &result); if (result != SDP_SUCCESS){ - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: problem parsing ice attribute ", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - /* We need the attr= here. This is pretty gross. */ - snprintf(attr_p->attr.ice_attr, sizeof(attr_p->attr.ice_attr), - "%s:%s", sdp_get_attr_name(attr_p->type), tmp); + snprintf(attr_p->attr.ice_attr, sizeof(attr_p->attr.ice_attr), "%s", tmp); if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parsed a=%s, %s", sdp_p->debug_str, sdp_get_attr_name(attr_p->type), tmp); @@ -4767,7 +4786,7 @@ sdp_result_e sdp_parse_attr_simple_flag (sdp_t *sdp_p, sdp_attr_t *attr_p, } -sdp_result_e sdp_parse_attr_fingerprint_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, +sdp_result_e sdp_parse_attr_complete_line (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { sdp_result_e result; @@ -4775,7 +4794,7 @@ sdp_result_e sdp_parse_attr_fingerprint_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, ptr = sdp_getnextstrtok(ptr, attr_p->attr.string_val, sizeof(attr_p->attr.string_val), "\r\n", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No string token found for %s attribute", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); sdp_p->conf_p->num_invalid_param++; @@ -4790,19 +4809,6 @@ sdp_result_e sdp_parse_attr_fingerprint_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, } } -sdp_result_e sdp_build_attr_rtcp_mux_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, - flex_string *fs) { - flex_string_append(fs, "a=rtcp-mux\r\n"); - - return SDP_SUCCESS; -} - -sdp_result_e sdp_parse_attr_rtcp_mux_attr (sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr) { - attr_p->attr.boolean_val = TRUE; - - return (SDP_SUCCESS); -} - sdp_result_e sdp_build_attr_rtcp_fb(sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs) @@ -4885,7 +4891,7 @@ static int find_token_enum(const char *attr_name, *ptr = sdp_getnextstrtok(*ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: problem parsing %s", sdp_p->debug_str, attr_name); sdp_p->conf_p->num_invalid_param++; return -1; @@ -4905,7 +4911,6 @@ sdp_result_e sdp_parse_attr_rtcp_fb (sdp_t *sdp_p, { sdp_result_e result = SDP_SUCCESS; sdp_fmtp_fb_t *rtcp_fb_p = &(attr_p->attr.rtcp_fb); - char tmp[SDP_MAX_STRING_LEN+1]; int i; /* Set up attribute fields */ @@ -4927,7 +4932,7 @@ sdp_result_e sdp_parse_attr_rtcp_fb (sdp_t *sdp_p, rtcp_fb_p->payload_num = (u16)sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: could not parse payload type for rtcp-fb attribute", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4940,7 +4945,7 @@ sdp_result_e sdp_parse_attr_rtcp_fb (sdp_t *sdp_p, i = find_token_enum("rtcp-fb attribute", sdp_p, &ptr, sdp_rtcp_fb_type_val, SDP_MAX_RTCP_FB, SDP_RTCP_FB_UNKNOWN); if (i < 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: could not parse feedback type for rtcp-fb attribute", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4954,7 +4959,7 @@ sdp_result_e sdp_parse_attr_rtcp_fb (sdp_t *sdp_p, sdp_rtcp_fb_ack_type_val, SDP_MAX_RTCP_FB_ACK, SDP_RTCP_FB_ACK_UNKNOWN); if (i < 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: could not parse ack type for rtcp-fb attribute", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4968,7 +4973,7 @@ sdp_result_e sdp_parse_attr_rtcp_fb (sdp_t *sdp_p, sdp_rtcp_fb_ccm_type_val, SDP_MAX_RTCP_FB_CCM, SDP_RTCP_FB_CCM_UNKNOWN); if (i < 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: could not parse ccm type for rtcp-fb attribute", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -4979,7 +4984,9 @@ sdp_result_e sdp_parse_attr_rtcp_fb (sdp_t *sdp_p, /* TODO -- We don't currently parse tmmbr parameters or vbcm submessage types. If we decide to support these modes of operation, we probably want to add parsing code for them. - For the time being, they'll just end up parsed into "extra". */ + For the time being, they'll just end up parsed into "extra" + Bug 1097169. + */ break; case SDP_RTCP_FB_NACK: @@ -4997,7 +5004,7 @@ sdp_result_e sdp_parse_attr_rtcp_fb (sdp_t *sdp_p, sdp_rtcp_fb_nack_type_val, SDP_MAX_RTCP_FB_NACK, SDP_RTCP_FB_NACK_UNKNOWN); if (i < 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: could not parse nack type for rtcp-fb attribute", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -5010,7 +5017,7 @@ sdp_result_e sdp_parse_attr_rtcp_fb (sdp_t *sdp_p, rtcp_fb_p->param.trr_int = sdp_getnextnumtok(ptr, &ptr, " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: could not parse trr-int value for rtcp-fb " "attribute", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -5073,7 +5080,7 @@ sdp_result_e sdp_parse_attr_setup(sdp_t *sdp_p, SDP_MAX_SETUP, SDP_SETUP_UNKNOWN); if (i < 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: could not parse setup attribute", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -5090,7 +5097,7 @@ sdp_result_e sdp_parse_attr_setup(sdp_t *sdp_p, /* All these values are OK */ break; case SDP_SETUP_UNKNOWN: - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Unknown setup attribute", sdp_p->debug_str); return SDP_INVALID_PARAMETER; @@ -5135,7 +5142,7 @@ sdp_result_e sdp_parse_attr_connection(sdp_t *sdp_p, SDP_MAX_CONNECTION, SDP_CONNECTION_UNKNOWN); if (i < 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: could not parse connection attribute", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -5150,7 +5157,7 @@ sdp_result_e sdp_parse_attr_connection(sdp_t *sdp_p, /* All these values are OK */ break; case SDP_CONNECTION_UNKNOWN: - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Unknown connection attribute", sdp_p->debug_str); return SDP_INVALID_PARAMETER; @@ -5184,6 +5191,7 @@ sdp_result_e sdp_parse_attr_extmap(sdp_t *sdp_p, attr_p->attr.extmap.id = 0; attr_p->attr.extmap.media_direction = SDP_DIRECTION_SENDRECV; + attr_p->attr.extmap.media_direction_specified = FALSE; attr_p->attr.extmap.uri[0] = '\0'; attr_p->attr.extmap.extension_attributes[0] = '\0'; @@ -5191,7 +5199,7 @@ sdp_result_e sdp_parse_attr_extmap(sdp_t *sdp_p, attr_p->attr.extmap.id = (u16)sdp_getnextnumtok(ptr, &ptr, "/ \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid extmap id specified for %s attribute.", sdp_p->debug_str, sdp_get_attr_name(attr_p->type)); sdp_p->conf_p->num_invalid_param++; @@ -5200,28 +5208,50 @@ sdp_result_e sdp_parse_attr_extmap(sdp_t *sdp_p, if (*ptr == '/') { char direction[SDP_MAX_STRING_LEN+1]; - /* Find the encoding name. */ + ++ptr; /* Skip over '/' */ ptr = sdp_getnextstrtok(ptr, direction, 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); - } + sdp_parse_error(sdp_p, + "%s Warning: Invalid direction 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); + } + + if (!cpr_strcasecmp(direction, "sendrecv")) { + attr_p->attr.extmap.media_direction = SDP_DIRECTION_SENDRECV; + } else if (!cpr_strcasecmp(direction, "sendonly")) { + attr_p->attr.extmap.media_direction = SDP_DIRECTION_SENDONLY; + } else if (!cpr_strcasecmp(direction, "recvonly")) { + attr_p->attr.extmap.media_direction = SDP_DIRECTION_RECVONLY; + } else if (!cpr_strcasecmp(direction, "inactive")) { + attr_p->attr.extmap.media_direction = SDP_DIRECTION_INACTIVE; + } else { + sdp_parse_error(sdp_p, + "%s Warning: Invalid direction 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); + } + attr_p->attr.extmap.media_direction_specified = TRUE; } ptr = sdp_getnextstrtok(ptr, attr_p->attr.extmap.uri, sizeof(attr_p->attr.extmap.uri), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%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); } + while (*ptr == ' ' || *ptr == '\t') { + ++ptr; + } + + /* Grab everything that follows, even if it contains whitespace */ ptr = sdp_getnextstrtok(ptr, attr_p->attr.extmap.extension_attributes, sizeof(attr_p->attr.extmap.extension_attributes), "\r\n", &result); @@ -5238,3 +5268,49 @@ sdp_result_e sdp_parse_attr_extmap(sdp_t *sdp_p, return (SDP_SUCCESS); } +sdp_result_e sdp_parse_attr_msid(sdp_t *sdp_p, + sdp_attr_t *attr_p, + const char *ptr) +{ + sdp_result_e result; + + ptr = sdp_getnextstrtok(ptr, attr_p->attr.msid.identifier, + sizeof(attr_p->attr.msid.identifier), " \t", &result); + if (result != SDP_SUCCESS) { + sdp_parse_error(sdp_p, "%s Warning: Bad msid identity value", + sdp_p->debug_str); + sdp_p->conf_p->num_invalid_param++; + return SDP_INVALID_PARAMETER; + } + + ptr = sdp_getnextstrtok(ptr, attr_p->attr.msid.appdata, + sizeof(attr_p->attr.msid.appdata), " \t", &result); + if ((result != SDP_SUCCESS) && (result != SDP_EMPTY_TOKEN)) { + sdp_parse_error(sdp_p, "%s Warning: Bad msid appdata value", + sdp_p->debug_str); + sdp_p->conf_p->num_invalid_param++; + return SDP_INVALID_PARAMETER; + } + if (result == SDP_EMPTY_TOKEN) { + attr_p->attr.msid.appdata[0] = '\0'; + } + + if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { + SDP_PRINT("%s Parsed a=msid, %s %s", sdp_p->debug_str, + attr_p->attr.msid.identifier, attr_p->attr.msid.appdata); + } + + return SDP_SUCCESS; +} + + +sdp_result_e sdp_build_attr_msid(sdp_t *sdp_p, + sdp_attr_t *attr_p, + flex_string *fs) +{ + flex_string_sprintf(fs, "a=msid:%s%s%s\r\n", + attr_p->attr.msid.identifier, + attr_p->attr.msid.appdata[0] ? " " : "", + attr_p->attr.msid.appdata); + return SDP_SUCCESS; +} 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 8b4603bc2ff5..0a8b1e476771 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c @@ -5,7 +5,7 @@ #include "sdp_os_defs.h" #include "sdp.h" #include "sdp_private.h" -#include "fsm.h" + #include "CSFLog.h" static const char* logTag = "sdp_attr_access"; @@ -350,6 +350,7 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) case SDP_ATTR_FRAMING: case SDP_ATTR_MAXPRATE: case SDP_ATTR_LABEL: + case SDP_ATTR_MID: sstrncpy(dst_attr_p->attr.string_val, src_attr_p->attr.string_val, SDP_MAX_STRING_LEN+1); break; @@ -366,7 +367,6 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) case SDP_ATTR_TC2_PAYLOAD_BYTES: case SDP_ATTR_TC2_WINDOW_SIZE: case SDP_ATTR_RTCP: - case SDP_ATTR_MID: case SDP_ATTR_RTCP_UNICAST: dst_attr_p->attr.u32_val = src_attr_p->attr.u32_val; break; @@ -569,6 +569,15 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) src_attr_p->attr.silencesupp.fxnslevel; break; + case SDP_ATTR_MPTIME: + dst_attr_p->attr.mptime.num_intervals = + src_attr_p->attr.mptime.num_intervals; + for (i=0; i < src_attr_p->attr.mptime.num_intervals; i++) { + dst_attr_p->attr.mptime.intervals[i] = + src_attr_p->attr.mptime.intervals[i]; + } + break; + case SDP_ATTR_RTR: dst_attr_p->attr.rtr.confirm = src_attr_p->attr.rtr.confirm; break; @@ -591,8 +600,8 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) src_attr_p->attr.stream_data.num_group_id; for (i=0; i < src_attr_p->attr.stream_data.num_group_id; i++) { - dst_attr_p->attr.stream_data.group_id_arr[i] = - src_attr_p->attr.stream_data.group_id_arr[i]; + dst_attr_p->attr.stream_data.group_ids[i] = + cpr_strdup(src_attr_p->attr.stream_data.group_ids[i]); } break; @@ -634,12 +643,12 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) dst_attr_p->attr.srtp_context.master_salt_size_bytes = src_attr_p->attr.srtp_context.master_salt_size_bytes; - bcopy(src_attr_p->attr.srtp_context.master_key, - dst_attr_p->attr.srtp_context.master_key, + memcpy(dst_attr_p->attr.srtp_context.master_key, + src_attr_p->attr.srtp_context.master_key, SDP_SRTP_MAX_KEY_SIZE_BYTES); - bcopy(src_attr_p->attr.srtp_context.master_salt, - dst_attr_p->attr.srtp_context.master_salt, + memcpy(dst_attr_p->attr.srtp_context.master_salt, + src_attr_p->attr.srtp_context.master_salt, SDP_SRTP_MAX_SALT_SIZE_BYTES); @@ -661,6 +670,15 @@ void sdp_copy_attr_fields (sdp_attr_t *src_attr_p, sdp_attr_t *dst_attr_p) break; + case SDP_ATTR_MSID: + sstrncpy(dst_attr_p->attr.msid.identifier, + src_attr_p->attr.msid.identifier, + SDP_MAX_MSID_LEN); + sstrncpy(dst_attr_p->attr.msid.appdata, + src_attr_p->attr.msid.appdata, + SDP_MAX_MSID_LEN); + break; + default: break; } @@ -695,7 +713,6 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, u8 src_cap_num, u8 dst_cap_num, sdp_attr_e src_attr_type, u16 src_inst_num) { - u16 i; sdp_mca_t *mca_p; sdp_mca_t *cap_p; sdp_t *src_sdp_p = (sdp_t *)src_sdp_ptr; @@ -745,338 +762,7 @@ sdp_result_e sdp_copy_attr (void *src_sdp_ptr, void *dst_sdp_ptr, } /* Copy over all the attribute information. */ - new_attr_p->type = src_attr_type; - new_attr_p->next_p = NULL; - - switch (src_attr_type) { - - case SDP_ATTR_BEARER: - case SDP_ATTR_CALLED: - case SDP_ATTR_CONN_TYPE: - case SDP_ATTR_DIALED: - case SDP_ATTR_DIALING: - case SDP_ATTR_FRAMING: - case SDP_ATTR_MAXPRATE: - case SDP_ATTR_LABEL: - sstrncpy(new_attr_p->attr.string_val, src_attr_p->attr.string_val, - SDP_MAX_STRING_LEN+1); - break; - - case SDP_ATTR_EECID: - case SDP_ATTR_PTIME: - case SDP_ATTR_T38_VERSION: - case SDP_ATTR_T38_MAXBITRATE: - case SDP_ATTR_T38_MAXBUFFER: - case SDP_ATTR_T38_MAXDGRAM: - case SDP_ATTR_X_SQN: - case SDP_ATTR_TC1_PAYLOAD_BYTES: - case SDP_ATTR_TC1_WINDOW_SIZE: - case SDP_ATTR_TC2_PAYLOAD_BYTES: - case SDP_ATTR_TC2_WINDOW_SIZE: - case SDP_ATTR_RTCP: - case SDP_ATTR_MID: - case SDP_ATTR_RTCP_UNICAST: - new_attr_p->attr.u32_val = src_attr_p->attr.u32_val; - break; - - case SDP_ATTR_T38_FILLBITREMOVAL: - case SDP_ATTR_T38_TRANSCODINGMMR: - case SDP_ATTR_T38_TRANSCODINGJBIG: - case SDP_ATTR_TMRGWXID: - new_attr_p->attr.boolean_val = src_attr_p->attr.boolean_val; - break; - - case SDP_ATTR_QOS: - case SDP_ATTR_SECURE: - case SDP_ATTR_X_PC_QOS: - case SDP_ATTR_X_QOS: - new_attr_p->attr.qos.strength = src_attr_p->attr.qos.strength; - new_attr_p->attr.qos.direction = src_attr_p->attr.qos.direction; - new_attr_p->attr.qos.confirm = src_attr_p->attr.qos.confirm; - break; - - case SDP_ATTR_CURR: - new_attr_p->attr.curr.type = src_attr_p->attr.curr.type; - new_attr_p->attr.curr.direction = src_attr_p->attr.curr.direction; - new_attr_p->attr.curr.status_type = src_attr_p->attr.curr.status_type; - break; - case SDP_ATTR_DES: - new_attr_p->attr.des.type = src_attr_p->attr.des.type; - new_attr_p->attr.des.direction = src_attr_p->attr.des.direction; - new_attr_p->attr.des.status_type = src_attr_p->attr.des.status_type; - new_attr_p->attr.des.strength = src_attr_p->attr.des.strength; - break; - - case SDP_ATTR_CONF: - new_attr_p->attr.conf.type = src_attr_p->attr.conf.type; - new_attr_p->attr.conf.direction = src_attr_p->attr.conf.direction; - new_attr_p->attr.conf.status_type = src_attr_p->attr.conf.status_type; - break; - - case SDP_ATTR_INACTIVE: - case SDP_ATTR_RECVONLY: - case SDP_ATTR_SENDONLY: - case SDP_ATTR_SENDRECV: - /* These attrs have no parameters. */ - break; - - case SDP_ATTR_FMTP: - new_attr_p->attr.fmtp.payload_num = src_attr_p->attr.fmtp.payload_num; - new_attr_p->attr.fmtp.maxval = src_attr_p->attr.fmtp.maxval; - new_attr_p->attr.fmtp.bitrate = src_attr_p->attr.fmtp.bitrate; - new_attr_p->attr.fmtp.annexa = src_attr_p->attr.fmtp.annexa; - new_attr_p->attr.fmtp.annexb = src_attr_p->attr.fmtp.annexb; - new_attr_p->attr.fmtp.cif = src_attr_p->attr.fmtp.cif; - new_attr_p->attr.fmtp.qcif = src_attr_p->attr.fmtp.qcif; - new_attr_p->attr.fmtp.sqcif = src_attr_p->attr.fmtp.qcif; - new_attr_p->attr.fmtp.cif4 = src_attr_p->attr.fmtp.cif4; - new_attr_p->attr.fmtp.cif16 = src_attr_p->attr.fmtp.cif16; - new_attr_p->attr.fmtp.maxbr = src_attr_p->attr.fmtp.maxbr; - new_attr_p->attr.fmtp.custom_x = src_attr_p->attr.fmtp.custom_x; - new_attr_p->attr.fmtp.custom_y = src_attr_p->attr.fmtp.custom_y; - new_attr_p->attr.fmtp.custom_mpi = src_attr_p->attr.fmtp.custom_mpi; - new_attr_p->attr.fmtp.par_width = src_attr_p->attr.fmtp.par_width; - new_attr_p->attr.fmtp.par_height = src_attr_p->attr.fmtp.par_height; - new_attr_p->attr.fmtp.cpcf = src_attr_p->attr.fmtp.cpcf; - new_attr_p->attr.fmtp.bpp = src_attr_p->attr.fmtp.bpp; - new_attr_p->attr.fmtp.hrd = src_attr_p->attr.fmtp.hrd; - new_attr_p->attr.fmtp.profile = src_attr_p->attr.fmtp.profile; - new_attr_p->attr.fmtp.level = src_attr_p->attr.fmtp.level; - new_attr_p->attr.fmtp.is_interlace = src_attr_p->attr.fmtp.is_interlace; - - sstrncpy(new_attr_p->attr.fmtp.profile_level_id, - src_attr_p->attr.fmtp.profile_level_id, - SDP_MAX_STRING_LEN+1); - sstrncpy(new_attr_p->attr.fmtp.parameter_sets, - src_attr_p->attr.fmtp.parameter_sets, - SDP_MAX_STRING_LEN+1); - new_attr_p->attr.fmtp.deint_buf_req = - src_attr_p->attr.fmtp.deint_buf_req; - new_attr_p->attr.fmtp.max_don_diff = - src_attr_p->attr.fmtp.max_don_diff; - new_attr_p->attr.fmtp.init_buf_time = - src_attr_p->attr.fmtp.init_buf_time; - new_attr_p->attr.fmtp.packetization_mode = - src_attr_p->attr.fmtp.packetization_mode; - new_attr_p->attr.fmtp.flag = - src_attr_p->attr.fmtp.flag; - - new_attr_p->attr.fmtp.max_mbps = src_attr_p->attr.fmtp.max_mbps; - new_attr_p->attr.fmtp.max_fs = src_attr_p->attr.fmtp.max_fs; - new_attr_p->attr.fmtp.max_fr = src_attr_p->attr.fmtp.max_fr; - new_attr_p->attr.fmtp.max_cpb = src_attr_p->attr.fmtp.max_cpb; - new_attr_p->attr.fmtp.max_dpb = src_attr_p->attr.fmtp.max_dpb; - new_attr_p->attr.fmtp.max_br = src_attr_p->attr.fmtp.max_br; - new_attr_p->attr.fmtp.redundant_pic_cap = - src_attr_p->attr.fmtp.redundant_pic_cap; - new_attr_p->attr.fmtp.deint_buf_cap = - src_attr_p->attr.fmtp.deint_buf_cap; - new_attr_p->attr.fmtp.max_rcmd_nalu_size = - src_attr_p->attr.fmtp.max_rcmd_nalu_size; - new_attr_p->attr.fmtp.interleaving_depth = - src_attr_p->attr.fmtp.interleaving_depth; - new_attr_p->attr.fmtp.parameter_add = - src_attr_p->attr.fmtp.parameter_add; - - new_attr_p->attr.fmtp.annex_d = src_attr_p->attr.fmtp.annex_d; - new_attr_p->attr.fmtp.annex_f = src_attr_p->attr.fmtp.annex_f; - new_attr_p->attr.fmtp.annex_i = src_attr_p->attr.fmtp.annex_i; - new_attr_p->attr.fmtp.annex_j = src_attr_p->attr.fmtp.annex_j; - new_attr_p->attr.fmtp.annex_t = src_attr_p->attr.fmtp.annex_t; - new_attr_p->attr.fmtp.annex_k_val = src_attr_p->attr.fmtp.annex_k_val; - new_attr_p->attr.fmtp.annex_n_val = src_attr_p->attr.fmtp.annex_n_val; - new_attr_p->attr.fmtp.annex_p_val_picture_resize = - src_attr_p->attr.fmtp.annex_p_val_picture_resize; - new_attr_p->attr.fmtp.annex_p_val_warp = - src_attr_p->attr.fmtp.annex_p_val_warp; - - new_attr_p->attr.fmtp.annexb_required = - src_attr_p->attr.fmtp.annexb_required; - new_attr_p->attr.fmtp.annexa_required = - src_attr_p->attr.fmtp.annexa_required; - new_attr_p->attr.fmtp.fmtp_format - = src_attr_p->attr.fmtp.fmtp_format; - - for (i=0; i < SDP_NE_NUM_BMAP_WORDS; i++) { - new_attr_p->attr.fmtp.bmap[i] = src_attr_p->attr.fmtp.bmap[i]; - } - break; - - case SDP_ATTR_RTPMAP: - new_attr_p->attr.transport_map.payload_num = - src_attr_p->attr.transport_map.payload_num; - new_attr_p->attr.transport_map.clockrate = - src_attr_p->attr.transport_map.clockrate; - new_attr_p->attr.transport_map.num_chan = - src_attr_p->attr.transport_map.num_chan; - sstrncpy(new_attr_p->attr.transport_map.encname, - src_attr_p->attr.transport_map.encname, - SDP_MAX_STRING_LEN+1); - break; - - case SDP_ATTR_SUBNET: - new_attr_p->attr.subnet.nettype = src_attr_p->attr.subnet.nettype; - new_attr_p->attr.subnet.addrtype = src_attr_p->attr.subnet.addrtype; - new_attr_p->attr.subnet.prefix = src_attr_p->attr.subnet.prefix; - sstrncpy(new_attr_p->attr.subnet.addr, src_attr_p->attr.subnet.addr, - SDP_MAX_STRING_LEN+1); - break; - - case SDP_ATTR_T38_RATEMGMT: - new_attr_p->attr.t38ratemgmt = src_attr_p->attr.t38ratemgmt; - break; - - case SDP_ATTR_T38_UDPEC: - new_attr_p->attr.t38udpec = src_attr_p->attr.t38udpec; - break; - - case SDP_ATTR_X_PC_CODEC: - new_attr_p->attr.pccodec.num_payloads = - src_attr_p->attr.pccodec.num_payloads; - for (i=0; i < src_attr_p->attr.pccodec.num_payloads; i++) { - new_attr_p->attr.pccodec.payload_type[i] = - src_attr_p->attr.pccodec.payload_type[i]; - } - break; - - case SDP_ATTR_DIRECTION: - - new_attr_p->attr.comediadir.role = - src_attr_p->attr.comediadir.role; - - if (src_attr_p->attr.comediadir.conn_info.nettype) { - new_attr_p->attr.comediadir.conn_info_present = TRUE; - new_attr_p->attr.comediadir.conn_info.nettype = - src_attr_p->attr.comediadir.conn_info.nettype; - new_attr_p->attr.comediadir.conn_info.addrtype = - src_attr_p->attr.comediadir.conn_info.addrtype; - sstrncpy(new_attr_p->attr.comediadir.conn_info.conn_addr, - src_attr_p->attr.comediadir.conn_info.conn_addr, - SDP_MAX_STRING_LEN+1); - new_attr_p->attr.comediadir.src_port = - src_attr_p->attr.comediadir.src_port; - } - break; - - - case SDP_ATTR_SILENCESUPP: - new_attr_p->attr.silencesupp.enabled = - src_attr_p->attr.silencesupp.enabled; - new_attr_p->attr.silencesupp.timer_null = - src_attr_p->attr.silencesupp.timer_null; - new_attr_p->attr.silencesupp.timer = - src_attr_p->attr.silencesupp.timer; - new_attr_p->attr.silencesupp.pref = - src_attr_p->attr.silencesupp.pref; - new_attr_p->attr.silencesupp.siduse = - src_attr_p->attr.silencesupp.siduse; - new_attr_p->attr.silencesupp.fxnslevel_null = - src_attr_p->attr.silencesupp.fxnslevel_null; - new_attr_p->attr.silencesupp.fxnslevel = - src_attr_p->attr.silencesupp.fxnslevel; - break; - - case SDP_ATTR_MPTIME: - new_attr_p->attr.mptime.num_intervals = - src_attr_p->attr.mptime.num_intervals; - for (i=0; i < src_attr_p->attr.mptime.num_intervals; i++) { - new_attr_p->attr.mptime.intervals[i] = - src_attr_p->attr.mptime.intervals[i]; - } - break; - - case SDP_ATTR_X_SIDIN: - case SDP_ATTR_X_SIDOUT: - case SDP_ATTR_X_CONFID: - sstrncpy(new_attr_p->attr.stream_data.x_sidin, - src_attr_p->attr.stream_data.x_sidin,SDP_MAX_STRING_LEN+1); - sstrncpy(new_attr_p->attr.stream_data.x_sidout, - src_attr_p->attr.stream_data.x_sidout,SDP_MAX_STRING_LEN+1); - sstrncpy(new_attr_p->attr.stream_data.x_confid, - src_attr_p->attr.stream_data.x_confid,SDP_MAX_STRING_LEN+1); - break; - - case SDP_ATTR_GROUP: - new_attr_p->attr.stream_data.group_attr = - src_attr_p->attr.stream_data.group_attr; - new_attr_p->attr.stream_data.num_group_id = - src_attr_p->attr.stream_data.num_group_id; - - for (i=0; i < src_attr_p->attr.stream_data.num_group_id; i++) { - new_attr_p->attr.stream_data.group_id_arr[i] = - src_attr_p->attr.stream_data.group_id_arr[i]; - } - break; - - case SDP_ATTR_SOURCE_FILTER: - new_attr_p->attr.source_filter.mode = - src_attr_p->attr.source_filter.mode; - new_attr_p->attr.source_filter.nettype = - src_attr_p->attr.source_filter.nettype; - new_attr_p->attr.source_filter.addrtype = - src_attr_p->attr.source_filter.addrtype; - sstrncpy(new_attr_p->attr.source_filter.dest_addr, - src_attr_p->attr.source_filter.dest_addr, - SDP_MAX_STRING_LEN+1); - for (i=0; iattr.source_filter.num_src_addr; ++i) { - sstrncpy(new_attr_p->attr.source_filter.src_list[i], - src_attr_p->attr.source_filter.src_list[i], - SDP_MAX_STRING_LEN+1); - } - new_attr_p->attr.source_filter.num_src_addr = - src_attr_p->attr.source_filter.num_src_addr; - break; - - case SDP_ATTR_SRTP_CONTEXT: - case SDP_ATTR_SDESCRIPTIONS: - /* Tag parameter is only valid for version 9 sdescriptions */ - if (src_attr_type == SDP_ATTR_SDESCRIPTIONS) { - new_attr_p->attr.srtp_context.tag = - src_attr_p->attr.srtp_context.tag; - } - - new_attr_p->attr.srtp_context.suite = - src_attr_p->attr.srtp_context.suite; - - new_attr_p->attr.srtp_context.selection_flags = - src_attr_p->attr.srtp_context.selection_flags; - - new_attr_p->attr.srtp_context.master_key_size_bytes = - src_attr_p->attr.srtp_context.master_key_size_bytes; - - new_attr_p->attr.srtp_context.master_salt_size_bytes = - src_attr_p->attr.srtp_context.master_salt_size_bytes; - - bcopy(src_attr_p->attr.srtp_context.master_key, - new_attr_p->attr.srtp_context.master_key, - 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); - - - sstrncpy((char*)new_attr_p->attr.srtp_context.master_key_lifetime, - (char*)src_attr_p->attr.srtp_context.master_key_lifetime, - SDP_SRTP_MAX_LIFETIME_BYTES); - - sstrncpy((char*)new_attr_p->attr.srtp_context.mki, - (char*)src_attr_p->attr.srtp_context.mki, - SDP_SRTP_MAX_MKI_SIZE_BYTES); - - new_attr_p->attr.srtp_context.mki_size_bytes = - src_attr_p->attr.srtp_context.mki_size_bytes; - - if (src_attr_p->attr.srtp_context.session_parameters) { - new_attr_p->attr.srtp_context.session_parameters = - cpr_strdup(src_attr_p->attr.srtp_context.session_parameters); - } - - break; - - default: - break; - } + sdp_copy_attr_fields(src_attr_p, new_attr_p); if (src_cap_num == 0) { if (dst_level == SDP_SESSION_LEVEL) { @@ -1172,7 +858,7 @@ sdp_result_e sdp_copy_all_attrs (void *src_sdp_ptr, void *dst_sdp_ptr, if (mca_p == NULL) { if (src_sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Invalid src media level (%u) for copy all " - "attrs ", src_sdp_p->debug_str, src_level); + "attrs ", src_sdp_p->debug_str, (unsigned)src_level); } return (SDP_INVALID_PARAMETER); } @@ -1187,7 +873,7 @@ sdp_result_e sdp_copy_all_attrs (void *src_sdp_ptr, void *dst_sdp_ptr, if (mca_p == NULL) { if (src_sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Invalid dst media level (%u) for copy all " - "attrs ", src_sdp_p->debug_str, dst_level); + "attrs ", src_sdp_p->debug_str, (unsigned)dst_level); } return (SDP_INVALID_PARAMETER); } @@ -1423,7 +1109,7 @@ sdp_result_e sdp_get_attr_type (void *sdp_ptr, u16 level, u8 cap_num, if (attr_num < 1) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s, invalid attr num specified (%u) at level %u", - sdp_p->debug_str, fname, attr_num, level); + sdp_p->debug_str, fname, (unsigned)attr_num, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -1465,6 +1151,7 @@ void sdp_free_attr (sdp_attr_t *attr_p) sdp_mca_t *cap_p; sdp_attr_t *cpar_p; sdp_attr_t *next_cpar_p; + int i; /* If this is an X-cap/cdsc attr, free the cap_p structure and * all X-cpar/cpar attributes. */ @@ -1484,6 +1171,13 @@ void sdp_free_attr (sdp_attr_t *attr_p) SDP_FREE(attr_p->attr.srtp_context.session_parameters); } + + if (attr_p->type == SDP_ATTR_GROUP) { + for (i = 0; i < attr_p->attr.stream_data.num_group_id; i++) { + SDP_FREE(attr_p->attr.stream_data.group_ids[i]); + } + } + /* Now free the actual attribute memory. */ SDP_FREE(attr_p); @@ -1529,9 +1223,9 @@ sdp_result_e sdp_delete_attr (void *sdp_ptr, u16 level, u8 cap_num, } if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Delete attribute (%s) instance %d not " + CSFLogError(logTag, "%s Delete attribute (%s) instance %u not " "found.", sdp_p->debug_str, - sdp_get_attr_name(attr_type), inst_num); + sdp_get_attr_name(attr_type), (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -1559,9 +1253,9 @@ sdp_result_e sdp_delete_attr (void *sdp_ptr, u16 level, u8 cap_num, } if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { - CSFLogError(logTag, "%s Delete attribute (%s) instance %d " + CSFLogError(logTag, "%s Delete attribute (%s) instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(attr_type), inst_num); + sdp_get_attr_name(attr_type), (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -1594,8 +1288,8 @@ sdp_result_e sdp_delete_attr (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Delete X-cpar/cpar attribute (%s) cap_num %u, " - "instance %d not found.", sdp_p->debug_str, - sdp_get_attr_name(attr_type), cap_num, inst_num); + "instance %u not found.", sdp_p->debug_str, + sdp_get_attr_name(attr_type), (unsigned)cap_num, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -1724,7 +1418,7 @@ sdp_result_e sdp_find_attr_list (sdp_t *sdp_p, u16 level, u8 cap_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s, invalid capability %u at " "level %u specified.", sdp_p->debug_str, fname, - cap_num, level); + (unsigned)cap_num, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_CAPABILITY); @@ -1741,7 +1435,6 @@ int sdp_find_fmtp_inst (sdp_t *sdp_p, u16 level, u16 payload_num) { u16 attr_count=0; sdp_mca_t *mca_p; - sdp_mca_t *cap_p; sdp_attr_t *attr_p; /* Attr is at a media level */ @@ -1888,7 +1581,7 @@ sdp_attr_t *sdp_find_capability (sdp_t *sdp_p, u16 level, u8 cap_num) /* We didn't find the specified capability. */ if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Unable to find specified capability (level %u, " - "cap_num %u).", sdp_p->debug_str, level, cap_num); + "cap_num %u).", sdp_p->debug_str, (unsigned)level, (unsigned)cap_num); } sdp_p->conf_p->num_invalid_param++; return (NULL); @@ -1922,6 +1615,56 @@ tinybool sdp_attr_valid (void *sdp_ptr, sdp_attr_e attr_type, u16 level, } } +/* Function: sdp_attr_line_number(void *sdp_ptr) + * Description: Returns the line number this attribute appears on. + * Only works if the SDP was parsed rather than created + * locally. + * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. + * attr_type The attribute type to validate. + * level The level to check for the attribute. + * cap_num The capability number associated with the + * attribute if any. If none, should be zero. + * inst_num The attribute instance number to check. + * Returns: line number, or 0 if an error + */ +u32 sdp_attr_line_number (void *sdp_ptr, sdp_attr_e attr_type, u16 level, + u8 cap_num, u16 inst_num) +{ + sdp_t *sdp_p = (sdp_t *)sdp_ptr; + sdp_attr_t *attr_p; + + if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { + return 0; + } + + attr_p = sdp_find_attr(sdp_p, level, cap_num, attr_type, inst_num); + if (attr_p == NULL) { + return 0; + } else { + return attr_p->line_number; + } +} + +static boolean sdp_attr_is_simple_string(sdp_attr_e attr_type) { + if ((attr_type != SDP_ATTR_BEARER) && + (attr_type != SDP_ATTR_CALLED) && + (attr_type != SDP_ATTR_CONN_TYPE) && + (attr_type != SDP_ATTR_DIALED) && + (attr_type != SDP_ATTR_DIALING) && + (attr_type != SDP_ATTR_FRAMING) && + (attr_type != SDP_ATTR_MID) && + (attr_type != SDP_ATTR_X_SIDIN) && + (attr_type != SDP_ATTR_X_SIDOUT)&& + (attr_type != SDP_ATTR_X_CONFID) && + (attr_type != SDP_ATTR_LABEL) && + (attr_type != SDP_ATTR_IDENTITY) && + (attr_type != SDP_ATTR_MSID_SEMANTIC) && + (attr_type != SDP_ATTR_ICE_OPTIONS)) { + return FALSE; + } + return TRUE; +} + /* Function: sdp_attr_get_simple_string * Description: Returns a pointer to a string attribute parameter. This * routine can only be called for attributes that have just @@ -1949,16 +1692,7 @@ const char *sdp_attr_get_simple_string (void *sdp_ptr, sdp_attr_e attr_type, return (NULL); } - if ((attr_type != SDP_ATTR_BEARER) && - (attr_type != SDP_ATTR_CALLED) && - (attr_type != SDP_ATTR_CONN_TYPE) && - (attr_type != SDP_ATTR_DIALED) && - (attr_type != SDP_ATTR_DIALING) && - (attr_type != SDP_ATTR_FRAMING) && - (attr_type != SDP_ATTR_X_SIDIN) && - (attr_type != SDP_ATTR_X_SIDOUT)&& - (attr_type != SDP_ATTR_X_CONFID) && - (attr_type != SDP_ATTR_LABEL)) { + if (!sdp_attr_is_simple_string(attr_type)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute type is not a simple string (%s)", sdp_p->debug_str, sdp_get_attr_name(attr_type)); @@ -1972,7 +1706,7 @@ const char *sdp_attr_get_simple_string (void *sdp_ptr, sdp_attr_e attr_type, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", sdp_p->debug_str, sdp_get_attr_name(attr_type), - level, inst_num); + (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (NULL); @@ -2011,17 +1745,7 @@ sdp_result_e sdp_attr_set_simple_string (void *sdp_ptr, sdp_attr_e attr_type, return (SDP_INVALID_SDP_PTR); } - if ((attr_type != SDP_ATTR_BEARER) && - (attr_type != SDP_ATTR_CALLED) && - (attr_type != SDP_ATTR_CONN_TYPE) && - (attr_type != SDP_ATTR_DIALED) && - (attr_type != SDP_ATTR_DIALING) && - (attr_type != SDP_ATTR_FRAMING) && - (attr_type != SDP_ATTR_X_SIDIN) && - (attr_type != SDP_ATTR_X_SIDOUT) && - (attr_type != SDP_ATTR_X_CONFID) && - (attr_type != SDP_ATTR_LABEL) && - (attr_type != SDP_ATTR_IDENTITY)) { + if (!sdp_attr_is_simple_string(attr_type)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute type is not a simple string (%s)", sdp_p->debug_str, sdp_get_attr_name(attr_type)); @@ -2035,7 +1759,7 @@ sdp_result_e sdp_attr_set_simple_string (void *sdp_ptr, sdp_attr_e attr_type, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", sdp_p->debug_str, sdp_get_attr_name(attr_type), - level, inst_num); + (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2046,6 +1770,27 @@ sdp_result_e sdp_attr_set_simple_string (void *sdp_ptr, sdp_attr_e attr_type, } } +static boolean sdp_attr_is_simple_u32(sdp_attr_e attr_type) { + if ((attr_type != SDP_ATTR_EECID) && + (attr_type != SDP_ATTR_PTIME) && + (attr_type != SDP_ATTR_MAXPTIME) && + (attr_type != SDP_ATTR_T38_VERSION) && + (attr_type != SDP_ATTR_T38_MAXBITRATE) && + (attr_type != SDP_ATTR_T38_MAXBUFFER) && + (attr_type != SDP_ATTR_T38_MAXDGRAM) && + (attr_type != SDP_ATTR_X_SQN) && + (attr_type != SDP_ATTR_TC1_PAYLOAD_BYTES) && + (attr_type != SDP_ATTR_TC1_WINDOW_SIZE) && + (attr_type != SDP_ATTR_TC2_PAYLOAD_BYTES) && + (attr_type != SDP_ATTR_TC2_WINDOW_SIZE) && + (attr_type != SDP_ATTR_RTCP) && + (attr_type != SDP_ATTR_FRAMERATE)) { + return FALSE; + } + + return TRUE; +} + /* Function: sdp_attr_get_simple_u32 * Description: Returns an unsigned 32-bit attribute parameter. This * routine can only be called for attributes that have just @@ -2076,21 +1821,7 @@ u32 sdp_attr_get_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, u16 level, return (0); } - if ((attr_type != SDP_ATTR_EECID) && - (attr_type != SDP_ATTR_PTIME) && - (attr_type != SDP_ATTR_MAXPTIME) && - (attr_type != SDP_ATTR_T38_VERSION) && - (attr_type != SDP_ATTR_T38_MAXBITRATE) && - (attr_type != SDP_ATTR_T38_MAXBUFFER) && - (attr_type != SDP_ATTR_T38_MAXDGRAM) && - (attr_type != SDP_ATTR_X_SQN) && - (attr_type != SDP_ATTR_TC1_PAYLOAD_BYTES) && - (attr_type != SDP_ATTR_TC1_WINDOW_SIZE) && - (attr_type != SDP_ATTR_TC2_PAYLOAD_BYTES) && - (attr_type != SDP_ATTR_TC2_WINDOW_SIZE) && - (attr_type != SDP_ATTR_RTCP) && - (attr_type != SDP_ATTR_MID) && - (attr_type != SDP_ATTR_FRAMERATE)) { + if (!sdp_attr_is_simple_u32(attr_type)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute type is not a simple u32 (%s)", sdp_p->debug_str, sdp_get_attr_name(attr_type)); @@ -2104,7 +1835,7 @@ u32 sdp_attr_get_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", sdp_p->debug_str, sdp_get_attr_name(attr_type), - level, inst_num); + (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -2141,21 +1872,7 @@ sdp_result_e sdp_attr_set_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, return (SDP_INVALID_SDP_PTR); } - if ((attr_type != SDP_ATTR_EECID) && - (attr_type != SDP_ATTR_PTIME) && - (attr_type != SDP_ATTR_MAXPTIME) && - (attr_type != SDP_ATTR_T38_VERSION) && - (attr_type != SDP_ATTR_T38_MAXBITRATE) && - (attr_type != SDP_ATTR_T38_MAXBUFFER) && - (attr_type != SDP_ATTR_T38_MAXDGRAM) && - (attr_type != SDP_ATTR_X_SQN) && - (attr_type != SDP_ATTR_TC1_PAYLOAD_BYTES) && - (attr_type != SDP_ATTR_TC1_WINDOW_SIZE) && - (attr_type != SDP_ATTR_TC2_PAYLOAD_BYTES) && - (attr_type != SDP_ATTR_TC2_WINDOW_SIZE) && - (attr_type != SDP_ATTR_RTCP) && - (attr_type != SDP_ATTR_MID) && - (attr_type != SDP_ATTR_FRAMERATE)) { + if (!sdp_attr_is_simple_u32(attr_type)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute type is not a simple u32 (%s)", sdp_p->debug_str, sdp_get_attr_name(attr_type)); @@ -2169,7 +1886,7 @@ sdp_result_e sdp_attr_set_simple_u32 (void *sdp_ptr, sdp_attr_e attr_type, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", sdp_p->debug_str, sdp_get_attr_name(attr_type), - level, inst_num); + (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2226,7 +1943,7 @@ tinybool sdp_attr_get_simple_boolean (void *sdp_ptr, sdp_attr_e attr_type, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", sdp_p->debug_str, sdp_get_attr_name(attr_type), - level, inst_num); + (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -2280,7 +1997,7 @@ sdp_result_e sdp_attr_set_simple_boolean (void *sdp_ptr, sdp_attr_e attr_type, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", sdp_p->debug_str, sdp_get_attr_name(attr_type), - level, inst_num); + (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2318,7 +2035,7 @@ sdp_attr_get_maxprate (void *sdp_ptr, u16 level, u16 inst_num) if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", sdp_p->debug_str, sdp_get_attr_name(SDP_ATTR_MAXPRATE), - level, inst_num); + (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (NULL); @@ -2375,7 +2092,7 @@ sdp_attr_set_maxprate (void *sdp_ptr, u16 level, u16 inst_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Attribute %s, level %u instance %u not found.", sdp_p->debug_str, sdp_get_attr_name(SDP_ATTR_MAXPRATE), - level, inst_num); + (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2420,7 +2137,7 @@ sdp_t38_ratemgmt_e sdp_attr_get_t38ratemgmt (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s t38ratemgmt attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_T38_UNKNOWN_RATE); @@ -2457,7 +2174,7 @@ sdp_result_e sdp_attr_set_t38ratemgmt (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s t38ratemgmt attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2494,7 +2211,7 @@ sdp_t38_udpec_e sdp_attr_get_t38udpec (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s t38udpec attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_T38_UDPEC_UNKNOWN); @@ -2531,7 +2248,7 @@ sdp_result_e sdp_attr_set_t38udpec (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s t38udpec attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2741,7 +2458,7 @@ sdp_qos_strength_e sdp_attr_get_qos_strength (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_QOS_STRENGTH_UNKNOWN); @@ -2794,7 +2511,7 @@ sdp_qos_dir_e sdp_attr_get_qos_direction (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_QOS_DIR_UNKNOWN); @@ -2851,7 +2568,7 @@ sdp_qos_status_types_e sdp_attr_get_qos_status_type (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_QOS_STATUS_TYPE_UNKNOWN); @@ -2905,7 +2622,7 @@ tinybool sdp_attr_get_qos_confirm (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -2950,7 +2667,7 @@ sdp_result_e sdp_attr_set_qos_strength (void *sdp_ptr, u16 level, u8 cap_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -2998,7 +2715,7 @@ sdp_curr_type_e sdp_attr_get_curr_type (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_CURR_UNKNOWN_TYPE); @@ -3036,7 +2753,7 @@ sdp_des_type_e sdp_attr_get_des_type (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_DES_UNKNOWN_TYPE); @@ -3074,7 +2791,7 @@ sdp_conf_type_e sdp_attr_get_conf_type (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_CONF_UNKNOWN_TYPE); @@ -3121,7 +2838,7 @@ sdp_result_e sdp_attr_set_curr_type (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3169,7 +2886,7 @@ sdp_result_e sdp_attr_set_des_type (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3218,7 +2935,7 @@ sdp_result_e sdp_attr_set_conf_type (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3264,7 +2981,7 @@ sdp_result_e sdp_attr_set_qos_direction (void *sdp_ptr, u16 level, u8 cap_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3325,7 +3042,7 @@ sdp_result_e sdp_attr_set_qos_status_type (void *sdp_ptr, u16 level, u8 cap_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3386,7 +3103,7 @@ sdp_result_e sdp_attr_set_qos_confirm (void *sdp_ptr, u16 level, u8 cap_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(qos_attr), level, inst_num); + sdp_get_attr_name(qos_attr), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3423,7 +3140,7 @@ sdp_nettype_e sdp_attr_get_subnet_nettype (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_NT_INVALID); @@ -3458,7 +3175,7 @@ sdp_addrtype_e sdp_attr_get_subnet_addrtype (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_AT_INVALID); @@ -3495,7 +3212,7 @@ const char *sdp_attr_get_subnet_addr (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (NULL); @@ -3532,7 +3249,7 @@ int32 sdp_attr_get_subnet_prefix (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -3569,7 +3286,7 @@ sdp_result_e sdp_attr_set_subnet_nettype (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3607,7 +3324,7 @@ sdp_result_e sdp_attr_set_subnet_addrtype (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3647,7 +3364,7 @@ sdp_result_e sdp_attr_set_subnet_addr (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3686,7 +3403,7 @@ sdp_result_e sdp_attr_set_subnet_prefix (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Subnet attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3766,7 +3483,10 @@ u16 sdp_attr_get_rtpmap_payload_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", + sdp_p->debug_str, + (unsigned)level, + (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -3802,7 +3522,10 @@ const char *sdp_attr_get_rtpmap_encname (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", + sdp_p->debug_str, + (unsigned)level, + (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (NULL); @@ -3836,7 +3559,7 @@ u32 sdp_attr_get_rtpmap_clockrate (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -3870,7 +3593,7 @@ u16 sdp_attr_get_rtpmap_num_chan (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -3906,7 +3629,7 @@ sdp_result_e sdp_attr_set_rtpmap_payload_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3942,7 +3665,7 @@ sdp_result_e sdp_attr_set_rtpmap_encname (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -3988,7 +3711,7 @@ sdp_result_e sdp_attr_get_ice_attribute (void *sdp_ptr, u16 level, } else { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s ice attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4023,7 +3746,7 @@ sdp_result_e sdp_attr_set_ice_attribute(void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s ice attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4106,7 +3829,7 @@ sdp_result_e sdp_attr_get_rtcp_mux_attribute (void *sdp_ptr, u16 level, } else { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtcp-mux attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4141,7 +3864,7 @@ sdp_result_e sdp_attr_set_rtcp_mux_attribute(void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtcp-mux attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4181,7 +3904,7 @@ sdp_result_e sdp_attr_get_setup_attribute (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s setup attribute, level %u instance %u not found.", - sdp_p->debug_str, level, inst_num); + sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -4219,7 +3942,7 @@ sdp_attr_set_setup_attribute(void *sdp_ptr, u16 level, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s setup attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -4259,7 +3982,7 @@ sdp_result_e sdp_attr_get_connection_attribute (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s setup attribute, level %u instance %u not found.", - sdp_p->debug_str, level, inst_num); + sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -4298,7 +4021,7 @@ sdp_attr_set_connection_attribute(void *sdp_ptr, u16 level, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s connection attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -4340,7 +4063,7 @@ sdp_result_e sdp_attr_get_dtls_fingerprint_attribute (void *sdp_ptr, u16 level, } else { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s dtls fingerprint attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4375,7 +4098,7 @@ sdp_result_e sdp_attr_set_dtls_fingerprint_attribute(void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s dtls fingerprint attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4416,7 +4139,7 @@ sdp_result_e sdp_attr_set_rtpmap_clockrate (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4453,7 +4176,7 @@ sdp_result_e sdp_attr_set_rtpmap_num_chan (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtpmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4533,7 +4256,7 @@ u16 sdp_attr_get_sprtmap_payload_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -4569,7 +4292,7 @@ const char *sdp_attr_get_sprtmap_encname (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (NULL); @@ -4603,7 +4326,7 @@ u32 sdp_attr_get_sprtmap_clockrate (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -4637,7 +4360,7 @@ u16 sdp_attr_get_sprtmap_num_chan (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -4673,7 +4396,7 @@ sdp_result_e sdp_attr_set_sprtmap_payload_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4709,7 +4432,7 @@ sdp_result_e sdp_attr_set_sprtmap_encname (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4747,7 +4470,7 @@ sdp_result_e sdp_attr_set_sprtmap_clockrate (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4784,7 +4507,7 @@ sdp_result_e sdp_attr_set_sprtmap_num_chan (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sprtmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -4869,7 +4592,7 @@ u16 sdp_attr_get_fmtp_payload_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -4916,7 +4639,7 @@ sdp_ne_res_e sdp_attr_fmtp_is_range_set (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_NO_MATCH); @@ -4977,7 +4700,7 @@ sdp_attr_fmtp_valid(void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return FALSE; @@ -5029,7 +4752,7 @@ sdp_result_e sdp_attr_set_fmtp_payload_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5064,7 +4787,7 @@ sdp_result_e sdp_attr_set_fmtp_bitmap(void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5102,7 +4825,7 @@ sdp_result_e sdp_attr_get_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5144,7 +4867,7 @@ sdp_result_e sdp_attr_set_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5193,7 +4916,7 @@ sdp_result_e sdp_attr_clear_fmtp_range (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5364,7 +5087,7 @@ sdp_result_e sdp_attr_set_fmtp_annexa (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5406,7 +5129,7 @@ sdp_result_e sdp_attr_set_fmtp_annexb (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5485,7 +5208,7 @@ sdp_result_e sdp_attr_set_fmtp_mode (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5529,7 +5252,7 @@ sdp_result_e sdp_attr_set_fmtp_bitrate_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5573,7 +5296,7 @@ sdp_result_e sdp_attr_set_fmtp_cif (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5617,7 +5340,7 @@ sdp_result_e sdp_attr_set_fmtp_qcif (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5660,7 +5383,7 @@ sdp_result_e sdp_attr_set_fmtp_sqcif (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5705,7 +5428,7 @@ sdp_result_e sdp_attr_set_fmtp_cif4 (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5749,7 +5472,7 @@ sdp_result_e sdp_attr_set_fmtp_cif16 (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5795,7 +5518,7 @@ sdp_result_e sdp_attr_set_fmtp_maxbr (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5840,7 +5563,7 @@ sdp_result_e sdp_attr_set_fmtp_custom (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5887,7 +5610,7 @@ sdp_result_e sdp_attr_set_fmtp_par (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5933,7 +5656,7 @@ sdp_result_e sdp_attr_set_fmtp_cpcf (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -5978,7 +5701,7 @@ sdp_result_e sdp_attr_set_fmtp_bpp (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6022,7 +5745,7 @@ sdp_result_e sdp_attr_set_fmtp_hrd (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6053,7 +5776,7 @@ sdp_result_e sdp_attr_set_fmtp_h263_num_params (void *sdp_ptr, int16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6097,7 +5820,7 @@ sdp_result_e sdp_attr_set_fmtp_profile_level_id (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6129,7 +5852,7 @@ sdp_result_e sdp_attr_set_fmtp_parameter_sets (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6164,7 +5887,7 @@ sdp_result_e sdp_attr_set_fmtp_pack_mode (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6193,7 +5916,7 @@ sdp_result_e sdp_attr_set_fmtp_level_asymmetry_allowed (void *sdp_ptr, u16 level if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6223,7 +5946,7 @@ sdp_result_e sdp_attr_set_fmtp_deint_buf_req (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6254,7 +5977,7 @@ sdp_result_e sdp_attr_set_fmtp_init_buf_time (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6285,7 +6008,7 @@ sdp_result_e sdp_attr_set_fmtp_max_don_diff (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6315,7 +6038,7 @@ sdp_result_e sdp_attr_set_fmtp_interleaving_depth (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6345,7 +6068,7 @@ sdp_result_e sdp_attr_set_fmtp_redundant_pic_cap (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6378,7 +6101,7 @@ sdp_result_e sdp_attr_set_fmtp_max_mbps (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6411,7 +6134,7 @@ sdp_result_e sdp_attr_set_fmtp_max_fs (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6444,7 +6167,7 @@ sdp_result_e sdp_attr_set_fmtp_max_fr (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6477,7 +6200,7 @@ sdp_result_e sdp_attr_set_fmtp_max_br (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6510,7 +6233,7 @@ sdp_result_e sdp_attr_set_fmtp_max_average_bitrate (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6551,7 +6274,7 @@ sdp_result_e sdp_attr_get_fmtp_max_average_bitrate (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6578,7 +6301,7 @@ sdp_result_e sdp_attr_set_fmtp_usedtx (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6621,7 +6344,7 @@ sdp_result_e sdp_attr_get_fmtp_usedtx (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6647,7 +6370,7 @@ sdp_result_e sdp_attr_set_fmtp_stereo (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6690,7 +6413,7 @@ sdp_result_e sdp_attr_get_fmtp_stereo (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6716,7 +6439,7 @@ sdp_result_e sdp_attr_set_fmtp_useinbandfec (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6759,7 +6482,7 @@ sdp_result_e sdp_attr_get_fmtp_useinbandfec (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6785,7 +6508,7 @@ sdp_result_e sdp_attr_set_fmtp_maxcodedaudiobandwidth (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6826,7 +6549,7 @@ char* sdp_attr_get_fmtp_maxcodedaudiobandwidth (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -6851,7 +6574,7 @@ sdp_result_e sdp_attr_set_fmtp_cbr (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6894,7 +6617,7 @@ sdp_result_e sdp_attr_get_fmtp_cbr (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -6918,7 +6641,7 @@ u16 sdp_attr_get_sctpmap_port(void *sdp_ptr, u16 level, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sctpmap port, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return 0; @@ -6942,7 +6665,7 @@ sdp_result_e sdp_attr_set_sctpmap_port(void *sdp_ptr, u16 level, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sctpmap port, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -6966,10 +6689,9 @@ sdp_result_e sdp_attr_get_sctpmap_streams (void *sdp_ptr, u16 level, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sctpmap streams, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; - *val = WEBRTC_DATACHANNEL_STREAMS_DEFAULT; return (SDP_INVALID_PARAMETER); } else { *val = attr_p->attr.sctpmap.streams; @@ -6993,7 +6715,7 @@ sdp_result_e sdp_attr_set_sctpmap_streams (void *sdp_ptr, u16 level, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sctpmap streams, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -7026,7 +6748,7 @@ sdp_result_e sdp_attr_set_sctpmap_protocol(void *sdp_ptr, u16 level, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sctpmap streams, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -7059,7 +6781,7 @@ sdp_result_e sdp_attr_get_sctpmap_protocol (void *sdp_ptr, u16 level, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sctpmap, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -7085,7 +6807,7 @@ sdp_result_e sdp_attr_set_fmtp_max_cpb (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s sctpmap, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -7118,7 +6840,7 @@ sdp_result_e sdp_attr_set_fmtp_max_dpb (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -7152,7 +6874,7 @@ sdp_result_e sdp_attr_set_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -7183,7 +6905,7 @@ sdp_result_e sdp_attr_set_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -7214,7 +6936,7 @@ sdp_result_e sdp_attr_set_fmtp_h264_parameter_add (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -7243,7 +6965,7 @@ sdp_result_e sdp_attr_set_fmtp_h261_annex_params (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -7281,7 +7003,7 @@ sdp_result_e sdp_attr_set_fmtp_h263_annex_params (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -7334,7 +7056,7 @@ tinybool sdp_attr_fmtp_is_annexb_set (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -7370,7 +7092,7 @@ tinybool sdp_attr_fmtp_is_annexa_set (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -7405,7 +7127,7 @@ int32 sdp_attr_get_fmtp_bitrate_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7440,7 +7162,7 @@ int32 sdp_attr_get_fmtp_qcif (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7474,7 +7196,7 @@ int32 sdp_attr_get_fmtp_cif (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7510,7 +7232,7 @@ int32 sdp_attr_get_fmtp_sqcif (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7545,7 +7267,7 @@ int32 sdp_attr_get_fmtp_cif4 (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7581,7 +7303,7 @@ int32 sdp_attr_get_fmtp_cif16 (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7617,7 +7339,7 @@ int32 sdp_attr_get_fmtp_maxbr (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7653,7 +7375,7 @@ int32 sdp_attr_get_fmtp_custom_x (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7688,7 +7410,7 @@ int32 sdp_attr_get_fmtp_custom_y (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7724,7 +7446,7 @@ int32 sdp_attr_get_fmtp_custom_mpi (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7758,7 +7480,7 @@ int32 sdp_attr_get_fmtp_par_width (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7792,7 +7514,7 @@ int32 sdp_attr_get_fmtp_par_height (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7826,7 +7548,7 @@ int32 sdp_attr_get_fmtp_cpcf (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7860,7 +7582,7 @@ int32 sdp_attr_get_fmtp_bpp (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7894,7 +7616,7 @@ int32 sdp_attr_get_fmtp_hrd (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7928,7 +7650,7 @@ int32 sdp_attr_get_fmtp_profile (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7962,7 +7684,7 @@ int32 sdp_attr_get_fmtp_level (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -7996,7 +7718,7 @@ tinybool sdp_attr_get_fmtp_interlace (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return FALSE; @@ -8031,7 +7753,7 @@ sdp_result_e sdp_attr_get_fmtp_pack_mode (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8072,7 +7794,7 @@ sdp_result_e sdp_attr_get_fmtp_level_asymmetry_allowed (void *sdp_ptr, u16 level if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8107,7 +7829,7 @@ const char* sdp_attr_get_fmtp_profile_id (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -8141,7 +7863,7 @@ const char* sdp_attr_get_fmtp_param_sets (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -8175,7 +7897,7 @@ sdp_result_e sdp_attr_get_fmtp_interleaving_depth (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8211,7 +7933,7 @@ sdp_result_e sdp_attr_get_fmtp_deint_buf_req (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8250,7 +7972,7 @@ sdp_result_e sdp_attr_get_fmtp_max_don_diff (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8285,7 +8007,7 @@ sdp_result_e sdp_attr_get_fmtp_init_buf_time (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8325,7 +8047,7 @@ sdp_result_e sdp_attr_get_fmtp_max_mbps (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8360,7 +8082,7 @@ sdp_result_e sdp_attr_get_fmtp_max_fs (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8395,7 +8117,7 @@ sdp_result_e sdp_attr_get_fmtp_max_fr (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8430,7 +8152,7 @@ sdp_result_e sdp_attr_get_fmtp_max_cpb (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8465,7 +8187,7 @@ sdp_result_e sdp_attr_get_fmtp_max_dpb (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8501,7 +8223,7 @@ sdp_result_e sdp_attr_get_fmtp_max_br (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8536,7 +8258,7 @@ tinybool sdp_attr_fmtp_is_redundant_pic_cap (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -8572,7 +8294,7 @@ sdp_result_e sdp_attr_get_fmtp_deint_buf_cap (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8612,7 +8334,7 @@ sdp_result_e sdp_attr_get_fmtp_max_rcmd_nalu_size (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -8651,7 +8373,7 @@ tinybool sdp_attr_fmtp_is_parameter_add (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -8691,7 +8413,7 @@ tinybool sdp_attr_get_fmtp_annex_d (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -8716,7 +8438,7 @@ tinybool sdp_attr_get_fmtp_annex_f (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -8741,7 +8463,7 @@ tinybool sdp_attr_get_fmtp_annex_i (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -8766,7 +8488,7 @@ tinybool sdp_attr_get_fmtp_annex_j (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -8791,7 +8513,7 @@ tinybool sdp_attr_get_fmtp_annex_t (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -8816,7 +8538,7 @@ int32 sdp_attr_get_fmtp_annex_k_val (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -8841,7 +8563,7 @@ int32 sdp_attr_get_fmtp_annex_n_val (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -8867,7 +8589,7 @@ int32 sdp_attr_get_fmtp_annex_p_picture_resize (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -8892,7 +8614,7 @@ int32 sdp_attr_get_fmtp_annex_p_warp (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -8930,7 +8652,7 @@ sdp_fmtp_format_type_e sdp_attr_fmtp_get_fmtp_format (void *sdp_ptr, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s fmtp attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_FMTP_UNKNOWN_TYPE); @@ -8965,7 +8687,7 @@ u16 sdp_attr_get_pccodec_num_payload_types (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-pc-codec attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9002,7 +8724,7 @@ u16 sdp_attr_get_pccodec_payload_type (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-pc-codec attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9012,7 +8734,7 @@ u16 sdp_attr_get_pccodec_payload_type (void *sdp_ptr, u16 level, u8 cap_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-pc-codec attribute, level %u instance %u, " "invalid payload number %u requested.", - sdp_p->debug_str, level, inst_num, payload_num); + sdp_p->debug_str, (unsigned)level, (unsigned)inst_num, (unsigned)payload_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9053,7 +8775,7 @@ sdp_result_e sdp_attr_add_pccodec_payload_type (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-pc-codec attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -9119,7 +8841,7 @@ u16 sdp_attr_get_xcap_first_cap_num (void *sdp_ptr, u16 level, u16 inst_num) if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-cap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9150,7 +8872,7 @@ sdp_media_e sdp_attr_get_xcap_media_type (void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-cap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_MEDIA_INVALID); @@ -9186,7 +8908,7 @@ sdp_transport_e sdp_attr_get_xcap_transport_type (void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-cap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_TRANSPORT_INVALID); @@ -9224,7 +8946,7 @@ u16 sdp_attr_get_xcap_num_payload_types (void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-cap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9263,7 +8985,7 @@ u16 sdp_attr_get_xcap_payload_type (void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-cap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9274,7 +8996,7 @@ u16 sdp_attr_get_xcap_payload_type (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-cap attribute, level %u instance %u, " "payload num %u invalid.", sdp_p->debug_str, - level, inst_num, payload_num); + (unsigned)level, (unsigned)inst_num, (unsigned)payload_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9311,7 +9033,7 @@ sdp_result_e sdp_attr_set_xcap_media_type (void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-cap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -9348,7 +9070,7 @@ sdp_result_e sdp_attr_set_xcap_transport_type(void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-cap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -9386,7 +9108,7 @@ sdp_result_e sdp_attr_add_xcap_payload_type(void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-cap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -9453,7 +9175,7 @@ u16 sdp_attr_get_cdsc_first_cap_num(void *sdp_ptr, u16 level, u16 inst_num) if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s CDSC attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9484,7 +9206,7 @@ sdp_media_e sdp_attr_get_cdsc_media_type(void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s CDSC attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_MEDIA_INVALID); @@ -9520,7 +9242,7 @@ sdp_transport_e sdp_attr_get_cdsc_transport_type(void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s CDSC attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_TRANSPORT_INVALID); @@ -9558,7 +9280,7 @@ u16 sdp_attr_get_cdsc_num_payload_types (void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s CDSC attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9597,7 +9319,7 @@ u16 sdp_attr_get_cdsc_payload_type (void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s CDSC attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9608,7 +9330,7 @@ u16 sdp_attr_get_cdsc_payload_type (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s CDSC attribute, level %u instance %u, " "payload num %u invalid.", sdp_p->debug_str, - level, inst_num, payload_num); + (unsigned)level, (unsigned)inst_num, (unsigned)payload_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -9644,7 +9366,7 @@ sdp_result_e sdp_attr_set_cdsc_media_type (void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s CDSC attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -9680,7 +9402,7 @@ sdp_result_e sdp_attr_set_cdsc_transport_type (void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s CDSC attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -9718,7 +9440,7 @@ sdp_result_e sdp_attr_add_cdsc_payload_type (void *sdp_ptr, u16 level, if ((attr_p == NULL) || (attr_p->attr.cap_p == NULL)) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s CDSC attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -9812,7 +9534,7 @@ sdp_result_e sdp_attr_set_rtr_confirm (void *sdp_ptr, u16 level, u8 cap_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(SDP_ATTR_RTR), level, inst_num); + sdp_get_attr_name(SDP_ATTR_RTR), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -9848,7 +9570,7 @@ tinybool sdp_attr_get_rtr_confirm (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s %s attribute, level %u instance %u " "not found.", sdp_p->debug_str, - sdp_get_attr_name(SDP_ATTR_RTR), level, inst_num); + sdp_get_attr_name(SDP_ATTR_RTR), (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -9874,7 +9596,7 @@ sdp_mediadir_role_e sdp_attr_get_comediadir_role (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Comediadir role attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_MEDIADIR_ROLE_UNKNOWN); @@ -9911,7 +9633,7 @@ sdp_result_e sdp_attr_set_comediadir_role (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Comediadir role attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -9947,7 +9669,7 @@ tinybool sdp_attr_get_silencesupp_enabled (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s silenceSuppEnable attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (FALSE); @@ -9985,7 +9707,7 @@ u16 sdp_attr_get_silencesupp_timer (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s silenceTimer attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -10024,7 +9746,7 @@ sdp_silencesupp_pref_e sdp_attr_get_silencesupp_pref (void *sdp_ptr, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s silence suppPref attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_SILENCESUPP_PREF_UNKNOWN); @@ -10062,7 +9784,7 @@ sdp_silencesupp_siduse_e sdp_attr_get_silencesupp_siduse (void *sdp_ptr, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s silence sidUse attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_SILENCESUPP_SIDUSE_UNKNOWN); @@ -10100,7 +9822,7 @@ u8 sdp_attr_get_silencesupp_fxnslevel (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s silence fxnslevel attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); @@ -10137,7 +9859,7 @@ sdp_result_e sdp_attr_set_silencesupp_enabled (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s silenceSuppEnable attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10176,7 +9898,7 @@ sdp_result_e sdp_attr_set_silencesupp_timer (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s silenceTimer attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10214,7 +9936,7 @@ sdp_result_e sdp_attr_set_silencesupp_pref (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s silence SuppPref attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10251,7 +9973,7 @@ sdp_result_e sdp_attr_set_silencesupp_siduse (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s silence sidUse attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10290,7 +10012,7 @@ sdp_result_e sdp_attr_set_silencesupp_fxnslevel (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s silenceTimer attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10333,7 +10055,7 @@ u16 sdp_attr_get_mptime_num_intervals ( if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s mptime attribute, level %u instance %u not found.", - sdp_p->debug_str, level, inst_num); + sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return 0; @@ -10370,7 +10092,7 @@ u16 sdp_attr_get_mptime_interval ( if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s mptime attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return 0; @@ -10380,7 +10102,7 @@ u16 sdp_attr_get_mptime_interval ( if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s mptime attribute, level %u instance %u, " "invalid interval number %u requested.", - sdp_p->debug_str, level, inst_num, interval_num); + sdp_p->debug_str, (unsigned)level, (unsigned)inst_num, (unsigned)interval_num); } sdp_p->conf_p->num_invalid_param++; return 0; @@ -10423,7 +10145,7 @@ sdp_result_e sdp_attr_add_mptime_interval ( if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s mptime attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -10434,7 +10156,7 @@ sdp_result_e sdp_attr_add_mptime_interval ( if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s mptime attribute, level %u instance %u " "exceeds maximum length.", - sdp_p->debug_str, level, inst_num); + sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -10470,7 +10192,7 @@ sdp_group_attr_e sdp_get_group_attr (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Group (a= group line) attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_GROUP_ATTR_UNSUPPORTED); @@ -10508,7 +10230,7 @@ sdp_result_e sdp_set_group_attr (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Group attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10539,15 +10261,15 @@ u16 sdp_get_group_num_id (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s a=group level attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (0); } else { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Stream data group attr - num of ids is :%d ", + SDP_PRINT("%s Stream data group attr - num of ids is :%u ", sdp_p->debug_str, - attr_p->attr.stream_data.num_group_id); + (unsigned)attr_p->attr.stream_data.num_group_id); } } return (attr_p->attr.stream_data.num_group_id); @@ -10579,14 +10301,14 @@ sdp_result_e sdp_set_group_num_id (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Group attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } else if ((group_num_id == 0) || (group_num_id > SDP_MAX_GROUP_STREAM_ID)){ if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Number of group id value provided - %u is invalid", - sdp_p->debug_str, group_num_id); + sdp_p->debug_str, (unsigned)group_num_id); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10597,22 +10319,22 @@ sdp_result_e sdp_set_group_num_id (void *sdp_ptr, u16 level, } /* Function: sdp_get_group_id - * Description: Returns the number of ids from the a=group:<> line. + * Description: Returns the group id from the a=group:<> line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level SDP_SESSION_LEVEL * id_num Number of the id to retrieve. The range is (1 - * SDP_MAX_GROUP_STREAM_ID) * Returns: Value of the group id at the index specified or - * SDP_INVALID_VALUE if an error + * NULL if an error */ -int32 sdp_get_group_id (void *sdp_ptr, u16 level, +const char* sdp_get_group_id (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, u16 id_num) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { - return (SDP_INVALID_VALUE); + return (NULL); } attr_p = sdp_find_attr(sdp_p, level, cap_num, @@ -10620,26 +10342,25 @@ int32 sdp_get_group_id (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s a=group level attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; - return (SDP_INVALID_VALUE); + return (NULL); } else { if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { - SDP_PRINT("%s Stream data group attr - num of ids is :%d ", + SDP_PRINT("%s Stream data group attr - num of ids is :%u ", sdp_p->debug_str, - attr_p->attr.stream_data.num_group_id); + (unsigned)attr_p->attr.stream_data.num_group_id); } if ((id_num < 1) || (id_num > attr_p->attr.stream_data.num_group_id)) { - return (SDP_INVALID_VALUE); + return (NULL); } } - return (attr_p->attr.stream_data.group_id_arr[id_num-1]); + return (attr_p->attr.stream_data.group_ids[id_num-1]); } /* Function: sdp_set_group_id - * Description: Sets the number og group ids that would be added on - * a=group: ...line. + * Description: Adds a group ID to the a=group: ...line. * Parameters: sdp_ptr The SDP handle returned by sdp_init_description. * level SDP_SESSION_LEVEL * Returns: SDP_SUCCESS or SDP_INVALID_PARAMETER/SDP_INVALID_SDP_PTR @@ -10647,7 +10368,7 @@ int32 sdp_get_group_id (void *sdp_ptr, u16 level, sdp_result_e sdp_set_group_id (void *sdp_ptr, u16 level, u8 cap_num, u16 inst_num, - u16 group_id) + char* group_id) { sdp_t *sdp_p = (sdp_t *)sdp_ptr; sdp_attr_t *attr_p; @@ -10661,7 +10382,7 @@ sdp_result_e sdp_set_group_id (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Group attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10670,12 +10391,12 @@ sdp_result_e sdp_set_group_id (void *sdp_ptr, u16 level, if (num_group_id == SDP_MAX_GROUP_STREAM_ID) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Max number of Group Ids already defined " - "for this group line %u", sdp_p->debug_str, level); + "for this group line %u", sdp_p->debug_str, (unsigned)level); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } - attr_p->attr.stream_data.group_id_arr[num_group_id] = group_id; + attr_p->attr.stream_data.group_ids[num_group_id] = cpr_strdup(group_id); attr_p->attr.stream_data.num_group_id++; return (SDP_SUCCESS); } @@ -10706,7 +10427,7 @@ const char* sdp_attr_get_x_sidin (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-sidin attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (NULL); @@ -10750,7 +10471,7 @@ sdp_result_e sdp_attr_set_x_sidin (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-sidin attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10786,7 +10507,7 @@ const char* sdp_attr_get_x_sidout (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-sidout attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (NULL); @@ -10830,7 +10551,7 @@ sdp_result_e sdp_attr_set_x_sidout (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-sidout attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10866,7 +10587,7 @@ const char* sdp_attr_get_x_confid (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-confid attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (NULL); @@ -10910,7 +10631,7 @@ sdp_result_e sdp_attr_set_x_confid (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s X-confid attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -10955,7 +10676,7 @@ sdp_set_source_filter (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Source filter attribute, level %u instance %u " - "not found", sdp_p->debug_str, level, inst_num); + "not found", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -11009,7 +10730,7 @@ sdp_include_new_filter_src_addr (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Source filter attribute, level %u instance %u " - "not found", sdp_p->debug_str, level, inst_num); + "not found", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -11018,7 +10739,7 @@ sdp_include_new_filter_src_addr (void *sdp_ptr, u16 level, u8 cap_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Max number of source addresses included for " "filter for the instance %u", sdp_p->debug_str, - inst_num); + (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_FAILURE); @@ -11054,7 +10775,7 @@ sdp_get_source_filter_mode (void *sdp_ptr, u16 level, u8 cap_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Source filter attribute, level %u, " "instance %u not found", sdp_p->debug_str, - level, inst_num); + (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_FILTER_MODE_NOT_PRESENT); @@ -11086,7 +10807,7 @@ sdp_get_filter_destination_attributes (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Source filter attribute, level %u instance %u " - "not found", sdp_p->debug_str, level, inst_num); + "not found", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -11126,7 +10847,7 @@ sdp_get_filter_source_address_count (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Source filter attribute, level %u instance %u " - "not found", sdp_p->debug_str, level, inst_num); + "not found", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_VALUE); @@ -11166,7 +10887,7 @@ sdp_get_filter_source_address (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s Source filter attribute, level %u instance %u " - "not found", sdp_p->debug_str, level, inst_num); + "not found", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -11199,7 +10920,7 @@ sdp_set_rtcp_unicast_mode (void *sdp_ptr, u16 level, u8 cap_num, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s RTCP Unicast attribute, level %u instance %u " - "not found", sdp_p->debug_str, level, inst_num); + "not found", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -11225,7 +10946,7 @@ sdp_get_rtcp_unicast_mode(void *sdp_ptr, u16 level, u8 cap_num, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s RTCP Unicast attribute, level %u, " "instance %u not found", sdp_p->debug_str, - level, inst_num); + (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_RTCP_UNICAST_MODE_NOT_PRESENT); @@ -11262,7 +10983,7 @@ sdp_attr_get_sdescriptions_tag (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute tag, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_VALUE; @@ -11313,7 +11034,7 @@ sdp_attr_get_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute suite, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_SRTP_UNKNOWN_CRYPTO_SUITE; @@ -11365,7 +11086,7 @@ sdp_attr_get_sdescriptions_key (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute key, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return NULL; @@ -11417,7 +11138,7 @@ sdp_attr_get_sdescriptions_salt (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute salt, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return NULL; @@ -11471,7 +11192,7 @@ sdp_attr_get_sdescriptions_lifetime (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute lifetime, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return NULL; @@ -11532,7 +11253,7 @@ sdp_attr_get_sdescriptions_mki (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute MKI, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -11588,7 +11309,7 @@ sdp_attr_get_sdescriptions_session_params (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute session params, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return NULL; @@ -11642,7 +11363,7 @@ sdp_attr_get_sdescriptions_key_size (void *sdp_ptr, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute MKI, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_SDESCRIPTIONS_KEY_SIZE_UNKNOWN; @@ -11697,7 +11418,7 @@ sdp_attr_get_sdescriptions_salt_size (void *sdp_ptr, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute MKI, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_SDESCRIPTIONS_KEY_SIZE_UNKNOWN; @@ -11754,7 +11475,7 @@ sdp_attr_get_srtp_crypto_selection_flags (void *sdp_ptr, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute MKI, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_SRTP_CRYPTO_SELECTION_FLAGS_UNKNOWN; @@ -11796,7 +11517,7 @@ sdp_attr_set_sdescriptions_tag (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute tag, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -11851,7 +11572,7 @@ sdp_attr_set_sdescriptions_crypto_suite (void *sdp_ptr, u16 level, if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute suite, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -11922,7 +11643,7 @@ sdp_attr_set_sdescriptions_key (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute key, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -11930,7 +11651,8 @@ sdp_attr_set_sdescriptions_key (void *sdp_ptr, u16 level, } - bcopy(key, attr_p->attr.srtp_context.master_key, + memcpy(attr_p->attr.srtp_context.master_key, + key, SDP_SRTP_MAX_KEY_SIZE_BYTES); return SDP_SUCCESS; @@ -11980,7 +11702,7 @@ sdp_attr_set_sdescriptions_salt (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp attribute salt, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -11988,7 +11710,8 @@ sdp_attr_set_sdescriptions_salt (void *sdp_ptr, u16 level, } - bcopy(salt, attr_p->attr.srtp_context.master_salt, + memcpy(attr_p->attr.srtp_context.master_salt, + salt, SDP_SRTP_MAX_SALT_SIZE_BYTES); return SDP_SUCCESS; @@ -12036,7 +11759,7 @@ sdp_attr_set_sdescriptions_lifetime (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp lifetime attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -12095,7 +11818,7 @@ sdp_attr_set_sdescriptions_mki (void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp MKI attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -12155,7 +11878,7 @@ sdp_attr_set_sdescriptions_key_size (void *sdp_ptr, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp MKI attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -12212,7 +11935,7 @@ sdp_attr_set_sdescriptions_salt_size (void *sdp_ptr, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s srtp MKI attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return SDP_INVALID_PARAMETER; @@ -12288,8 +12011,8 @@ sdp_attr_get_rtcp_fb_ack(void *sdp_ptr, u16 level, u16 payload_type, u16 inst) if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtcp-fb attribute, level %u, pt %u, " - "instance %u not found.", sdp_p->debug_str, level, - payload_type, inst); + "instance %u not found.", sdp_p->debug_str, (unsigned)level, + (unsigned)payload_type, (unsigned)inst); } sdp_p->conf_p->num_invalid_param++; return SDP_RTCP_FB_ACK_NOT_FOUND; @@ -12320,8 +12043,8 @@ sdp_attr_get_rtcp_fb_nack(void *sdp_ptr, u16 level, u16 payload_type, u16 inst) if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtcp-fb attribute, level %u, pt %u, " - "instance %u not found.", sdp_p->debug_str, level, - payload_type, inst); + "instance %u not found.", sdp_p->debug_str, (unsigned)level, + (unsigned)payload_type, (unsigned)inst); } sdp_p->conf_p->num_invalid_param++; return SDP_RTCP_FB_NACK_NOT_FOUND; @@ -12353,8 +12076,8 @@ sdp_attr_get_rtcp_fb_trr_int(void *sdp_ptr, u16 level, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtcp-fb attribute, level %u, pt %u, " - "instance %u not found.", sdp_p->debug_str, level, - payload_type, inst); + "instance %u not found.", sdp_p->debug_str, (unsigned)level, + (unsigned)payload_type, (unsigned)inst); } sdp_p->conf_p->num_invalid_param++; return 0xFFFFFFFF; @@ -12385,8 +12108,8 @@ sdp_attr_get_rtcp_fb_ccm(void *sdp_ptr, u16 level, u16 payload_type, u16 inst) if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtcp-fb attribute, level %u, pt %u, " - "instance %u not found.", sdp_p->debug_str, level, - payload_type, inst); + "instance %u not found.", sdp_p->debug_str, (unsigned)level, + (unsigned)payload_type, (unsigned)inst); } sdp_p->conf_p->num_invalid_param++; return SDP_RTCP_FB_CCM_NOT_FOUND; @@ -12420,8 +12143,8 @@ sdp_attr_set_rtcp_fb_ack(void *sdp_ptr, u16 level, u16 payload_type, u16 inst, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtcp_fb ack attribute, level %u " - "instance %u not found.", sdp_p->debug_str, level, - inst); + "instance %u not found.", sdp_p->debug_str, (unsigned)level, + (unsigned)inst); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -12461,8 +12184,8 @@ sdp_attr_set_rtcp_fb_nack(void *sdp_ptr, u16 level, u16 payload_type, u16 inst, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtcp_fb nack attribute, level %u " - "instance %u not found.", sdp_p->debug_str, level, - inst); + "instance %u not found.", sdp_p->debug_str, (unsigned)level, + (unsigned)inst); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -12501,8 +12224,8 @@ sdp_attr_set_rtcp_fb_trr_int(void *sdp_ptr, u16 level, u16 payload_type, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtcp_fb trr-int attribute, level %u " - "instance %u not found.", sdp_p->debug_str, level, - inst); + "instance %u not found.", sdp_p->debug_str, (unsigned)level, + (unsigned)inst); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -12541,8 +12264,8 @@ sdp_attr_set_rtcp_fb_ccm(void *sdp_ptr, u16 level, u16 payload_type, u16 inst, if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s rtcp_fb ccm attribute, level %u " - "instance %u not found.", sdp_p->debug_str, level, - inst); + "instance %u not found.", sdp_p->debug_str, (unsigned)level, + (unsigned)inst); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -12579,7 +12302,7 @@ const char *sdp_attr_get_extmap_uri(void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s extmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return (NULL); @@ -12611,7 +12334,7 @@ u16 sdp_attr_get_extmap_id(void *sdp_ptr, u16 level, if (attr_p == NULL) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s extmap attribute, level %u instance %u " - "not found.", sdp_p->debug_str, level, inst_num); + "not found.", sdp_p->debug_str, (unsigned)level, (unsigned)inst_num); } sdp_p->conf_p->num_invalid_param++; return 0xFFFF; @@ -12644,8 +12367,8 @@ sdp_attr_set_extmap(void *sdp_ptr, u16 level, u16 id, const char* uri, u16 inst) if (!attr_p) { if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) { CSFLogError(logTag, "%s extmap attribute, level %u " - "instance %u not found.", sdp_p->debug_str, level, - inst); + "instance %u not found.", sdp_p->debug_str, (unsigned)level, + (unsigned)inst); } sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -12655,3 +12378,25 @@ sdp_attr_set_extmap(void *sdp_ptr, u16 level, u16 id, const char* uri, u16 inst) sstrncpy(attr_p->attr.extmap.uri, uri, SDP_MAX_STRING_LEN+1); return (SDP_SUCCESS); } + +const char *sdp_attr_get_msid_identifier(sdp_t *sdp_p, u16 level, + u8 cap_num, u16 inst) +{ + sdp_attr_t *attr_p = sdp_find_attr(sdp_p, level, cap_num, + SDP_ATTR_MSID, inst); + if (!attr_p) { + return NULL; + } + return attr_p->attr.msid.identifier; +} + +const char *sdp_attr_get_msid_appdata(sdp_t *sdp_p, u16 level, + u8 cap_num, u16 inst) +{ + sdp_attr_t *attr_p = sdp_find_attr(sdp_p, level, cap_num, + SDP_ATTR_MSID, inst); + if (!attr_p) { + return NULL; + } + return attr_p->attr.msid.appdata; +} diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_config.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_config.c index 4c788f36f370..1bfc508a9809 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_config.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_config.c @@ -5,6 +5,7 @@ #include "sdp_os_defs.h" #include "sdp.h" #include "sdp_private.h" + #include "CSFLog.h" static const char* logTag = "sdp_config"; @@ -41,7 +42,7 @@ tinybool sdp_verify_conf_ptr (sdp_conf_options_t *conf_p) * Parameters: None. * Returns: A handle for the configuration as a void ptr. */ -void *sdp_init_config () +sdp_conf_options_t *sdp_init_config () { int i; sdp_conf_options_t *conf_p; @@ -101,12 +102,22 @@ void *sdp_init_config () conf_p->num_invalid_param = 0; conf_p->num_no_resource = 0; + /* Parse error handler stuff */ + conf_p->error_handler = NULL; + conf_p->error_handler_context = NULL; + CSFLogInfo(logTag, "SDP: Initialized config pointer: %p (magic=0x%X)", conf_p, conf_p ? conf_p->magic_num : 0); return (conf_p); } +void sdp_free_config(sdp_conf_options_t* config_p) { + if (config_p) { + SDP_FREE(config_p); + } +} + /* Function: void sdp_appl_debug(void *config_p, sdp_debug_e debug_type, * tinybool my_bool); * Description: Define the default type of debug for the application. @@ -304,3 +315,13 @@ void sdp_allow_choose (void *config_p, sdp_choose_param_e param, tinybool choose conf_p->allow_choose[param] = choose_allowed; } } + +void sdp_config_set_error_handler(void *config_p, + sdp_parse_error_handler handler, + void *context) +{ + sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; + + conf_p->error_handler = handler; + conf_p->error_handler_context = context; +} diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_main.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_main.c index 58de4df58a21..4c1c780115e4 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_main.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_main.c @@ -5,7 +5,7 @@ #include "sdp_os_defs.h" #include "sdp.h" #include "sdp_private.h" -#include "vcm.h" + #include "CSFLog.h" static const char* logTag = "sdp_main"; @@ -137,7 +137,7 @@ const sdp_attrarray_t sdp_attr[SDP_MAX_ATTR_TYPES] = {"group", sizeof("group"), sdp_parse_attr_group, sdp_build_attr_group }, {"mid", sizeof("mid"), - sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32 }, + sdp_parse_attr_simple_string, sdp_build_attr_simple_string }, {"source-filter", sizeof("source-filter"), sdp_parse_attr_source_filter, sdp_build_source_filter}, {"rtcp-unicast", sizeof("rtcp-unicast"), @@ -167,9 +167,9 @@ const sdp_attrarray_t sdp_attr[SDP_MAX_ATTR_TYPES] = {"ice-lite", sizeof("ice-lite"), sdp_parse_attr_simple_flag, sdp_build_attr_simple_flag}, {"rtcp-mux", sizeof("rtcp-mux"), - sdp_parse_attr_rtcp_mux_attr, sdp_build_attr_rtcp_mux_attr}, + sdp_parse_attr_simple_flag, sdp_build_attr_simple_flag}, {"fingerprint", sizeof("fingerprint"), - sdp_parse_attr_fingerprint_attr, sdp_build_attr_simple_string}, + sdp_parse_attr_complete_line, sdp_build_attr_simple_string}, {"maxptime", sizeof("maxptime"), sdp_parse_attr_simple_u32, sdp_build_attr_simple_u32}, {"rtcp-fb", sizeof("rtcp-fb"), @@ -182,7 +182,18 @@ const sdp_attrarray_t sdp_attr[SDP_MAX_ATTR_TYPES] = sdp_parse_attr_extmap, sdp_build_attr_extmap}, {"identity", sizeof("identity"), sdp_parse_attr_simple_string, sdp_build_attr_simple_string}, + {"msid", sizeof("msid"), + sdp_parse_attr_msid, sdp_build_attr_msid}, + {"msid-semantic", sizeof("msid-semantic"), + sdp_parse_attr_simple_string, sdp_build_attr_simple_string}, + {"bundle-only", sizeof("bundle-only"), + sdp_parse_attr_simple_flag, sdp_build_attr_simple_flag}, + {"end-of-candidates", sizeof("end-of-candidates"), + sdp_parse_attr_simple_flag, sdp_build_attr_simple_flag}, + {"ice-options", sizeof("ice-options"), + sdp_parse_attr_complete_line, sdp_build_attr_simple_string}, }; + /* Note: These *must* be in the same order as the enum types. */ const sdp_namearray_t sdp_media[SDP_MAX_MEDIA_TYPES] = { @@ -240,7 +251,12 @@ const sdp_namearray_t sdp_transport[SDP_MAX_TRANSPORT_TYPES] = {"RTP/SAVP", sizeof("RTP/SAVP")}, {"tcp", sizeof("tcp")}, {"RTP/SAVPF", sizeof("RTP/SAVPF")}, - {"DTLS/SCTP", sizeof("DTLS/SCTP")} + {"DTLS/SCTP", sizeof("DTLS/SCTP")}, + {"RTP/AVPF", sizeof("RTP/AVPF")}, + {"UDP/TLS/RTP/SAVP", sizeof("UDP/TLS/RTP/SAVP")}, + {"UDP/TLS/RTP/SAVPF", sizeof("UDP/TLS/RTP/SAVPF")}, + {"TCP/TLS/RTP/SAVP", sizeof("TCP/TLS/RTP/SAVP")}, + {"TCP/TLS/RTP/SAVPF", sizeof("TCP/TLS/RTP/SAVPF")}, }; /* Note: These *must* be in the same order as the enum type. */ @@ -427,7 +443,8 @@ const sdp_namearray_t sdp_group_attr_val[SDP_MAX_GROUP_ATTR_VAL] = { {"FID", sizeof("FID")}, {"LS", sizeof("LS")}, - {"ANAT", sizeof("ANAT")} + {"ANAT", sizeof("ANAT")}, + {"BUNDLE", sizeof("BUNDLE")} }; const sdp_namearray_t sdp_srtp_context_crypto_suite[SDP_SRTP_MAX_NUM_CRYPTO_SUITES] = @@ -535,7 +552,8 @@ const char* sdp_result_name[SDP_MAX_RC] = "SDP_NO_RESOURCE", "SDP_UNRECOGNIZED_TOKEN", "SDP_NULL_BUF_PTR", - "SDP_POTENTIAL_SDP_OVERFLOW"}; + "SDP_POTENTIAL_SDP_OVERFLOW", + "SDP_EMPTY_TOKEN"}; const char *sdp_get_result_name ( sdp_result_e rc ) { @@ -775,7 +793,7 @@ const char *sdp_get_rtcp_unicast_mode_name (sdp_rtcp_unicast_mode_e type) * Parameters: sdp_p The SDP structure handle. * Returns: TRUE or FALSE. */ -inline tinybool sdp_verify_sdp_ptr (sdp_t *sdp_p) +tinybool sdp_verify_sdp_ptr (sdp_t *sdp_p) { if ((sdp_p != NULL) && (sdp_p->magic_num == SDP_MAGIC_NUM)) { return (TRUE); @@ -795,11 +813,10 @@ inline tinybool sdp_verify_sdp_ptr (sdp_t *sdp_p) * Parameters: config_p The config handle returned by sdp_init_config * Returns: A handle for a new SDP structure as a void ptr. */ -sdp_t *sdp_init_description (const char *peerconnection, void *config_p) +sdp_t *sdp_init_description (sdp_conf_options_t *conf_p) { int i; sdp_t *sdp_p; - sdp_conf_options_t *conf_p = (sdp_conf_options_t *)config_p; if (sdp_verify_conf_ptr(conf_p) == FALSE) { return (NULL); @@ -810,8 +827,6 @@ sdp_t *sdp_init_description (const char *peerconnection, void *config_p) return (NULL); } - sstrncpy(sdp_p->peerconnection, peerconnection, sizeof(sdp_p->peerconnection)); - /* Initialize magic number. */ sdp_p->magic_num = SDP_MAGIC_NUM; @@ -914,7 +929,7 @@ sdp_result_e sdp_validate_sdp (sdp_t *sdp_p) num_media_levels = sdp_get_num_media_lines((void *)sdp_p); for (i=1; i <= num_media_levels; i++) { if (sdp_connection_valid((void *)sdp_p, (unsigned short)i) == FALSE) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s c= connection line not specified for " "every media level, validation failed.", sdp_p->debug_str); @@ -926,7 +941,7 @@ sdp_result_e sdp_validate_sdp (sdp_t *sdp_p) /* Validate required lines were specified */ if ((sdp_owner_valid((void *)sdp_p) == FALSE) && (sdp_p->conf_p->owner_reqd == TRUE)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s o= owner line not specified, validation failed.", sdp_p->debug_str); return (SDP_FAILURE); @@ -934,7 +949,7 @@ sdp_result_e sdp_validate_sdp (sdp_t *sdp_p) if ((sdp_session_name_valid((void *)sdp_p) == FALSE) && (sdp_p->conf_p->session_name_reqd == TRUE)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s s= session name line not specified, validation failed.", sdp_p->debug_str); return (SDP_FAILURE); @@ -942,7 +957,7 @@ sdp_result_e sdp_validate_sdp (sdp_t *sdp_p) if ((sdp_timespec_valid((void *)sdp_p) == FALSE) && (sdp_p->conf_p->timespec_reqd == TRUE)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s t= timespec line not specified, validation failed.", sdp_p->debug_str); return (SDP_FAILURE); @@ -961,12 +976,12 @@ sdp_result_e sdp_validate_sdp (sdp_t *sdp_p) * if not, what type of error was encountered. The * information from the parse is stored in the sdp_p structure. */ -sdp_result_e sdp_parse (sdp_t *sdp_p, char **bufp, u16 len) +sdp_result_e sdp_parse (sdp_t *sdp_p, const char *buf, size_t len) { u8 i; u16 cur_level = SDP_SESSION_LEVEL; - char *ptr; - char *next_ptr = NULL; + const char *ptr; + const char *next_ptr = NULL; char *line_end; sdp_token_e last_token = SDP_TOKEN_V; sdp_result_e result = SDP_SUCCESS; @@ -974,6 +989,7 @@ sdp_result_e sdp_parse (sdp_t *sdp_p, char **bufp, u16 len) tinybool end_found = FALSE; tinybool first_line = TRUE; tinybool unrec_token = FALSE; + const char **bufp = &buf; if (sdp_verify_sdp_ptr(sdp_p) == FALSE) { return (SDP_INVALID_SDP_PTR); @@ -995,6 +1011,8 @@ sdp_result_e sdp_parse (sdp_t *sdp_p, char **bufp, u16 len) sdp_p->cap_valid = FALSE; sdp_p->last_cap_inst = 0; + sdp_p->parse_line = 0; + /* We want to try to find the end of the SDP description, even if * we find a parsing error. */ @@ -1003,6 +1021,7 @@ sdp_result_e sdp_parse (sdp_t *sdp_p, char **bufp, u16 len) * we don't parse it. */ ptr = next_ptr; + sdp_p->parse_line++; line_end = sdp_findchar(ptr, "\n"); if ((line_end >= (*bufp + len)) || (*line_end == '\0')) { @@ -1010,10 +1029,11 @@ sdp_result_e sdp_parse (sdp_t *sdp_p, char **bufp, u16 len) * is still accept as valid. So encountering this is not treated as * an error. */ - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s End of line beyond end of buffer.", sdp_p->debug_str); - CSFLogError(logTag, "SDP: Invalid SDP, no \\n (len %u): %*s", len, len, *bufp); + CSFLogError(logTag, "SDP: Invalid SDP, no \\n (len %u): %*s", + (unsigned)len, (int)len, *bufp); end_found = TRUE; break; } @@ -1040,7 +1060,7 @@ sdp_result_e sdp_parse (sdp_t *sdp_p, char **bufp, u16 len) unrec_token = TRUE; } if (first_line == TRUE) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Attempt to parse text not recognized as " "SDP text, parse fails.", sdp_p->debug_str); /* If we haven't already printed out the line we @@ -1083,7 +1103,7 @@ sdp_result_e sdp_parse (sdp_t *sdp_p, char **bufp, u16 len) (i != SDP_TOKEN_B) && (i != SDP_TOKEN_K) && (i != SDP_TOKEN_A) && (i != SDP_TOKEN_M)) { sdp_p->conf_p->num_invalid_token_order++; - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid token %s found at media level", sdp_p->debug_str, sdp_token[i].name); continue; @@ -1094,7 +1114,7 @@ sdp_result_e sdp_parse (sdp_t *sdp_p, char **bufp, u16 len) if (first_line == TRUE) { if (i != SDP_TOKEN_V) { if (sdp_p->conf_p->version_reqd == TRUE) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s First line not v=, parse fails", sdp_p->debug_str); sdp_p->conf_p->num_invalid_token_order++; @@ -1110,7 +1130,7 @@ sdp_result_e sdp_parse (sdp_t *sdp_p, char **bufp, u16 len) } else { if (i < last_token) { sdp_p->conf_p->num_invalid_token_order++; - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Invalid token ordering detected, " "token %s found after token %s", sdp_p->debug_str, sdp_token[i].name, sdp_token[last_token].name); @@ -1242,9 +1262,7 @@ sdp_result_e sdp_free_description (sdp_t *sdp_p) } /* Free the config structure */ - if (sdp_p->conf_p) { - SDP_FREE(sdp_p->conf_p); - } + sdp_free_config(sdp_p->conf_p); /* Free any timespec structures - should be only one since * this is all we currently support. @@ -1311,7 +1329,7 @@ sdp_result_e sdp_free_description (sdp_t *sdp_p) * sdp_parse_error * Send SDP parsing errors to log and up to peerconnection */ -void sdp_parse_error(const char *peerconnection, const char *format, ...) { +void sdp_parse_error(sdp_t* sdp, const char *format, ...) { flex_string fs; va_list ap; @@ -1321,8 +1339,14 @@ void sdp_parse_error(const char *peerconnection, const char *format, ...) { flex_string_vsprintf(&fs, format, ap); va_end(ap); - CSFLogError("SDP Parse", "SDP Parse Error %s, pc %s", fs.buffer, peerconnection); - vcmOnSdpParseError(peerconnection, fs.buffer); + CSFLogError("SDP Parse", "SDP Parse Error %s, line %u", fs.buffer, + sdp->parse_line); + + if (sdp->conf_p->error_handler) { + sdp->conf_p->error_handler(sdp->conf_p->error_handler_context, + sdp->parse_line, + fs.buffer); + } flex_string_free(&fs); } diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h b/media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h index cd24b289ac5f..5ecd7cbd38fb 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h @@ -5,17 +5,17 @@ #ifndef _SDP_OS_DEFS_H_ #define _SDP_OS_DEFS_H_ +#include #include "cpr_types.h" -#include "cpr_stdio.h" -#include "cpr_stdlib.h" #include "cpr_string.h" -#include "phone_debug.h" #define SDP_PRINT(format, ...) CSFLogError("sdp" , format , ## __VA_ARGS__ ) -#define SDP_MALLOC(x) cpr_calloc(1, (x)) -#define SDP_FREE cpr_free + +/* Use operating system malloc */ +#define SDP_MALLOC(x) calloc(1, (x)) +#define SDP_FREE free typedef uint8_t tinybool; typedef uint8_t u8; diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h b/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h index 975aa9492bca..c1f827034b84 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_private.h @@ -2,8 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _SDP_PRIVATE_H_ -#define _SDP_PRIVATE_H_ +#ifndef _SIPCC_SDP_PRIVATE_H_ +#define _SIPCC_SDP_PRIVATE_H_ #include "sdp.h" @@ -49,6 +49,9 @@ extern sdp_mca_t *sdp_find_media_level(sdp_t *sdp_p, u16 level); extern sdp_bw_data_t* sdp_find_bw_line (void *sdp_ptr, u16 level, u16 inst_num); /* sdp_attr.c */ +extern sdp_result_e +sdp_build_attr_fmtp_params (sdp_t *sdp_p, sdp_fmtp_t *attr_p, flex_string *fs); + extern sdp_result_e sdp_parse_attribute(sdp_t *sdp_p, u16 level, const char *ptr); extern sdp_result_e sdp_parse_attr_simple_string(sdp_t *sdp_p, @@ -73,6 +76,10 @@ extern sdp_result_e sdp_parse_attr_sctpmap(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_sctpmap(sdp_t *sdp_p, sdp_attr_t *attr_p, flex_string *fs); +extern sdp_result_e sdp_parse_attr_msid(sdp_t *sdp_p, sdp_attr_t *attr_p, + const char *ptr); +extern sdp_result_e sdp_build_attr_msid(sdp_t *sdp_p, sdp_attr_t *attr_p, + flex_string *fs); extern sdp_result_e sdp_parse_attr_direction(sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); extern sdp_result_e sdp_build_attr_direction(sdp_t *sdp_p, sdp_attr_t *attr_p, @@ -217,11 +224,7 @@ extern sdp_result_e sdp_build_attr_simple_flag ( 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); -extern sdp_result_e sdp_parse_attr_rtcp_mux_attr ( - sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); -extern sdp_result_e sdp_parse_attr_fingerprint_attr ( +extern sdp_result_e sdp_parse_attr_complete_line ( sdp_t *sdp_p, sdp_attr_t *attr_p, const char *ptr); /* sdp_attr_access.c */ @@ -256,7 +259,6 @@ extern const char *sdp_get_silencesupp_pref_name(sdp_silencesupp_pref_e pref); extern const char *sdp_get_silencesupp_siduse_name(sdp_silencesupp_siduse_e siduse); -extern const char *sdp_get_bw_modifier_name(sdp_bw_modifier_e bw_modifier); extern const char *sdp_get_group_attr_name(sdp_group_attr_e group_attr); extern const char *sdp_get_src_filter_mode_name(sdp_src_filter_mode_e type); extern const char *sdp_get_rtcp_unicast_mode_name(sdp_rtcp_unicast_mode_e type); @@ -323,7 +325,7 @@ sdp_build_attr_sdescriptions(sdp_t *sdp_p, sdp_attr_t *attr_p, /* sdp_utils.c */ -extern sdp_mca_t *sdp_alloc_mca(void); +extern sdp_mca_t *sdp_alloc_mca(u32 line); extern tinybool sdp_validate_maxprate(const char *string_parm); extern char *sdp_findchar(const char *ptr, char *char_list); extern const char *sdp_getnextstrtok(const char *str, char *tokenstr, unsigned tokenstr_len, diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_services_unix.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_services_unix.c index 7af6a4bd428f..86989792817f 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_services_unix.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_services_unix.c @@ -6,6 +6,7 @@ #include "sdp.h" #include "sdp_private.h" +#include "CSFLog.h" /******************************************************************/ /* Required Platform Routines */ diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c index 2dd6981d4c4a..b33887c21f7e 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_token.c @@ -7,9 +7,7 @@ #include "sdp_os_defs.h" #include "sdp.h" #include "sdp_private.h" -#include "configmgr.h" -#include "prot_configmgr.h" -#include "ccapi.h" + #include "CSFLog.h" #include "prprf.h" @@ -24,16 +22,16 @@ sdp_result_e sdp_parse_version (sdp_t *sdp_p, u16 level, const char *ptr) sdp_p->version = (u16)sdp_getnextnumtok(ptr, &ptr, " \t", &result); if ((result != SDP_SUCCESS) || (sdp_p->version != SDP_CURRENT_VERSION)) { - sdp_parse_error(sdp_p->peerconnection, - "%s Invalid version (%lu) found, parse failed.", - sdp_p->debug_str, sdp_p->version); + sdp_parse_error(sdp_p, + "%s Invalid version (%u) found, parse failed.", + sdp_p->debug_str, (unsigned)sdp_p->version); sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parse version line successful, version %u", - sdp_p->debug_str, (u16)sdp_p->version); + sdp_p->debug_str, (unsigned)sdp_p->version); } return (SDP_SUCCESS); } @@ -52,7 +50,7 @@ sdp_result_e sdp_build_version (sdp_t *sdp_p, u16 level, flex_string *fs) } } - flex_string_sprintf(fs, "v=%u\r\n", (u16)sdp_p->version); + flex_string_sprintf(fs, "v=%u\r\n", (unsigned)sdp_p->version); if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Built v= version line", sdp_p->debug_str); @@ -82,7 +80,6 @@ static sdp_result_e sdp_verify_unsigned(const char *ptr, uint64_t max_value) sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) { int i; - char *tmpptr; sdp_result_e result; char tmp[SDP_MAX_STRING_LEN]; /* The spec says this: @@ -93,11 +90,13 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) (2**62)-1, to avoid rollovers. */ const uint64_t max_value_sessid = ((((uint64_t) 1) << 63) - 1); - const uint64_t max_value_version = ((((uint64_t) 1) << 62) - 2); + /* Do not check that this is 2^62 - 1; that's just the limit on + * the initial version, not every version number. */ + const uint64_t max_value_version = ((((uint64_t) 1) << 63) - 1); if (sdp_p->owner_name[0] != '\0') { sdp_p->conf_p->num_invalid_token_order++; - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: More than one o= line specified.", sdp_p->debug_str); } @@ -105,7 +104,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the owner name. */ ptr = sdp_getnextstrtok(ptr, sdp_p->owner_name, sizeof(sdp_p->owner_name), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No owner name specified for o=.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -123,7 +122,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) result = sdp_verify_unsigned(sdp_p->owner_sessid, max_value_sessid); } if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Invalid owner session id specified for o=.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -139,7 +138,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) result = sdp_verify_unsigned(sdp_p->owner_version, max_value_version); } if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Invalid owner version specified for o=.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -149,7 +148,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the owner network type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No owner network type specified for o=.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -165,7 +164,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) } } if (sdp_p->owner_network_type == SDP_NT_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Owner network type unsupported (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -175,7 +174,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the owner address type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No owner address type specified for o=.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -192,7 +191,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) } if ((sdp_p->owner_addr_type == SDP_AT_UNSUPPORTED) && (sdp_p->owner_network_type != SDP_NT_ATM)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Owner address type unsupported (%s)", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -202,7 +201,7 @@ sdp_result_e sdp_parse_owner (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the owner address. */ ptr = sdp_getnextstrtok(ptr, sdp_p->owner_addr, sizeof(sdp_p->owner_addr), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No owner address specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); @@ -267,14 +266,14 @@ sdp_result_e sdp_parse_sessname (sdp_t *sdp_p, u16 level, const char *ptr) if (sdp_p->sessname[0] != '\0') { sdp_p->conf_p->num_invalid_token_order++; - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: More than one s= line specified.", sdp_p->debug_str); } endptr = sdp_findchar(ptr, "\r\n"); if (ptr == endptr) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No session name specified.", sdp_p->debug_str); } @@ -322,7 +321,7 @@ sdp_result_e sdp_parse_sessinfo (sdp_t *sdp_p, u16 level, const char *ptr) if (level == SDP_SESSION_LEVEL) { if (sdp_p->sessinfo_found == TRUE) { sdp_p->conf_p->num_invalid_token_order++; - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: More than one i= line specified.", sdp_p->debug_str); } @@ -334,16 +333,16 @@ sdp_result_e sdp_parse_sessinfo (sdp_t *sdp_p, u16 level, const char *ptr) } if (mca_p->sessinfo_found == TRUE) { sdp_p->conf_p->num_invalid_token_order++; - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: More than one i= line specified" - " for media line %d.", sdp_p->debug_str, level); + " for media line %u.", sdp_p->debug_str, (unsigned)level); } mca_p->sessinfo_found = TRUE; } endptr = sdp_findchar(ptr, "\n"); if (ptr == endptr) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No session info specified.", sdp_p->debug_str); } @@ -366,7 +365,7 @@ sdp_result_e sdp_parse_uri (sdp_t *sdp_p, u16 level, const char *ptr) if (sdp_p->uri_found == TRUE) { sdp_p->conf_p->num_invalid_token_order++; - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: More than one u= line specified.", sdp_p->debug_str); } @@ -374,7 +373,7 @@ sdp_result_e sdp_parse_uri (sdp_t *sdp_p, u16 level, const char *ptr) endptr = sdp_findchar(ptr, "\n"); if (ptr == endptr) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No URI info specified.", sdp_p->debug_str); } @@ -396,7 +395,7 @@ sdp_result_e sdp_parse_email (sdp_t *sdp_p, u16 level, const char *ptr) endptr = sdp_findchar(ptr, "\n"); if (ptr == endptr) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No email info specified.", sdp_p->debug_str); } @@ -418,7 +417,7 @@ sdp_result_e sdp_parse_phonenum (sdp_t *sdp_p, u16 level, const char *ptr) endptr = sdp_findchar(ptr, "\n"); if (ptr == endptr) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No phone number info specified.", sdp_p->debug_str); } @@ -464,7 +463,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) */ if (conn_p->nettype != SDP_NT_INVALID) { sdp_p->conf_p->num_invalid_token_order++; - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s c= line specified twice at same level, " "parse failed.", sdp_p->debug_str); return (SDP_INVALID_TOKEN_ORDERING); @@ -473,7 +472,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the connection network type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No connection network type specified for c=.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -489,7 +488,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) } } if (conn_p->nettype == SDP_NT_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Connection network type unsupported " "(%s) for c=.", sdp_p->debug_str, tmp); } @@ -505,7 +504,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) } return (SDP_SUCCESS); } else { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No connection address type specified for " "c=.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -522,7 +521,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) } } if (conn_p->addrtype == SDP_AT_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Connection address type unsupported " "(%s) for c=.", sdp_p->debug_str, tmp); } @@ -530,7 +529,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the connection address. */ ptr = sdp_getnextstrtok(ptr, conn_p->conn_addr, sizeof(conn_p->conn_addr), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No connection address specified for c=.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -545,11 +544,12 @@ 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); + if (conn_p->addrtype == SDP_AT_IP4) { errno = 0; strtoul_result = strtoul(mcast_str, &strtoul_end, 10); if (errno || mcast_str == strtoul_end || strtoul_result > 255) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Error parsing address %s for mcast.", sdp_p->debug_str, mcast_str); sdp_p->conf_p->num_invalid_param++; @@ -564,17 +564,20 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) 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", + /* this used to rely on the above busted multicast check */ + SDP_PRINT("%s An address with slash %s", sdp_p->debug_str, conn_p->conn_addr); + conn_p->conn_addr[slash_ptr - conn_p->conn_addr] = '\0'; slash_ptr++; - slash_ptr = sdp_getnextstrtok(slash_ptr, tmp, sizeof(tmp), "/", &result); + slash_ptr = sdp_getnextstrtok(slash_ptr, tmp, sizeof(tmp), + "/", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No ttl value specified for this multicast addr with a slash", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -585,7 +588,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) 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, + sdp_parse_error(sdp_p, "%s Invalid TTL: Value must be in the range 0-255 ", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -609,7 +612,7 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) strtoul_result = strtoul(slash_ptr, &strtoul_end, 10); if (errno || slash_ptr == strtoul_end || strtoul_result == 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Invalid Num of addresses: Value must be > 0 ", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -618,30 +621,24 @@ sdp_result_e sdp_parse_connection (sdp_t *sdp_p, u16 level, const char *ptr) 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", - sdp_p->debug_str); - return (SDP_INVALID_PARAMETER); - } } } /* See if the address is the choose param and if it's allowed. */ if ((sdp_p->conf_p->allow_choose[SDP_CHOOSE_CONN_ADDR] == FALSE) && (strcmp(conn_p->conn_addr, "$") == 0)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Choose parameter for connection " "address specified but not allowed.", sdp_p->debug_str); } if (sdp_p->debug_flag[SDP_DEBUG_TRACE]) { SDP_PRINT("%s Parse connection: network %s, address type %s, " - "address %s ttl= %d num of addresses = %d", + "address %s ttl= %u num of addresses = %u", sdp_p->debug_str, sdp_get_network_name(conn_p->nettype), sdp_get_address_name(conn_p->addrtype), - conn_p->conn_addr, conn_p->ttl, conn_p->num_of_addresses); + conn_p->conn_addr, (unsigned)conn_p->ttl, (unsigned)conn_p->num_of_addresses); } return (SDP_SUCCESS); } @@ -678,16 +675,18 @@ sdp_result_e sdp_build_connection (sdp_t *sdp_p, u16 level, flex_string *fs) if (conn_p->is_multicast) { if (conn_p->num_of_addresses > 1) { - flex_string_sprintf(fs, "c=%s %s %s/%d/%d\r\n", + flex_string_sprintf(fs, "c=%s %s %s/%u/%u\r\n", sdp_get_network_name(conn_p->nettype), sdp_get_address_name(conn_p->addrtype), - conn_p->conn_addr, conn_p->ttl, - conn_p->num_of_addresses); + conn_p->conn_addr, + (unsigned)conn_p->ttl, + (unsigned)conn_p->num_of_addresses); } else { - flex_string_sprintf(fs, "c=%s %s %s/%d\r\n", + flex_string_sprintf(fs, "c=%s %s %s/%u\r\n", sdp_get_network_name(conn_p->nettype), sdp_get_address_name(conn_p->addrtype), - conn_p->conn_addr, conn_p->ttl); + conn_p->conn_addr, + (unsigned)conn_p->ttl); } } else { @@ -744,7 +743,7 @@ sdp_result_e sdp_parse_bandwidth (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the bw type (AS, CT or TIAS) */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), ":", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No bandwidth type specified for b= ", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -759,7 +758,7 @@ sdp_result_e sdp_parse_bandwidth (sdp_t *sdp_p, u16 level, const char *ptr) } if (bw_modifier == SDP_BW_MODIFIER_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Error: BW Modifier type unsupported (%s).", sdp_p->debug_str, tmp); sdp_p->conf_p->num_invalid_param++; @@ -774,7 +773,7 @@ sdp_result_e sdp_parse_bandwidth (sdp_t *sdp_p, u16 level, const char *ptr) ptr++; bw_val = sdp_getnextnumtok(ptr, &ptr, " \t", &result); if ((result != SDP_SUCCESS)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Error: No BW Value specified ", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -882,7 +881,7 @@ sdp_result_e sdp_parse_timespec (sdp_t *sdp_p, u16 level, const char *ptr) (const char **)&tmpptr, " \t", &result); } if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Invalid timespec start time specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -899,7 +898,7 @@ sdp_result_e sdp_parse_timespec (sdp_t *sdp_p, u16 level, const char *ptr) (const char **)&tmpptr, " \t", &result); } if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Invalid timespec stop time specified.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -956,7 +955,7 @@ sdp_result_e sdp_parse_repeat_time (sdp_t *sdp_p, u16 level, const char *ptr) endptr = sdp_findchar(ptr, "\n"); if (ptr == endptr) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No repeat time parameters " "specified.", sdp_p->debug_str); } @@ -979,7 +978,7 @@ sdp_result_e sdp_parse_timezone_adj (sdp_t *sdp_p, u16 level, const char *ptr) endptr = sdp_findchar(ptr, "\n"); if (ptr == endptr) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No timezone parameters specified.", sdp_p->debug_str); } @@ -1018,7 +1017,7 @@ sdp_result_e sdp_parse_encryption (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the encryption type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), ":", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No encryption type specified for k=.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -1033,7 +1032,7 @@ sdp_result_e sdp_parse_encryption (sdp_t *sdp_p, u16 level, const char *ptr) } } if (encrypt_p->encrypt_type == SDP_ENCRYPT_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Encryption type unsupported (%s).", sdp_p->debug_str, tmp); } @@ -1051,7 +1050,7 @@ sdp_result_e sdp_parse_encryption (sdp_t *sdp_p, u16 level, const char *ptr) ((encrypt_p->encrypt_type == SDP_ENCRYPT_CLEAR) || (encrypt_p->encrypt_type == SDP_ENCRYPT_BASE64) || (encrypt_p->encrypt_type == SDP_ENCRYPT_URI))) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No encryption key specified " "as required.", sdp_p->debug_str); sdp_p->conf_p->num_invalid_param++; @@ -1121,7 +1120,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) int32 sctp_port; /* Allocate resource for new media stream. */ - mca_p = sdp_alloc_mca(); + mca_p = sdp_alloc_mca(sdp_p->parse_line); if (mca_p == NULL) { sdp_p->conf_p->num_no_resource++; return (SDP_NO_RESOURCE); @@ -1130,7 +1129,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the media type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No media type specified, parse failed.", sdp_p->debug_str); SDP_FREE(mca_p); @@ -1145,7 +1144,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) } } if (mca_p->media == SDP_MEDIA_UNSUPPORTED) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Media type unsupported (%s).", sdp_p->debug_str, tmp); } @@ -1156,7 +1155,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) */ ptr = sdp_getnextstrtok(ptr, port, sizeof(port), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No port specified in m= media line, " "parse failed.", sdp_p->debug_str); SDP_FREE(mca_p); @@ -1180,7 +1179,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) /* Find the transport protocol type. */ ptr = sdp_getnextstrtok(ptr, tmp, sizeof(tmp), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No transport protocol type specified, " "parse failed.", sdp_p->debug_str); SDP_FREE(mca_p); @@ -1212,7 +1211,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) * just store the first num as the port. */ mca_p->port = num[0]; - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Transport protocol type unsupported " "(%s).", sdp_p->debug_str, tmp); } @@ -1226,6 +1225,10 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) if ((mca_p->transport == SDP_TRANSPORT_RTPAVP) || (mca_p->transport == SDP_TRANSPORT_RTPSAVP) || (mca_p->transport == SDP_TRANSPORT_RTPSAVPF) || + (mca_p->transport == SDP_TRANSPORT_UDPTLSRTPSAVP) || + (mca_p->transport == SDP_TRANSPORT_UDPTLSRTPSAVPF) || + (mca_p->transport == SDP_TRANSPORT_TCPTLSRTPSAVP) || + (mca_p->transport == SDP_TRANSPORT_TCPTLSRTPSAVPF) || (mca_p->transport == SDP_TRANSPORT_UDP) || (mca_p->transport == SDP_TRANSPORT_TCP) || (mca_p->transport == SDP_TRANSPORT_UDPTL) || @@ -1265,6 +1268,10 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) if ((mca_p->transport == SDP_TRANSPORT_RTPAVP) || (mca_p->transport == SDP_TRANSPORT_RTPSAVP) || (mca_p->transport == SDP_TRANSPORT_RTPSAVPF) || + (mca_p->transport == SDP_TRANSPORT_UDPTLSRTPSAVP) || + (mca_p->transport == SDP_TRANSPORT_UDPTLSRTPSAVPF) || + (mca_p->transport == SDP_TRANSPORT_TCPTLSRTPSAVP) || + (mca_p->transport == SDP_TRANSPORT_TCPTLSRTPSAVPF) || (mca_p->transport == SDP_TRANSPORT_UDP) || (mca_p->transport == SDP_TRANSPORT_LOCAL)) { /* Port format is /. Make sure choose @@ -1357,7 +1364,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) break; } if (valid_param == FALSE) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Invalid port format (%s) specified for transport " "protocol (%s), parse failed.", sdp_p->debug_str, port, sdp_get_transport_name(mca_p->transport)); @@ -1382,7 +1389,7 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) } else if (mca_p->transport == SDP_TRANSPORT_DTLSSCTP) { ptr = sdp_getnextstrtok(ptr, port, sizeof(port), " \t", &result); if (result != SDP_SUCCESS) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s No sctp port specified in m= media line, " "parse failed.", sdp_p->debug_str); SDP_FREE(mca_p); @@ -1397,6 +1404,11 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) sctp_port = sdp_getnextnumtok(port_ptr, (const char **)&port_ptr, "/ \t", &result); if (result != SDP_SUCCESS) { + sdp_parse_error(sdp_p, + "%s No sctp port specified in m= media line, " + "parse failed.", sdp_p->debug_str); + SDP_FREE(mca_p); + sdp_p->conf_p->num_invalid_param++; return (SDP_INVALID_PARAMETER); } mca_p->sctpport = sctp_port; @@ -1460,12 +1472,12 @@ sdp_result_e sdp_parse_media (sdp_t *sdp_p, u16 level, const char *ptr) for (i=0; i < mca_p->media_profiles_p->num_profiles; i++) { SDP_PRINT("Profile %s, Num payloads %u ", sdp_get_transport_name(mca_p->media_profiles_p->profile[i]), - mca_p->media_profiles_p->num_payloads[i]); + (unsigned)mca_p->media_profiles_p->num_payloads[i]); } } else { SDP_PRINT("Transport %s, Num payloads %u", sdp_get_transport_name(mca_p->transport), - mca_p->num_payloads); + (unsigned)mca_p->num_payloads); } } return (SDP_SUCCESS); @@ -1506,19 +1518,19 @@ sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, flex_string *fs) if (mca_p->port == SDP_CHOOSE_PARAM) { flex_string_sprintf(fs, "$ "); } else { - flex_string_sprintf(fs, "%u ", (u16)mca_p->port); + flex_string_sprintf(fs, "%u ", (unsigned)mca_p->port); } } else if (mca_p->port_format == SDP_PORT_NUM_COUNT) { - flex_string_sprintf(fs, "%u/%u ", (u16)mca_p->port, - (u16)mca_p->num_ports); + flex_string_sprintf(fs, "%u/%u ", (unsigned)mca_p->port, + (unsigned)mca_p->num_ports); } else if (mca_p->port_format == SDP_PORT_VPI_VCI) { flex_string_sprintf(fs, "%u/%u ", - (u16)mca_p->vpi, (u16)mca_p->vci); + (unsigned)mca_p->vpi, (unsigned)mca_p->vci); } else if (mca_p->port_format == SDP_PORT_VCCI) { - flex_string_sprintf(fs, "%u ", (u16)mca_p->vcci); + flex_string_sprintf(fs, "%u ", (unsigned)mca_p->vcci); } else if (mca_p->port_format == SDP_PORT_NUM_VPI_VCI) { - flex_string_sprintf(fs, "%u/%u/%u ", (u16)mca_p->port, - (u16)mca_p->vpi, (u16)mca_p->vci); + flex_string_sprintf(fs, "%u/%u/%u ", (unsigned)mca_p->port, + (unsigned)mca_p->vpi, (unsigned)mca_p->vci); } else if (mca_p->port_format == SDP_PORT_VCCI_CID) { if ((mca_p->vcci == SDP_CHOOSE_PARAM) && (mca_p->cid == SDP_CHOOSE_PARAM)) { @@ -1532,11 +1544,11 @@ sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, flex_string *fs) return (SDP_INVALID_PARAMETER); } else { flex_string_sprintf(fs, "%u/%u ", - (u16)mca_p->vcci, (u16)mca_p->cid); + (unsigned)mca_p->vcci, (unsigned)mca_p->cid); } } else if (mca_p->port_format == SDP_PORT_NUM_VPI_VCI_CID) { - flex_string_sprintf(fs, "%u/%u/%u/%u ", (u16)mca_p->port, - (u16)mca_p->vpi, (u16)mca_p->vci, (u16)mca_p->cid); + flex_string_sprintf(fs, "%u/%u/%u/%u ", (unsigned)mca_p->port, + (unsigned)mca_p->vpi, (unsigned)mca_p->vci, (unsigned)mca_p->cid); } /* If the media line has AAL2 profiles, build them differently. */ @@ -1550,7 +1562,7 @@ sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, flex_string *fs) for (j=0; j < profile_p->num_payloads[i]; j++) { flex_string_sprintf(fs, " %u", - profile_p->payload_type[i][j]); + (unsigned)profile_p->payload_type[i][j]); } flex_string_sprintf(fs, " "); } @@ -1573,12 +1585,12 @@ sdp_result_e sdp_build_media (sdp_t *sdp_p, u16 level, flex_string *fs) flex_string_sprintf(fs, " %s", sdp_get_payload_name((sdp_payload_e)mca_p->payload_type[i])); } else { - flex_string_sprintf(fs, " %u", mca_p->payload_type[i]); + flex_string_sprintf(fs, " %u", (unsigned)mca_p->payload_type[i]); } } } else { /* Add port to SDP if transport is DTLS/SCTP */ - flex_string_sprintf(fs, " %u", (u32)mca_p->sctpport); + flex_string_sprintf(fs, " %u", (unsigned)mca_p->sctpport); } flex_string_sprintf(fs, "\r\n"); @@ -1620,7 +1632,7 @@ void sdp_parse_payload_types (sdp_t *sdp_p, sdp_mca_t *mca_p, const char *ptr) if (result == SDP_SUCCESS) { if ((mca_p->media == SDP_MEDIA_IMAGE) && (mca_p->transport == SDP_TRANSPORT_UDPTL)) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Numeric payload type not " "valid for media %s with transport %s.", sdp_p->debug_str, @@ -1666,7 +1678,7 @@ void sdp_parse_payload_types (sdp_t *sdp_p, sdp_mca_t *mca_p, const char *ptr) mca_p->num_payloads++; num_payloads++; } else { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Payload type %s not valid for " "media %s with transport %s.", sdp_p->debug_str, @@ -1676,13 +1688,13 @@ void sdp_parse_payload_types (sdp_t *sdp_p, sdp_mca_t *mca_p, const char *ptr) } } else { /* Payload type wasn't recognized. */ - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Payload type " "unsupported (%s).", sdp_p->debug_str, tmp); } } if (mca_p->num_payloads == 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No payload types specified.", sdp_p->debug_str); } @@ -1764,7 +1776,7 @@ sdp_result_e sdp_parse_multiple_profile_payload_types (sdp_t *sdp_p, /* This token must be a payload type. Make sure there aren't * too many payload types. */ if (payload >= SDP_MAX_PAYLOAD_TYPES) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Too many payload types " "found, truncating.", sdp_p->debug_str); continue; @@ -1785,14 +1797,14 @@ sdp_result_e sdp_parse_multiple_profile_payload_types (sdp_t *sdp_p, /* No string payload types are currently valid for the AAL2 * transport types. This support can be added when needed. */ - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: Unsupported payload type " "found (%s).", sdp_p->debug_str, tmp); } for (i=0; i < profile_p->num_profiles; i++) { /* Make sure we have payloads for each profile type. */ if (profile_p->num_payloads[i] == 0) { - sdp_parse_error(sdp_p->peerconnection, + sdp_parse_error(sdp_p, "%s Warning: No payload types specified " "for AAL2 profile %s.", sdp_p->debug_str, sdp_get_transport_name(profile_p->profile[i])); diff --git a/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c b/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c index 66407abc3f30..2d5e753cac00 100644 --- a/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c +++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c @@ -4,16 +4,18 @@ #include #include +#include #include "sdp_os_defs.h" #include "sdp.h" #include "sdp_private.h" + #include "CSFLog.h" #define MKI_BUF_LEN 4 static const char* logTag = "sdp_utils"; -sdp_mca_t *sdp_alloc_mca () { +sdp_mca_t *sdp_alloc_mca (u32 line) { sdp_mca_t *mca_p; /* Allocate resource for new media stream. */ @@ -44,6 +46,7 @@ sdp_mca_t *sdp_alloc_mca () { mca_p->mid = 0; mca_p->bw.bw_data_count = 0; mca_p->bw.bw_data_list = NULL; + mca_p->line_number = line; return (mca_p); } @@ -83,7 +86,7 @@ static sdp_result_e next_token(const char **string_of_tokens, char *token, unsig /* Make sure there's really a token present. */ if ((*str == '\0') || (*str == '\n') || (*str == '\r')) { - return SDP_FAILURE; + return SDP_EMPTY_TOKEN; } /* Now locate end of token */