textops.c File Reference

#include "../../action.h"
#include "../../sr_module.h"
#include "../../dprint.h"
#include "../../data_lump.h"
#include "../../data_lump_rpl.h"
#include "../../error.h"
#include "../../mem/mem.h"
#include "../../str.h"
#include "../../re.h"
#include "../../mod_fix.h"
#include "../../parser/parse_uri.h"
#include "../../parser/parse_hname2.h"
#include "../../parser/parse_methods.h"
#include "../../parser/parse_content.h"
#include "../../parser/parse_privacy.h"
#include "../../ut.h"
#include "../../cmpapi.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <regex.h>
#include <time.h>
#include <sys/time.h>
#include "textops.h"
#include "txt_var.h"
#include "api.h"

Include dependency graph for textops.c:

Go to the source code of this file.

Defines

#define MAX_TIME   64
#define TIME_FORMAT   "Date: %a, %d %b %Y %H:%M:%S GMT"

Functions

static int add_header_fixup (void **param, int param_no)
int add_hf_helper (struct sip_msg *msg, str *str1, str *str2, gparam_p hfval, int mode, gparam_p hfanc)
static int append_hf_1 (struct sip_msg *msg, char *str1, char *str2)
static int append_hf_2 (struct sip_msg *msg, char *str1, char *str2)
static int append_time_f (struct sip_msg *msg, char *, char *)
static int append_to_reply_f (struct sip_msg *msg, char *key, char *str)
static int append_urihf (struct sip_msg *msg, char *str1, char *str2)
static int cmp_istr_f (struct sip_msg *msg, char *str1, char *str2)
static int cmp_str_f (struct sip_msg *msg, char *str1, char *str2)
static int do_replace_body_f (struct sip_msg *msg, char *key, char *str2, int nobol)
static int filter_body_f (struct sip_msg *, char *, char *)
static int find_line_start (char *text, unsigned int text_len, char **buf, unsigned int *buf_len)
static int fixup_body_type (void **param, int param_no)
static int fixup_method (void **param, int param_no)
static int fixup_privacy (void **param, int param_no)
static int fixup_substre (void **, int)
static int free_hname_fixup (void **param, int param_no)
static char * get_header (struct sip_msg *msg)
static int has_body_f (struct sip_msg *msg, char *type, char *str2)
static int hname_fixup (void **param, int param_no)
static int insert_hf_1 (struct sip_msg *msg, char *str1, char *str2)
static int insert_hf_2 (struct sip_msg *msg, char *str1, char *str2)
static int is_method_f (struct sip_msg *msg, char *, char *)
static int is_present_hf_f (struct sip_msg *msg, char *str_hf, char *foo)
static int is_present_hf_re_f (struct sip_msg *msg, char *key, char *foo)
static int is_privacy_f (struct sip_msg *msg, char *privacy, char *str2)
static int mod_init (void)
int mod_register (char *path, int *dlflags, void *p1, void *p2)
int remove_hf_f (struct sip_msg *msg, char *str_hf, char *foo)
static int remove_hf_re_f (struct sip_msg *msg, char *key, char *foo)
static int replace_all_f (struct sip_msg *, char *, char *)
static int replace_body_all_f (struct sip_msg *, char *, char *)
static int replace_body_atonce_f (struct sip_msg *, char *, char *)
static int replace_body_f (struct sip_msg *, char *, char *)
static int replace_f (struct sip_msg *, char *, char *)
static int search_append_body_f (struct sip_msg *, char *, char *)
int search_append_f (struct sip_msg *msg, char *key, char *str2)
static int search_body_f (struct sip_msg *, char *, char *)
int search_f (struct sip_msg *msg, char *key, char *str2)
static int set_body_f (struct sip_msg *msg, char *, char *)
static int set_rpl_body_f (struct sip_msg *msg, char *, char *)
static int subst_body_f (struct sip_msg *, char *, char *)
static int subst_f (struct sip_msg *, char *, char *)
static int subst_uri_f (struct sip_msg *, char *, char *)
static int subst_user_f (struct sip_msg *, char *, char *)

Variables

static cmd_export_t cmds []
struct module_exports exports
static tr_export_t mod_trans []


Define Documentation

#define MAX_TIME   64

Definition at line 92 of file textops.c.

Referenced by append_time_f().

#define TIME_FORMAT   "Date: %a, %d %b %Y %H:%M:%S GMT"

Definition at line 91 of file textops.c.

Referenced by append_time_f().


Function Documentation

static int add_header_fixup ( void **  param,
int  param_no 
) [static]

Definition at line 1645 of file textops.c.

References E_UNSPEC, fixup_spve_null(), hname_fixup(), and LM_ERR.

int add_hf_helper ( struct sip_msg msg,
str str1,
str str2,
gparam_p  hfval,
int  mode,
gparam_p  hfanc 
)

static int append_hf_1 ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 1423 of file textops.c.

References add_hf_helper().

static int append_hf_2 ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 1428 of file textops.c.

References add_hf_helper().

static int append_time_f ( struct sip_msg msg,
char *  p1,
char *  p2 
) [static]

Definition at line 1047 of file textops.c.

References add_lump_rpl(), len, LM_ERR, LUMP_RPL_HDR, MAX_TIME, NULL, and TIME_FORMAT.

static int append_to_reply_f ( struct sip_msg msg,
char *  key,
char *  str 
) [static]

Definition at line 1307 of file textops.c.

References add_lump_rpl(), fixup_get_svalue(), _str::len, LM_ERR, LUMP_RPL_HDR, NULL, and _str::s.

static int append_urihf ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 1445 of file textops.c.

References add_hf_helper().

static int cmp_istr_f ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 1760 of file textops.c.

References cmpi_str(), fixup_get_svalue(), and LM_ERR.

static int cmp_str_f ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 1736 of file textops.c.

References cmp_str(), fixup_get_svalue(), and LM_ERR.

static int do_replace_body_f ( struct sip_msg msg,
char *  key,
char *  str2,
int  nobol 
) [static]

static int filter_body_f ( struct sip_msg msg,
char *  _content_type,
char *  ignored 
) [static]

static int find_line_start ( char *  text,
unsigned int  text_len,
char **  buf,
unsigned int *  buf_len 
) [inline, static]

Definition at line 800 of file textops.c.

References len, and LM_ERR.

Referenced by filter_body_f().

static int fixup_body_type ( void **  param,
int  param_no 
) [static]

Definition at line 1659 of file textops.c.

References decode_mime_type(), E_CFG, LM_ERR, pkg_free, and hdr_field::type.

static int fixup_method ( void **  param,
int  param_no 
) [static]

static int fixup_privacy ( void **  param,
int  param_no 
) [static]

Definition at line 1623 of file textops.c.

References E_UNSPEC, _str::len, LM_ERR, parse_priv_value(), and _str::s.

static int fixup_substre ( void **  param,
int  param_no 
) [static]

Definition at line 1024 of file textops.c.

References E_BAD_RE, _str::len, LM_DBG, LM_ERR, module_exports::name, _str::s, and subst_parser().

static int free_hname_fixup ( void **  param,
int  param_no 
) [static]

Definition at line 1538 of file textops.c.

References GPARAM_TYPE_STR, pkg_free, and hdr_field::type.

static char* get_header ( struct sip_msg msg  )  [static]

Definition at line 273 of file textops.c.

References sip_msg::buf, sip_msg::first_line, and msg_start::len.

Referenced by replace_all_f(), replace_f(), search_append_f(), and subst_f().

static int has_body_f ( struct sip_msg msg,
char *  type,
char *  str2 
) [static]

static int hname_fixup ( void **  param,
int  param_no 
) [static]

static int insert_hf_1 ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 1434 of file textops.c.

References add_hf_helper().

static int insert_hf_2 ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 1439 of file textops.c.

References add_hf_helper().

static int is_method_f ( struct sip_msg msg,
char *  meth,
char *  str2 
) [static]

static int is_present_hf_f ( struct sip_msg msg,
char *  str_hf,
char *  foo 
) [static]

static int is_present_hf_re_f ( struct sip_msg msg,
char *  key,
char *  foo 
) [static]

static int is_privacy_f ( struct sip_msg msg,
char *  privacy,
char *  str2 
) [static]

Definition at line 1727 of file textops.c.

References get_privacy_values, and parse_privacy().

static int mod_init ( void   )  [static]

Definition at line 263 of file textops.c.

int mod_register ( char *  path,
int *  dlflags,
void *  p1,
void *  p2 
)

Definition at line 268 of file textops.c.

References register_trans_mod().

int remove_hf_f ( struct sip_msg msg,
char *  str_hf,
char *  foo 
)

static int remove_hf_re_f ( struct sip_msg msg,
char *  key,
char *  foo 
) [static]

static int replace_all_f ( struct sip_msg msg,
char *  key,
char *  str2 
) [static]

static int replace_body_all_f ( struct sip_msg msg,
char *  key,
char *  str2 
) [static]

Definition at line 511 of file textops.c.

References do_replace_body_f().

static int replace_body_atonce_f ( struct sip_msg msg,
char *  key,
char *  str2 
) [static]

Definition at line 516 of file textops.c.

References do_replace_body_f().

static int replace_body_f ( struct sip_msg msg,
char *  key,
char *  str2 
) [static]

static int replace_f ( struct sip_msg msg,
char *  key,
char *  str2 
) [static]

static int search_append_body_f ( struct sip_msg msg,
char *  key,
char *  str2 
) [static]

int search_append_f ( struct sip_msg msg,
char *  key,
char *  str2 
)

Definition at line 312 of file textops.c.

References anchor_lump(), sip_msg::buf, get_header(), insert_new_lump_after(), len, LM_ERR, pkg_free, pkg_malloc, and s.

Referenced by search_append_api().

static int search_body_f ( struct sip_msg msg,
char *  key,
char *  str2 
) [static]

Definition at line 290 of file textops.c.

References sip_msg::buf, get_body(), sip_msg::len, _str::len, LM_DBG, LM_ERR, and _str::s.

int search_f ( struct sip_msg msg,
char *  key,
char *  str2 
)

Definition at line 280 of file textops.c.

References sip_msg::buf.

Referenced by search_api().

static int set_body_f ( struct sip_msg msg,
char *  p1,
char *  p2 
) [static]

static int set_rpl_body_f ( struct sip_msg msg,
char *  p1,
char *  p2 
) [static]

static int subst_body_f ( struct sip_msg msg,
char *  subst,
char *  ignored 
) [static]

static int subst_f ( struct sip_msg msg,
char *  subst,
char *  ignored 
) [static]

static int subst_uri_f ( struct sip_msg msg,
char *  subst,
char *  ignored 
) [static]

static int subst_user_f ( struct sip_msg msg,
char *  subst,
char *  ignored 
) [static]


Variable Documentation

cmd_export_t cmds[] [static]

Definition at line 142 of file textops.c.

Definition at line 247 of file textops.c.

tr_export_t mod_trans[] [static]

Definition at line 135 of file textops.c.


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