Skip to content

Commit

Permalink
nat_traversal: port script functions to new param interface
Browse files Browse the repository at this point in the history
  • Loading branch information
rvlad-patrascu authored and liviuchircu committed Apr 4, 2019
1 parent 156994b commit 510bc85
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions modules/nat_traversal/nat_traversal.c
Expand Up @@ -40,7 +40,6 @@
#include "../../timer.h"
#include "../../resolve.h"
#include "../../data_lump.h"
#include "../../mod_fix.h"
#include "../../script_cb.h"
#include "../../sl_cb.h"
#include "../../parser/msg_parser.h"
Expand Down Expand Up @@ -173,7 +172,7 @@ typedef struct Keepalive_Params {
//
static int NAT_Keepalive(struct sip_msg *msg);
static int FixContact(struct sip_msg *msg);
static int ClientNatTest(struct sip_msg *msg, unsigned int *tests);
static int ClientNatTest(struct sip_msg *msg, int *tests);

static Bool test_private_contact(struct sip_msg *msg);
static Bool test_source_address(struct sip_msg *msg);
Expand Down Expand Up @@ -233,11 +232,22 @@ static NatTest NAT_Tests[] = {
};


// static cmd_export_t commands[] = {
// {"nat_keepalive", (cmd_function)NAT_Keepalive, 0, NULL, 0, REQUEST_ROUTE},
// {"fix_contact", (cmd_function)FixContact, 0, NULL, 0, REQUEST_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE},
// {"client_nat_test", (cmd_function)ClientNatTest, 1, fixup_uint_null, 0, REQUEST_ROUTE | ONREPLY_ROUTE | FAILURE_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE},
// {0, 0, 0, 0, 0, 0}
// };

static cmd_export_t commands[] = {
{"nat_keepalive", (cmd_function)NAT_Keepalive, 0, NULL, 0, REQUEST_ROUTE},
{"fix_contact", (cmd_function)FixContact, 0, NULL, 0, REQUEST_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE},
{"client_nat_test", (cmd_function)ClientNatTest, 1, fixup_uint_null, 0, REQUEST_ROUTE | ONREPLY_ROUTE | FAILURE_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE},
{0, 0, 0, 0, 0, 0}
{"nat_keepalive", (cmd_function)NAT_Keepalive, {{0,0,0}},
REQUEST_ROUTE},
{"fix_contact", (cmd_function)FixContact, {{0,0,0}},
REQUEST_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE},
{"client_nat_test", (cmd_function)ClientNatTest, {
{CMD_PARAM_INT,0,0}, {0,0,0}},
REQUEST_ROUTE | ONREPLY_ROUTE | FAILURE_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE},
{0,0,{{0,0,0}},0}
};

static param_export_t parameters[] = {
Expand Down Expand Up @@ -1553,7 +1563,7 @@ FixContact(struct sip_msg *msg)


static int
ClientNatTest(struct sip_msg *msg, unsigned int *tests)
ClientNatTest(struct sip_msg *msg, int *tests)
{
int i;

Expand Down

0 comments on commit 510bc85

Please sign in to comment.