blob: 4cb55b508a614eba3e4b135e701b720b2025cf55 (
plain)
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
@startuml
title requestLease4 algorithm (Kea 1.8.0)
start
:get lease for the client;
if (reserved address) then (yes)
if (requested address) then (no)
:requested address = reserved address;
else (yes)
if (requested address is reserved for another client) then (yes)
:return no lease;
stop
else (no)
endif
endif
if (lease for requested address) then (yes)
if (active and owned by another client) then (yes)
:return no lease;
stop
else (no)
endif
else (no)
endif
if (requested address == reserved address) then (no)
if (lease for requested address) then (yes)
if (active) then (yes)
:return no lease;
stop
else (no)
endif
else (no)
endif
if (requested address in allowed pool) then (no)
:return no lease;
stop
else (yes)
endif
else (yes)
endif
else (no)
if (requested address) then (yes)
if (requested address is reserved for another client) then (yes)
:return no lease;
stop
else (no)
endif
if (lease for requested address) then (yes)
if (active and owned by another client) then (yes)
:return no lease;
stop
else (no)
endif
else (no)
endif
if (requested address in allowed pool) then (no)
:return no lease;
stop
else (yes)
endif
else (no)
if (client lease and lease address in allowed pool) then (no)
while (iterate over pools and subnets)
:pick candidate address;
if (candidate is reserved for another client) then (no)
if (candidate is used by another thread) then (no)
if (lease for candidate) then (no)
:create and return new lease;
stop
else (yes)
if (expired) then (yes)
:reclaim expired lease;
:update lease information;
:callout lease4_select;
if (callout return) then (SKIP)
:return no lease;
stop
else (CONTINUE)
:update lease;
:return reused lease;
stop
endif
else (no)
endif
endif
else (yes)
endif
else (yes)
endif
endwhile
:maximum attempts;
:return no lease;
stop
else (yes)
endif
endif
endif
' after check
if (client lease) then (yes)
if (no requested address or requested address == client lease address) then (yes)
if (has reserved address or client lease address in allowed pool) then (yes)
:update lease information;
if (old lease expired) then (yes)
:reclaim expired lease;
else (no)
endif
:callout lease4_renew;
if (callout return) then (SKIP)
:return old client lease;
stop
else (CONTINUE)
:update lease;
:return renewed client lease;
stop
endif
else (no)
endif
else (no)
endif
else (no)
endif
:get lease for requested address;
if (requested lease) then (yes)
if (expired) then (no)
:return no lease;
stop
else (yes)
:reclaim expired lease;
:update lease information;
:callout lease4_select;
if (callout return) then (SKIP)
:return no lease;
stop
else (CONTINUE)
:update lease;
:return reused lease;
stop
endif
endif
else (no)
:create and return new lease;
stop
endif
@enduml
|