xua_as_fsm: ignore ASP_DOWN in AS-PENDING and fix state list generation

This commit is contained in:
Harald Welte 2012-05-09 00:02:59 +02:00
parent eb61885c35
commit 312a1eb1ae
2 changed files with 18 additions and 3 deletions

View File

@ -197,6 +197,9 @@ as_pending(#primitive{subsystem = 'ASPAS', gen_name = 'ASP_INACTIVE',
% FIXME: do we need to re-check as_pending state if we get ASP_DOWN of the last
% inactive ASP ?
as_pending(#primitive{subsystem = 'ASPAS', gen_name = 'ASP_DOWN',
spec_name = indication, parameters = _Params}, LoopDat) ->
next_state(as_pending, LoopDat);
as_pending({timer_expired, t_r}, LoopDat) ->
% check if there is at least one ASP in ASP-INACTIVE -> AS-INACTIVE
@ -240,5 +243,4 @@ check_any_other_asp_in_state(State, LoopDat, AspPid) ->
lists:member(State, StateList).
build_asp_state_list(ListOfPids) ->
% FIXME
[].
[xua_asp_fsm:get_state(X) || X <- ListOfPids].

View File

@ -39,7 +39,8 @@
-include("m3ua.hrl").
% gen_fsm exports
-export([init/1, terminate/3, code_change/4, handle_event/3, handle_info/3]).
-export([init/1, terminate/3, code_change/4, handle_event/3, handle_info/3,
handle_sync_event/4]).
% states in this FSM
-export([asp_down/2, asp_inactive/2, asp_active/2]).
@ -47,6 +48,9 @@
% helper functions exporte to callback modules
-export([send_sctp_to_peer/2, send_prim_to_user/2]).
% global exports
-export([get_state/1]).
-export([behaviour_info/1]).
behaviour_info(callbacks) ->
@ -98,6 +102,15 @@ handle_info(Info, State, LoopDat) ->
io:format("Unknown Info ~p in state ~p~n", [Info, State]),
{next_state, State, LoopDat}.
handle_sync_event(get_state, _From, StateName, LoopDat) ->
{reply, state2aspas(StateName), StateName, LoopDat}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% exports
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
get_state(Pid) ->
gen_fsm:sync_send_all_state_event(Pid, get_state).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% STATE "asp_down"