Skip Navigation Links | |
Exit Print View | |
man pages section 3: Networking Library Functions Oracle Solaris 11.1 Information Library |
DNSServiceConstructFullName(3DNS_SD)
DNSServiceCreateConnection(3DNS_SD)
DNSServiceEnumerateDomains(3DNS_SD)
DNSServiceProcessResult(3DNS_SD)
DNSServiceQueryRecord(3DNS_SD)
DNSServiceReconfirmRecord(3DNS_SD)
DNSServiceRefDeallocate(3DNS_SD)
DNSServiceRegisterRecord(3DNS_SD)
DNSServiceRemoveRecord(3DNS_SD)
DNSServiceUpdateRecord(3DNS_SD)
gss_create_empty_oid_set(3GSS)
gss_inquire_cred_by_mech(3GSS)
gss_inquire_mechs_for_name(3GSS)
gss_inquire_names_for_mech(3GSS)
gss_process_context_token(3GSS)
ldap_enable_translation(3LDAP)
ldap_get_entry_controls(3LDAP)
ldap_get_lang_values_len(3LDAP)
ldap_init_getfilter_buf(3LDAP)
ldap_init_searchprefs_buf(3LDAP)
ldap_init_templates_buf(3LDAP)
ldap_parse_extended_result(3LDAP)
ldap_parse_sasl_bind_result(3LDAP)
ldap_sasl_interactive_bind_s(3LDAP)
ldap_set_string_translators(3LDAP)
ldap_translate_from_t61(3LDAP)
rpc_gss_get_principal_name(3NSL)
rpc_gss_svc_max_data_length(3NSL)
sasl_auxprop_add_plugin(3SASL)
sasl_canonuser_add_plugin(3SASL)
sasl_client_plug_init_t(3SASL)
sasl_server_plug_init_t(3SASL)
sasl_server_userdb_checkpass_t(3SASL)
sasl_server_userdb_setpass_t(3SASL)
sdp_add_connection(3COMMPUTIL)
sdp_add_information(3COMMPUTIL)
sdp_delete_all_field(3COMMPUTIL)
sdp_delete_all_media_field(3COMMPUTIL)
sdp_delete_attribute(3COMMPUTIL)
sdp_find_attribute(3COMMPUTIL)
sdp_find_media_rtpmap(3COMMPUTIL)
sdp_session_to_str(3COMMPUTIL)
sip_create_dialog_req_nocontact(3SIP)
sip_delete_header_by_name(3SIP)
sip_disable_dialog_logging(3SIP)
sip_disable_trans_logging(3SIP)
sip_enable_dialog_logging(3SIP)
sip_enable_trans_logging(3SIP)
sip_get_contact_display_name(3SIP)
sip_get_content_sub_type(3SIP)
sip_get_dialog_local_contact_uri(3SIP)
sip_get_dialog_local_cseq(3SIP)
sip_get_dialog_local_tag(3SIP)
sip_get_dialog_local_uri(3SIP)
sip_get_dialog_remote_cseq(3SIP)
sip_get_dialog_remote_tag(3SIP)
sip_get_dialog_remote_target_uri(3SIP)
sip_get_dialog_remote_uri(3SIP)
sip_get_dialog_route_set(3SIP)
sip_get_from_display_name(3SIP)
sip_get_passertedid_display_name(3SIP)
sip_get_passertedid_uri_str(3SIP)
sip_get_ppreferredid_display_name(3SIP)
sip_get_ppreferredid_uri_str(3SIP)
sip_get_proxy_authen_param(3SIP)
sip_get_proxy_authen_scheme(3SIP)
sip_get_proxy_author_param(3SIP)
sip_get_proxy_author_scheme(3SIP)
sip_get_replyto_display_name(3SIP)
sip_get_retry_after_cmts(3SIP)
sip_get_retry_after_time(3SIP)
sip_get_route_display_name(3SIP)
sip_get_via_sent_by_host(3SIP)
sip_get_via_sent_by_port(3SIP)
sip_get_via_sent_protocol_name(3SIP)
sip_get_via_sent_protocol_version(3SIP)
sip_get_via_sent_transport(3SIP)
sip_get_www_authen_param(3SIP)
sip_get_www_authen_scheme(3SIP)
sip_unregister_all_sent_by(3SIP)
- parse the SDP description
cc [ flag...] file... -lcommputil [ library...] #include <sdp.h> int sdp_parse(const char *sdp_info, int len, int flags, sdp_session_t **session, uint_t *p_error);
The sdp_parse() function parses the SDP description present in sdp_info and populates the sdp_session_t structure. The len argument specifies the length of the character buffer sdp_info. The flags argument is not used, but must be set to 0, otherwise the call fails with the error value of EINVAL and *session set to NULL. The function allocates the memory required for the sdp_session_t structure and hence the caller is responsible for freeing the parsed session structure (sdp_session_t) using sdp_free_session(), described on the sdp_new_session(3COMMPUTIL) manual page.
The p_error argument identifies any field that had a parsing error. It cannot be NULL and can take any of the following values:
|
RFC 4566 states that the fields in the SDP description need to be in a strict order. If the fields are not in the order specified in the RFC, SDP_FIELDS_ORDER_ERROR will be set.
RFC 4566 mandates certain fields to be present in SDP description. If those fields are missing then SDP_MISSING_FIELDS will be set.
Applications can check for presence of parsing error using the bit-wise operators.
If there was an error on a particular field, that field information will not be in the sdp_session_t structure. Also, parsing continues even if there was a field with a parsing error.
The sdp_session_t structure is defined in the header file <sdp.h> and contains the following members:
typedef struct sdp_session { int sdp_session_version; /* SDP session verstion */ int s_version; /* SDP version field */ sdp_origin_t *s_origin; /* SDP origin field */ char *s_name; /* SDP name field */ char *s_info; /* SDP info field */ char *s_uri; /* SDP uri field */ sdp_list_t *s_email; /* SDP email field */ sdp_list_t *s_phone; /* SDP phone field */ sdp_conn_t *s_conn; /* SDP connection field */ sdp_bandwidth_t *s_bw; /* SDP bandwidth field */ sdp_time_t *s_time; /* SDP time field */ sdp_zone_t *s_zone; /* SDP zone field */ sdp_key_t *s_key; /* SDP key field */ sdp_attr_t *s_attr; /* SDP attribute field */ sdp_media_t *s_media; /* SDP media field */ } sdp_session_t;
The sdp_session_version member is used to track the version of the structure. Initially it is set to SDP_SESSION_VERSION_1 (= 1).
The sdp_origin_t structure contains the following members:
typedef struct sdp_origin { char *o_username; /* username of the originating host */ uint64_t o_id; /* session id */ uint64_t o_version; /* version number of this session */ /* description */ char *o_nettype; /* type of network */ char *o_addrtype; /* type of the address */ char *o_address; /* address of the machine from which */ /* session was created */ } sdp_origin_t;
The sdp_conn_t structure contains the following members:
typedef struct sdp_conn { char *c_nettype; /* type of network */ char *c_addrtype; /* type of the address */ char *c_address; /* unicast-address or multicast */ /* address */ int c_addrcount; /* number of addresses (case of */ /* multicast address with layered */ /* encodings */ struct sdp_conn *c_next; /* pointer to next connection */ /* structure; there could be several */ /* connection fields in SDP description */ uint8_t c_ttl; /* TTL value for IPV4 multicast address */ } sdp_conn_t;
The sdp_bandwidth_t structure contains the following members:
typedef struct sdp_bandwidth { char *b_type; /* info needed to interpret b_value */ uint64_t b_value; /* bandwidth value */ struct sdp_bandwidth *b_next; /* pointer to next bandwidth structure*/ /* (there could be several bandwidth */ /* fields in SDP description */ } sdp_bandwidth_t;
The sdp_list_t structure is a linked list of void pointers. This structure holds SDP fields like email and phone, in which case the void pointers point to character buffers. It to hold information in cases where the number of elements is not predefined (for example, offset (in repeat field) where void pointer holds integer values or format (in media field) where void pointers point to character buffers). The sdp_list_t structure is defined as:
typedef struct sdp_list { void *value; /* string values in case of email, phone and */ /* format (in media field) or integer values */ /* in case of offset (in repeat field) */ struct sdp_list *next; /* pointer to the next node in the list */ } sdp_list_t;
The sdp_repeat_t structure contains the following members:
typedef struct sdp_repeat { uint64_t r_interval; /* repeat interval, e.g. 86400 seconds */ /* (1 day) */ uint64_t r_duration; /* duration of session, e.g. 3600 */ /* seconds (1 hour) */ sdp_list_t *r_offset; /* linked list of offset values; each */ /* represents offset from start-time */ /* in SDP time field */ struct sdp_repeat *r_next; /* pointer to next repeat structure; */ /* there could be several repeat */ /* fields in SDP description */
The sdp_repeat_t structure will always be part of the time structure sdp_time_t, since the repeat field does not appear alone in SDP description and is always associated with the time field.
The sdp_time_t structure contains the following members:
typedef struct sdp_time { uint64_t t_start; /* start-time for a session */ uint64_t t_stop; /* end-time for a session */ sdp_repeat_t *t_repeat; /* points to the SDP repeat field */ struct sdp_time *t_next; /* pointer to next time field; there */ /* could there could be several time */ /* fields in SDP description */ } sdp_time_t;
The sdp_zone_t structure contains the following members:
typedef struct sdp_zone { uint64_t z_time; /* base time */ char *z_offset; /* offset added to z_time to determine */ /* session time; mainly used for daylight */ /* saving time conversions */ struct sdp_zone *z_next; /* pointer to next zone field; there */ /* could be several <adjustment-time> */ /* <offset> pairs within a zone field */ } sdp_zone_t;
The sdp_key_t structure contains the following members:
typedef struct sdp_key { char *k_method; /* key type */ char *k_enckey; /* encryption key */ } sdp_key_t;
The sdp_attr_t structure contains the following members:
typedef struct sdp_attr { char *a_name; /* name of the attribute */ char *a_value; /* value of the attribute */ struct sdp_attr *a_next; /* pointer to the next attribute */ /* structure; there could be several */ /* attribute fields within SDP description */ } sdp_attr_t;
The sdp_media_t structure contains the following members:
typedef struct sdp_media { char *m_name; /* name of the media such as "audio", */ /* "video", "message" */ uint_t m_port; /* transport layer port information */ int m_portcount; /* number of ports in case of */ /* hierarchically encoded streams */ char *m_proto; /* transport protocol */ sdp_list_t *m_format; /* media format description */ char *m_info; /* media info field */ sdp_conn_t *m_conn; /* media connection field */ sdp_bandwidth_t *m_bw; /* media bandwidth field */ sdp_key_t *m_key; /* media key field */ sdp_attr_t *m_attr; /* media attribute field */ struct sdp_media *m_next; /* pointer to next media structure; */ /* there could be several media */ /* sections in SDP description */ sdp_session_t *m_session; /* pointer to the session structure */ } sdp_media_t;
The sdp_parse() function returns 0 on success and the appropriate error value on failure. The value of errno is not changed by these calls in the event of an error.
The sdp_parse() function will fail if:
Arguments to the function were invalid.
Memory allocation failed while parsing sdp_info.
Example 1 sdp_parse() example
If the SDP description was
v=0\r\n o=jdoe 23423423 234234234 IN IP4 192.168.1.1\r\n s=SDP seminar\r\n i=A seminar on the session description protocol\r\n e=test@host.com c=IN IP4 156.78.90.1\r\n t=2873397496 2873404696\r\n
then after call to sdp_parse() function the sdp_session_t structure would be
session { sdp_session_version = 1 s_version = 0 s_origin { o_username = "jdoe" o_id = 23423423ULL o_version = 234234234ULL o_nettype = "IN" o_addrtype = "IP4" o_address = "192.168.1.1" } s_name = "SDP seminar" s_info = "A seminar on the session description protocol" s_uri = (nil) s_email { value = "test@host.com" next = (nil) } s_phone = (nil) s_conn { c_nettype = "IN" c_addrtype = "IP4" c_address = "156.78.90.1" c_addrcount = 0 c_ttl = 0 c_next = (nil) } s_bw = (nil) s_time { t_start = 2873397496ULL t_stop = 2873404696ULL t_repeat = (nil) t_next = (nil) } s_zone = (nil) s_key = (nil) s_attr = (nil) s_media = (nil) }
See attributes(5) for descriptions of the following attributes:
|
libcommputil(3LIB), sdp_new_session(3COMMPUTIL), attributes(5)