Defines | Functions

sofia-sip/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.

Defines

#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.Pessi@nokia-email.address.hidden>
Date:
Created: Tue Jun 13 02:58:26 2000 ppessi

Define Documentation

#define HTTP_HEADER_CLASS (   c,
  l,
  params,
  kind,
  dup 
)

Define a header class for a HTTP header.

#define HTTP_PARSER_H

Defined when <sofia-sip/http_parser.h> has been included.


Function Documentation

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:
-1 error
0 cannot proceed
other number of bytes extracted
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:
ss pointer to pointer to string to be parsed
nname pointer 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.

char const* http_method_name ( http_method_t  method,
char const *  name 
)

Return string corresponding to the method.

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

Parse HTTP version.

The function http_version_d() parses a HTTP method.

Return values:
0 when successful,
-1 upon an error.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

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