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 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
|
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
/*
* This file is the implementation of the ULTransitionTable class, including
* the actual event handling as well as the construction of the table itself.
*/
#include "gdcmULTransitionTable.h"
#include "gdcmULActionAA.h"
#include "gdcmULActionAE.h"
#include "gdcmULActionAR.h"
#include "gdcmULActionDT.h"
namespace gdcm
{
namespace network
{
//construct the table
ULTransitionTable::ULTransitionTable()
{
//row 1
// A-ASSOCIATE Request (local user)
mTable[eAASSOCIATERequestLocalUser].transitions[GetStateIndex(eSta1Idle)] =
Transition::MakeNew(eSta4LocalAssocDone, new ULActionAE1());
//row 2
// Transport Conn. Confirmn (local transport service)
mTable[eTransportConnConfirmLocal].transitions[GetStateIndex(eSta4LocalAssocDone)] =
Transition::MakeNew(eSta5WaitRemoteAssoc, new ULActionAE2());
//row 3
// A-ASSOCIATE-AC PDU (received on transport connection)
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta2Open)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta5WaitRemoteAssoc)] =
Transition::MakeNew(eSta6TransferReady, new ULActionAE3());
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta7WaitRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta10ReleaseCollisionAc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta11ReleaseCollisionRq)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_ACPDUreceived].transitions[GetStateIndex(eSta13AwaitingClose)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA6());
//row 4
// A-ASSOCIATE-RJ PDU (received on transport connection)
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta2Open)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta5WaitRemoteAssoc)] =
Transition::MakeNew(eSta1Idle, new ULActionAE4());
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta7WaitRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta10ReleaseCollisionAc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta11ReleaseCollisionRq)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eASSOCIATE_RJPDUreceived].transitions[GetStateIndex(eSta13AwaitingClose)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA6());
//row 5
// Transport Connection Indication (local transport service)
mTable[eTransportConnIndicLocal].transitions[GetStateIndex(eSta1Idle)] =
Transition::MakeNew(eSta2Open, new ULActionAE5());
//row 6
// A-ASSOCIATE-RQ PDU (received on transport connection)
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta2Open)] =
Transition::MakeNew(eSta3WaitLocalAssoc | eSta13AwaitingClose, new ULActionAE6());
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta5WaitRemoteAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta7WaitRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta10ReleaseCollisionAc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta11ReleaseCollisionRq)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eAASSOCIATE_RQPDUreceived].transitions[GetStateIndex(eSta13AwaitingClose)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA7());
//row 7
// A-ASSOCIATE response primitive (accept)
mTable[eAASSOCIATEresponseAccept].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta7WaitRelease, new ULActionAE7());
//row 8
// A-ASSOCIATE response primitive (reject)
mTable[eAASSOCIATEresponseReject].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta7WaitRelease, new ULActionAE7());
//Row 9
// P-DATA request primitive
mTable[ePDATArequest].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta6TransferReady, new ULActionDT1());
mTable[ePDATArequest].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta8WaitLocalRelease, new ULActionAR7());
//row 10
// P-DATA-TF PDU
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta2Open)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta5WaitRemoteAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta6TransferReady, new ULActionDT2());
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta7WaitRelease)] =
Transition::MakeNew(eSta7WaitRelease, new ULActionAR6());
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta10ReleaseCollisionAc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta11ReleaseCollisionRq)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[ePDATATFPDU].transitions[GetStateIndex(eSta13AwaitingClose)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA6());
//row 11
// A-RELEASE Request primitive
mTable[eARELEASERequest].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta7WaitRelease, new ULActionAR1());
//row 12
// A-RELEASE-RQ PDU (received on open transport connection)
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta2Open)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta5WaitRemoteAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta8WaitLocalRelease, new ULActionAR2());
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta7WaitRelease)] =
Transition::MakeNew(eSta9ReleaseCollisionRqLocal | eSta10ReleaseCollisionAc, new ULActionAR8());
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta10ReleaseCollisionAc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta11ReleaseCollisionRq)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RQPDUReceivedOpen].transitions[GetStateIndex(eSta13AwaitingClose)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA6());
//row 13
// A-RELEASE-RP PDU (received on transport connection)
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta2Open)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta5WaitRemoteAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta7WaitRelease)] =
Transition::MakeNew(eSta1Idle, new ULActionAR3());
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta10ReleaseCollisionAc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta11ReleaseCollisionRq)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eARELEASE_RPPDUReceived].transitions[GetStateIndex(eSta13AwaitingClose)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA6());
// Row 14
// A-RELEASE Response primitive
mTable[eARELEASEResponse].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAR4());
mTable[eARELEASEResponse].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta11ReleaseCollisionRq, new ULActionAR9);
mTable[eARELEASEResponse].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAR4());
// row 15
// A-ABORT Request primitive
mTable[eAABORTRequest].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eAABORTRequest].transitions[GetStateIndex(eSta4LocalAssocDone)] =
Transition::MakeNew(eSta1Idle, new ULActionAA2());
mTable[eAABORTRequest].transitions[GetStateIndex(eSta5WaitRemoteAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eAABORTRequest].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eAABORTRequest].transitions[GetStateIndex(eSta7WaitRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eAABORTRequest].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eAABORTRequest].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eAABORTRequest].transitions[GetStateIndex(eSta10ReleaseCollisionAc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eAABORTRequest].transitions[GetStateIndex(eSta11ReleaseCollisionRq)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eAABORTRequest].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
// row 16
// A-ABORT PDU (received on open transport connection)
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta2Open)] =
Transition::MakeNew(eSta1Idle, new ULActionAA2());
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta1Idle, new ULActionAA3());
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta5WaitRemoteAssoc)] =
Transition::MakeNew(eSta1Idle, new ULActionAA3());
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta1Idle, new ULActionAA3());
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta7WaitRelease)] =
Transition::MakeNew(eSta1Idle, new ULActionAA3());
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta1Idle, new ULActionAA3());
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta1Idle, new ULActionAA3());
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta10ReleaseCollisionAc)] =
Transition::MakeNew(eSta1Idle, new ULActionAA3());
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta11ReleaseCollisionRq)] =
Transition::MakeNew(eSta1Idle, new ULActionAA3());
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta1Idle, new ULActionAA3());
mTable[eAABORTPDUReceivedOpen].transitions[GetStateIndex(eSta13AwaitingClose)] =
Transition::MakeNew(eSta1Idle, new ULActionAA2());
//row 17
// Transport connection closed indication (local transport service),
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta2Open)] =
Transition::MakeNew(eSta1Idle, new ULActionAA5());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta1Idle, new ULActionAA4());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta4LocalAssocDone)] =
Transition::MakeNew(eSta1Idle, new ULActionAA4());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta5WaitRemoteAssoc)] =
Transition::MakeNew(eSta1Idle, new ULActionAA4());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta1Idle, new ULActionAA4());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta7WaitRelease)] =
Transition::MakeNew(eSta1Idle, new ULActionAA4());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta1Idle, new ULActionAA4());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta1Idle, new ULActionAA4());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta10ReleaseCollisionAc)] =
Transition::MakeNew(eSta1Idle, new ULActionAA4());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta11ReleaseCollisionRq)] =
Transition::MakeNew(eSta1Idle, new ULActionAA4());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta1Idle, new ULActionAA4());
mTable[eTransportConnectionClosed].transitions[GetStateIndex(eSta13AwaitingClose)] =
Transition::MakeNew(eSta1Idle, new ULActionAA5());
//row 18
// ARTIM timer expired (Association reject/release timer),
mTable[eARTIMTimerExpired].transitions[GetStateIndex(eSta2Open)] =
Transition::MakeNew(eSta1Idle, new ULActionAA2());
mTable[eARTIMTimerExpired].transitions[GetStateIndex(eSta13AwaitingClose)] =
Transition::MakeNew(eSta1Idle, new ULActionAA2());
//row 19
// Unrecognized or invalid PDU received
mTable[eUnrecognizedPDUReceived].transitions[GetStateIndex(eSta3WaitLocalAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA1());
mTable[eUnrecognizedPDUReceived].transitions[GetStateIndex(eSta13AwaitingClose)] =
Transition::MakeNew(eSta1Idle, new ULActionAA8());
mTable[eUnrecognizedPDUReceived].transitions[GetStateIndex(eSta5WaitRemoteAssoc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eUnrecognizedPDUReceived].transitions[GetStateIndex(eSta6TransferReady)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eUnrecognizedPDUReceived].transitions[GetStateIndex(eSta7WaitRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eUnrecognizedPDUReceived].transitions[GetStateIndex(eSta8WaitLocalRelease)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eUnrecognizedPDUReceived].transitions[GetStateIndex(eSta9ReleaseCollisionRqLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eUnrecognizedPDUReceived].transitions[GetStateIndex(eSta10ReleaseCollisionAc)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eUnrecognizedPDUReceived].transitions[GetStateIndex(eSta11ReleaseCollisionRq)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA8());
mTable[eUnrecognizedPDUReceived].transitions[GetStateIndex(eSta12ReleaseCollisionAcLocal)] =
Transition::MakeNew(eSta13AwaitingClose, new ULActionAA7());
}
//given the event and the state of the connection, call the appropriate action
void ULTransitionTable::HandleEvent(Subject *s, ULEvent& inEvent, ULConnection& inConnection,
bool& outWaitingForEvent, EEventID& outRaisedEvent) const{
//first, find the Event
EEventID eventID = inEvent.GetEvent();
if (eventID < eEventDoesNotExist)
{ //make sure that the event exists
//have to convert the state ID into an index
int stateIndex = GetStateIndex(inConnection.GetState());
if (stateIndex >= 0 && stateIndex < cMaxStateID)
{
if ( mTable[eventID].transitions[stateIndex] )
{
if (mTable[eventID].transitions[stateIndex]->mAction != nullptr)
{
gdcmDebugMacro( "Process: Event:" << (int)eventID << ", State:" << stateIndex );
inConnection.SetState(mTable[eventID].transitions[stateIndex]->mAction->
PerformAction(s,inEvent, inConnection, outWaitingForEvent, outRaisedEvent));
}
}
else
{
gdcmDebugMacro( "Transition failed (NULL) for event:" << (int)eventID << ", State:" << stateIndex );
}
}
}
}
} // end namespace network
} // end namespace gdcm
|