1 /*
2  *
3  *  Copyright (C) 1994-2010, OFFIS e.V.
4  *  All rights reserved.  See COPYRIGHT file for details.
5  *
6  *  This software and supporting documentation were partly developed by
7  *
8  *    OFFIS e.V.
9  *    R&D Division Health
10  *    Escherweg 2
11  *    D-26121 Oldenburg, Germany
12  *
13  *  For further copyrights, see the following paragraphs.
14  *
15  */
16 
17 /*
18           Copyright (C) 1993, 1994, RSNA and Washington University
19 
20           The software and supporting documentation for the Radiological
21           Society of North America (RSNA) 1993, 1994 Digital Imaging and
22           Communications in Medicine (DICOM) Demonstration were developed
23           at the
24                   Electronic Radiology Laboratory
25                   Mallinckrodt Institute of Radiology
26                   Washington University School of Medicine
27                   510 S. Kingshighway Blvd.
28                   St. Louis, MO 63110
29           as part of the 1993, 1994 DICOM Central Test Node project for, and
30           under contract with, the Radiological Society of North America.
31 
32           THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER RSNA NOR
33           WASHINGTON UNIVERSITY MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS
34           PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
35           USE, FREEDOM FROM ANY COMPUTER DISEASES OR ITS CONFORMITY TO ANY
36           SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF
37           THE SOFTWARE IS WITH THE USER.
38 
39           Copyright of the software and supporting documentation is
40           jointly owned by RSNA and Washington University, and free access
41           is hereby granted as a license to use this software, copy this
42           software and prepare derivative works based upon this software.
43           However, any distribution of this software source code or
44           supporting documentation or derivative works (source code and
45           supporting documentation) must include the three paragraphs of
46           the copyright notice.
47 */
48 
49 /*
50 **          DICOM 93
51 **        Electronic Radiology Laboratory
52 **      Mallinckrodt Institute of Radiology
53 **    Washington University School of Medicine
54 **
55 ** Module Name(s):
56 ** Author, Date:  Stephen M. Moore, 11-May-92
57 ** Intent:        This module defines structures and constants needed
58 **                to implement the DICOM Upper Layer state machine.
59 */
60 
61 #ifndef DULFSM_H
62 #define DULFSM_H
63 
64 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
65 
66 #define	A_ASSOCIATE_REQ_LOCAL_USER	0
67 #define	TRANS_CONN_CONFIRM_LOCAL_USER	1
68 #define	A_ASSOCIATE_AC_PDU_RCV		2
69 #define	A_ASSOCIATE_RJ_PDU_RCV		3
70 #define	TRANS_CONN_INDICATION		4
71 #define	A_ASSOCIATE_RQ_PDU_RCV		5
72 #define	A_ASSOCIATE_RESPONSE_ACCEPT	6
73 #define	A_ASSOCIATE_RESPONSE_REJECT	7
74 #define	P_DATA_REQ			8
75 #define	P_DATA_TF_PDU_RCV		9
76 #define	A_RELEASE_REQ			10
77 #define	A_RELEASE_RQ_PDU_RCV		11
78 #define	A_RELEASE_RP_PDU_RCV		12
79 #define	A_RELEASE_RESP			13
80 #define	A_ABORT_REQ			14
81 #define	A_ABORT_PDU_RCV			15
82 #define	TRANS_CONN_CLOSED		16
83 #define	ARTIM_TIMER_EXPIRED		17
84 #define	INVALID_PDU 			18
85 #define DUL_NUMBER_OF_EVENTS		19
86 
87 #define	NOSTATE		-1
88 #define	STATE1		1
89 #define	STATE2		2
90 #define	STATE3		3
91 #define	STATE4		4
92 #define	STATE5		5
93 #define	STATE6		6
94 #define	STATE7		7
95 #define	STATE8		8
96 #define	STATE9		9
97 #define	STATE10		10
98 #define	STATE11		11
99 #define	STATE12		12
100 #define	STATE13		13
101 #define	DUL_NUMBER_OF_STATES		13
102 
103 typedef enum {
104     AE_1, AE_2, AE_3, AE_4, AE_5, AE_6, AE_7, AE_8,
105     DT_1, DT_2,
106     AA_1, AA_2, AA_2T, AA_3, AA_4, AA_5, AA_6, AA_7, AA_8,
107     AR_1, AR_2, AR_3, AR_4, AR_5, AR_6, AR_7, AR_8, AR_9, AR_10,
108     NOACTION
109 }   DUL_FSM_ACTION;
110 
111 typedef struct {
112     int event;
113     const char *eventName;
114 }   FSM_Event_Description;
115 
116 typedef struct {
117     DUL_FSM_ACTION action;
118     OFCondition (*actionFunction)(PRIVATE_NETWORKKEY **network,
119 				PRIVATE_ASSOCIATIONKEY **association,
120 				int nextState, void *params);
121     char actionName[64];
122 }   FSM_FUNCTION;
123 
124 typedef struct {
125     int event;
126     int state;
127     DUL_FSM_ACTION action;
128     int nextState;
129     char eventName[64];
130     char actionName[64];
131     OFCondition (*actionFunction)(PRIVATE_NETWORKKEY **network,
132 				PRIVATE_ASSOCIATIONKEY **association,
133 				int nextState, void *params);
134 
135 }   FSM_ENTRY;
136 
137 #endif
138