parse_param.h File Reference

Generic Parameter Parser. More...

#include <stdio.h>

Include dependency graph for parse_param.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  contact_hooks
struct  param
union  param_hooks
struct  uri_hooks

Typedefs

typedef union param_hooks param_hooks_t
typedef struct param param_t
typedef enum pclass pclass_t
typedef enum ptype ptype_t

Enumerations

enum  pclass { CLASS_ANY = 0, CLASS_CONTACT, CLASS_URI }
enum  ptype {
  P_OTHER = 0, P_Q, P_EXPIRES, P_METHODS,
  P_RECEIVED, P_TRANSPORT, P_LR, P_R2,
  P_MADDR, P_TTL, P_DSTIP, P_DSTPORT
}

Functions

int duplicate_params (param_t **_n, param_t *_p)
void free_params (param_t *_p)
int parse_params (str *_s, pclass_t _c, param_hooks_t *_h, param_t **_p)
 Parse parameters.
void print_params (FILE *_o, param_t *_p)
int shm_duplicate_params (param_t **_n, param_t *_p)
void shm_free_params (param_t *_p)


Detailed Description

Generic Parameter Parser.

Definition in file parse_param.h.


Typedef Documentation

typedef union param_hooks param_hooks_t

Union of hooks structures for all classes

typedef struct param param_t

Structure representing a parameter

typedef enum pclass pclass_t

Class of parameters

typedef enum ptype ptype_t

Supported types of parameters


Enumeration Type Documentation

enum pclass

Class of parameters

Enumerator:
CLASS_ANY  Any parameters, well-known hooks will be not used
CLASS_CONTACT  Contact parameters
CLASS_URI  URI parameters

Definition at line 57 of file parse_param.h.

enum ptype

Supported types of parameters

Enumerator:
P_OTHER  Unknown parameter
P_Q  Contact: q parameter
P_EXPIRES  Contact: expires parameter
P_METHODS  Contact: methods parameter (RFC 3840)
P_RECEIVED  Contact: received parameter
P_TRANSPORT  URI: transport parameter
P_LR  URI: lr parameter
P_R2  URI: r2 parameter (ser specific)
P_MADDR  URI: maddr parameter
P_TTL  URI: ttl parameter
P_DSTIP  URI: dstip parameter
P_DSTPORT  URi: dstport parameter

Definition at line 38 of file parse_param.h.


Function Documentation

int duplicate_params ( param_t **  _n,
param_t _p 
)

Duplicate linked list of parameters in pkg_mem

Definition at line 560 of file parse_param.c.

References do_duplicate_params().

Referenced by do_duplicate_rr().

void free_params ( param_t _p  ) 

Free linked list of parameters in pkg_mem

Definition at line 452 of file parse_param.c.

References do_free_params().

Referenced by build_path_vector(), do_free_rr(), free_contacts(), free_event(), parse_params(), path_rr_callback(), and uri_param_2().

int parse_params ( str _s,
pclass_t  _c,
param_hooks_t _h,
param_t **  _p 
)

Parse parameters.

Parameters:
_s string containing parameters, it will be updated to point behind the parameters
_c class of parameters
_h structure that will be filled with pointer to well known parameters
_p linked list of parsed parameters will be stored in the variable _p is pointing to
Returns:
0 on success and negative number on an error
Parameters:
_s string containing parameters, it will be updated to point behind the parameters
_c class of parameters
_h structure that will be filled with pointer to well known parameters
_p linked list of parsed parameters will be stored in the variable _p is pointing to
Returns:
0 on success and negative number on an error

Definition at line 341 of file parse_param.c.

References to_body::error, free_params(), param::len, _str::len, LM_DBG, LM_ERR, param::name, param::next, parse_param_body(), parse_param_name(), pkg_free, pkg_malloc, _str::s, and trim_leading().

Referenced by assemble_msg(), build_path_vector(), cmp_str_params(), do_parse_rr_body(), event_parser(), parse_contacts(), path_rr_callback(), and uri_param_2().

void print_params ( FILE *  _o,
param_t _p 
)

Print linked list of parameters, just for debugging

Definition at line 503 of file parse_param.c.

References param::next, and print_param().

Referenced by print_contacts(), and print_rr().

int shm_duplicate_params ( param_t **  _n,
param_t _p 
)

Duplicate linked list of parameters in shm_mem

Definition at line 569 of file parse_param.c.

References do_duplicate_params().

Referenced by do_duplicate_rr().

void shm_free_params ( param_t _p  ) 

Free linked list of parameters in shm_mem

Definition at line 461 of file parse_param.c.

References do_free_params().

Referenced by do_free_rr().


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