sdp_helpr_funcs.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * SDP parser helpers
  3. *
  4. * Copyright (C) 2008-2009 SOMA Networks, INC.
  5. * Copyright (C) 2010 VoIP Embedded, Inc
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright notice,
  11. * this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR
  17. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  19. * EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  20. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  21. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  23. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  24. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  25. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. *
  27. */
  28. #ifndef _SDP_HLPR_FUNCS_H
  29. #define _SDP_HLPR_FUNCS_H
  30. #include "../../str.h"
  31. #include "../msg_parser.h"
  32. #include "sdp.h"
  33. /**
  34. * Detect the mixed part delimiter.
  35. *
  36. * Example: "boundary1"
  37. * Content-Type: multipart/mixed; boundary="boundary1"
  38. */
  39. int get_mixed_part_delimiter(str * body, str * mp_delimiter);
  40. int extract_field(str* body, str* value, str field);
  41. int extract_rtpmap(str *body, str *rtpmap_payload, str *rtpmap_encoding, str *rtpmap_clockrate, str *rtpmap_parmas);
  42. int extract_fmtp( str *body, str *fmtp_payload, str *fmtp_string );
  43. int extract_ptime(str *body, str *ptime);
  44. int extract_sendrecv_mode(str *body, str *sendrecv_mode, int *is_on_hold);
  45. int extract_mediaip(str *body, str *mediaip, int *pf, char *line);
  46. int extract_media_attr(str *body, str *mediamedia, str *mediaport, str *mediatransport, str *mediapayload, int *is_rtp);
  47. int extract_bwidth(str *body, str *bwtype, str *bwwitdth);
  48. int extract_candidate(str *body, sdp_stream_cell_t *stream);
  49. /* RFC3605 attributes */
  50. int extract_rtcp(str *body, str *rtcp);
  51. /* RFC4975 attributes */
  52. int extract_accept_types(str *body, str *accept_types);
  53. int extract_accept_wrapped_types(str *body, str *accept_wrapped_types);
  54. int extract_max_size(str *body, str *max_size);
  55. int extract_path(str *body, str *path);
  56. char *find_sdp_line(char *p, char *plimit, char linechar);
  57. char *find_next_sdp_line(char *p, char *plimit, char linechar, char *defptr);
  58. char* get_sdp_hdr_field(char* , char* , struct hdr_field* );
  59. char *find_sdp_line_delimiter(char *p, char *plimit, str delimiter);
  60. char *find_next_sdp_line_delimiter(char *p, char *plimit, str delimiter, char *defptr);
  61. char * find_first_sdp_line(char* pstart, char* plimit, char linechar,
  62. char* defptr);
  63. #endif