$Revision$
$Date$

# Via HF Body Parser

Purpose of this parser is to parse body of Via header field. The parser can be found in file `parse_via.c` under `parser` subdirectory.

Main function is `parse_via` but there is no need to call the function explicitly. Every time the parser finds a Via header field, this function will be called automatically. Result of the parser is via_body structure. Pointer to the structure will be stored in parsed field of hdr_field structure representing the parsed header field.

The parser itself is a finite state machine that will parse Via body according to the grammar defined in RFC3261 and store result in via_body structure.

The parser gets called automatically from function `get_hdr_field` in file `msg_parser.c`. The function first creates and initializes an instance of via_body structure, then calls `parse_via` function with the structure as a parameter and if everything went OK, puts the pointer to the structure in parsed field of hdr_field structure representing the parsed Via header field.

The newly created structure will be freed when the message is being destroyed, see function `clean_hdr_field` in file `hf.c` for more details.

Structure via_body is described in .