File: cseq_parser.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 (58 lines) | stat: -rw-r--r-- 2,401 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
<?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="cseq_parser" xmlns:xi="http://www.w3.org/2001/XInclude">
    <sectioninfo>
	<revhistory>
	    <revision>
		<revnumber>$Revision$</revnumber>
		<date>$Date$</date>
	    </revision>
	</revhistory>
    </sectioninfo>

    <title>CSeq Header Field Parser</title>
    <para>
	Purpose of this parser is to parse body of CSeq header field. The
	parser can be found in file <filename>parse_cseq.c</filename> under
	<filename>parser</filename> subdirectory.
    </para>
    <para>
	Main function is <function>parse_cseq</function> but there is no need
	to call the function explicitly. Every time the parser finds a CSeq
	header field, this function will be called automatically. Result of the
	parser is <structname>cseq_body</structname> structure. Pointer to the
	structure will be stored in <structfield>parsed</structfield> field of
	<structname>hdr_field</structname> structure. Since the pointer is
	<type>void*</type>, there is a convenience macro
	<function>get_cseq</function> in file <filename>parse_cseq.h</filename>
	that will do the necessary type-casting and will return pointer to
	<structname>cseq_body</structname> structure.
    </para>
    <para>
	The parser will parse CSeq body according to the grammar defined in
	<acronym>RFC3261</acronym> and store result in
	<structname>cseq_body</structname> structure.
    </para>
    <para>
	The parser gets called automatically from function
	<function>get_hdr_field</function> in file
	<filename>msg_parser.c</filename>. The function first creates and
	initializes an instance of <structname>cseq_body</structname>
	structure, then calls <function>parse_cseq</function> function with the
	structure as a parameter and if everything went OK, puts the pointer to
	the structure in <structfield>parsed</structfield> field of
	<structname>hdr_field</structname> structure representing the parsed
	CSeq header field.
    </para>
    <para>
	The newly created structure will be freed when the message is being
	destroyed, see function <function>clean_hdr_field</function> in file
	<filename>hf.c</filename> for more details.
    </para>
    <para>
	See <xref linkend="cseq_body"/> for description of the
	<structname>cseq_body</structname> structure.
    </para>
</section>