Kai Vehmanen <kai.vehmanen@nokia-email.address.hidden>
#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <assert.h>
#include <sofia-sip/su_alloc.h>
#include "sofia-sip/sdp.h"
Include dependency graph for sdp_parse.c:
Functions | |
sdp_parser_t * | sdp_parse (su_home_t *home, char const msg[], int msgsize, int flags) |
Parse an SDP message. | |
su_home_t * | sdp_parser_home (sdp_parser_t *parser) |
Obtain memory home used by parser. | |
sdp_session_t * | sdp_session (sdp_parser_t *p) |
Retrieve an SDP session structure. | |
char const * | sdp_parsing_error (sdp_parser_t *p) |
Get a parsing error message. | |
void | sdp_parser_free (sdp_parser_t *p) |
Free an SDP parser. | |
int | sdp_sanity_check (sdp_parser_t *p) |
Validates that all mandatory fields exist. | |
void | sdp_media_type (sdp_media_t *m, char const *s) |
Set media type. | |
void | sdp_media_transport (sdp_media_t *m, char const *s) |
Set transport protocol. | |
int | sdp_media_has_rtp (sdp_media_t const *m) |
Check if media uses RTP as its transport protocol. | |
Variables | |
sdp_rtpmap_t const *const | sdp_rtpmap_well_known [128] |
Table of rtpmap structures by payload type numbers. |
sdp_parser_t* sdp_parse | ( | su_home_t * | home, | |
char const | msg[], | |||
int | msgsize, | |||
int | flags | |||
) |
Parse an SDP message.
The function sdp_parse() parses an SDP message msg of size msgsize. Parsing is done according to the given flags. The SDP message may not contain a NUL
.
The parsing result is stored to an sdp_session_t
structure.
home | memory home | |
msg | pointer to message | |
msgsize | size of the message (excluding final NUL, if any) | |
flags | flags affecting the parsing. |
sdp_f_strict
Parser should accept only messages conforming strictly to the specification. sdp_f_anynet
Parser accepts unknown network or address types.void sdp_parser_free | ( | sdp_parser_t * | p | ) |
Free an SDP parser.
The function sdp_parser_free() frees an SDP parser object along with the memory blocks associated with it.
p | pointer to the SDP parser to be freed |
char const* sdp_parsing_error | ( | sdp_parser_t * | p | ) |
Get a parsing error message.
The function sdp_parsing_error() returns the error message associated with an SDP parser p.
p | SDP parser |
NULL
if no error occurred. int sdp_sanity_check | ( | sdp_parser_t * | p | ) |
Validates that all mandatory fields exist.
Checks that all necessary fields (v=, o=) exists in the given sdp. If strict, check that all mandatory fields (c=, o=, s=, t=) are present. This function also goes through all media, marks rejected media as such, and updates the mode accordingly.
0 | if parsed SDP description is valid | |
-1 | if some SDP line is missing | |
-2 | if c= line is missing |
sdp_session_t* sdp_session | ( | sdp_parser_t * | p | ) |
Retrieve an SDP session structure.
The function sdp_session() returns a pointer to the SDP session structure associated with the SDP parser p. The pointer and all the data in the structure are valid until sdp_parser_free()
is called.
p | SDP parser |
NULL
, if an error has occurred.
sdp_rtpmap_t const* const sdp_rtpmap_well_known[128] |