via_parser.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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="via_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>Via HF Body Parser</title>
  14. <para>
  15. Purpose of this parser is to parse body of Via header field. The parser
  16. can be found in file <filename>parse_via.c</filename> under
  17. <filename>parser</filename> subdirectory.
  18. </para>
  19. <para>
  20. Main function is <function>parse_via</function> but there is no need to
  21. call the function explicitly. Every time the parser finds a Via header
  22. field, this function will be called automatically. Result of the parser
  23. is <structname>via_body</structname> structure. Pointer to the
  24. structure will be stored in <structfield>parsed</structfield> field of
  25. <structname>hdr_field</structname> structure representing the parsed
  26. header field.
  27. </para>
  28. <para>
  29. The parser itself is a finite state machine that will parse Via body
  30. according to the grammar defined in <acronym>RFC3261</acronym> and
  31. store result in <structname>via_body</structname> structure.
  32. </para>
  33. <para>
  34. The parser gets called automatically from function
  35. <function>get_hdr_field</function> in file
  36. <filename>msg_parser.c</filename>. The function first creates and
  37. initializes an instance of <structname>via_body</structname> structure,
  38. then calls <function>parse_via</function> function with the structure
  39. as a parameter and if everything went OK, puts the pointer to the
  40. structure in <structfield>parsed</structfield> field of
  41. <structname>hdr_field</structname> structure representing the parsed
  42. Via header field.
  43. </para>
  44. <para>
  45. The newly created structure will be freed when the message is being
  46. destroyed, see function <function>clean_hdr_field</function> in file
  47. <filename>hf.c</filename> for more details.
  48. </para>
  49. <para>
  50. Structure <structname>via_body</structname> is described in
  51. <xref linkend="via_body"/>.
  52. </para>
  53. </section>