summaryrefslogtreecommitdiffstats
path: root/src/tcap_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tcap_test.c')
-rw-r--r--src/tcap_test.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/tcap_test.c b/src/tcap_test.c
index 86a8d96..5f94f48 100644
--- a/src/tcap_test.c
+++ b/src/tcap_test.c
@@ -111,7 +111,7 @@ static int send_begin(uint32_t dialg_id, struct tcap_obj_ident *app_ctx)
return tcap_user_req_dialg(TCAP_PR_TC_BEGIN, &tcdi);
}
-int tcap_user_ind_dialg(enum tcap_primitive prim, struct tcap_dialg_ind *tcdi)
+static int tcap_user_ind_dialg(enum tcap_primitive prim, struct tcap_dialg_ind *tcdi)
{
printf("-> USER_IND_DIALG(%s): ", tcap_prim_name(prim));
@@ -127,19 +127,15 @@ int tcap_user_ind_dialg(enum tcap_primitive prim, struct tcap_dialg_ind *tcdi)
printf("\n");
- talloc_free(tcdi);
-
return 0;
}
-int tcap_user_ind_comp(enum tcap_primitive prim, struct tcap_component_ind *tcci)
+static int tcap_user_ind_comp(enum tcap_primitive prim, struct tcap_component_ind *tcci)
{
printf("-> USER_IND_COMP(%s)\n", tcap_prim_name(prim));
- if (!test_state.begin_rcvd) {
- talloc_free(tcci);
+ if (!test_state.begin_rcvd)
return -1;
- }
switch (prim) {
case TCAP_PR_TC_INVOKE:
@@ -152,11 +148,21 @@ int tcap_user_ind_comp(enum tcap_primitive prim, struct tcap_component_ind *tcci
break;
}
- talloc_free(tcci);
-
return 0;
}
+int tcap_user_ind_cb(struct tcap_prim_buf *tcpb)
+{
+ int rc;
+
+ if (tcpb->prim > _TCAP_PR_COMP_BASE)
+ rc = tcap_user_ind_comp(tcpb->prim, &tcpb->comp);
+ else
+ rc = tcap_user_ind_dialg(tcpb->prim, &tcpb->dialg);
+
+ talloc_free(tcpb);
+}
+
static void signal_handler(int signal)
{
switch (signal) {