#include "asterisk.h"
#include "chan_misdn_config.h"
#include "asterisk/config.h"
#include "asterisk/channel.h"
#include "asterisk/lock.h"
#include "asterisk/pbx.h"
#include "asterisk/strings.h"
#include "asterisk/utils.h"
Go to the source code of this file.
Data Structures | |
union | misdn_cfg_pt |
struct | misdn_cfg_spec |
struct | msn_list |
Defines | |
#define | CLI_ERROR(name, value, section) |
#define | GEN_CFG 1 |
#define | NO_DEFAULT "<>" |
#define | NONE 0 |
#define | NUM_GEN_ELEMENTS (sizeof(gen_spec) / sizeof(struct misdn_cfg_spec)) |
#define | NUM_PORT_ELEMENTS (sizeof(port_spec) / sizeof(struct misdn_cfg_spec)) |
#define | PORT_CFG 2 |
Enumerations | |
enum | misdn_cfg_type { MISDN_CTYPE_STR, MISDN_CTYPE_INT, MISDN_CTYPE_BOOL, MISDN_CTYPE_BOOLINT, MISDN_CTYPE_MSNLIST, MISDN_CTYPE_ASTGROUP } |
Functions | |
static void | _build_general_config (struct ast_variable *v) |
static void | _build_port_config (struct ast_variable *v, char *cat) |
static int | _enum_array_map (void) |
static void | _fill_defaults (void) |
static void | _free_general_cfg (void) |
static void | _free_msn_list (struct msn_list *iter) |
static void | _free_port_cfg (void) |
static int | _parse (union misdn_cfg_pt *dest, const char *value, enum misdn_cfg_type type, int boolint_def) |
static int | get_cfg_position (const char *name, int type) |
void | misdn_cfg_destroy (void) |
void | misdn_cfg_get (int port, enum misdn_cfg_elements elem, void *buf, int bufsize) |
void | misdn_cfg_get_config_string (int port, enum misdn_cfg_elements elem, char *buf, int bufsize) |
void | misdn_cfg_get_desc (enum misdn_cfg_elements elem, void *buf, int bufsize, void *buf_default, int bufsize_default) |
enum misdn_cfg_elements | misdn_cfg_get_elem (const char *name) |
void | misdn_cfg_get_name (enum misdn_cfg_elements elem, void *buf, int bufsize) |
int | misdn_cfg_get_next_port (int port) |
int | misdn_cfg_get_next_port_spin (int port) |
void | misdn_cfg_get_ports_string (char *ports) |
Generate a comma separated list of all active ports. | |
int | misdn_cfg_init (int this_max_ports, int reload) |
int | misdn_cfg_is_group_method (char *group, enum misdn_cfg_method meth) |
int | misdn_cfg_is_msn_valid (int port, char *msn) |
int | misdn_cfg_is_port_valid (int port) |
static void | misdn_cfg_lock (void) |
void | misdn_cfg_reload (void) |
static void | misdn_cfg_unlock (void) |
void | misdn_cfg_update_ptp (void) |
ast_jb_conf * | misdn_get_global_jbconf () |
Variables | |
static ast_mutex_t | config_mutex |
static struct ast_jb_conf | default_jbconf |
static struct misdn_cfg_spec | gen_spec [] |
static union misdn_cfg_pt * | general_cfg |
static struct ast_jb_conf | global_jbconf |
static int * | map |
static int | max_ports |
static union misdn_cfg_pt ** | port_cfg |
static struct misdn_cfg_spec | port_spec [] |
static const char | ports_description [] |
static int * | ptp |
Definition in file misdn_config.c.
Value:
({ \ ast_log(LOG_WARNING, "misdn.conf: \"%s=%s\" (section: %s) invalid or out of range. " \ "Please edit your misdn.conf and then do a \"misdn reload\".\n", name, value, section); \ })
Definition at line 433 of file misdn_config.c.
Referenced by _build_general_config(), and _build_port_config().
#define GEN_CFG 1 |
Definition at line 45 of file misdn_config.c.
Referenced by _build_general_config(), get_cfg_position(), and misdn_cfg_get_elem().
#define NO_DEFAULT "<>" |
Definition at line 42 of file misdn_config.c.
Referenced by _fill_defaults(), and misdn_cfg_get_desc().
#define NONE 0 |
Definition at line 43 of file misdn_config.c.
Referenced by __sip_autodestruct(), cb_extensionstate(), handle_request_subscribe(), handle_response_notify(), show_channels_cb(), show_chanstats_cb(), sip_alloc(), sip_show_channel(), sip_show_history(), state_notify_build_xml(), and transmit_state_notify().
#define NUM_GEN_ELEMENTS (sizeof(gen_spec) / sizeof(struct misdn_cfg_spec)) |
Definition at line 47 of file misdn_config.c.
Referenced by _enum_array_map(), _fill_defaults(), _free_general_cfg(), get_cfg_position(), and misdn_cfg_init().
#define NUM_PORT_ELEMENTS (sizeof(port_spec) / sizeof(struct misdn_cfg_spec)) |
Definition at line 48 of file misdn_config.c.
Referenced by _build_port_config(), _enum_array_map(), _fill_defaults(), _free_port_cfg(), get_cfg_position(), and misdn_cfg_init().
#define PORT_CFG 2 |
Definition at line 46 of file misdn_config.c.
Referenced by _build_port_config(), get_cfg_position(), and misdn_cfg_get_elem().
enum misdn_cfg_type |
MISDN_CTYPE_STR | |
MISDN_CTYPE_INT | |
MISDN_CTYPE_BOOL | |
MISDN_CTYPE_BOOLINT | |
MISDN_CTYPE_MSNLIST | |
MISDN_CTYPE_ASTGROUP |
Definition at line 62 of file misdn_config.c.
00062 { 00063 MISDN_CTYPE_STR, 00064 MISDN_CTYPE_INT, 00065 MISDN_CTYPE_BOOL, 00066 MISDN_CTYPE_BOOLINT, 00067 MISDN_CTYPE_MSNLIST, 00068 MISDN_CTYPE_ASTGROUP 00069 };
static void _build_general_config | ( | struct ast_variable * | v | ) | [static] |
Definition at line 987 of file misdn_config.c.
References _parse(), ast_jb_read_conf(), misdn_cfg_spec::boolint_def, CLI_ERROR, GEN_CFG, gen_spec, general_cfg, get_cfg_position(), global_jbconf, ast_variable::name, ast_variable::next, misdn_cfg_spec::type, and ast_variable::value.
Referenced by misdn_cfg_init().
00988 { 00989 int pos; 00990 00991 for (; v; v = v->next) { 00992 if (!ast_jb_read_conf(&global_jbconf, v->name, v->value)) 00993 continue; 00994 if (((pos = get_cfg_position(v->name, GEN_CFG)) < 0) || 00995 (_parse(&general_cfg[pos], v->value, gen_spec[pos].type, gen_spec[pos].boolint_def) < 0)) 00996 CLI_ERROR(v->name, v->value, "general"); 00997 } 00998 }
static void _build_port_config | ( | struct ast_variable * | v, | |
char * | cat | |||
) | [static] |
Definition at line 1000 of file misdn_config.c.
References _parse(), ast_strdupa, misdn_cfg_spec::boolint_def, BUFFERSIZE, CLI_ERROR, get_cfg_position(), max_ports, ast_variable::name, ast_variable::next, NUM_PORT_ELEMENTS, PORT_CFG, port_spec, ptp, strsep(), misdn_cfg_spec::type, type, and ast_variable::value.
Referenced by misdn_cfg_init().
01001 { 01002 int pos, i; 01003 union misdn_cfg_pt cfg_tmp[NUM_PORT_ELEMENTS]; 01004 int cfg_for_ports[max_ports + 1]; 01005 01006 if (!v || !cat) 01007 return; 01008 01009 memset(cfg_tmp, 0, sizeof(cfg_tmp)); 01010 memset(cfg_for_ports, 0, sizeof(cfg_for_ports)); 01011 01012 if (!strcasecmp(cat, "default")) { 01013 cfg_for_ports[0] = 1; 01014 } 01015 01016 if (((pos = get_cfg_position("name", PORT_CFG)) < 0) || 01017 (_parse(&cfg_tmp[pos], cat, port_spec[pos].type, port_spec[pos].boolint_def) < 0)) { 01018 CLI_ERROR(v->name, v->value, cat); 01019 return; 01020 } 01021 01022 for (; v; v = v->next) { 01023 if (!strcasecmp(v->name, "ports")) { 01024 char *token, *tmp = ast_strdupa(v->value); 01025 char ptpbuf[BUFFERSIZE] = ""; 01026 int start, end; 01027 for (token = strsep(&tmp, ","); token; token = strsep(&tmp, ","), *ptpbuf = 0) { 01028 if (!*token) 01029 continue; 01030 if (sscanf(token, "%30d-%30d%511s", &start, &end, ptpbuf) >= 2) { 01031 for (; start <= end; start++) { 01032 if (start <= max_ports && start > 0) { 01033 cfg_for_ports[start] = 1; 01034 ptp[start] = (strstr(ptpbuf, "ptp")) ? 1 : 0; 01035 } else 01036 CLI_ERROR(v->name, v->value, cat); 01037 } 01038 } else { 01039 if (sscanf(token, "%30d%511s", &start, ptpbuf)) { 01040 if (start <= max_ports && start > 0) { 01041 cfg_for_ports[start] = 1; 01042 ptp[start] = (strstr(ptpbuf, "ptp")) ? 1 : 0; 01043 } else 01044 CLI_ERROR(v->name, v->value, cat); 01045 } else 01046 CLI_ERROR(v->name, v->value, cat); 01047 } 01048 } 01049 } else { 01050 if (((pos = get_cfg_position(v->name, PORT_CFG)) < 0) || 01051 (_parse(&cfg_tmp[pos], v->value, port_spec[pos].type, port_spec[pos].boolint_def) < 0)) 01052 CLI_ERROR(v->name, v->value, cat); 01053 } 01054 } 01055 01056 for (i = 0; i < (max_ports + 1); ++i) { 01057 if (i > 0 && cfg_for_ports[0]) { 01058 /* default category, will populate the port_cfg with additional port 01059 categories in subsequent calls to this function */ 01060 memset(cfg_tmp, 0, sizeof(cfg_tmp)); 01061 } 01062 if (cfg_for_ports[i]) { 01063 memcpy(port_cfg[i], cfg_tmp, sizeof(cfg_tmp)); 01064 } 01065 } 01066 }
static int _enum_array_map | ( | void | ) | [static] |
Definition at line 438 of file misdn_config.c.
References ast_log(), gen_spec, LOG_WARNING, MISDN_CFG_FIRST, MISDN_CFG_LAST, MISDN_CFG_PTP, MISDN_GEN_FIRST, MISDN_GEN_LAST, NUM_GEN_ELEMENTS, NUM_PORT_ELEMENTS, and port_spec.
Referenced by misdn_cfg_init().
00439 { 00440 int i, j, ok; 00441 00442 for (i = MISDN_CFG_FIRST + 1; i < MISDN_CFG_LAST; ++i) { 00443 if (i == MISDN_CFG_PTP) 00444 continue; 00445 ok = 0; 00446 for (j = 0; j < NUM_PORT_ELEMENTS; ++j) { 00447 if (port_spec[j].elem == i) { 00448 map[i] = j; 00449 ok = 1; 00450 break; 00451 } 00452 } 00453 if (!ok) { 00454 ast_log(LOG_WARNING, "Enum element %d in misdn_cfg_elements (port section) has no corresponding element in the config struct!\n", i); 00455 return -1; 00456 } 00457 } 00458 for (i = MISDN_GEN_FIRST + 1; i < MISDN_GEN_LAST; ++i) { 00459 ok = 0; 00460 for (j = 0; j < NUM_GEN_ELEMENTS; ++j) { 00461 if (gen_spec[j].elem == i) { 00462 map[i] = j; 00463 ok = 1; 00464 break; 00465 } 00466 } 00467 if (!ok) { 00468 ast_log(LOG_WARNING, "Enum element %d in misdn_cfg_elements (general section) has no corresponding element in the config struct!\n", i); 00469 return -1; 00470 } 00471 } 00472 return 0; 00473 }
static void _fill_defaults | ( | void | ) | [static] |
Definition at line 1123 of file misdn_config.c.
References _parse(), misdn_cfg_pt::any, gen_spec, general_cfg, NO_DEFAULT, NUM_GEN_ELEMENTS, NUM_PORT_ELEMENTS, port_cfg, port_spec, and type.
Referenced by misdn_cfg_init().
01124 { 01125 int i; 01126 01127 for (i = 0; i < NUM_PORT_ELEMENTS; ++i) { 01128 if (!port_cfg[0][i].any && strcasecmp(port_spec[i].def, NO_DEFAULT)) 01129 _parse(&(port_cfg[0][i]), (char *)port_spec[i].def, port_spec[i].type, port_spec[i].boolint_def); 01130 } 01131 for (i = 0; i < NUM_GEN_ELEMENTS; ++i) { 01132 if (!general_cfg[i].any && strcasecmp(gen_spec[i].def, NO_DEFAULT)) 01133 _parse(&(general_cfg[i]), (char *)gen_spec[i].def, gen_spec[i].type, gen_spec[i].boolint_def); 01134 } 01135 }
static void _free_general_cfg | ( | void | ) | [static] |
Definition at line 548 of file misdn_config.c.
References misdn_cfg_pt::any, ast_free, general_cfg, and NUM_GEN_ELEMENTS.
Referenced by misdn_cfg_destroy(), and misdn_cfg_init().
00549 { 00550 int i; 00551 00552 for (i = 0; i < NUM_GEN_ELEMENTS; i++) 00553 if (general_cfg[i].any) 00554 ast_free(general_cfg[i].any); 00555 }
static void _free_msn_list | ( | struct msn_list * | iter | ) | [static] |
Definition at line 506 of file misdn_config.c.
References ast_free, msn_list::msn, and msn_list::next.
Referenced by _free_port_cfg().
00507 { 00508 if (iter->next) 00509 _free_msn_list(iter->next); 00510 if (iter->msn) 00511 ast_free(iter->msn); 00512 ast_free(iter); 00513 }
static void _free_port_cfg | ( | void | ) | [static] |
Definition at line 515 of file misdn_config.c.
References _free_msn_list(), misdn_cfg_pt::any, ast_free, MISDN_CFG_GROUPNAME, MISDN_CTYPE_MSNLIST, misdn_cfg_pt::ml, NUM_PORT_ELEMENTS, port_cfg, port_spec, str, and type.
Referenced by misdn_cfg_destroy(), and misdn_cfg_init().
00516 { 00517 int i, j; 00518 int gn = map[MISDN_CFG_GROUPNAME]; 00519 union misdn_cfg_pt* free_list[max_ports + 2]; 00520 00521 memset(free_list, 0, sizeof(free_list)); 00522 free_list[0] = port_cfg[0]; 00523 for (i = 1; i <= max_ports; ++i) { 00524 if (port_cfg[i][gn].str) { 00525 /* we always have a groupname in the non-default case, so this is fine */ 00526 for (j = 1; j <= max_ports; ++j) { 00527 if (free_list[j] && free_list[j][gn].str == port_cfg[i][gn].str) 00528 break; 00529 else if (!free_list[j]) { 00530 free_list[j] = port_cfg[i]; 00531 break; 00532 } 00533 } 00534 } 00535 } 00536 for (j = 0; free_list[j]; ++j) { 00537 for (i = 0; i < NUM_PORT_ELEMENTS; ++i) { 00538 if (free_list[j][i].any) { 00539 if (port_spec[i].type == MISDN_CTYPE_MSNLIST) 00540 _free_msn_list(free_list[j][i].ml); 00541 else 00542 ast_free(free_list[j][i].any); 00543 } 00544 } 00545 } 00546 }
static int _parse | ( | union misdn_cfg_pt * | dest, | |
const char * | value, | |||
enum misdn_cfg_type | type, | |||
int | boolint_def | |||
) | [static] |
Definition at line 910 of file misdn_config.c.
References ast_calloc, ast_free, ast_get_group(), ast_malloc, ast_strdupa, ast_true(), misdn_cfg_pt::grp, len(), MISDN_CTYPE_ASTGROUP, MISDN_CTYPE_BOOL, MISDN_CTYPE_BOOLINT, MISDN_CTYPE_INT, MISDN_CTYPE_MSNLIST, MISDN_CTYPE_STR, misdn_cfg_pt::ml, misdn_cfg_pt::num, misdn_cfg_pt::str, and strsep().
Referenced by _build_general_config(), _build_port_config(), and _fill_defaults().
00911 { 00912 int re = 0; 00913 int len, tmp; 00914 char *valtmp; 00915 char *tmp2 = ast_strdupa(value); 00916 00917 switch (type) { 00918 case MISDN_CTYPE_STR: 00919 if (dest->str) { 00920 ast_free(dest->str); 00921 } 00922 if ((len = strlen(value))) { 00923 dest->str = ast_malloc((len + 1) * sizeof(char)); 00924 strncpy(dest->str, value, len); 00925 dest->str[len] = 0; 00926 } else { 00927 dest->str = ast_malloc(sizeof(char)); 00928 dest->str[0] = 0; 00929 } 00930 break; 00931 case MISDN_CTYPE_INT: 00932 { 00933 int res; 00934 00935 if (strchr(value,'x')) { 00936 res = sscanf(value, "%30x", &tmp); 00937 } else { 00938 res = sscanf(value, "%30d", &tmp); 00939 } 00940 if (res) { 00941 if (!dest->num) { 00942 dest->num = ast_malloc(sizeof(int)); 00943 } 00944 memcpy(dest->num, &tmp, sizeof(int)); 00945 } else 00946 re = -1; 00947 } 00948 break; 00949 case MISDN_CTYPE_BOOL: 00950 if (!dest->num) { 00951 dest->num = ast_malloc(sizeof(int)); 00952 } 00953 *(dest->num) = (ast_true(value) ? 1 : 0); 00954 break; 00955 case MISDN_CTYPE_BOOLINT: 00956 if (!dest->num) { 00957 dest->num = ast_malloc(sizeof(int)); 00958 } 00959 if (sscanf(value, "%30d", &tmp)) { 00960 memcpy(dest->num, &tmp, sizeof(int)); 00961 } else { 00962 *(dest->num) = (ast_true(value) ? boolint_def : 0); 00963 } 00964 break; 00965 case MISDN_CTYPE_MSNLIST: 00966 for (valtmp = strsep(&tmp2, ","); valtmp; valtmp = strsep(&tmp2, ",")) { 00967 if ((len = strlen(valtmp))) { 00968 struct msn_list *ml = ast_malloc(sizeof(*ml)); 00969 ml->msn = ast_calloc(len+1, sizeof(char)); 00970 strncpy(ml->msn, valtmp, len); 00971 ml->next = dest->ml; 00972 dest->ml = ml; 00973 } 00974 } 00975 break; 00976 case MISDN_CTYPE_ASTGROUP: 00977 if (!dest->grp) { 00978 dest->grp = ast_malloc(sizeof(ast_group_t)); 00979 } 00980 *(dest->grp) = ast_get_group(value); 00981 break; 00982 } 00983 00984 return re; 00985 }
static int get_cfg_position | ( | const char * | name, | |
int | type | |||
) | [static] |
Definition at line 475 of file misdn_config.c.
References GEN_CFG, gen_spec, NUM_GEN_ELEMENTS, NUM_PORT_ELEMENTS, PORT_CFG, and port_spec.
Referenced by _build_general_config(), _build_port_config(), and misdn_cfg_get_elem().
00476 { 00477 int i; 00478 00479 switch (type) { 00480 case PORT_CFG: 00481 for (i = 0; i < NUM_PORT_ELEMENTS; ++i) { 00482 if (!strcasecmp(name, port_spec[i].name)) 00483 return i; 00484 } 00485 break; 00486 case GEN_CFG: 00487 for (i = 0; i < NUM_GEN_ELEMENTS; ++i) { 00488 if (!strcasecmp(name, gen_spec[i].name)) 00489 return i; 00490 } 00491 } 00492 00493 return -1; 00494 }
void misdn_cfg_destroy | ( | void | ) |
Definition at line 1142 of file misdn_config.c.
References _free_general_cfg(), _free_port_cfg(), ast_free, ast_mutex_destroy, config_mutex, general_cfg, map, misdn_cfg_lock(), misdn_cfg_unlock(), port_cfg, and ptp.
Referenced by unload_module().
01143 { 01144 misdn_cfg_lock(); 01145 01146 _free_port_cfg(); 01147 _free_general_cfg(); 01148 01149 ast_free(port_cfg); 01150 ast_free(general_cfg); 01151 ast_free(ptp); 01152 ast_free(map); 01153 01154 misdn_cfg_unlock(); 01155 ast_mutex_destroy(&config_mutex); 01156 }
void misdn_cfg_get | ( | int | port, | |
enum misdn_cfg_elements | elem, | |||
void * | buf, | |||
int | bufsize | |||
) |
Definition at line 557 of file misdn_config.c.
References misdn_cfg_pt::any, ast_copy_string(), ast_log(), gen_spec, general_cfg, LOG_WARNING, misdn_cfg_is_port_valid(), MISDN_CFG_LAST, misdn_cfg_lock(), MISDN_CFG_PTP, misdn_cfg_unlock(), MISDN_CTYPE_STR, port_cfg, port_spec, S_OR, str, and type.
Referenced by add_in_calls(), add_out_calls(), cb_events(), dialtone_indicate(), load_module(), misdn_add_number_prefix(), misdn_bridge(), misdn_call(), misdn_cfg_update_ptp(), misdn_check_l2l1(), misdn_get_connected_line(), misdn_new(), misdn_request(), misdn_set_opt_exec(), process_ast_dsp(), read_config(), reload_config(), update_config(), and update_ec_config().
00558 { 00559 int place; 00560 00561 if ((elem < MISDN_CFG_LAST) && !misdn_cfg_is_port_valid(port)) { 00562 memset(buf, 0, bufsize); 00563 ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get! Port number %d is not valid.\n", port); 00564 return; 00565 } 00566 00567 misdn_cfg_lock(); 00568 if (elem == MISDN_CFG_PTP) { 00569 if (!memcpy(buf, &ptp[port], (bufsize > ptp[port]) ? sizeof(ptp[port]) : bufsize)) 00570 memset(buf, 0, bufsize); 00571 } else { 00572 if ((place = map[elem]) < 0) { 00573 memset(buf, 0, bufsize); 00574 ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get! Invalid element (%d) requested.\n", elem); 00575 } else { 00576 if (elem < MISDN_CFG_LAST) { 00577 switch (port_spec[place].type) { 00578 case MISDN_CTYPE_STR: 00579 if (port_cfg[port][place].str) { 00580 ast_copy_string(buf, port_cfg[port][place].str, bufsize); 00581 } else if (port_cfg[0][place].str) { 00582 ast_copy_string(buf, port_cfg[0][place].str, bufsize); 00583 } else 00584 memset(buf, 0, bufsize); 00585 break; 00586 default: 00587 if (port_cfg[port][place].any) 00588 memcpy(buf, port_cfg[port][place].any, bufsize); 00589 else if (port_cfg[0][place].any) 00590 memcpy(buf, port_cfg[0][place].any, bufsize); 00591 else 00592 memset(buf, 0, bufsize); 00593 } 00594 } else { 00595 switch (gen_spec[place].type) { 00596 case MISDN_CTYPE_STR: 00597 ast_copy_string(buf, S_OR(general_cfg[place].str, ""), bufsize); 00598 break; 00599 default: 00600 if (general_cfg[place].any) 00601 memcpy(buf, general_cfg[place].any, bufsize); 00602 else 00603 memset(buf, 0, bufsize); 00604 } 00605 } 00606 } 00607 } 00608 misdn_cfg_unlock(); 00609 }
void misdn_cfg_get_config_string | ( | int | port, | |
enum misdn_cfg_elements | elem, | |||
char * | buf, | |||
int | bufsize | |||
) |
Definition at line 782 of file misdn_config.c.
References ast_log(), ast_print_group(), BUFFERSIZE, gen_spec, general_cfg, LOG_WARNING, map, MISDN_CFG_FIRST, misdn_cfg_is_port_valid(), MISDN_CFG_LAST, misdn_cfg_lock(), MISDN_CFG_PTP, misdn_cfg_unlock(), MISDN_CTYPE_ASTGROUP, MISDN_CTYPE_BOOL, MISDN_CTYPE_BOOLINT, MISDN_CTYPE_INT, MISDN_CTYPE_MSNLIST, MISDN_CTYPE_STR, MISDN_GEN_FIRST, MISDN_GEN_LAST, misdn_cfg_pt::ml, msn_list::msn, name, msn_list::next, port_cfg, port_spec, ptp, str, and type.
00783 { 00784 int place; 00785 char tempbuf[BUFFERSIZE] = ""; 00786 struct msn_list *iter; 00787 00788 if ((elem < MISDN_CFG_LAST) && !misdn_cfg_is_port_valid(port)) { 00789 *buf = 0; 00790 ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get_config_string! Port number %d is not valid.\n", port); 00791 return; 00792 } 00793 00794 place = map[elem]; 00795 00796 misdn_cfg_lock(); 00797 if (elem == MISDN_CFG_PTP) { 00798 snprintf(buf, bufsize, " -> ptp: %s", ptp[port] ? "yes" : "no"); 00799 } 00800 else if (elem > MISDN_CFG_FIRST && elem < MISDN_CFG_LAST) { 00801 switch (port_spec[place].type) { 00802 case MISDN_CTYPE_INT: 00803 case MISDN_CTYPE_BOOLINT: 00804 if (port_cfg[port][place].num) 00805 snprintf(buf, bufsize, " -> %s: %d", port_spec[place].name, *port_cfg[port][place].num); 00806 else if (port_cfg[0][place].num) 00807 snprintf(buf, bufsize, " -> %s: %d", port_spec[place].name, *port_cfg[0][place].num); 00808 else 00809 snprintf(buf, bufsize, " -> %s:", port_spec[place].name); 00810 break; 00811 case MISDN_CTYPE_BOOL: 00812 if (port_cfg[port][place].num) 00813 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, *port_cfg[port][place].num ? "yes" : "no"); 00814 else if (port_cfg[0][place].num) 00815 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, *port_cfg[0][place].num ? "yes" : "no"); 00816 else 00817 snprintf(buf, bufsize, " -> %s:", port_spec[place].name); 00818 break; 00819 case MISDN_CTYPE_ASTGROUP: 00820 if (port_cfg[port][place].grp) 00821 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, 00822 ast_print_group(tempbuf, sizeof(tempbuf), *port_cfg[port][place].grp)); 00823 else if (port_cfg[0][place].grp) 00824 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, 00825 ast_print_group(tempbuf, sizeof(tempbuf), *port_cfg[0][place].grp)); 00826 else 00827 snprintf(buf, bufsize, " -> %s:", port_spec[place].name); 00828 break; 00829 case MISDN_CTYPE_MSNLIST: 00830 if (port_cfg[port][place].ml) 00831 iter = port_cfg[port][place].ml; 00832 else 00833 iter = port_cfg[0][place].ml; 00834 if (iter) { 00835 for (; iter; iter = iter->next) { 00836 strncat(tempbuf, iter->msn, sizeof(tempbuf) - strlen(tempbuf) - 1); 00837 } 00838 if (strlen(tempbuf) > 1) { 00839 tempbuf[strlen(tempbuf)-2] = 0; 00840 } 00841 } 00842 snprintf(buf, bufsize, " -> msns: %s", *tempbuf ? tempbuf : "none"); 00843 break; 00844 case MISDN_CTYPE_STR: 00845 if ( port_cfg[port][place].str) { 00846 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, port_cfg[port][place].str); 00847 } else if (port_cfg[0][place].str) { 00848 snprintf(buf, bufsize, " -> %s: %s", port_spec[place].name, port_cfg[0][place].str); 00849 } else { 00850 snprintf(buf, bufsize, " -> %s:", port_spec[place].name); 00851 } 00852 break; 00853 } 00854 } else if (elem > MISDN_GEN_FIRST && elem < MISDN_GEN_LAST) { 00855 switch (gen_spec[place].type) { 00856 case MISDN_CTYPE_INT: 00857 case MISDN_CTYPE_BOOLINT: 00858 if (general_cfg[place].num) 00859 snprintf(buf, bufsize, " -> %s: %d", gen_spec[place].name, *general_cfg[place].num); 00860 else 00861 snprintf(buf, bufsize, " -> %s:", gen_spec[place].name); 00862 break; 00863 case MISDN_CTYPE_BOOL: 00864 if (general_cfg[place].num) 00865 snprintf(buf, bufsize, " -> %s: %s", gen_spec[place].name, *general_cfg[place].num ? "yes" : "no"); 00866 else 00867 snprintf(buf, bufsize, " -> %s:", gen_spec[place].name); 00868 break; 00869 case MISDN_CTYPE_STR: 00870 if ( general_cfg[place].str) { 00871 snprintf(buf, bufsize, " -> %s: %s", gen_spec[place].name, general_cfg[place].str); 00872 } else { 00873 snprintf(buf, bufsize, " -> %s:", gen_spec[place].name); 00874 } 00875 break; 00876 default: 00877 snprintf(buf, bufsize, " -> type of %s not handled yet", gen_spec[place].name); 00878 break; 00879 } 00880 } else { 00881 *buf = 0; 00882 ast_log(LOG_WARNING, "Invalid call to misdn_cfg_get_config_string! Invalid config element (%d) requested.\n", elem); 00883 } 00884 misdn_cfg_unlock(); 00885 }
void misdn_cfg_get_desc | ( | enum misdn_cfg_elements | elem, | |
void * | buf, | |||
int | bufsize, | |||
void * | buf_default, | |||
int | bufsize_default | |||
) |
Definition at line 658 of file misdn_config.c.
References ast_copy_string(), misdn_cfg_spec::def, desc, gen_spec, MISDN_CFG_FIRST, MISDN_CFG_GROUPNAME, MISDN_CFG_LAST, MISDN_GEN_FIRST, MISDN_GEN_LAST, NO_DEFAULT, and port_spec.
Referenced by show_config_description().
00659 { 00660 int place = map[elem]; 00661 struct misdn_cfg_spec *spec = NULL; 00662 00663 /* here comes a hack to replace the (not existing) "name" element with the "ports" element */ 00664 if (elem == MISDN_CFG_GROUPNAME) { 00665 ast_copy_string(buf, ports_description, bufsize); 00666 if (buf_default && bufsize_default) 00667 memset(buf_default, 0, 1); 00668 return; 00669 } 00670 00671 if ((elem > MISDN_CFG_FIRST) && (elem < MISDN_CFG_LAST)) 00672 spec = (struct misdn_cfg_spec *)port_spec; 00673 else if ((elem > MISDN_GEN_FIRST) && (elem < MISDN_GEN_LAST)) 00674 spec = (struct misdn_cfg_spec *)gen_spec; 00675 00676 if (!spec || !spec[place].desc) 00677 memset(buf, 0, 1); 00678 else { 00679 ast_copy_string(buf, spec[place].desc, bufsize); 00680 if (buf_default && bufsize) { 00681 if (!strcmp(spec[place].def, NO_DEFAULT)) 00682 memset(buf_default, 0, 1); 00683 else 00684 ast_copy_string(buf_default, spec[place].def, bufsize_default); 00685 } 00686 } 00687 }
enum misdn_cfg_elements misdn_cfg_get_elem | ( | const char * | name | ) |
Definition at line 611 of file misdn_config.c.
References misdn_cfg_spec::elem, GEN_CFG, gen_spec, get_cfg_position(), MISDN_CFG_FIRST, MISDN_CFG_GROUPNAME, PORT_CFG, and port_spec.
Referenced by handle_cli_misdn_show_config().
00612 { 00613 int pos; 00614 00615 /* here comes a hack to replace the (not existing) "name" element with the "ports" element */ 00616 if (!strcmp(name, "ports")) 00617 return MISDN_CFG_GROUPNAME; 00618 if (!strcmp(name, "name")) 00619 return MISDN_CFG_FIRST; 00620 00621 pos = get_cfg_position(name, PORT_CFG); 00622 if (pos >= 0) 00623 return port_spec[pos].elem; 00624 00625 pos = get_cfg_position(name, GEN_CFG); 00626 if (pos >= 0) 00627 return gen_spec[pos].elem; 00628 00629 return MISDN_CFG_FIRST; 00630 }
void misdn_cfg_get_name | ( | enum misdn_cfg_elements | elem, | |
void * | buf, | |||
int | bufsize | |||
) |
Definition at line 632 of file misdn_config.c.
References ast_copy_string(), gen_spec, MISDN_CFG_FIRST, MISDN_CFG_GROUPNAME, MISDN_CFG_LAST, MISDN_CFG_PTP, MISDN_GEN_FIRST, MISDN_GEN_LAST, name, and port_spec.
Referenced by complete_show_config(), and show_config_description().
00633 { 00634 struct misdn_cfg_spec *spec = NULL; 00635 int place = map[elem]; 00636 00637 /* the ptp hack */ 00638 if (elem == MISDN_CFG_PTP) { 00639 memset(buf, 0, 1); 00640 return; 00641 } 00642 00643 /* here comes a hack to replace the (not existing) "name" element with the "ports" element */ 00644 if (elem == MISDN_CFG_GROUPNAME) { 00645 if (!snprintf(buf, bufsize, "ports")) 00646 memset(buf, 0, 1); 00647 return; 00648 } 00649 00650 if ((elem > MISDN_CFG_FIRST) && (elem < MISDN_CFG_LAST)) 00651 spec = (struct misdn_cfg_spec *)port_spec; 00652 else if ((elem > MISDN_GEN_FIRST) && (elem < MISDN_GEN_LAST)) 00653 spec = (struct misdn_cfg_spec *)gen_spec; 00654 00655 ast_copy_string(buf, spec ? spec[place].name : "", bufsize); 00656 }
int misdn_cfg_get_next_port | ( | int | port | ) |
Definition at line 887 of file misdn_config.c.
References map, max_ports, MISDN_CFG_GROUPNAME, misdn_cfg_lock(), misdn_cfg_unlock(), port_cfg, and str.
Referenced by complete_show_config(), handle_cli_misdn_show_ports_stats(), handle_cli_misdn_show_stacks(), load_module(), misdn_cfg_get_next_port_spin(), misdn_check_l2l1(), misdn_new(), misdn_request(), and update_name().
00888 { 00889 int p = -1; 00890 int gn = map[MISDN_CFG_GROUPNAME]; 00891 00892 misdn_cfg_lock(); 00893 for (port++; port <= max_ports; port++) { 00894 if (port_cfg[port][gn].str) { 00895 p = port; 00896 break; 00897 } 00898 } 00899 misdn_cfg_unlock(); 00900 00901 return p; 00902 }
int misdn_cfg_get_next_port_spin | ( | int | port | ) |
Definition at line 904 of file misdn_config.c.
References misdn_cfg_get_next_port().
Referenced by misdn_request().
00905 { 00906 int p = misdn_cfg_get_next_port(port); 00907 return (p > 0) ? p : misdn_cfg_get_next_port(0); 00908 }
void misdn_cfg_get_ports_string | ( | char * | ports | ) |
Generate a comma separated list of all active ports.
Definition at line 756 of file misdn_config.c.
References map, max_ports, MISDN_CFG_GROUPNAME, misdn_cfg_lock(), misdn_cfg_unlock(), port_cfg, ptp, and str.
Referenced by load_module().
00757 { 00758 char tmp[16]; 00759 int l, i; 00760 int gn = map[MISDN_CFG_GROUPNAME]; 00761 00762 *ports = 0; 00763 00764 misdn_cfg_lock(); 00765 for (i = 1; i <= max_ports; i++) { 00766 if (port_cfg[i][gn].str) { 00767 if (ptp[i]) 00768 sprintf(tmp, "%dptp,", i); 00769 else 00770 sprintf(tmp, "%d,", i); 00771 strcat(ports, tmp); 00772 } 00773 } 00774 misdn_cfg_unlock(); 00775 00776 if ((l = strlen(ports))) { 00777 /* Strip trailing ',' */ 00778 ports[l-1] = 0; 00779 } 00780 }
int misdn_cfg_init | ( | int | this_max_ports, | |
int | reload | |||
) |
Definition at line 1158 of file misdn_config.c.
References _build_general_config(), _build_port_config(), _enum_array_map(), _fill_defaults(), _free_general_cfg(), _free_port_cfg(), ast_calloc, ast_category_browse(), ast_config_destroy(), ast_config_load2(), ast_log(), ast_mutex_init, ast_variable_browse(), config, CONFIG_FLAG_FILEUNCHANGED, config_flags, config_mutex, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, default_jbconf, general_cfg, global_jbconf, LOG_WARNING, map, max_ports, misdn_cfg_lock(), misdn_cfg_unlock(), MISDN_GEN_LAST, NUM_GEN_ELEMENTS, NUM_PORT_ELEMENTS, port_cfg, and ptp.
Referenced by load_module(), and misdn_cfg_reload().
01159 { 01160 char config[] = "misdn.conf"; 01161 char *cat, *p; 01162 int i; 01163 struct ast_config *cfg; 01164 struct ast_variable *v; 01165 struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 }; 01166 01167 if (!(cfg = ast_config_load2(config, "chan_misdn", config_flags)) || cfg == CONFIG_STATUS_FILEINVALID) { 01168 ast_log(LOG_WARNING, "missing or invalid file: misdn.conf\n"); 01169 return -1; 01170 } else if (cfg == CONFIG_STATUS_FILEUNCHANGED) 01171 return 0; 01172 01173 ast_mutex_init(&config_mutex); 01174 01175 /* Copy the default jb config over global_jbconf */ 01176 memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf)); 01177 01178 misdn_cfg_lock(); 01179 01180 if (this_max_ports) { 01181 /* this is the first run */ 01182 max_ports = this_max_ports; 01183 map = ast_calloc(MISDN_GEN_LAST + 1, sizeof(int)); 01184 if (_enum_array_map()) 01185 return -1; 01186 p = ast_calloc(1, (max_ports + 1) * sizeof(union misdn_cfg_pt *) 01187 + (max_ports + 1) * NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt)); 01188 port_cfg = (union misdn_cfg_pt **)p; 01189 p += (max_ports + 1) * sizeof(union misdn_cfg_pt *); 01190 for (i = 0; i <= max_ports; ++i) { 01191 port_cfg[i] = (union misdn_cfg_pt *)p; 01192 p += NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt); 01193 } 01194 general_cfg = ast_calloc(1, sizeof(union misdn_cfg_pt *) * NUM_GEN_ELEMENTS); 01195 ptp = ast_calloc(max_ports + 1, sizeof(int)); 01196 } 01197 else { 01198 /* misdn reload */ 01199 _free_port_cfg(); 01200 _free_general_cfg(); 01201 memset(port_cfg[0], 0, NUM_PORT_ELEMENTS * sizeof(union misdn_cfg_pt) * (max_ports + 1)); 01202 memset(general_cfg, 0, sizeof(union misdn_cfg_pt *) * NUM_GEN_ELEMENTS); 01203 memset(ptp, 0, sizeof(int) * (max_ports + 1)); 01204 } 01205 01206 cat = ast_category_browse(cfg, NULL); 01207 01208 while(cat) { 01209 v = ast_variable_browse(cfg, cat); 01210 if (!strcasecmp(cat, "general")) { 01211 _build_general_config(v); 01212 } else { 01213 _build_port_config(v, cat); 01214 } 01215 cat = ast_category_browse(cfg, cat); 01216 } 01217 01218 _fill_defaults(); 01219 01220 misdn_cfg_unlock(); 01221 ast_config_destroy(cfg); 01222 01223 return 0; 01224 }
int misdn_cfg_is_group_method | ( | char * | group, | |
enum misdn_cfg_method | meth | |||
) |
Definition at line 721 of file misdn_config.c.
References map, max_ports, METHOD_ROUND_ROBIN, METHOD_STANDARD, METHOD_STANDARD_DEC, MISDN_CFG_GROUPNAME, misdn_cfg_lock(), MISDN_CFG_METHOD, misdn_cfg_unlock(), port_cfg, misdn_cfg_pt::str, and str.
Referenced by misdn_request().
00722 { 00723 int i, re = 0; 00724 char *method ; 00725 00726 misdn_cfg_lock(); 00727 00728 method = port_cfg[0][map[MISDN_CFG_METHOD]].str; 00729 00730 for (i = 1; i <= max_ports; i++) { 00731 if (port_cfg[i] && port_cfg[i][map[MISDN_CFG_GROUPNAME]].str) { 00732 if (!strcasecmp(port_cfg[i][map[MISDN_CFG_GROUPNAME]].str, group)) 00733 method = (port_cfg[i][map[MISDN_CFG_METHOD]].str ? 00734 port_cfg[i][map[MISDN_CFG_METHOD]].str : port_cfg[0][map[MISDN_CFG_METHOD]].str); 00735 } 00736 } 00737 00738 if (method) { 00739 switch (meth) { 00740 case METHOD_STANDARD: re = !strcasecmp(method, "standard"); 00741 break; 00742 case METHOD_ROUND_ROBIN: re = !strcasecmp(method, "round_robin"); 00743 break; 00744 case METHOD_STANDARD_DEC: re = !strcasecmp(method, "standard_dec"); 00745 break; 00746 } 00747 } 00748 misdn_cfg_unlock(); 00749 00750 return re; 00751 }
int misdn_cfg_is_msn_valid | ( | int | port, | |
char * | msn | |||
) |
Definition at line 689 of file misdn_config.c.
References ast_extension_match(), ast_log(), LOG_WARNING, misdn_cfg_is_port_valid(), misdn_cfg_lock(), MISDN_CFG_MSNS, misdn_cfg_pt::ml, msn_list::msn, msn_list::next, and port_cfg.
Referenced by misdn_is_msn_valid().
00690 { 00691 int re = 0; 00692 struct msn_list *iter; 00693 00694 if (!misdn_cfg_is_port_valid(port)) { 00695 ast_log(LOG_WARNING, "Invalid call to misdn_cfg_is_msn_valid! Port number %d is not valid.\n", port); 00696 return 0; 00697 } 00698 00699 misdn_cfg_lock(); 00700 if (port_cfg[port][map[MISDN_CFG_MSNS]].ml) 00701 iter = port_cfg[port][map[MISDN_CFG_MSNS]].ml; 00702 else 00703 iter = port_cfg[0][map[MISDN_CFG_MSNS]].ml; 00704 for (; iter; iter = iter->next) 00705 if (*(iter->msn) == '*' || ast_extension_match(iter->msn, msn)) { 00706 re = 1; 00707 break; 00708 } 00709 misdn_cfg_unlock(); 00710 00711 return re; 00712 }
int misdn_cfg_is_port_valid | ( | int | port | ) |
Definition at line 714 of file misdn_config.c.
References map, max_ports, MISDN_CFG_GROUPNAME, port_cfg, and str.
Referenced by misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_is_msn_valid(), and misdn_cfg_update_ptp().
00715 { 00716 int gn = map[MISDN_CFG_GROUPNAME]; 00717 00718 return (port >= 1 && port <= max_ports && port_cfg[port][gn].str); 00719 }
static void misdn_cfg_lock | ( | void | ) | [inline, static] |
Definition at line 496 of file misdn_config.c.
References ast_mutex_lock, and config_mutex.
Referenced by misdn_cfg_destroy(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_get_next_port(), misdn_cfg_get_ports_string(), misdn_cfg_init(), misdn_cfg_is_group_method(), misdn_cfg_is_msn_valid(), and misdn_cfg_update_ptp().
00497 { 00498 ast_mutex_lock(&config_mutex); 00499 }
void misdn_cfg_reload | ( | void | ) |
Definition at line 1137 of file misdn_config.c.
References misdn_cfg_init().
Referenced by reload_config().
01138 { 01139 misdn_cfg_init(0, 1); 01140 }
static void misdn_cfg_unlock | ( | void | ) | [inline, static] |
Definition at line 501 of file misdn_config.c.
References ast_mutex_unlock, and config_mutex.
Referenced by misdn_cfg_destroy(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_get_next_port(), misdn_cfg_get_ports_string(), misdn_cfg_init(), misdn_cfg_is_group_method(), and misdn_cfg_update_ptp().
00502 { 00503 ast_mutex_unlock(&config_mutex); 00504 }
void misdn_cfg_update_ptp | ( | void | ) |
Definition at line 1068 of file misdn_config.c.
References ast_log(), ast_strlen_zero(), BUFFERSIZE, errno, LOG_WARNING, max_ports, misdn_cfg_get(), misdn_cfg_is_port_valid(), misdn_cfg_lock(), misdn_cfg_unlock(), MISDN_GEN_MISDN_INIT, and ptp.
Referenced by load_module(), and reload_config().
01069 { 01070 #ifndef MISDN_1_2 01071 char misdn_init[BUFFERSIZE]; 01072 char line[BUFFERSIZE]; 01073 FILE *fp; 01074 char *tok, *p, *end; 01075 int port; 01076 01077 misdn_cfg_get(0, MISDN_GEN_MISDN_INIT, &misdn_init, sizeof(misdn_init)); 01078 01079 if (!ast_strlen_zero(misdn_init)) { 01080 fp = fopen(misdn_init, "r"); 01081 if (fp) { 01082 while(fgets(line, sizeof(line), fp)) { 01083 if (!strncmp(line, "nt_ptp", 6)) { 01084 for (tok = strtok_r(line,",=", &p); 01085 tok; 01086 tok = strtok_r(NULL,",=", &p)) { 01087 port = strtol(tok, &end, 10); 01088 if (end != tok && misdn_cfg_is_port_valid(port)) { 01089 misdn_cfg_lock(); 01090 ptp[port] = 1; 01091 misdn_cfg_unlock(); 01092 } 01093 } 01094 } 01095 } 01096 fclose(fp); 01097 } else { 01098 ast_log(LOG_WARNING,"Couldn't open %s: %s\n", misdn_init, strerror(errno)); 01099 } 01100 } 01101 #else 01102 int i; 01103 int proto; 01104 char filename[128]; 01105 FILE *fp; 01106 01107 for (i = 1; i <= max_ports; ++i) { 01108 snprintf(filename, sizeof(filename), "/sys/class/mISDN-stacks/st-%08x/protocol", i << 8); 01109 fp = fopen(filename, "r"); 01110 if (!fp) { 01111 ast_log(LOG_WARNING, "Could not open %s: %s\n", filename, strerror(errno)); 01112 continue; 01113 } 01114 if (fscanf(fp, "0x%08x", &proto) != 1) 01115 ast_log(LOG_WARNING, "Could not parse contents of %s!\n", filename); 01116 else 01117 ptp[i] = proto & 1<<5 ? 1 : 0; 01118 fclose(fp); 01119 } 01120 #endif 01121 }
struct ast_jb_conf* misdn_get_global_jbconf | ( | void | ) |
Definition at line 1226 of file misdn_config.c.
References global_jbconf.
Referenced by misdn_new().
01226 { 01227 return &global_jbconf; 01228 }
ast_mutex_t config_mutex [static] |
Definition at line 431 of file misdn_config.c.
Referenced by misdn_cfg_destroy(), misdn_cfg_init(), misdn_cfg_lock(), and misdn_cfg_unlock().
struct ast_jb_conf default_jbconf [static] |
Global jitterbuffer configuration - by default, jb is disabled
Definition at line 51 of file misdn_config.c.
struct misdn_cfg_spec gen_spec[] [static] |
Definition at line 382 of file misdn_config.c.
Referenced by _build_general_config(), _enum_array_map(), _fill_defaults(), get_cfg_position(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_get_desc(), misdn_cfg_get_elem(), and misdn_cfg_get_name().
union misdn_cfg_pt* general_cfg [static] |
Definition at line 425 of file misdn_config.c.
Referenced by _build_general_config(), _fill_defaults(), _free_general_cfg(), misdn_cfg_destroy(), misdn_cfg_get(), misdn_cfg_get_config_string(), and misdn_cfg_init().
struct ast_jb_conf global_jbconf [static] |
Definition at line 60 of file misdn_config.c.
int* map [static] |
Definition at line 429 of file misdn_config.c.
Referenced by append_mapping(), build_mapping(), build_translators(), clear_config_maps(), data_search_mapping_find(), destroy_map(), dundi_lookup_local(), dundi_show_mappings(), find_engine(), find_transcoders(), get_mapping_weight(), handle_cli_core_show_config_mappings(), last_message_index(), mark_mappings(), misdn_cfg_destroy(), misdn_cfg_get_config_string(), misdn_cfg_get_next_port(), misdn_cfg_get_ports_string(), misdn_cfg_init(), misdn_cfg_is_group_method(), misdn_cfg_is_port_valid(), and prune_mappings().
int max_ports [static] |
Definition at line 423 of file misdn_config.c.
union misdn_cfg_pt** port_cfg [static] |
Definition at line 421 of file misdn_config.c.
Referenced by _fill_defaults(), _free_port_cfg(), misdn_cfg_destroy(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_get_next_port(), misdn_cfg_get_ports_string(), misdn_cfg_init(), misdn_cfg_is_group_method(), misdn_cfg_is_msn_valid(), and misdn_cfg_is_port_valid().
struct misdn_cfg_spec port_spec[] [static] |
Definition at line 97 of file misdn_config.c.
Referenced by _build_port_config(), _enum_array_map(), _fill_defaults(), _free_port_cfg(), get_cfg_position(), misdn_cfg_get(), misdn_cfg_get_config_string(), misdn_cfg_get_desc(), misdn_cfg_get_elem(), and misdn_cfg_get_name().
const char ports_description[] [static] |
Initial value:
"Define your ports, e.g. 1,2 (depends on mISDN-driver loading order)."
Definition at line 94 of file misdn_config.c.
int* ptp [static] |
Definition at line 427 of file misdn_config.c.
Referenced by _build_port_config(), misdn_cfg_destroy(), misdn_cfg_get_config_string(), misdn_cfg_get_ports_string(), misdn_cfg_init(), misdn_cfg_update_ptp(), and misdn_lib_init().