http 1.12.11devel
Loading...
Searching...
No Matches
Macros | Functions
http_parser.h File Reference

Typedefs and prototypes used by HTTP parser. More...

#include <sofia-sip/su_alloc.h>
#include <sofia-sip/msg.h>
#include <sofia-sip/msg_parser.h>
#include <sofia-sip/http.h>
#include <sofia-sip/http_header.h>
Include dependency graph for http_parser.h:

Go to the source code of this file.

Macros

#define HTTP_PARSER_H
 Defined when <sofia-sip/http_parser.h> has been included.
 
#define HTTP_HEADER_CLASS(c, l, params, kind, dup)
 Define a header class for a HTTP header.
 
#define HTTP_HEADER_CLASS_G(c, l, kind)
 This is used by headers with no extra data in copy.
 
#define HTTP_HEADER_CLASS_LIST(c, l, kind)
 Define a header class for a msg_list_t kind of header.
 
#define HTTP_HEADER_CLASS_AUTH(c, l, kind)
 Define a authorization header class.
 

Functions

int http_version_d (char **ss, char const **ver)
 Parse HTTP version.
 
isize_t http_version_xtra (char const *version)
 Calculate extra space required by version string.
 
void http_version_dup (char **pp, char const **dd, char const *s)
 Duplicate a transport string.
 
http_method_t http_method_d (char **ss, char const **nname)
 Parse a HTTP method name.
 
char const * http_method_name (http_method_t method, char const *name)
 Return string corresponding to the method.
 
issize_t http_extract_body (msg_t *, http_t *, char b[], isize_t bsiz, int eos)
 Extract HTTP message body.
 

Detailed Description

Typedefs and prototypes used by HTTP parser.

Author
Pekka Pessi Pekka.nosp@m..Pes.nosp@m.si@no.nosp@m.kia..nosp@m.com
Date
Created: Tue Jun 13 02:58:26 2000 ppessi

Function Documentation

◆ http_extract_body()

issize_t http_extract_body ( msg_t msg,
http_t http,
char  b[],
isize_t  bsiz,
int  eos 
)

Extract HTTP message body.

Extract HTTP message body.

Return values
-1error
0cannot proceed
othernumber of bytes extracted

◆ http_method_d()

http_method_t http_method_d ( char **  ss,
char const **  nname 
)

Parse a HTTP method name.

The function http_method_d() parses a HTTP method, and returns a code corresponding to the method. It stores the address of the first non-LWS character after method name in *ss.

Parameters
sspointer to pointer to string to be parsed
nnamepointer to value-result parameter formethod name
Note
If there is no whitespace after method name, the value in *nname may not be NUL-terminated. The calling function must NUL terminate the value by setting the **ss to NUL after first examining its value.
Returns
The function http_method_d returns the method code if method was identified, 0 (http_method_unknown) if method is not known, or -1 (http_method_invalid) if an error occurred.

If the value-result argument nname is not NULL, http_method_d() stores a pointer to the method name to it.

◆ http_version_d()

int http_version_d ( char **  ss,
char const **  ver 
)

Parse HTTP version.

The function http_version_d() parses a HTTP method.

Return values
0when successful,
-1upon an error.

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.