SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
oSIP url parser Handling

Data Structures

struct  osip_uri_param
 Structure for referencing url parameters. More...
 
struct  osip_uri
 Structure for referencing SIP urls. More...
 

Macros

#define osip_uri_header_init(url_header)   osip_uri_param_init(url_header)
 Allocate a generic parameter element. More...
 
#define osip_uri_header_free(url_header)   osip_uri_param_free(url_header)
 Free a generic parameter element. More...
 
#define osip_uri_header_set(url_header, name, value)   osip_uri_param_set(url_header, name, value)
 Set values of a generic parameter element. More...
 
#define osip_uri_header_clone(url_header, dest)   osip_uri_param_clone(url_header,dest)
 Clone a generic parameter element. More...
 
#define osip_uri_header_freelist(LIST)   osip_uri_param_freelist(LIST)
 
#define osip_uri_header_add(url_headers, name, value)   osip_uri_param_add(url_headers,name,value)
 Allocate and add a generic parameter element in a list. More...
 
#define osip_uri_header_get_byname(url_headers, name, dest)   osip_uri_param_get_byname(url_headers,name,dest)
 Find in a generic parameter element in a list. More...
 
#define osip_uri_set_transport_udp(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("transport"), osip_strdup("udp"))
 Set the transport parameter to UDP in a url element. More...
 
#define osip_uri_set_transport_tcp(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("transport"), osip_strdup("tcp"))
 Set the transport parameter to TCP in a url element. More...
 
#define osip_uri_set_transport_sctp(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("transport"), osip_strdup("sctp"))
 Set the transport parameter to SCTP in a url element. More...
 
#define osip_uri_set_transport_tls(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("transport"), osip_strdup("tls"))
 Set the transport parameter to TLS in a url element. More...
 
#define osip_uri_set_transport(url, value)   osip_uri_param_add((&(url)->url_params), osip_strdup("transport"), value)
 Set the transport parameter to TLS in a url element. More...
 
#define osip_uri_set_user_phone(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("user"), osip_strdup("phone"))
 Set the user parameter to PHONE in a url element. More...
 
#define osip_uri_set_user_ip(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("user"), osip_strdup("ip"))
 Set the user parameter to IP in a url element. More...
 
#define osip_uri_set_method_invite(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("method"), osip_strdup("INVITE"))
 Set a method parameter to INVITE in a url element. More...
 
#define osip_uri_set_method_ack(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("method"), osip_strdup("ACK"))
 Set a method parameter to ACK in a url element. More...
 
#define osip_uri_set_method_options(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("method"), osip_strdup("OPTIONS"))
 Set a method parameter to OPTIONS in a url element. More...
 
#define osip_uri_set_method_bye(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("method"), osip_strdup("BYE"))
 Set a method parameter to BYE in a url element. More...
 
#define osip_uri_set_method_cancel(url)   osip_uri_param_add((&(url)->url_params), osip_strdup("method"), osip_strdup("CANCEL"))
 Set a method parameter to CANCEL in a url element. More...
 
#define osip_uri_set_method_register(url)   osip_uri_param_add((&(url)->url_params),osip_strdup("method"), osip_strdup("REGISTER"))
 Set a method parameter to REGISTER in a url element. More...
 
#define osip_uri_set_method(url, value)   osip_uri_param_add((&(url)->url_params), osip_strdup("method"), value)
 Set a method parameter in a url element. More...
 
#define osip_uri_set_ttl(url, value)   osip_uri_param_add((&(url)->url_params), osip_strdup("ttl"), value)
 Set a ttl parameter in a url element. More...
 
#define osip_uri_set_maddr(url, value)   osip_uri_param_add((&(url)->url_params), osip_strdup("maddr"), value)
 Set a maddr parameter in a url element. More...
 
#define osip_uri_uparam_add(url, name, value)   osip_uri_param_add((&(url)->url_params),name,value)
 Allocate and add a url parameter element in a url element. More...
 
#define osip_uri_uparam_get_byname(url, name, dest)   osip_uri_param_get_byname((&(url)->url_params),name,dest)
 Find in a url parameter element in a url element. More...
 
#define osip_uri_uheader_add(url, name, value)   osip_uri_header_add((&(url)->url_headers),name,value)
 Allocate and add a url header element in a url element. More...
 
#define osip_uri_uheader_get_byname(url, name, dest)   osip_uri_header_get_byname((&(url)->url_headers),name,dest)
 Find in a url header element in a url element. More...
 

Typedefs

typedef struct osip_uri_param osip_uri_param_t
 Structure for referencing url parameters. More...
 
typedef osip_uri_param_t osip_uri_header_t
 Structure for referencing url headers. More...
 
typedef struct osip_uri osip_uri_t
 Structure for referencing SIP urls. More...
 

Functions

int osip_uri_param_init (osip_uri_param_t **url_param)
 Allocate a url parameter element. More...
 
void osip_uri_param_free (osip_uri_param_t *url_param)
 Free a url parameter element. More...
 
int osip_uri_param_set (osip_uri_param_t *url_param, char *name, char *value)
 Set values of a url parameter element. More...
 
int osip_uri_param_clone (const osip_uri_param_t *url_param, osip_uri_param_t **dest)
 Clone a url parameter element. More...
 
void osip_uri_param_freelist (osip_list_t *url_params)
 
int osip_uri_param_add (osip_list_t *url_params, char *name, char *value)
 Allocate and add a url parameter element in a list. More...
 
int osip_uri_param_get_byname (osip_list_t *url_params, char *name, osip_uri_param_t **dest)
 Find in a url parameter element in a list. More...
 
int osip_uri_init (osip_uri_t **url)
 Allocate a url element. More...
 
void osip_uri_free (osip_uri_t *url)
 Free a url element. More...
 
int osip_uri_parse (osip_uri_t *url, const char *buf)
 Parse a url. More...
 
int osip_uri_parse_headers (osip_uri_t *url, const char *buf)
 Parse the header part of a url. More...
 
int osip_uri_parse_params (osip_uri_t *url, const char *buf)
 Parse the parameter part of a url. More...
 
int osip_uri_to_str (const osip_uri_t *url, char **dest)
 Get a string representation of a url element. More...
 
int osip_uri_clone (const osip_uri_t *url, osip_uri_t **dest)
 Clone a url element. More...
 
int osip_uri_to_str_canonical (const osip_uri_t *url, char **dest)
 Get a canonical string representation of a url element. More...
 
void osip_uri_set_scheme (osip_uri_t *url, char *value)
 Set the scheme of a url element. More...
 
char * osip_uri_get_scheme (osip_uri_t *url)
 Get the scheme of a url element. More...
 
void osip_uri_set_host (osip_uri_t *url, char *value)
 Set the host of a url element. More...
 
char * osip_uri_get_host (osip_uri_t *url)
 Get the host of a url element. More...
 
void osip_uri_set_username (osip_uri_t *url, char *value)
 Set the username of a url element. More...
 
char * osip_uri_get_username (osip_uri_t *url)
 Get the username of a url element. More...
 
void osip_uri_set_password (osip_uri_t *url, char *value)
 Set the password of a url element. More...
 
char * osip_uri_get_password (osip_uri_t *url)
 Get the password of a url element. More...
 
void osip_uri_set_port (osip_uri_t *url, char *value)
 Set the port of a url element. More...
 
char * osip_uri_get_port (osip_uri_t *url)
 Get the port of a url element. More...
 
const char * next_separator (const char *ch, int separator_osip_to_find, int before_separator)
 
char * __osip_uri_escape_nonascii_and_nondef (const char *string, const char *def)
 
char * __osip_uri_escape_userinfo (const char *string)
 
char * __osip_uri_escape_password (const char *string)
 
char * __osip_uri_escape_uri_param (char *string)
 
char * __osip_uri_escape_header_param (char *string)
 
void __osip_uri_unescape (char *string)
 

Detailed Description

Macro Definition Documentation

#define osip_uri_header_add (   url_headers,
  name,
  value 
)    osip_uri_param_add(url_headers,name,value)

#include <osip_uri.h>

Allocate and add a generic parameter element in a list.

Parameters
url_headersThe list of generic parameter element to work on.
nameThe token name.
valueThe token value.

Definition at line 148 of file osip_uri.h.

#define osip_uri_header_clone (   url_header,
  dest 
)    osip_uri_param_clone(url_header,dest)

#include <osip_uri.h>

Clone a generic parameter element.

Parameters
url_headerThe element to work on.
destThe resulting new allocated element.

Definition at line 134 of file osip_uri.h.

#define osip_uri_header_free (   url_header)    osip_uri_param_free(url_header)

#include <osip_uri.h>

Free a generic parameter element.

Parameters
url_headerThe element to work on.

Definition at line 121 of file osip_uri.h.

#define osip_uri_header_freelist (   LIST)    osip_uri_param_freelist(LIST)

#include <osip_uri.h>

Definition at line 140 of file osip_uri.h.

#define osip_uri_header_get_byname (   url_headers,
  name,
  dest 
)    osip_uri_param_get_byname(url_headers,name,dest)

#include <osip_uri.h>

Find in a generic parameter element in a list.

Parameters
url_headersThe list of generic parameter element to work on.
nameThe name of the parameter element to find.
destA pointer on the element found.

Definition at line 155 of file osip_uri.h.

#define osip_uri_header_init (   url_header)    osip_uri_param_init(url_header)

#include <osip_uri.h>

Allocate a generic parameter element.

Parameters
url_headerThe element to work on.

Definition at line 116 of file osip_uri.h.

#define osip_uri_header_set (   url_header,
  name,
  value 
)    osip_uri_param_set(url_header, name, value)

#include <osip_uri.h>

Set values of a generic parameter element.

Parameters
url_headerThe element to work on.
nameThe token name.
valueThe token value.

Definition at line 128 of file osip_uri.h.

#define osip_uri_set_maddr (   url,
  value 
)    osip_uri_param_add((&(url)->url_params), osip_strdup("maddr"), value)

#include <osip_uri.h>

Set a maddr parameter in a url element.

Parameters
urlThe element to work on.
valueThe value for the maddr parameter.

Definition at line 373 of file osip_uri.h.

#define osip_uri_set_method (   url,
  value 
)    osip_uri_param_add((&(url)->url_params), osip_strdup("method"), value)

#include <osip_uri.h>

Set a method parameter in a url element.

Parameters
urlThe element to work on.
valueThe value for the method parameter.

Definition at line 361 of file osip_uri.h.

#define osip_uri_set_method_ack (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("method"), osip_strdup("ACK"))

#include <osip_uri.h>

Set a method parameter to ACK in a url element.

Parameters
urlThe element to work on.

Definition at line 335 of file osip_uri.h.

#define osip_uri_set_method_bye (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("method"), osip_strdup("BYE"))

#include <osip_uri.h>

Set a method parameter to BYE in a url element.

Parameters
urlThe element to work on.

Definition at line 345 of file osip_uri.h.

#define osip_uri_set_method_cancel (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("method"), osip_strdup("CANCEL"))

#include <osip_uri.h>

Set a method parameter to CANCEL in a url element.

Parameters
urlThe element to work on.

Definition at line 350 of file osip_uri.h.

#define osip_uri_set_method_invite (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("method"), osip_strdup("INVITE"))

#include <osip_uri.h>

Set a method parameter to INVITE in a url element.

Parameters
urlThe element to work on.

Definition at line 330 of file osip_uri.h.

#define osip_uri_set_method_options (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("method"), osip_strdup("OPTIONS"))

#include <osip_uri.h>

Set a method parameter to OPTIONS in a url element.

Parameters
urlThe element to work on.

Definition at line 340 of file osip_uri.h.

#define osip_uri_set_method_register (   url)    osip_uri_param_add((&(url)->url_params),osip_strdup("method"), osip_strdup("REGISTER"))

#include <osip_uri.h>

Set a method parameter to REGISTER in a url element.

Parameters
urlThe element to work on.

Definition at line 355 of file osip_uri.h.

#define osip_uri_set_transport (   url,
  value 
)    osip_uri_param_add((&(url)->url_params), osip_strdup("transport"), value)

#include <osip_uri.h>

Set the transport parameter to TLS in a url element.

Parameters
urlThe element to work on.
valueThe value describing the transport protocol.

Definition at line 314 of file osip_uri.h.

#define osip_uri_set_transport_sctp (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("transport"), osip_strdup("sctp"))

#include <osip_uri.h>

Set the transport parameter to SCTP in a url element.

Parameters
urlThe element to work on.

Definition at line 303 of file osip_uri.h.

#define osip_uri_set_transport_tcp (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("transport"), osip_strdup("tcp"))

#include <osip_uri.h>

Set the transport parameter to TCP in a url element.

Parameters
urlThe element to work on.

Definition at line 298 of file osip_uri.h.

#define osip_uri_set_transport_tls (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("transport"), osip_strdup("tls"))

#include <osip_uri.h>

Set the transport parameter to TLS in a url element.

Parameters
urlThe element to work on.

Definition at line 308 of file osip_uri.h.

#define osip_uri_set_transport_udp (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("transport"), osip_strdup("udp"))

#include <osip_uri.h>

Set the transport parameter to UDP in a url element.

Parameters
urlThe element to work on.

Definition at line 293 of file osip_uri.h.

#define osip_uri_set_ttl (   url,
  value 
)    osip_uri_param_add((&(url)->url_params), osip_strdup("ttl"), value)

#include <osip_uri.h>

Set a ttl parameter in a url element.

Parameters
urlThe element to work on.
valueThe value for the ttl parameter.

Definition at line 367 of file osip_uri.h.

#define osip_uri_set_user_ip (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("user"), osip_strdup("ip"))

#include <osip_uri.h>

Set the user parameter to IP in a url element.

Parameters
urlThe element to work on.

Definition at line 325 of file osip_uri.h.

#define osip_uri_set_user_phone (   url)    osip_uri_param_add((&(url)->url_params), osip_strdup("user"), osip_strdup("phone"))

#include <osip_uri.h>

Set the user parameter to PHONE in a url element.

Parameters
urlThe element to work on.

Definition at line 320 of file osip_uri.h.

#define osip_uri_uheader_add (   url,
  name,
  value 
)    osip_uri_header_add((&(url)->url_headers),name,value)

#include <osip_uri.h>

Allocate and add a url header element in a url element.

Parameters
urlThe element to work on.
nameThe token name.
valueThe token value.

Definition at line 396 of file osip_uri.h.

#define osip_uri_uheader_get_byname (   url,
  name,
  dest 
)    osip_uri_header_get_byname((&(url)->url_headers),name,dest)

#include <osip_uri.h>

Find in a url header element in a url element.

Parameters
urlThe element to work on.
nameThe name of the url header element to find.
destA pointer on the element found.

Definition at line 403 of file osip_uri.h.

#define osip_uri_uparam_add (   url,
  name,
  value 
)    osip_uri_param_add((&(url)->url_params),name,value)

#include <osip_uri.h>

Allocate and add a url parameter element in a url element.

Parameters
urlThe element to work on.
nameThe token name.
valueThe token value.

Definition at line 381 of file osip_uri.h.

#define osip_uri_uparam_get_byname (   url,
  name,
  dest 
)    osip_uri_param_get_byname((&(url)->url_params),name,dest)

#include <osip_uri.h>

Find in a url parameter element in a url element.

Parameters
urlThe element to work on.
nameThe name of the url parameter element to find.
destA pointer on the element found.

Definition at line 388 of file osip_uri.h.

Typedef Documentation

#include <osip_uri.h>

Structure for referencing url headers.

Definition at line 65 of file osip_uri.h.

#include <osip_uri.h>

Structure for referencing url parameters.

Definition at line 49 of file osip_uri.h.

#include <osip_uri.h>

Structure for referencing SIP urls.

Definition at line 161 of file osip_uri.h.

Function Documentation

char* __osip_uri_escape_header_param ( char *  string)

#include <osip_uri.h>

char* __osip_uri_escape_nonascii_and_nondef ( const char *  string,
const char *  def 
)

#include <osip_uri.h>

char* __osip_uri_escape_password ( const char *  string)

#include <osip_uri.h>

char* __osip_uri_escape_uri_param ( char *  string)

#include <osip_uri.h>

char* __osip_uri_escape_userinfo ( const char *  string)

#include <osip_uri.h>

void __osip_uri_unescape ( char *  string)

#include <osip_uri.h>

const char* next_separator ( const char *  ch,
int  separator_osip_to_find,
int  before_separator 
)

#include <osip_uri.h>

int osip_uri_clone ( const osip_uri_t url,
osip_uri_t **  dest 
)

#include <osip_uri.h>

Clone a url element.

Parameters
urlThe element to work on.
destThe resulting new allocated element.
void osip_uri_free ( osip_uri_t url)

#include <osip_uri.h>

Free a url element.

Parameters
urlThe element to work on.
char* osip_uri_get_host ( osip_uri_t url)

#include <osip_uri.h>

Get the host of a url element.

Parameters
urlThe element to work on.
char* osip_uri_get_password ( osip_uri_t url)

#include <osip_uri.h>

Get the password of a url element.

Parameters
urlThe element to work on.
char* osip_uri_get_port ( osip_uri_t url)

#include <osip_uri.h>

Get the port of a url element.

Parameters
urlThe element to work on.
char* osip_uri_get_scheme ( osip_uri_t url)

#include <osip_uri.h>

Get the scheme of a url element.

Parameters
urlThe element to work on.
char* osip_uri_get_username ( osip_uri_t url)

#include <osip_uri.h>

Get the username of a url element.

Parameters
urlThe element to work on.
int osip_uri_init ( osip_uri_t **  url)

#include <osip_uri.h>

Allocate a url element.

Parameters
urlThe element to work on.
int osip_uri_param_add ( osip_list_t url_params,
char *  name,
char *  value 
)

#include <osip_uri.h>

Allocate and add a url parameter element in a list.

Parameters
url_paramsThe list of url parameter element to work on.
nameThe token name.
valueThe token value.
int osip_uri_param_clone ( const osip_uri_param_t url_param,
osip_uri_param_t **  dest 
)

#include <osip_uri.h>

Clone a url parameter element.

Parameters
url_paramThe element to work on.
destThe resulting new allocated element.
void osip_uri_param_free ( osip_uri_param_t url_param)

#include <osip_uri.h>

Free a url parameter element.

Parameters
url_paramThe element to work on.
void osip_uri_param_freelist ( osip_list_t url_params)

#include <osip_uri.h>

int osip_uri_param_get_byname ( osip_list_t url_params,
char *  name,
osip_uri_param_t **  dest 
)

#include <osip_uri.h>

Find in a url parameter element in a list.

Parameters
url_paramsThe list of url parameter element to work on.
nameThe name of the parameter element to find.
destA pointer on the element found.
int osip_uri_param_init ( osip_uri_param_t **  url_param)

#include <osip_uri.h>

Allocate a url parameter element.

Parameters
url_paramThe element to work on.
int osip_uri_param_set ( osip_uri_param_t url_param,
char *  name,
char *  value 
)

#include <osip_uri.h>

Set values of a url parameter element.

Parameters
url_paramThe element to work on.
nameThe token name.
valueThe token value.
int osip_uri_parse ( osip_uri_t url,
const char *  buf 
)

#include <osip_uri.h>

Parse a url.

Parameters
urlThe element to work on.
bufThe buffer to parse.
int osip_uri_parse_headers ( osip_uri_t url,
const char *  buf 
)

#include <osip_uri.h>

Parse the header part of a url.

Parameters
urlThe element to work on.
bufThe buffer to parse.
int osip_uri_parse_params ( osip_uri_t url,
const char *  buf 
)

#include <osip_uri.h>

Parse the parameter part of a url.

Parameters
urlThe element to work on.
bufThe buffer to parse.
void osip_uri_set_host ( osip_uri_t url,
char *  value 
)

#include <osip_uri.h>

Set the host of a url element.

Parameters
urlThe element to work on.
valueThe token value.
void osip_uri_set_password ( osip_uri_t url,
char *  value 
)

#include <osip_uri.h>

Set the password of a url element.

Parameters
urlThe element to work on.
valueThe token value.
void osip_uri_set_port ( osip_uri_t url,
char *  value 
)

#include <osip_uri.h>

Set the port of a url element.

Parameters
urlThe element to work on.
valueThe token value.
void osip_uri_set_scheme ( osip_uri_t url,
char *  value 
)

#include <osip_uri.h>

Set the scheme of a url element.

Parameters
urlThe element to work on.
valueThe token value.
void osip_uri_set_username ( osip_uri_t url,
char *  value 
)

#include <osip_uri.h>

Set the username of a url element.

Parameters
urlThe element to work on.
valueThe token value.
int osip_uri_to_str ( const osip_uri_t url,
char **  dest 
)

#include <osip_uri.h>

Get a string representation of a url element.

Parameters
urlThe element to work on.
destThe resulting new allocated buffer.
int osip_uri_to_str_canonical ( const osip_uri_t url,
char **  dest 
)

#include <osip_uri.h>

Get a canonical string representation of a url element.

as defined in 10.3-5

Parameters
urlThe element to work on.
destThe resulting new allocated buffer.