This submodule contains the functions and types for building a protocol-specific parser.
More...
This submodule contains the functions and types for building a protocol-specific parser.
◆ msg_mclass_clone() [1/2]
Clone a message class.
The function msg_mclass_clone() makes a copy of message class object old. It is possible to resize the hash table by giving a non-zero newsize. If newsize is 0, the size of hash table is not changed. If empty is true, the copied message class object will not recognize any headers. This is useful if more fine-grained control of parsing process is required, for instance.
- Parameters
-
[in] | old | pointer to the message class object to be copied |
[in] | newsize | size of hash table in the copied object |
[in] | empty | if true, resulting copy does not contain any headers |
- Returns
- The function msg_mclass_clone() returns a pointer to a newly copied message class object, or NULL upon an error. The returned message class object can be freed with free().
- Errors:
- \n ENOMEM
- A memory allocation failed.
- \n EINVAL
- The function was given invalid arguments.
- Note
- The empty parser can handle request/status line. All headers are put into list of unknown headers (unless they are malformed, and they are put into list of erronous headers). However, SIP, RTSP, and HTTP protocols all require that the parser recognizes Content-Length header before they can extract the message body from the data received from network.
◆ msg_mclass_clone() [2/2]
Clone a message class.
The function msg_mclass_clone() makes a copy of message class object old. It is possible to resize the hash table by giving a non-zero newsize. If newsize is 0, the size of hash table is not changed. If empty is true, the copied message class object will not recognize any headers. This is useful if more fine-grained control of parsing process is required, for instance.
- Parameters
-
[in] | old | pointer to the message class object to be copied |
[in] | newsize | size of hash table in the copied object |
[in] | empty | if true, resulting copy does not contain any headers |
- Returns
- The function msg_mclass_clone() returns a pointer to a newly copied message class object, or NULL upon an error. The returned message class object can be freed with free().
- Errors:
- \n ENOMEM
- A memory allocation failed.
- \n EINVAL
- The function was given invalid arguments.
- Note
- The empty parser can handle request/status line. All headers are put into list of unknown headers (unless they are malformed, and they are put into list of erronous headers). However, SIP, RTSP, and HTTP protocols all require that the parser recognizes Content-Length header before they can extract the message body from the data received from network.