Mercurial > hg > orthanc
annotate OrthancServer/Internals/CommandDispatcher.cpp @ 1400:1c8df4424437
install plugin SDK
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 01 Jun 2015 14:05:35 +0200 |
parents | 6e7e5ed91c2d |
children | f967bdf8534e |
rev | line source |
---|---|
0 | 1 /** |
62 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1164
diff
changeset
|
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics |
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1164
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
0 | 5 * |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
136 | 10 * |
11 * In addition, as a special exception, the copyright holders of this | |
12 * program give permission to link the code of its release with the | |
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
14 * that use the same license as the "OpenSSL" library), and distribute | |
15 * the linked executables. You must obey the GNU General Public License | |
16 * in all respects for all of the code used other than "OpenSSL". If you | |
17 * modify file(s) with this exception, you may extend this exception to | |
18 * your version of the file(s), but you are not obligated to do so. If | |
19 * you do not wish to do so, delete this exception statement from your | |
20 * version. If you delete this exception statement from all source files | |
21 * in the program, then also delete it here. | |
0 | 22 * |
23 * This program is distributed in the hope that it will be useful, but | |
24 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
26 * General Public License for more details. | |
27 * | |
28 * You should have received a copy of the GNU General Public License | |
29 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
30 **/ | |
31 | |
32 | |
766
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
33 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
34 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
35 /*========================================================================= |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
36 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
37 This file is based on portions of the following project: |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
38 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
39 Program: DCMTK 3.6.0 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
40 Module: http://dicom.offis.de/dcmtk.php.en |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
41 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
42 Copyright (C) 1994-2011, OFFIS e.V. |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
43 All rights reserved. |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
44 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
45 This software and supporting documentation were developed by |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
46 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
47 OFFIS e.V. |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
48 R&D Division Health |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
49 Escherweg 2 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
50 26121 Oldenburg, Germany |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
51 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
52 Redistribution and use in source and binary forms, with or without |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
53 modification, are permitted provided that the following conditions |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
54 are met: |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
55 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
56 - Redistributions of source code must retain the above copyright |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
57 notice, this list of conditions and the following disclaimer. |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
58 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
59 - Redistributions in binary form must reproduce the above copyright |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
60 notice, this list of conditions and the following disclaimer in the |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
61 documentation and/or other materials provided with the distribution. |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
62 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
63 - Neither the name of OFFIS nor the names of its contributors may be |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
64 used to endorse or promote products derived from this software |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
65 without specific prior written permission. |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
66 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
67 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
68 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
69 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
70 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
71 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
72 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
73 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
74 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
75 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
76 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
77 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
78 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
79 =========================================================================*/ |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
80 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
81 |
831
84513f2ee1f3
pch for unit tests and server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
824
diff
changeset
|
82 #include "../PrecompiledHeadersServer.h" |
0 | 83 #include "CommandDispatcher.h" |
84 | |
85 #include "FindScp.h" | |
86 #include "StoreScp.h" | |
87 #include "MoveScp.h" | |
88 #include "../../Core/Toolbox.h" | |
89 | |
90 #include <dcmtk/dcmnet/dcasccfg.h> /* for class DcmAssociationConfiguration */ | |
101 | 91 #include <boost/lexical_cast.hpp> |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
92 #include <glog/logging.h> |
0 | 93 |
503 | 94 #define ORTHANC_PROMISCUOUS 1 |
95 | |
0 | 96 static OFBool opt_rejectWithoutImplementationUID = OFFalse; |
97 | |
98 | |
503 | 99 |
100 #if ORTHANC_PROMISCUOUS == 1 | |
101 static | |
102 DUL_PRESENTATIONCONTEXT * | |
103 findPresentationContextID(LST_HEAD * head, | |
104 T_ASC_PresentationContextID presentationContextID) | |
105 { | |
106 DUL_PRESENTATIONCONTEXT *pc; | |
107 LST_HEAD **l; | |
108 OFBool found = OFFalse; | |
109 | |
110 if (head == NULL) | |
111 return NULL; | |
112 | |
113 l = &head; | |
114 if (*l == NULL) | |
115 return NULL; | |
116 | |
117 pc = OFstatic_cast(DUL_PRESENTATIONCONTEXT *, LST_Head(l)); | |
118 (void)LST_Position(l, OFstatic_cast(LST_NODE *, pc)); | |
119 | |
120 while (pc && !found) { | |
121 if (pc->presentationContextID == presentationContextID) { | |
122 found = OFTrue; | |
123 } else { | |
124 pc = OFstatic_cast(DUL_PRESENTATIONCONTEXT *, LST_Next(l)); | |
125 } | |
126 } | |
127 return pc; | |
128 } | |
129 | |
130 | |
131 /** accept all presenstation contexts for unknown SOP classes, | |
132 * i.e. UIDs appearing in the list of abstract syntaxes | |
133 * where no corresponding name is defined in the UID dictionary. | |
134 * @param params pointer to association parameters structure | |
135 * @param transferSyntax transfer syntax to accept | |
136 * @param acceptedRole SCU/SCP role to accept | |
137 */ | |
138 static OFCondition acceptUnknownContextsWithTransferSyntax( | |
139 T_ASC_Parameters * params, | |
140 const char* transferSyntax, | |
141 T_ASC_SC_ROLE acceptedRole) | |
142 { | |
143 OFCondition cond = EC_Normal; | |
144 int n, i, k; | |
145 DUL_PRESENTATIONCONTEXT *dpc; | |
146 T_ASC_PresentationContext pc; | |
147 OFBool accepted = OFFalse; | |
148 OFBool abstractOK = OFFalse; | |
149 | |
150 n = ASC_countPresentationContexts(params); | |
151 for (i = 0; i < n; i++) | |
152 { | |
153 cond = ASC_getPresentationContext(params, i, &pc); | |
154 if (cond.bad()) return cond; | |
155 abstractOK = OFFalse; | |
156 accepted = OFFalse; | |
157 | |
158 if (dcmFindNameOfUID(pc.abstractSyntax) == NULL) | |
159 { | |
160 abstractOK = OFTrue; | |
161 | |
162 /* check the transfer syntax */ | |
163 for (k = 0; (k < OFstatic_cast(int, pc.transferSyntaxCount)) && !accepted; k++) | |
164 { | |
165 if (strcmp(pc.proposedTransferSyntaxes[k], transferSyntax) == 0) | |
166 { | |
167 accepted = OFTrue; | |
168 } | |
169 } | |
170 } | |
171 | |
172 if (accepted) | |
173 { | |
174 cond = ASC_acceptPresentationContext( | |
175 params, pc.presentationContextID, | |
176 transferSyntax, acceptedRole); | |
177 if (cond.bad()) return cond; | |
178 } else { | |
179 T_ASC_P_ResultReason reason; | |
180 | |
181 /* do not refuse if already accepted */ | |
182 dpc = findPresentationContextID(params->DULparams.acceptedPresentationContext, | |
183 pc.presentationContextID); | |
184 if ((dpc == NULL) || ((dpc != NULL) && (dpc->result != ASC_P_ACCEPTANCE))) | |
185 { | |
186 | |
187 if (abstractOK) { | |
188 reason = ASC_P_TRANSFERSYNTAXESNOTSUPPORTED; | |
189 } else { | |
190 reason = ASC_P_ABSTRACTSYNTAXNOTSUPPORTED; | |
191 } | |
192 /* | |
193 * If previously this presentation context was refused | |
194 * because of bad transfer syntax let it stay that way. | |
195 */ | |
196 if ((dpc != NULL) && (dpc->result == ASC_P_TRANSFERSYNTAXESNOTSUPPORTED)) | |
197 reason = ASC_P_TRANSFERSYNTAXESNOTSUPPORTED; | |
198 | |
199 cond = ASC_refusePresentationContext(params, pc.presentationContextID, reason); | |
200 if (cond.bad()) return cond; | |
201 } | |
202 } | |
203 } | |
204 return EC_Normal; | |
205 } | |
206 | |
207 | |
208 /** accept all presenstation contexts for unknown SOP classes, | |
209 * i.e. UIDs appearing in the list of abstract syntaxes | |
210 * where no corresponding name is defined in the UID dictionary. | |
211 * This method is passed a list of "preferred" transfer syntaxes. | |
212 * @param params pointer to association parameters structure | |
213 * @param transferSyntax transfer syntax to accept | |
214 * @param acceptedRole SCU/SCP role to accept | |
215 */ | |
216 static OFCondition acceptUnknownContextsWithPreferredTransferSyntaxes( | |
217 T_ASC_Parameters * params, | |
218 const char* transferSyntaxes[], int transferSyntaxCount, | |
219 T_ASC_SC_ROLE acceptedRole = ASC_SC_ROLE_DEFAULT) | |
220 { | |
221 OFCondition cond = EC_Normal; | |
222 /* | |
223 ** Accept in the order "least wanted" to "most wanted" transfer | |
224 ** syntax. Accepting a transfer syntax will override previously | |
225 ** accepted transfer syntaxes. | |
226 */ | |
227 for (int i = transferSyntaxCount - 1; i >= 0; i--) | |
228 { | |
229 cond = acceptUnknownContextsWithTransferSyntax(params, transferSyntaxes[i], acceptedRole); | |
230 if (cond.bad()) return cond; | |
231 } | |
232 return cond; | |
233 } | |
234 #endif | |
235 | |
236 | |
1073
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
237 |
62 | 238 namespace Orthanc |
0 | 239 { |
240 namespace Internals | |
241 { | |
1073
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
242 /** |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
243 * EXTRACT OF FILE "dcmdata/libsrc/dcuid.cc" FROM DCMTK 3.6.0 |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
244 * (dcmAllStorageSOPClassUIDs). |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
245 * |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
246 * an array of const strings containing all known Storage SOP |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
247 * Classes that fit into the conventional |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
248 * PATIENT-STUDY-SERIES-INSTANCE information model, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
249 * i.e. everything a Storage SCP might want to store in a PACS. |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
250 * Special cases such as hanging protocol storage or the Storage |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
251 * SOP Class are not included in this list. |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
252 * |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
253 * THIS LIST CONTAINS ALL STORAGE SOP CLASSES INCLUDING RETIRED |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
254 * ONES AND IS LARGER THAN 64 ENTRIES. |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
255 */ |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
256 |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
257 const char* orthancStorageSOPClassUIDs[] = |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
258 { |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
259 UID_AmbulatoryECGWaveformStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
260 UID_ArterialPulseWaveformStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
261 UID_AutorefractionMeasurementsStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
262 UID_BasicStructuredDisplayStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
263 UID_BasicTextSRStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
264 UID_BasicVoiceAudioWaveformStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
265 UID_BlendingSoftcopyPresentationStateStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
266 UID_BreastTomosynthesisImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
267 UID_CardiacElectrophysiologyWaveformStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
268 UID_ChestCADSRStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
269 UID_ColonCADSRStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
270 UID_ColorSoftcopyPresentationStateStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
271 UID_ComprehensiveSRStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
272 UID_ComputedRadiographyImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
273 UID_CTImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
274 UID_DeformableSpatialRegistrationStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
275 UID_DigitalIntraOralXRayImageStorageForPresentation, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
276 UID_DigitalIntraOralXRayImageStorageForProcessing, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
277 UID_DigitalMammographyXRayImageStorageForPresentation, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
278 UID_DigitalMammographyXRayImageStorageForProcessing, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
279 UID_DigitalXRayImageStorageForPresentation, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
280 UID_DigitalXRayImageStorageForProcessing, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
281 UID_EncapsulatedCDAStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
282 UID_EncapsulatedPDFStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
283 UID_EnhancedCTImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
284 UID_EnhancedMRColorImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
285 UID_EnhancedMRImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
286 UID_EnhancedPETImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
287 UID_EnhancedSRStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
288 UID_EnhancedUSVolumeStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
289 UID_EnhancedXAImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
290 UID_EnhancedXRFImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
291 UID_GeneralAudioWaveformStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
292 UID_GeneralECGWaveformStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
293 UID_GenericImplantTemplateStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
294 UID_GrayscaleSoftcopyPresentationStateStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
295 UID_HemodynamicWaveformStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
296 UID_ImplantAssemblyTemplateStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
297 UID_ImplantationPlanSRDocumentStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
298 UID_ImplantTemplateGroupStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
299 UID_IntraocularLensCalculationsStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
300 UID_KeratometryMeasurementsStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
301 UID_KeyObjectSelectionDocumentStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
302 UID_LensometryMeasurementsStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
303 UID_MacularGridThicknessAndVolumeReportStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
304 UID_MammographyCADSRStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
305 UID_MRImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
306 UID_MRSpectroscopyStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
307 UID_MultiframeGrayscaleByteSecondaryCaptureImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
308 UID_MultiframeGrayscaleWordSecondaryCaptureImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
309 UID_MultiframeSingleBitSecondaryCaptureImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
310 UID_MultiframeTrueColorSecondaryCaptureImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
311 UID_NuclearMedicineImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
312 UID_OphthalmicAxialMeasurementsStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
313 UID_OphthalmicPhotography16BitImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
314 UID_OphthalmicPhotography8BitImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
315 UID_OphthalmicTomographyImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
316 UID_OphthalmicVisualFieldStaticPerimetryMeasurementsStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
317 UID_PositronEmissionTomographyImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
318 UID_ProcedureLogStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
319 UID_PseudoColorSoftcopyPresentationStateStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
320 UID_RawDataStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
321 UID_RealWorldValueMappingStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
322 UID_RespiratoryWaveformStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
323 UID_RTBeamsTreatmentRecordStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
324 UID_RTBrachyTreatmentRecordStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
325 UID_RTDoseStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
326 UID_RTImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
327 UID_RTIonBeamsTreatmentRecordStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
328 UID_RTIonPlanStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
329 UID_RTPlanStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
330 UID_RTStructureSetStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
331 UID_RTTreatmentSummaryRecordStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
332 UID_SecondaryCaptureImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
333 UID_SegmentationStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
334 UID_SpatialFiducialsStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
335 UID_SpatialRegistrationStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
336 UID_SpectaclePrescriptionReportStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
337 UID_StereometricRelationshipStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
338 UID_SubjectiveRefractionMeasurementsStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
339 UID_SurfaceSegmentationStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
340 UID_TwelveLeadECGWaveformStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
341 UID_UltrasoundImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
342 UID_UltrasoundMultiframeImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
343 UID_VideoEndoscopicImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
344 UID_VideoMicroscopicImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
345 UID_VideoPhotographicImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
346 UID_VisualAcuityMeasurementsStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
347 UID_VLEndoscopicImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
348 UID_VLMicroscopicImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
349 UID_VLPhotographicImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
350 UID_VLSlideCoordinatesMicroscopicImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
351 UID_VLWholeSlideMicroscopyImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
352 UID_XAXRFGrayscaleSoftcopyPresentationStateStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
353 UID_XRay3DAngiographicImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
354 UID_XRay3DCraniofacialImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
355 UID_XRayAngiographicImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
356 UID_XRayRadiationDoseSRStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
357 UID_XRayRadiofluoroscopicImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
358 // retired |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
359 UID_RETIRED_HardcopyColorImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
360 UID_RETIRED_HardcopyGrayscaleImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
361 UID_RETIRED_NuclearMedicineImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
362 UID_RETIRED_StandaloneCurveStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
363 UID_RETIRED_StandaloneModalityLUTStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
364 UID_RETIRED_StandaloneOverlayStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
365 UID_RETIRED_StandalonePETCurveStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
366 UID_RETIRED_StandaloneVOILUTStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
367 UID_RETIRED_StoredPrintStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
368 UID_RETIRED_UltrasoundImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
369 UID_RETIRED_UltrasoundMultiframeImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
370 UID_RETIRED_VLImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
371 UID_RETIRED_VLMultiFrameImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
372 UID_RETIRED_XRayAngiographicBiPlaneImageStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
373 // draft |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
374 UID_DRAFT_SRAudioStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
375 UID_DRAFT_SRComprehensiveStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
376 UID_DRAFT_SRDetailStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
377 UID_DRAFT_SRTextStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
378 UID_DRAFT_WaveformStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
379 UID_DRAFT_RTBeamsDeliveryInstructionStorage, |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
380 NULL |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
381 }; |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
382 |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
383 const int orthancStorageSOPClassUIDsCount = (sizeof(orthancStorageSOPClassUIDs) / sizeof(const char*)) - 1; |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
384 |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
385 |
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
386 |
0 | 387 OFCondition AssociationCleanup(T_ASC_Association *assoc) |
388 { | |
389 OFString temp_str; | |
390 OFCondition cond = ASC_dropSCPAssociation(assoc); | |
391 if (cond.bad()) | |
392 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
393 LOG(FATAL) << cond.text(); |
0 | 394 return cond; |
395 } | |
396 | |
397 cond = ASC_destroyAssociation(&assoc); | |
398 if (cond.bad()) | |
399 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
400 LOG(FATAL) << cond.text(); |
0 | 401 return cond; |
402 } | |
403 | |
404 return cond; | |
405 } | |
406 | |
407 | |
408 | |
409 CommandDispatcher* AcceptAssociation(const DicomServer& server, T_ASC_Network *net) | |
410 { | |
411 DcmAssociationConfiguration asccfg; | |
412 char buf[BUFSIZ]; | |
413 T_ASC_Association *assoc; | |
414 OFCondition cond; | |
415 OFString sprofile; | |
416 OFString temp_str; | |
417 | |
418 std::vector<const char*> knownAbstractSyntaxes; | |
419 | |
420 // For C-STORE | |
421 if (server.HasStoreRequestHandlerFactory()) | |
422 { | |
423 knownAbstractSyntaxes.push_back(UID_VerificationSOPClass); | |
424 } | |
425 | |
426 // For C-FIND | |
427 if (server.HasFindRequestHandlerFactory()) | |
428 { | |
429 knownAbstractSyntaxes.push_back(UID_FINDPatientRootQueryRetrieveInformationModel); | |
430 knownAbstractSyntaxes.push_back(UID_FINDStudyRootQueryRetrieveInformationModel); | |
431 } | |
432 | |
433 // For C-MOVE | |
434 if (server.HasMoveRequestHandlerFactory()) | |
435 { | |
436 knownAbstractSyntaxes.push_back(UID_MOVEStudyRootQueryRetrieveInformationModel); | |
665 | 437 knownAbstractSyntaxes.push_back(UID_MOVEPatientRootQueryRetrieveInformationModel); |
0 | 438 } |
439 | |
440 cond = ASC_receiveAssociation(net, &assoc, | |
441 /*opt_maxPDU*/ ASC_DEFAULTMAXPDU, | |
442 NULL, NULL, | |
443 /*opt_secureConnection*/ OFFalse, | |
444 DUL_NOBLOCK, 1); | |
445 | |
446 if (cond == DUL_NOASSOCIATIONREQUEST) | |
447 { | |
448 // Timeout | |
449 AssociationCleanup(assoc); | |
450 return NULL; | |
451 } | |
452 | |
453 // if some kind of error occured, take care of it | |
454 if (cond.bad()) | |
455 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
456 LOG(ERROR) << "Receiving Association failed: " << cond.text(); |
0 | 457 // no matter what kind of error occurred, we need to do a cleanup |
458 AssociationCleanup(assoc); | |
459 return NULL; | |
460 } | |
461 | |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
462 // Retrieve the AET and the IP address of the remote modality |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
463 std::string callingAet; |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
464 std::string callingIp; |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
465 std::string calledAet; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
466 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
467 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
468 DIC_AE callingAet_C; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
469 DIC_AE calledAet_C; |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
470 DIC_AE callingIp_C; |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
471 DIC_AE calledIP_C; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
472 if (ASC_getAPTitles(assoc->params, callingAet_C, calledAet_C, NULL).bad() || |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
473 ASC_getPresentationAddresses(assoc->params, callingIp_C, calledIP_C).bad()) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
474 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
475 T_ASC_RejectParameters rej = |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
476 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
477 ASC_RESULT_REJECTEDPERMANENT, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
478 ASC_SOURCE_SERVICEUSER, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
479 ASC_REASON_SU_NOREASON |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
480 }; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
481 ASC_rejectAssociation(assoc, &rej); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
482 AssociationCleanup(assoc); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
483 return NULL; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
484 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
485 |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
486 callingIp = std::string(/*OFSTRING_GUARD*/(callingIp_C)); |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
487 callingAet = std::string(/*OFSTRING_GUARD*/(callingAet_C)); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
488 calledAet = (/*OFSTRING_GUARD*/(calledAet_C)); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
489 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
490 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
491 LOG(INFO) << "Association Received from AET " << callingAet |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
492 << " on IP " << callingIp; |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
493 |
0 | 494 |
661
d233b5090105
accept more transfer syntaxes for C-Store SCP, write meta-header when receiving files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
620
diff
changeset
|
495 std::vector<const char*> transferSyntaxes; |
d233b5090105
accept more transfer syntaxes for C-Store SCP, write meta-header when receiving files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
620
diff
changeset
|
496 |
d233b5090105
accept more transfer syntaxes for C-Store SCP, write meta-header when receiving files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
620
diff
changeset
|
497 // This is the list of the transfer syntaxes that were supported up to Orthanc 0.7.1 |
d233b5090105
accept more transfer syntaxes for C-Store SCP, write meta-header when receiving files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
620
diff
changeset
|
498 transferSyntaxes.push_back(UID_LittleEndianExplicitTransferSyntax); |
d233b5090105
accept more transfer syntaxes for C-Store SCP, write meta-header when receiving files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
620
diff
changeset
|
499 transferSyntaxes.push_back(UID_BigEndianExplicitTransferSyntax); |
d233b5090105
accept more transfer syntaxes for C-Store SCP, write meta-header when receiving files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
620
diff
changeset
|
500 transferSyntaxes.push_back(UID_LittleEndianImplicitTransferSyntax); |
665 | 501 |
502 // New transfer syntaxes supported since Orthanc 0.7.2 | |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
503 if (!server.HasApplicationEntityFilter() || |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
504 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(callingIp, callingAet, TransferSyntax_Deflated)) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
505 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
506 transferSyntaxes.push_back(UID_DeflatedExplicitVRLittleEndianTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
507 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
508 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
509 if (!server.HasApplicationEntityFilter() || |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
510 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(callingIp, callingAet, TransferSyntax_Jpeg)) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
511 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
512 transferSyntaxes.push_back(UID_JPEGProcess1TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
513 transferSyntaxes.push_back(UID_JPEGProcess2_4TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
514 transferSyntaxes.push_back(UID_JPEGProcess3_5TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
515 transferSyntaxes.push_back(UID_JPEGProcess6_8TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
516 transferSyntaxes.push_back(UID_JPEGProcess7_9TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
517 transferSyntaxes.push_back(UID_JPEGProcess10_12TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
518 transferSyntaxes.push_back(UID_JPEGProcess11_13TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
519 transferSyntaxes.push_back(UID_JPEGProcess14TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
520 transferSyntaxes.push_back(UID_JPEGProcess15TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
521 transferSyntaxes.push_back(UID_JPEGProcess16_18TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
522 transferSyntaxes.push_back(UID_JPEGProcess17_19TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
523 transferSyntaxes.push_back(UID_JPEGProcess20_22TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
524 transferSyntaxes.push_back(UID_JPEGProcess21_23TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
525 transferSyntaxes.push_back(UID_JPEGProcess24_26TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
526 transferSyntaxes.push_back(UID_JPEGProcess25_27TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
527 transferSyntaxes.push_back(UID_JPEGProcess28TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
528 transferSyntaxes.push_back(UID_JPEGProcess29TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
529 transferSyntaxes.push_back(UID_JPEGProcess14SV1TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
530 transferSyntaxes.push_back(UID_JPEGLSLosslessTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
531 transferSyntaxes.push_back(UID_JPEGLSLossyTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
532 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
533 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
534 if (!server.HasApplicationEntityFilter() || |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
535 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(callingIp, callingAet, TransferSyntax_Jpeg2000)) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
536 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
537 transferSyntaxes.push_back(UID_JPEG2000LosslessOnlyTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
538 transferSyntaxes.push_back(UID_JPEG2000TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
539 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
540 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
541 if (!server.HasApplicationEntityFilter() || |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
542 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(callingIp, callingAet, TransferSyntax_JpegLossless)) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
543 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
544 transferSyntaxes.push_back(UID_JPEG2000LosslessOnlyTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
545 transferSyntaxes.push_back(UID_JPEG2000TransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
546 transferSyntaxes.push_back(UID_JPEG2000Part2MulticomponentImageCompressionLosslessOnlyTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
547 transferSyntaxes.push_back(UID_JPEG2000Part2MulticomponentImageCompressionTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
548 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
549 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
550 if (!server.HasApplicationEntityFilter() || |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
551 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(callingIp, callingAet, TransferSyntax_Jpip)) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
552 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
553 transferSyntaxes.push_back(UID_JPIPReferencedTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
554 transferSyntaxes.push_back(UID_JPIPReferencedDeflateTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
555 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
556 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
557 if (!server.HasApplicationEntityFilter() || |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
558 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(callingIp, callingAet, TransferSyntax_Mpeg2)) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
559 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
560 transferSyntaxes.push_back(UID_MPEG2MainProfileAtMainLevelTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
561 transferSyntaxes.push_back(UID_MPEG2MainProfileAtHighLevelTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
562 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
563 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
564 if (!server.HasApplicationEntityFilter() || |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
565 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(callingIp, callingAet, TransferSyntax_Rle)) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
566 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
567 transferSyntaxes.push_back(UID_RLELosslessTransferSyntax); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
568 } |
0 | 569 |
570 /* accept the Verification SOP Class if presented */ | |
1073
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
571 cond = ASC_acceptContextsWithPreferredTransferSyntaxes(assoc->params, &knownAbstractSyntaxes[0], knownAbstractSyntaxes.size(), &transferSyntaxes[0], transferSyntaxes.size()); |
0 | 572 if (cond.bad()) |
573 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
574 LOG(INFO) << cond.text(); |
0 | 575 AssociationCleanup(assoc); |
576 return NULL; | |
577 } | |
578 | |
579 /* the array of Storage SOP Class UIDs comes from dcuid.h */ | |
1073
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
580 cond = ASC_acceptContextsWithPreferredTransferSyntaxes(assoc->params, orthancStorageSOPClassUIDs, orthancStorageSOPClassUIDsCount, &transferSyntaxes[0], transferSyntaxes.size()); |
0 | 581 if (cond.bad()) |
582 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
583 LOG(INFO) << cond.text(); |
0 | 584 AssociationCleanup(assoc); |
585 return NULL; | |
586 } | |
587 | |
503 | 588 #if ORTHANC_PROMISCUOUS == 1 |
589 /* accept everything not known not to be a storage SOP class */ | |
590 cond = acceptUnknownContextsWithPreferredTransferSyntaxes( | |
661
d233b5090105
accept more transfer syntaxes for C-Store SCP, write meta-header when receiving files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
620
diff
changeset
|
591 assoc->params, &transferSyntaxes[0], transferSyntaxes.size()); |
503 | 592 if (cond.bad()) |
593 { | |
594 LOG(INFO) << cond.text(); | |
595 AssociationCleanup(assoc); | |
596 return NULL; | |
597 } | |
598 #endif | |
599 | |
0 | 600 /* set our app title */ |
601 ASC_setAPTitles(assoc->params, NULL, NULL, server.GetApplicationEntityTitle().c_str()); | |
602 | |
603 /* acknowledge or reject this association */ | |
604 cond = ASC_getApplicationContextName(assoc->params, buf); | |
605 if ((cond.bad()) || strcmp(buf, UID_StandardApplicationContext) != 0) | |
606 { | |
607 /* reject: the application context name is not supported */ | |
608 T_ASC_RejectParameters rej = | |
609 { | |
610 ASC_RESULT_REJECTEDPERMANENT, | |
611 ASC_SOURCE_SERVICEUSER, | |
612 ASC_REASON_SU_APPCONTEXTNAMENOTSUPPORTED | |
613 }; | |
614 | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
615 LOG(INFO) << "Association Rejected: Bad Application Context Name: " << buf; |
0 | 616 cond = ASC_rejectAssociation(assoc, &rej); |
617 if (cond.bad()) | |
618 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
619 LOG(INFO) << cond.text(); |
0 | 620 } |
621 AssociationCleanup(assoc); | |
622 return NULL; | |
623 } | |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
624 |
0 | 625 /* check the AETs */ |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
626 if (!server.IsMyAETitle(calledAet)) |
0 | 627 { |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
628 LOG(WARNING) << "Rejected association, because of a bad called AET in the request (" << calledAet << ")"; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
629 T_ASC_RejectParameters rej = |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
630 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
631 ASC_RESULT_REJECTEDPERMANENT, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
632 ASC_SOURCE_SERVICEUSER, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
633 ASC_REASON_SU_CALLEDAETITLENOTRECOGNIZED |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
634 }; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
635 ASC_rejectAssociation(assoc, &rej); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
636 AssociationCleanup(assoc); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
637 return NULL; |
0 | 638 } |
639 | |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
640 if (server.HasApplicationEntityFilter() && |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
641 !server.GetApplicationEntityFilter().IsAllowedConnection(callingIp, callingAet)) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
642 { |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
643 LOG(WARNING) << "Rejected association for remote AET " << callingAet << " on IP " << callingIp; |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
644 T_ASC_RejectParameters rej = |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
645 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
646 ASC_RESULT_REJECTEDPERMANENT, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
647 ASC_SOURCE_SERVICEUSER, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
648 ASC_REASON_SU_CALLINGAETITLENOTRECOGNIZED |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
649 }; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
650 ASC_rejectAssociation(assoc, &rej); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
651 AssociationCleanup(assoc); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
652 return NULL; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
653 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
654 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
655 if (opt_rejectWithoutImplementationUID && |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
656 strlen(assoc->params->theirImplementationClassUID) == 0) |
0 | 657 { |
658 /* reject: the no implementation Class UID provided */ | |
659 T_ASC_RejectParameters rej = | |
660 { | |
661 ASC_RESULT_REJECTEDPERMANENT, | |
662 ASC_SOURCE_SERVICEUSER, | |
663 ASC_REASON_SU_NOREASON | |
664 }; | |
665 | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
666 LOG(INFO) << "Association Rejected: No Implementation Class UID provided"; |
0 | 667 cond = ASC_rejectAssociation(assoc, &rej); |
668 if (cond.bad()) | |
669 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
670 LOG(INFO) << cond.text(); |
0 | 671 } |
672 AssociationCleanup(assoc); | |
673 return NULL; | |
674 } | |
675 | |
676 { | |
677 cond = ASC_acknowledgeAssociation(assoc); | |
678 if (cond.bad()) | |
679 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
680 LOG(ERROR) << cond.text(); |
0 | 681 AssociationCleanup(assoc); |
682 return NULL; | |
683 } | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
684 LOG(INFO) << "Association Acknowledged (Max Send PDV: " << assoc->sendPDVLength << ")"; |
0 | 685 if (ASC_countAcceptedPresentationContexts(assoc->params) == 0) |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
686 LOG(INFO) << " (but no valid presentation contexts)"; |
0 | 687 } |
688 | |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
689 IApplicationEntityFilter* filter = server.HasApplicationEntityFilter() ? &server.GetApplicationEntityFilter() : NULL; |
1164
0a55d8eb194e
Configuration/Lua to select the accepted C-Store SCP transfer syntaxes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
690 return new CommandDispatcher(server, assoc, callingIp, callingAet, filter); |
0 | 691 } |
692 | |
693 bool CommandDispatcher::Step() | |
694 /* | |
695 * This function receives DIMSE commmands over the network connection | |
696 * and handles these commands correspondingly. Note that in case of | |
697 * storscp only C-ECHO-RQ and C-STORE-RQ commands can be processed. | |
698 */ | |
699 { | |
700 bool finished = false; | |
701 | |
702 // receive a DIMSE command over the network, with a timeout of 1 second | |
703 DcmDataset *statusDetail = NULL; | |
704 T_ASC_PresentationContextID presID = 0; | |
705 T_DIMSE_Message msg; | |
706 | |
707 OFCondition cond = DIMSE_receiveCommand(assoc_, DIMSE_NONBLOCKING, 1, &presID, &msg, &statusDetail); | |
708 elapsedTimeSinceLastCommand_++; | |
709 | |
710 // if the command which was received has extra status | |
711 // detail information, dump this information | |
712 if (statusDetail != NULL) | |
713 { | |
101 | 714 //LOG4CPP_WARN(Internals::GetLogger(), "Status Detail:" << OFendl << DcmObject::PrintHelper(*statusDetail)); |
0 | 715 delete statusDetail; |
716 } | |
717 | |
718 if (cond == DIMSE_OUTOFRESOURCES) | |
719 { | |
720 finished = true; | |
721 } | |
722 else if (cond == DIMSE_NODATAAVAILABLE) | |
723 { | |
724 // Timeout due to DIMSE_NONBLOCKING | |
725 if (clientTimeout_ != 0 && | |
726 elapsedTimeSinceLastCommand_ >= clientTimeout_) | |
727 { | |
728 // This timeout is actually a client timeout | |
729 finished = true; | |
730 } | |
731 } | |
732 else if (cond == EC_Normal) | |
733 { | |
734 // Reset the client timeout counter | |
735 elapsedTimeSinceLastCommand_ = 0; | |
736 | |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
737 // Convert the type of request to Orthanc's internal type |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
738 bool supported = false; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
739 DicomRequestType request; |
0 | 740 switch (msg.CommandField) |
741 { | |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
742 case DIMSE_C_ECHO_RQ: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
743 request = DicomRequestType_Echo; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
744 supported = true; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
745 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
746 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
747 case DIMSE_C_STORE_RQ: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
748 request = DicomRequestType_Store; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
749 supported = true; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
750 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
751 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
752 case DIMSE_C_MOVE_RQ: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
753 request = DicomRequestType_Move; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
754 supported = true; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
755 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
756 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
757 case DIMSE_C_FIND_RQ: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
758 request = DicomRequestType_Find; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
759 supported = true; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
760 break; |
0 | 761 |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
762 default: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
763 // we cannot handle this kind of message |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
764 cond = DIMSE_BADCOMMANDTYPE; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
765 LOG(ERROR) << "cannot handle command: 0x" << std::hex << msg.CommandField; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
766 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
767 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
768 |
0 | 769 |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
770 // Check whether this request is allowed by the security filter |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
771 if (supported && |
1085
b161593551db
Always allow incoming ECHO requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1073
diff
changeset
|
772 request != DicomRequestType_Echo && // Always allow incoming ECHO requests |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
773 filter_ != NULL && |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
774 !filter_->IsAllowedRequest(callingIP_, callingAETitle_, request)) |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
775 { |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
776 LOG(ERROR) << EnumerationToString(request) |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
777 << " requests are disallowed for the AET \"" |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
778 << callingAETitle_ << "\""; |
1085
b161593551db
Always allow incoming ECHO requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1073
diff
changeset
|
779 cond = DIMSE_ILLEGALASSOCIATION; |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
780 supported = false; |
1085
b161593551db
Always allow incoming ECHO requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1073
diff
changeset
|
781 finished = true; |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
782 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
783 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
784 // in case we received a supported message, process this command |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
785 if (supported) |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
786 { |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
787 // If anything goes wrong, there will be a "BADCOMMANDTYPE" answer |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
788 cond = DIMSE_BADCOMMANDTYPE; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
789 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
790 switch (request) |
0 | 791 { |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
792 case DicomRequestType_Echo: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
793 cond = EchoScp(assoc_, &msg, presID); |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
794 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
795 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
796 case DicomRequestType_Store: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
797 if (server_.HasStoreRequestHandlerFactory()) // Should always be true |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
798 { |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
799 std::auto_ptr<IStoreRequestHandler> handler |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
800 (server_.GetStoreRequestHandlerFactory().ConstructStoreRequestHandler()); |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
801 cond = Internals::storeScp(assoc_, &msg, presID, *handler); |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
802 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
803 break; |
0 | 804 |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
805 case DicomRequestType_Move: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
806 if (server_.HasMoveRequestHandlerFactory()) // Should always be true |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
807 { |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
808 std::auto_ptr<IMoveRequestHandler> handler |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
809 (server_.GetMoveRequestHandlerFactory().ConstructMoveRequestHandler()); |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
810 cond = Internals::moveScp(assoc_, &msg, presID, *handler); |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
811 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
812 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
813 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
814 case DicomRequestType_Find: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
815 if (server_.HasFindRequestHandlerFactory()) // Should always be true |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
816 { |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
817 std::auto_ptr<IFindRequestHandler> handler |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
818 (server_.GetFindRequestHandlerFactory().ConstructFindRequestHandler()); |
665 | 819 cond = Internals::findScp(assoc_, &msg, presID, *handler, callingAETitle_); |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
820 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
821 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
822 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
823 default: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
824 // Should never happen |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
825 break; |
0 | 826 } |
827 } | |
828 } | |
829 else | |
830 { | |
831 // Bad status, which indicates the closing of the connection by | |
832 // the peer or a network error | |
833 finished = true; | |
665 | 834 |
667
aa2ab67d913d
log error to log info
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
665
diff
changeset
|
835 LOG(INFO) << cond.text(); |
0 | 836 } |
837 | |
838 if (finished) | |
839 { | |
840 if (cond == DUL_PEERREQUESTEDRELEASE) | |
841 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
842 LOG(INFO) << "Association Release"; |
0 | 843 ASC_acknowledgeRelease(assoc_); |
844 } | |
845 else if (cond == DUL_PEERABORTEDASSOCIATION) | |
846 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
847 LOG(INFO) << "Association Aborted"; |
0 | 848 } |
849 else | |
850 { | |
851 OFString temp_str; | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
852 LOG(ERROR) << "DIMSE failure (aborting association): " << cond.text(); |
0 | 853 /* some kind of error so abort the association */ |
854 ASC_abortAssociation(assoc_); | |
855 } | |
856 } | |
857 | |
858 return !finished; | |
859 } | |
860 | |
861 | |
1073
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
862 OFCondition EchoScp(T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID) |
0 | 863 { |
864 OFString temp_str; | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
865 LOG(INFO) << "Received Echo Request"; |
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
866 //LOG(DEBUG) << DIMSE_dumpMessage(temp_str, msg->msg.CEchoRQ, DIMSE_INCOMING, NULL, presID)); |
0 | 867 |
868 /* the echo succeeded !! */ | |
869 OFCondition cond = DIMSE_sendEchoResponse(assoc, presID, &msg->msg.CEchoRQ, STATUS_Success, NULL); | |
870 if (cond.bad()) | |
871 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
872 LOG(ERROR) << "Echo SCP Failed: " << cond.text(); |
0 | 873 } |
874 return cond; | |
875 } | |
876 } | |
877 } |