sdp  1.12.11devel
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sdp.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Sofia-SIP package
3  *
4  * Copyright (C) 2005 Nokia Corporation.
5  *
6  * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24 
25 #ifndef SDP_H
26 #define SDP_H
27 
35 #ifndef SU_ALLOC_H
36 #include <sofia-sip/su_alloc.h>
37 #endif
38 #ifndef SU_TYPES_H
39 #include <sofia-sip/su_types.h>
40 #endif
41 
42 SOFIA_BEGIN_DECLS
43 
47 typedef unsigned long sdp_version_t;
49 typedef struct sdp_origin_s sdp_origin_t;
55 typedef struct sdp_time_s sdp_time_t;
57 typedef struct sdp_repeat_s sdp_repeat_t;
59 typedef struct sdp_zone_s sdp_zone_t;
61 typedef struct sdp_key_s sdp_key_t;
65 typedef struct sdp_media_s sdp_media_t;
67 typedef struct sdp_list_s sdp_list_t;
69 typedef struct sdp_rtpmap_s sdp_rtpmap_t;
70 
72 typedef char const sdp_text_t;
73 
74 #define SDP_MIME_TYPE "application/sdp"
75 
76 enum {
77  SDP_CURRENT_VERSION = 0
78 };
79 
82 {
83  int sdp_size;
99 };
100 
103 {
104  int o_size;
109 };
110 
112 typedef enum
113 {
114  sdp_net_x = 0,
116 } sdp_nettype_e;
117 
119 typedef enum
120 {
125 
128 {
129  int c_size;
134  unsigned c_ttl : 8;
135  unsigned c_mcast : 1;
136  unsigned : 0;
137  unsigned c_groups;
138 };
139 
141 typedef enum
142 {
147 
150 {
151  int b_size;
156  unsigned long b_value;
157 };
158 
161 {
162  int t_size;
164  unsigned long t_start;
165  unsigned long t_stop;
168 };
169 
172 {
173  int r_size;
177  unsigned long r_interval;
178  unsigned long r_duration;
179  unsigned long r_offsets[1];
180 };
181 
184 {
186  int z_size;
188  struct {
189  unsigned long z_at;
190  long z_offset;
191  } z_adjustments[1];
192 };
193 
195 typedef enum {
203 
205 struct sdp_key_s
206 {
207  int k_size;
211 };
212 
215  int a_size;
219 };
220 
222 typedef enum
223 {
235 } sdp_media_e;
236 
238 typedef enum
239 {
248 } sdp_proto_e;
249 
251 typedef enum {
252  sdp_inactive = 0,
253  sdp_sendonly = 1,
254  sdp_recvonly = 2,
255  sdp_sendrecv = sdp_sendonly | sdp_recvonly
256 } sdp_mode_t;
257 
269 {
270  int m_size;
276  unsigned long m_port;
277  unsigned long m_number_of_ports;
288  void *m_user;
291  unsigned m_rejected : 1;
293  /* sdp_mode_t */ unsigned m_mode : 2;
294  unsigned : 0;
295 };
296 
299 {
300  int l_size;
303 };
304 
314 struct sdp_rtpmap_s {
315  int rm_size;
318  unsigned long rm_rate;
321  unsigned rm_predef : 1;
322  unsigned rm_pt : 7;
323  unsigned rm_any : 1;
324  unsigned :0;
325 };
326 
328 
331 
335 
339 
343 
347 
351 
355 
359 
363 
367  sdp_session_t *);
368 
372  sdp_session_t *);
373 
377 
381 
384  sdp_session_t const *b);
385 
388  sdp_origin_t const *b);
389 
392  sdp_connection_t const *b);
393 
396  sdp_bandwidth_t const *b);
397 
399 SOFIAPUBFUN int sdp_time_cmp(sdp_time_t const *a, sdp_time_t const *b);
400 
401 /* Compare two repeat (r=) fields */
402 SOFIAPUBFUN int sdp_repeat_cmp(sdp_repeat_t const *a, sdp_repeat_t const *b);
403 
404 /* Compare two zone (z=) fields */
405 SOFIAPUBFUN int sdp_zone_cmp(sdp_zone_t const *a, sdp_zone_t const *b);
406 
408 SOFIAPUBFUN int sdp_key_cmp(sdp_key_t const *a, sdp_key_t const *b);
409 
412  sdp_attribute_t const *);
413 
415 SOFIAPUBFUN int sdp_media_cmp(sdp_media_t const *, sdp_media_t const *);
416 
418 SOFIAPUBFUN int sdp_rtpmap_cmp(sdp_rtpmap_t const *a, sdp_rtpmap_t const *b);
419 
421 SOFIAPUBFUN int sdp_list_cmp(sdp_list_t const *a, sdp_list_t const *b);
422 
425 
428 
430 SOFIAPUBFUN void sdp_media_type(sdp_media_t *m, char const *s);
431 
433 SOFIAPUBFUN void sdp_media_transport(sdp_media_t *m, char const *s);
434 
437  char const *name);
438 
441  sdp_attribute_t const *a2,
442  char const *name);
443 
446  sdp_mode_t defmode);
447 
450  sdp_mode_t mode);
451 
455  char const *name,
456  int pt, char **return_result);
457 
460  sdp_attribute_t const *a);
461 
464  sdp_attribute_t *a,
465  sdp_attribute_t **return_replaced);
466 
469  char const *name);
470 
471 /* Return 1 if m= line struct matches with given type and name */
472 SOFIAPUBFUN unsigned sdp_media_match(sdp_media_t const *m,
473  sdp_media_e type,
474  sdp_text_t *type_name,
475  sdp_proto_e proto,
476  sdp_text_t *proto_name);
477 
478 SOFIAPUBFUN unsigned sdp_media_match_with(sdp_media_t const *a,
479  sdp_media_t const *b);
480 
482 SOFIAPUBFUN unsigned sdp_media_count(sdp_session_t const *sdp,
483  sdp_media_e type,
484  sdp_text_t *type_name,
485  sdp_proto_e proto,
486  sdp_text_t *proto_name);
487 
489  sdp_media_t const *m0);
490 
493 
496 
499  sdp_rtpmap_t const *rm);
500 
501 /* ======================================================================== */
502 
527 };
528 
530 typedef struct sdp_parser_s sdp_parser_t;
531 typedef sdp_parser_t *sdp_parser;
532 
534  char const msg[], issize_t msgsize,
535  int flags);
539 
541 
543 
544 /* ======================================================================== */
545 
547 typedef struct sdp_printer_s sdp_printer_t;
548 typedef sdp_printer_t *sdp_printer;
549 
551  char msgbuf[], isize_t maxmsgsize,
552  int flags);
554 SOFIAPUBFUN char const *sdp_message(sdp_printer_t *p);
557 
558 #define sdp_mapped_attribute_find sdp_attribute_mapped_find
559 #define sdp_free_parser sdp_parser_free
560 #define sdp_free_printer sdp_printer_free
561 
562 SOFIA_END_DECLS
563 
564 #endif /* SDP_H */

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.