-
Notifications
You must be signed in to change notification settings - Fork 1
/
pa_lap.sm
114 lines (91 loc) · 1.84 KB
/
pa_lap.sm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//
// Author: Markus Stenberg <[email protected]>
//
// Copyright (c) 2012 cisco Systems, Inc.
//
// This is 'locally assigned prefix' state machine.
// It receives 3 types of events:
// Assign()
// => do_assign => Assigned/AssignFailed
// .. also stop_assign, if async
// Unassign()
// => do_unassign => Unassigned/UnassignFailed
// .. also stop_unassign, if async
// Depracate()
// => do_depracate => Depracated/DepracateFailed
// .. also stop_depracate, if async
// Based on the prefix assignment code's adventures.
// Internally, there's third one -
// Timeout()
%start LAP::Init
%class LAP
%map LAP
%%
// We ignore transitions not defined here (for example, multi-Assign
// is perfectly valid)
Default
{
Error (s: String) Error { error(s); }
UnInit FinishedNoState {}
Default nil {}
}
Init
{
Assign Assigning {}
}
Assigning
Entry { do_assign(); }
{
Done Live {}
// handle other 2 commands if this one is async
Unassign Unassigning { stop_assign(); }
Depracate Depracating { stop_assign(); }
}
Unassigning
Entry { do_unassign(); }
{
Done Standby {}
// handle other 2 commands if this one is async
Assign Assigning { stop_unassign(); }
Depracate Depracating { stop_unassign(); }
}
Depracating
Entry { do_depracate(); }
{
Done Zombie {}
// handle other 2 commands if this one is async
Assign Assigning { stop_depracate(); }
Unassign Unassigning { stop_depracate(); }
}
Live
{
Unassign Unassigning {}
Depracate Depracating {}
}
Standby
Entry { start_depracate_timeout(); }
Exit { stop_depracate_timeout(); }
{
Assign Assigning {}
Timeout Depracating {}
Depracate Depracating {}
}
Zombie
Entry { start_expire_timeout(); }
Exit { stop_expire_timeout(); }
{
Assign Assigning {}
Timeout Finish {}
}
Error
Entry { done(); }
{
}
Finish
Entry { done(); }
{
}
FinishedNoState
{
}
%%