File: hdr_field.xml

package info (click to toggle)
kamailio 5.6.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 68,332 kB
  • sloc: ansic: 744,091; xml: 196,848; cpp: 14,471; makefile: 8,859; sh: 8,814; sql: 7,844; yacc: 3,863; perl: 2,955; python: 2,710; java: 449; javascript: 269; php: 258; ruby: 225; cs: 40; awk: 27
file content (92 lines) | stat: -rw-r--r-- 2,984 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<section id="hdr_field" xmlns:xi="http://www.w3.org/2001/XInclude">
    <sectioninfo>
	<revhistory>
	    <revision>
		<revnumber>$Revision$</revnumber>
		<date>$Date$</date>
	    </revision>
	</revhistory>
    </sectioninfo>
    
    <title>Structure <structname>hdr_field</structname></title>
    
    <para>
	The structure represents a header field of a SIP message. A header
	field consist of <emphasis>name</emphasis> and
	<emphasis>body</emphasis> separated by a double colon.  For example:
	"Server: SIP Express Router\r\n" is one header field. "Server" is
	header field name and "SI Express Router\r\n" is header field body.
    </para>
    <para>
	The structure is defined in file <filename>hf.h</filename> under
	<filename>parser</filename> subdirectory.
    </para>
    <para>
	<emphasis>Structure Declaration</emphasis>
	<programlisting>
struct hdr_field {   
    int type;                /* Header field type */
    str name;                /* Header field name */
    str body;                /* Header field body */
    void* parsed;            /* Parsed data structures */
    struct hdr_field* next;  /* Next header field in the list */
};
	</programlisting>
    </para>
    <para>
	<emphasis>Field Description:</emphasis>
	<itemizedlist>
	    <listitem>
		<para>
		    <structfield>type</structfield> - Type of the header field,
		    the following header field types are defined (and
		    recognized by the parser):
		</para>
		<para>
		    HDR_VIA1, HDR_VIA2, HDR_TO, HDR_FROM, HDR_CSEQ, HDR_CALLID,
		    HDR_CONTACT, HDR_MAXFORWARDS, HDR_ROUTE, HDR_RECORDROUTE,
		    HDR_CONTENTTYPE, HDR_CONTENTLENGTH, HDR_AUTHORIZATION,
		    HDR_EXPIRES, HDR_PROXYAUTH, HDR_WWWAUTH, HDR_SUPPORTED,
		    HDR_REQUIRE, HDR_PROXYREQUIRE, HDR_UNSUPPORTED, HDR_ALLOW,
		    HDR_EVENT, HDR_OTHER.
		</para>
		<para>
		    Their meaning is self explanatory. HDR_OTHER marks header
		    field not recognized by the parser.
		</para>
	    </listitem>
	    <listitem>
		<para>
		    <structfield>name</structfield> - Name of the header field
		    (the part before colon)
		</para>
	    </listitem>
	    <listitem>
		<para>
		    <structfield>body</structfield> - body of the header field
		    (the part after colon)
		</para>
	    </listitem>
	    <listitem>
		<para>
		    <structfield>parsed</structfield> - Each header field body
		    can be further parsed. The field contains pointer to parsed
		    structure if the header field was parsed already. The
		    pointer is of type <type>void*</type> because it can point
		    to different types of structure depending on the header
		    field type.
		</para>
	    </listitem>
	    <listitem>
		<para>
		    <structfield>next</structfield> - Pointer to the next
		    header field in linked list.
		</para>
	    </listitem>
	</itemizedlist>
    </para>
</section>