summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-05-30 12:06:21 +0200
committerHarald Welte <laforge@gnumonks.org>2012-05-30 12:06:21 +0200
commiteef6ce439727436febc67692c145e07847cc4c89 (patch)
tree80ae9ad782a6d7c02a6db743401aa44e9e6299c5
parente58b38f7a87b4d9e58cbc259ffd396d28a0da9f5 (diff)
add xua_asp_test module to repository (was in my local tree only)
-rw-r--r--src/xua_asp_test.erl32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/xua_asp_test.erl b/src/xua_asp_test.erl
new file mode 100644
index 0000000..7347afe
--- /dev/null
+++ b/src/xua_asp_test.erl
@@ -0,0 +1,32 @@
+
+-module(xua_asp_test).
+
+-include("osmo_util.hrl").
+-include("m3ua.hrl").
+
+-export([start/0, create_asp/0]).
+-export([asp_up_ack/1, asp_active_ack/1, asp_inactive_ack/1, asp_down_ack/1]).
+
+start() ->
+ sg_as_sup:start_link("foo", [{debug, [trace]}]).
+
+create_asp() ->
+ Fun = fun(Prim, Args) -> asp_prim_to_user(Prim, Args) end,
+ AspArgs = [sua_asp, [], Fun, [], self()],
+ xua_as_fsm:create_asp("foo", AspArgs).
+
+asp_up_ack(Pid) ->
+ gen_fsm:send_event(Pid, {xua_msg, ?M3UA_MSGC_ASPSM, ?M3UA_MSGT_ASPSM_ASPUP_ACK}).
+
+asp_active_ack(Pid) ->
+ gen_fsm:send_event(Pid, {xua_msg,?M3UA_MSGC_ASPTM, ?M3UA_MSGT_ASPTM_ASPAC_ACK}).
+
+asp_inactive_ack(Pid) ->
+ gen_fsm:send_event(Pid, {xua_msg, ?M3UA_MSGC_ASPTM, ?M3UA_MSGT_ASPTM_ASPIA_ACK}).
+
+asp_down_ack(Pid) ->
+ gen_fsm:send_event(Pid, {xua_msg, ?M3UA_MSGC_ASPSM, ?M3UA_MSGT_ASPSM_ASPDN_ACK}).
+
+
+asp_prim_to_user(Prim, _Args) ->
+ io:format("ASP->SCTP: ~p~n", [Prim]).