parse_methods.c File Reference

Method parser. More...

#include <strings.h>
#include "../dprint.h"
#include "../trim.h"
#include "../core_stats.h"
#include "parse_methods.h"
#include "msg_parser.h"

Include dependency graph for parse_methods.c:

Go to the source code of this file.

Functions

static int method_char (char _c)
char * parse_method (char *start, char *end, unsigned int *method)
int parse_methods (str *_body, unsigned int *_methods)


Detailed Description

Method parser.

Definition in file parse_methods.c.


Function Documentation

static int method_char ( char  _c  )  [inline, static]

Check if argument is valid RFC3261 token character.

Definition at line 46 of file parse_methods.c.

Referenced by parse_method().

char* parse_method ( char *  start,
char *  end,
unsigned int *  method 
)

Parse a method pointed by start, end is the last character to check (if NULL assume that start is a zero terminated string) => assign enum bit to method.

Returns:
pointer to next char if parse succeeded, NULL otherwise

Definition at line 62 of file parse_methods.c.

References len, LM_ERR, max, METHOD_ACK, METHOD_BYE, METHOD_CANCEL, method_char(), METHOD_INFO, METHOD_INVITE, METHOD_MESSAGE, METHOD_NOTIFY, METHOD_OPTIONS, METHOD_OTHER, METHOD_PRACK, METHOD_PUBLISH, METHOD_REFER, METHOD_REGISTER, METHOD_SUBSCRIBE, METHOD_UNDEF, METHOD_UPDATE, NULL, and update_stat.

Referenced by parse_cseq(), parse_first_line(), and parse_methods().

int parse_methods ( str _body,
unsigned int *  _methods 
)

Parse comma separated list of methods pointed by _body and assign their enum bits to _methods.

Returns:
0 on success, -1 on failure

Definition at line 351 of file parse_methods.c.

References _str::len, LM_DBG, LM_ERR, sip_uri::method, NULL, parse_method(), _str::s, and trim_leading().

Referenced by check_message_support(), encode_header(), fixup_method(), pack_ci(), and parse_allow().


Generated on Thu May 24 00:00:40 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6