hdr_field.xml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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="hdr_field" 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>Structure <structname>hdr_field</structname></title>
  14. <para>
  15. The structure represents a header field of a SIP message. A header
  16. field consist of <emphasis>name</emphasis> and
  17. <emphasis>body</emphasis> separated by a double colon. For example:
  18. "Server: SIP Express Router\r\n" is one header field. "Server" is
  19. header field name and "SI Express Router\r\n" is header field body.
  20. </para>
  21. <para>
  22. The structure is defined in file <filename>hf.h</filename> under
  23. <filename>parser</filename> subdirectory.
  24. </para>
  25. <para>
  26. <emphasis>Structure Declaration</emphasis>
  27. <programlisting>
  28. struct hdr_field {
  29. int type; /* Header field type */
  30. str name; /* Header field name */
  31. str body; /* Header field body */
  32. void* parsed; /* Parsed data structures */
  33. struct hdr_field* next; /* Next header field in the list */
  34. };
  35. </programlisting>
  36. </para>
  37. <para>
  38. <emphasis>Field Description:</emphasis>
  39. <itemizedlist>
  40. <listitem>
  41. <para>
  42. <structfield>type</structfield> - Type of the header field,
  43. the following header field types are defined (and
  44. recognized by the parser):
  45. </para>
  46. <para>
  47. HDR_VIA1, HDR_VIA2, HDR_TO, HDR_FROM, HDR_CSEQ, HDR_CALLID,
  48. HDR_CONTACT, HDR_MAXFORWARDS, HDR_ROUTE, HDR_RECORDROUTE,
  49. HDR_CONTENTTYPE, HDR_CONTENTLENGTH, HDR_AUTHORIZATION,
  50. HDR_EXPIRES, HDR_PROXYAUTH, HDR_WWWAUTH, HDR_SUPPORTED,
  51. HDR_REQUIRE, HDR_PROXYREQUIRE, HDR_UNSUPPORTED, HDR_ALLOW,
  52. HDR_EVENT, HDR_OTHER.
  53. </para>
  54. <para>
  55. Their meaning is self explanatory. HDR_OTHER marks header
  56. field not recognized by the parser.
  57. </para>
  58. </listitem>
  59. <listitem>
  60. <para>
  61. <structfield>name</structfield> - Name of the header field
  62. (the part before colon)
  63. </para>
  64. </listitem>
  65. <listitem>
  66. <para>
  67. <structfield>body</structfield> - body of the header field
  68. (the part after colon)
  69. </para>
  70. </listitem>
  71. <listitem>
  72. <para>
  73. <structfield>parsed</structfield> - Each header field body
  74. can be further parsed. The field contains pointer to parsed
  75. structure if the header field was parsed already. The
  76. pointer is of type <type>void*</type> because it can point
  77. to different types of structure depending on the header
  78. field type.
  79. </para>
  80. </listitem>
  81. <listitem>
  82. <para>
  83. <structfield>next</structfield> - Pointer to the next
  84. header field in linked list.
  85. </para>
  86. </listitem>
  87. </itemizedlist>
  88. </para>
  89. </section>