/home/dko/Projects/mobilec/trunk/src/include/mtp_http.h File Reference

Go to the source code of this file.

Data Structures

struct  mtp_http_content_s
struct  mtp_http_s

Defines

#define SOCKET_INPUT_SIZE   4096

Typedefs

typedef struct mtp_http_content_s mtp_http_content_t
typedef struct mtp_http_s mtp_http_t
typedef mtp_http_tmtp_http_p

Enumerations

enum  http_status_code_e {
  CONTINUE = 100, SWITCHING_PROTOCOLS, PROCESSING, OK = 200,
  CREATED, ACCEPTED, NON_AUTHORITATIVE_INFORMATION, NO_CONTENT,
  RESET_CONTENT, PARTIAL_CONTENT, MULTI_STATUS, BAD_REQUEST = 400,
  UNAUTHORIZED, PAYMENT_REQUIRED, FORBIDDEN, NOT_FOUND,
  METHOD_NOT_ALLOWED, NOT_ACCEPTABLE, PROXY_AUTHENTICATION_REQUIRED, REQUEST_TIMEOUT,
  CONFLICT, GONE, LENGTH_REQUIRED, PRECONDITION_FAILED,
  REQUST_ENTITY_TOO_LARGE, REQUEST_URI_TOO_LONG, UNSUPPORTED_MEDIA_TYPE, REQUESTED_RANGE_NOT_SATISFIABLE,
  EXPECTATION_FAILED, UNPROCESSABLE_ENTITY, LOCKED, FAILED_DEPENDANCY,
  UNORDERED_COLLECTION, UPGRADE_REQUIRED, RETRY_WITH
}
 

http return status codes

More...
enum  http_performative_e {
  HTTP_PERFORMATIVE_UNDEF = -1, HTTP_PERFORMATIVE_ZERO = 0, HTTP_HEAD, HTTP_GET,
  HTTP_POST, HTTP_PUT, HTTP_DELETE, HTTP_TRACE,
  HTTP_OPTIONS, HTTP_CONNECT, HTTP_RESPONSE, HTTP_NUM_PERFORMATIVES
}
 

http 'verbs'

More...

Functions

const char * http_GetExpression (const char *string, char **expr)
 Parse an html expression.
int http_ParseExpression (const char *expression_string, char **name, char **value)
 Parse an expression into its name and value.
const char * http_ParseRequest (mtp_http_p http, const char *string)
const char * http_GetToken (const char *string, char **token)
int mtp_http_Destroy (mtp_http_p http)
int mtp_http_InitializeFromConnection (struct mtp_http_s *http, struct connection_s *connection, char *privatekey)
mtp_http_p mtp_http_New (void)
const char * mtp_http_ParseHeader (struct mtp_http_s *http, const char *string)
int mtp_http_Parse (struct mtp_http_s *http, const char *string)
int mtp_http_ComposeMessage (struct message_s *message)
struct message_smtp_http_CreateMessage (mtp_http_t *mtp_http, char *hostname, int port)

Define Documentation

#define SOCKET_INPUT_SIZE   4096

Typedef Documentation

Definition at line 145 of file mtp_http.h.

typedef struct mtp_http_s mtp_http_t

Enumeration Type Documentation

http 'verbs'

Enumerator:
HTTP_PERFORMATIVE_UNDEF 
HTTP_PERFORMATIVE_ZERO 
HTTP_HEAD 
HTTP_GET 
HTTP_POST 
HTTP_PUT 
HTTP_DELETE 
HTTP_TRACE 
HTTP_OPTIONS 
HTTP_CONNECT 
HTTP_RESPONSE 
HTTP_NUM_PERFORMATIVES 

Definition at line 90 of file mtp_http.h.

http return status codes

Enumerator:
CONTINUE 
SWITCHING_PROTOCOLS 
PROCESSING 
OK 
CREATED 
ACCEPTED 
NON_AUTHORITATIVE_INFORMATION 
NO_CONTENT 
RESET_CONTENT 
PARTIAL_CONTENT 
MULTI_STATUS 
BAD_REQUEST 
UNAUTHORIZED 
PAYMENT_REQUIRED 
FORBIDDEN 
NOT_FOUND 
METHOD_NOT_ALLOWED 
NOT_ACCEPTABLE 
PROXY_AUTHENTICATION_REQUIRED 
REQUEST_TIMEOUT 
CONFLICT 
GONE 
LENGTH_REQUIRED 
PRECONDITION_FAILED 
REQUST_ENTITY_TOO_LARGE 
REQUEST_URI_TOO_LONG 
UNSUPPORTED_MEDIA_TYPE 
REQUESTED_RANGE_NOT_SATISFIABLE 
EXPECTATION_FAILED 
UNPROCESSABLE_ENTITY 
LOCKED 
FAILED_DEPENDANCY 
UNORDERED_COLLECTION 
UPGRADE_REQUIRED 
RETRY_WITH 

Definition at line 45 of file mtp_http.h.


Function Documentation

const char* http_GetExpression ( const char *  string,
char **  expr 
)

Parse an html expression.

Parameters:
string (input) The html block of text: Will parse the first expression pointed to by 'string'.
expr (output) The allocated expression
Returns:
A pointer to the next expression segment of the string block, or NULL.

Definition at line 349 of file mtp_http.c.

Referenced by mtp_http_Parse(), and mtp_http_ParseHeader().

const char* http_GetToken ( const char *  string,
char **  token 
)

Definition at line 790 of file mtp_http.c.

References cur.

Referenced by http_ParseRequest().

int http_ParseExpression ( const char *  expression_string,
char **  name,
char **  value 
)

Parse an expression into its name and value.

Parameters:
expression_string (input) The expression
name (output) An allocated name string or NULL
value (output) An allocated value string or NULL
Returns:
error_code_t type
Note:
an http expression is something like 'Date: Mon, 23 May 2005 22:38:34 GMT
' where 'Date' is the name and the remainder of the string is the value

Definition at line 408 of file mtp_http.c.

References CHECK_NULL, MC_ERR_PARSE, and MC_SUCCESS.

Referenced by mtp_http_Parse(), and mtp_http_ParseHeader().

const char* http_ParseRequest ( mtp_http_p  http,
const char *  string 
)
int mtp_http_ComposeMessage ( struct message_s message  ) 

Referenced by message_send_Thread().

struct message_s* mtp_http_CreateMessage ( mtp_http_t mtp_http,
char *  hostname,
int  port 
) [read]
int mtp_http_Destroy ( mtp_http_p  http  ) 
int mtp_http_InitializeFromConnection ( struct mtp_http_s http,
struct connection_s connection,
char *  privatekey 
)

Referenced by acc_connection_Thread().

mtp_http_p mtp_http_New ( void   ) 
int mtp_http_Parse ( struct mtp_http_s http,
const char *  string 
)
const char* mtp_http_ParseHeader ( struct mtp_http_s http,
const char *  string 
)

Generated on Tue Jun 22 11:11:40 2010 for Mobile-C by  doxygen 1.6.1