Skip to content

Commit

Permalink
statsc: exported functions to kemi interface
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed May 3, 2017
1 parent fedaceb commit 8577eb1
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion src/modules/statsc/statsc_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "../../core/timer_proc.h"
#include "../../core/rpc.h"
#include "../../core/rpc_lookup.h"
#include "../../core/kemi.h"

#include "../../core/parser/parse_param.h"

Expand Down Expand Up @@ -119,11 +120,20 @@ static void mod_destroy(void)
/**
*
*/
static int w_statsc_reset(sip_msg_t* msg, char* p1, char* p2)
static int ki_statsc_reset(sip_msg_t* msg)
{
LM_ERR("not implemented yet\n");
return 1;
}

/**
*
*/
static int w_statsc_reset(sip_msg_t* msg, char* p1, char* p2)
{
return ki_statsc_reset(msg);
}

typedef int (*statsc_func_t)(void *p, int64_t *res);

typedef struct statsc_nmap {
Expand Down Expand Up @@ -473,3 +483,26 @@ int statsc_init_rpc(void)
return 0;
}

/**
*
*/
/* clang-format off */
static sr_kemi_t sr_kemi_statsc_exports[] = {
{ str_init("statsc"), str_init("statsc_reset"),
SR_KEMIP_INT, ki_statsc_reset,
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},

{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
};
/* clang-format on */

/**
*
*/
int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
sr_kemi_modules_add(sr_kemi_statsc_exports);
return 0;
}

0 comments on commit 8577eb1

Please sign in to comment.