cr_fifo.h File Reference

Functions for modifying routing data via fifo commands.

More...

#include "../../mi/mi.h"

Include dependency graph for cr_fifo.h:

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

Go to the source code of this file.

Data Structures

struct  fifo_opt

Defines

#define E_ADDBACKUP   -9
#define E_DELBACKUP   -10
#define E_HELP   -17
#define E_INVALIDOPT   -13
#define E_LOADCONF   -11
#define E_MISC   -1
#define E_MISSOPT   -14
#define E_NOAUTOBACKUP   -6
#define E_NOHASHBACKUP   -7
#define E_NOHOSTBACKUP   -8
#define E_NOMEM   -4
#define E_NOOPT   -2
#define E_NOUPDATE   -16
#define E_RESET   -5
#define E_RULEFIXUP   -15
#define E_SAVECONF   -12
#define E_WRONGOPT   -3
#define FBUF_SIZE   2048
#define FIFO_ERR(e)   (fifo_err = e)
#define O_DOMAIN   (1 << 1)
#define O_H_INDEX   (1 << 7)
#define O_HOST   (1 << 2)
#define O_NEW_TARGET   (1 << 3)
#define O_PREFIX   1
#define O_PROB   (1 << 4)
#define O_R_PREFIX   (1 << 5)
#define O_R_SUFFIX   (1 << 6)
#define O_STRIP   (1 << 8)
#define OPT_ACTIVATE   4
#define OPT_ADD   0
#define OPT_DEACTIVATE   3
#define OPT_DOMAIN   1
#define OPT_DOMAIN_CHR   'd'
#define OPT_HASH_INDEX   7
#define OPT_HASH_INDEX_CHR   'i'
#define OPT_HELP_CHR   '?'
#define OPT_HOST   2
#define OPT_HOST_CHR   'h'
#define OPT_INVALID   2
#define OPT_MANDATORY   0
#define OPT_NEW_TARGET   3
#define OPT_NEW_TARGET_CHR   't'
#define OPT_OPTIONAL   1
#define OPT_PREFIX   0
#define OPT_PREFIX_CHR   'p'
#define OPT_PROB   4
#define OPT_PROB_CHR   'w'
#define OPT_R_PREFIX   5
#define OPT_R_PREFIX_CHR   'P'
#define OPT_R_SUFFIX   6
#define OPT_R_SUFFIX_CHR   'S'
#define OPT_REMOVE   1
#define OPT_REPLACE   2
#define OPT_STAR   "*"
#define OPT_STRIP   8
#define OPT_STRIP_CHR   's'

Typedefs

typedef struct fifo_opt fifo_opt_t

Functions

struct mi_rootactivate_host (struct mi_root *cmd_tree, void *param)
struct mi_rootadd_host (struct mi_root *cmd_tree, void *param)
struct mi_rootdeactivate_host (struct mi_root *cmd_tree, void *param)
struct mi_rootdelete_host (struct mi_root *cmd_tree, void *param)
struct mi_rootdump_fifo (struct mi_root *cmd_tree, void *param)
struct mi_rootreload_fifo (struct mi_root *cmd_tree, void *param)
struct mi_rootreplace_host (struct mi_root *cmd_tree, void *param)

Variables

int fifo_err


Detailed Description

Functions for modifying routing data via fifo commands.

Definition in file cr_fifo.h.


Define Documentation

#define E_ADDBACKUP   -9

Definition at line 45 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data_recursor().

#define E_DELBACKUP   -10

Definition at line 46 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data_recursor().

#define E_HELP   -17

Definition at line 53 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_fifo_err().

#define E_INVALIDOPT   -13

Definition at line 49 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_fifo_err().

#define E_LOADCONF   -11

Definition at line 47 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data().

#define E_MISC   -1

Definition at line 37 of file cr_fifo.h.

Referenced by print_fifo_err().

#define E_MISSOPT   -14

Definition at line 50 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_fifo_err().

#define E_NOAUTOBACKUP   -6

Definition at line 42 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data_recursor().

#define E_NOHASHBACKUP   -7

Definition at line 43 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data_recursor().

#define E_NOHOSTBACKUP   -8

Definition at line 44 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data_recursor().

#define E_NOMEM   -4

Definition at line 40 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data_recursor().

#define E_NOOPT   -2

Definition at line 38 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_fifo_err().

#define E_NOUPDATE   -16

Definition at line 52 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data().

#define E_RESET   -5

Definition at line 41 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data_recursor().

#define E_RULEFIXUP   -15

Definition at line 51 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data().

#define E_SAVECONF   -12

Definition at line 48 of file cr_fifo.h.

Referenced by print_fifo_err(), and update_route_data().

#define E_WRONGOPT   -3

Definition at line 39 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_fifo_err().

#define FBUF_SIZE   2048

Definition at line 77 of file cr_fifo.h.

#define FIFO_ERR (  )     (fifo_err = e)

Definition at line 55 of file cr_fifo.h.

Referenced by get_fifo_opts(), update_route_data(), and update_route_data_recursor().

#define O_DOMAIN   (1 << 1)

Definition at line 103 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define O_H_INDEX   (1 << 7)

Definition at line 109 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define O_HOST   (1 << 2)

Definition at line 104 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define O_NEW_TARGET   (1 << 3)

Definition at line 105 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define O_PREFIX   1

Flags for options to determine which options are used

Definition at line 102 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define O_PROB   (1 << 4)

Definition at line 106 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define O_R_PREFIX   (1 << 5)

Definition at line 107 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define O_R_SUFFIX   (1 << 6)

Definition at line 108 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define O_STRIP   (1 << 8)

Definition at line 110 of file cr_fifo.h.

#define OPT_ACTIVATE   4

Definition at line 83 of file cr_fifo.h.

Referenced by activate_host(), and update_route_data_recursor().

#define OPT_ADD   0

Definition at line 79 of file cr_fifo.h.

Referenced by add_host(), and update_route_data().

#define OPT_DEACTIVATE   3

Definition at line 82 of file cr_fifo.h.

Referenced by deactivate_host(), and update_route_data_recursor().

#define OPT_DOMAIN   1

Definition at line 90 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_DOMAIN_CHR   'd'

Definition at line 116 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_replace_help().

#define OPT_HASH_INDEX   7

Definition at line 96 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_HASH_INDEX_CHR   'i'

Definition at line 122 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_replace_help().

#define OPT_HELP_CHR   '?'

Definition at line 124 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_replace_help().

#define OPT_HOST   2

Definition at line 91 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_HOST_CHR   'h'

Definition at line 117 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_replace_help().

#define OPT_INVALID   2

Definition at line 87 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_MANDATORY   0

Definition at line 85 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_NEW_TARGET   3

Definition at line 92 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_NEW_TARGET_CHR   't'

Definition at line 118 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_replace_help().

#define OPT_OPTIONAL   1

Definition at line 86 of file cr_fifo.h.

#define OPT_PREFIX   0

Definition at line 89 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_PREFIX_CHR   'p'

Constants define option characters

Definition at line 115 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_replace_help().

#define OPT_PROB   4

Definition at line 93 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_PROB_CHR   'w'

Definition at line 119 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_replace_help().

#define OPT_R_PREFIX   5

Definition at line 94 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_R_PREFIX_CHR   'P'

Definition at line 120 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_replace_help().

#define OPT_R_SUFFIX   6

Definition at line 95 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_R_SUFFIX_CHR   'S'

Definition at line 121 of file cr_fifo.h.

Referenced by get_fifo_opts(), and print_replace_help().

#define OPT_REMOVE   1

Definition at line 80 of file cr_fifo.h.

Referenced by delete_host(), and update_route_data_recursor().

#define OPT_REPLACE   2

Definition at line 81 of file cr_fifo.h.

Referenced by replace_host(), and update_route_data_recursor().

#define OPT_STAR   "*"

Definition at line 126 of file cr_fifo.h.

Referenced by update_route_data_recursor().

#define OPT_STRIP   8

Definition at line 97 of file cr_fifo.h.

Referenced by get_fifo_opts().

#define OPT_STRIP_CHR   's'

Definition at line 123 of file cr_fifo.h.


Typedef Documentation

typedef struct fifo_opt fifo_opt_t


Function Documentation

struct mi_root* activate_host ( struct mi_root cmd_tree,
void *  param 
) [read]

activates the host given in the command line options, can be used only in file mode expect one mi node that contains the command

Parameters:
cmd_tree the MI command tree
param the parameter
Returns:
code 200 on success, code 400 or 500 on failure

Definition at line 272 of file cr_fifo.c.

References CARRIERROUTE_MODE_FILE, fifo_opt::cmd, get_fifo_opts(), init_mi_tree(), mi_node::kids, MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, mode, mi_node::next, mi_root::node, NULL, OPT_ACTIVATE, opt_settings, print_fifo_err(), _str::s, fifo_opt::status, update_route_data(), and mi_node::value.

struct mi_root* add_host ( struct mi_root cmd_tree,
void *  param 
) [read]

adds the host specified by the command line args, can be used only in file mode expect one mi node that contains the command

Parameters:
cmd_tree the MI command tree
param the parameter
Returns:
code 200 on success, code 400 or 500 on failure

Definition at line 316 of file cr_fifo.c.

References CARRIERROUTE_MODE_FILE, fifo_opt::cmd, get_fifo_opts(), init_mi_tree(), mi_node::kids, MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, mode, mi_node::next, mi_root::node, NULL, OPT_ADD, opt_settings, print_fifo_err(), _str::s, fifo_opt::status, update_route_data(), and mi_node::value.

struct mi_root* deactivate_host ( struct mi_root cmd_tree,
void *  param 
) [read]

deactivates the host given in the command line options, can be used only in file mode expect one mi node that contains the command

Parameters:
cmd_tree the MI command tree
param the parameter
Returns:
code 200 on success, code 400 or 500 on failure

Definition at line 228 of file cr_fifo.c.

References CARRIERROUTE_MODE_FILE, fifo_opt::cmd, get_fifo_opts(), init_mi_tree(), mi_node::kids, MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, mode, mi_node::next, mi_root::node, NULL, OPT_DEACTIVATE, opt_settings, print_fifo_err(), _str::s, fifo_opt::status, update_route_data(), and mi_node::value.

struct mi_root* delete_host ( struct mi_root cmd_tree,
void *  param 
) [read]

deletes the host specified by the command line args, can be used only in file mode expect one mi node that contains the command

Parameters:
cmd_tree the MI command tree
param the parameter
Returns:
code 200 on success, code 400 or 500 on failure

Definition at line 356 of file cr_fifo.c.

References CARRIERROUTE_MODE_FILE, fifo_opt::cmd, get_fifo_opts(), init_mi_tree(), mi_node::kids, MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, mode, mi_node::next, mi_root::node, NULL, OPT_REMOVE, opt_settings, print_fifo_err(), _str::s, update_route_data(), and mi_node::value.

struct mi_root* dump_fifo ( struct mi_root cmd_tree,
void *  param 
) [read]

struct mi_root* reload_fifo ( struct mi_root cmd_tree,
void *  param 
) [read]

reloads the routing data

Parameters:
cmd_tree the MI command tree
param the parameter
Returns:
code 200 on success, code 500 on failure

Definition at line 104 of file cr_fifo.c.

References init_mi_tree(), MI_OK_LEN, MI_OK_S, NULL, and reload_route_data().

struct mi_root* replace_host ( struct mi_root cmd_tree,
void *  param 
) [read]

replaces the host specified by parameters in the fifo command, can be used only in file mode expect one mi node that contains the command

Parameters:
cmd_tree the MI command tree
param the parameter
Returns:
code 200 on success, code 400 or 500 on failure

Definition at line 184 of file cr_fifo.c.

References CARRIERROUTE_MODE_FILE, fifo_opt::cmd, get_fifo_opts(), init_mi_tree(), mi_node::kids, MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, mode, mi_node::next, mi_root::node, NULL, OPT_REPLACE, opt_settings, print_fifo_err(), _str::s, fifo_opt::status, update_route_data(), and mi_node::value.


Variable Documentation

int fifo_err

Definition at line 58 of file cr_fifo.c.

Referenced by print_fifo_err().


Generated on Mon May 21 18:00:38 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6