Skip to content

Commit

Permalink
keepalive: reformat module exports structures
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Mar 25, 2024
1 parent 8114b20 commit dd221a6
Showing 1 changed file with 31 additions and 25 deletions.
56 changes: 31 additions & 25 deletions src/modules/keepalive/keepalive_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,39 +70,45 @@ str ka_ping_from = str_init("sip:keepalive@kamailio.org");
int ka_counter_del = 5;


static cmd_export_t cmds[] = {{"ka_is_alive", (cmd_function)w_cmd_is_alive, 1,
fixup_spve_null, 0, ANY_ROUTE},
// internal API
{"ka_add_destination", (cmd_function)w_add_destination, 2,
fixup_add_destination, 0,
REQUEST_ROUTE | BRANCH_ROUTE | ONREPLY_ROUTE},
{"ka_del_destination", (cmd_function)w_del_destination, 2,
fixup_add_destination, 0, ANY_ROUTE},
{"bind_keepalive", (cmd_function)bind_keepalive, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0}};
/* clang-format off */
static cmd_export_t cmds[] = {
{"ka_is_alive", (cmd_function)w_cmd_is_alive, 1,
fixup_spve_null, 0, ANY_ROUTE},
// internal API
{"ka_add_destination", (cmd_function)w_add_destination, 2,
fixup_add_destination, 0, REQUEST_ROUTE | BRANCH_ROUTE | ONREPLY_ROUTE},
{"ka_del_destination", (cmd_function)w_del_destination, 2,
fixup_add_destination, 0, ANY_ROUTE},
{"bind_keepalive", (cmd_function)bind_keepalive, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0}
};


static param_export_t params[] = {
{"ping_interval", PARAM_INT, &ka_ping_interval},
{"destination", PARAM_STRING | USE_FUNC_PARAM,
(void *)ka_mod_add_destination},
{"ping_from", PARAM_STR, &ka_ping_from},
{"delete_counter", PARAM_INT, &ka_counter_del}, {0, 0, 0}};
{"ping_interval", PARAM_INT, &ka_ping_interval},
{"destination", PARAM_STRING | USE_FUNC_PARAM,
(void *)ka_mod_add_destination},
{"ping_from", PARAM_STR, &ka_ping_from},
{"delete_counter", PARAM_INT, &ka_counter_del},
{0, 0, 0}
};


/** module exports */
struct module_exports exports = {
"keepalive", /* module name */
DEFAULT_DLFLAGS, /* dlopen flags */
cmds, /* cmd (cfg function) exports */
params, /* param exports */
0, /* RPC method exports */
0, /* pseudo-variables exports */
0, /* response handling function */
mod_init, /* module init function */
0, /* per-child init function */
mod_destroy /* module destroy function */
"keepalive", /* module name */
DEFAULT_DLFLAGS, /* dlopen flags */
cmds, /* cmd (cfg function) exports */
params, /* param exports */
0, /* RPC method exports */
0, /* pseudo-variables exports */
0, /* response handling function */
mod_init, /* module init function */
0, /* per-child init function */
mod_destroy /* module destroy function */
};
/* clang-format on */


/**
Expand Down

0 comments on commit dd221a6

Please sign in to comment.