cseq_parser.xml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
  4. <section id="cseq_parser" xmlns:xi="http://www.w3.org/2001/XInclude">
  5. <sectioninfo>
  6. <revhistory>
  7. <revision>
  8. <revnumber>$Revision$</revnumber>
  9. <date>$Date$</date>
  10. </revision>
  11. </revhistory>
  12. </sectioninfo>
  13. <title>CSeq Header Field Parser</title>
  14. <para>
  15. Purpose of this parser is to parse body of CSeq header field. The
  16. parser can be found in file <filename>parse_cseq.c</filename> under
  17. <filename>parser</filename> subdirectory.
  18. </para>
  19. <para>
  20. Main function is <function>parse_cseq</function> but there is no need
  21. to call the function explicitly. Every time the parser finds a CSeq
  22. header field, this function will be called automatically. Result of the
  23. parser is <structname>cseq_body</structname> structure. Pointer to the
  24. structure will be stored in <structfield>parsed</structfield> field of
  25. <structname>hdr_field</structname> structure. Since the pointer is
  26. <type>void*</type>, there is a convenience macro
  27. <function>get_cseq</function> in file <filename>parse_cseq.h</filename>
  28. that will do the necessary type-casting and will return pointer to
  29. <structname>cseq_body</structname> structure.
  30. </para>
  31. <para>
  32. The parser will parse CSeq body according to the grammar defined in
  33. <acronym>RFC3261</acronym> and store result in
  34. <structname>cseq_body</structname> structure.
  35. </para>
  36. <para>
  37. The parser gets called automatically from function
  38. <function>get_hdr_field</function> in file
  39. <filename>msg_parser.c</filename>. The function first creates and
  40. initializes an instance of <structname>cseq_body</structname>
  41. structure, then calls <function>parse_cseq</function> function with the
  42. structure as a parameter and if everything went OK, puts the pointer to
  43. the structure in <structfield>parsed</structfield> field of
  44. <structname>hdr_field</structname> structure representing the parsed
  45. CSeq header field.
  46. </para>
  47. <para>
  48. The newly created structure will be freed when the message is being
  49. destroyed, see function <function>clean_hdr_field</function> in file
  50. <filename>hf.c</filename> for more details.
  51. </para>
  52. <para>
  53. See <xref linkend="cseq_body"/> for description of the
  54. <structname>cseq_body</structname> structure.
  55. </para>
  56. </section>