Mercurial > hg > orthanc
annotate Core/DicomNetworking/Internals/CommandDispatcher.cpp @ 4023:cbdf62468d77 more-changes
merge
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Tue, 09 Jun 2020 11:54:58 +0200 |
parents | b3f09bc9734b |
children |
rev | line source |
---|---|
0 | 1 /** |
62 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1164
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
3640
94f4a18a79cc
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU General Public License as | |
9 * published by the Free Software Foundation, either version 3 of the | |
10 * License, or (at your option) any later version. | |
136 | 11 * |
12 * In addition, as a special exception, the copyright holders of this | |
13 * program give permission to link the code of its release with the | |
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
15 * that use the same license as the "OpenSSL" library), and distribute | |
16 * the linked executables. You must obey the GNU General Public License | |
17 * in all respects for all of the code used other than "OpenSSL". If you | |
18 * modify file(s) with this exception, you may extend this exception to | |
19 * your version of the file(s), but you are not obligated to do so. If | |
20 * you do not wish to do so, delete this exception statement from your | |
21 * version. If you delete this exception statement from all source files | |
22 * in the program, then also delete it here. | |
0 | 23 * |
24 * This program is distributed in the hope that it will be useful, but | |
25 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
27 * General Public License for more details. | |
28 * | |
29 * You should have received a copy of the GNU General Public License | |
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
31 **/ | |
32 | |
33 | |
766
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 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
38 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
|
39 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
40 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
|
41 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
|
42 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
43 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
|
44 All rights reserved. |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
45 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
46 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
|
47 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
48 OFFIS e.V. |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
49 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
|
50 Escherweg 2 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
51 26121 Oldenburg, Germany |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
52 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
53 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
|
54 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
|
55 are met: |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
56 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
57 - 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
|
58 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
|
59 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
60 - 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
|
61 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
|
62 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
|
63 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
64 - 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
|
65 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
|
66 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
|
67 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
68 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
|
69 "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
|
70 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
|
71 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
|
72 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
|
73 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
|
74 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
|
75 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
|
76 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
|
77 (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
|
78 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
|
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 |
0a2f8c707c78
Fix missing licensing terms about reuse of some DCMTK code
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
82 |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
83 #include "../../PrecompiledHeaders.h" |
0 | 84 #include "CommandDispatcher.h" |
85 | |
3118 | 86 #if !defined(DCMTK_VERSION_NUMBER) |
87 # error The macro DCMTK_VERSION_NUMBER must be defined | |
88 #endif | |
89 | |
0 | 90 #include "FindScp.h" |
91 #include "StoreScp.h" | |
92 #include "MoveScp.h" | |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
93 #include "GetScp.h" |
3712
2a170a8f1faf
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3704
diff
changeset
|
94 #include "../../Compatibility.h" |
2382
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
95 #include "../../Toolbox.h" |
7284093111b0
big reorganization to cleanly separate framework vs. server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2381
diff
changeset
|
96 #include "../../Logging.h" |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
97 #include "../../OrthancException.h" |
0 | 98 |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
99 #include <dcmtk/dcmdata/dcdeftag.h> /* for storage commitment */ |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
100 #include <dcmtk/dcmdata/dcsequen.h> /* for class DcmSequenceOfItems */ |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
101 #include <dcmtk/dcmdata/dcuid.h> /* for variable dcmAllStorageSOPClassUIDs */ |
0 | 102 #include <dcmtk/dcmnet/dcasccfg.h> /* for class DcmAssociationConfiguration */ |
3343
6e42d676401c
Fix issue #137 (C-STORE fails for unknown SOP Class although server is configured to accept any)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3249
diff
changeset
|
103 |
101 | 104 #include <boost/lexical_cast.hpp> |
0 | 105 |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
106 static OFBool opt_rejectWithoutImplementationUID = OFFalse; |
0 | 107 |
108 | |
503 | 109 |
1806
cd213ebcaefd
UnknownSopClassAccepted option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
110 static DUL_PRESENTATIONCONTEXT * |
503 | 111 findPresentationContextID(LST_HEAD * head, |
112 T_ASC_PresentationContextID presentationContextID) | |
113 { | |
114 DUL_PRESENTATIONCONTEXT *pc; | |
115 LST_HEAD **l; | |
116 OFBool found = OFFalse; | |
117 | |
118 if (head == NULL) | |
119 return NULL; | |
120 | |
121 l = &head; | |
122 if (*l == NULL) | |
123 return NULL; | |
124 | |
125 pc = OFstatic_cast(DUL_PRESENTATIONCONTEXT *, LST_Head(l)); | |
126 (void)LST_Position(l, OFstatic_cast(LST_NODE *, pc)); | |
127 | |
128 while (pc && !found) { | |
129 if (pc->presentationContextID == presentationContextID) { | |
130 found = OFTrue; | |
131 } else { | |
132 pc = OFstatic_cast(DUL_PRESENTATIONCONTEXT *, LST_Next(l)); | |
133 } | |
134 } | |
135 return pc; | |
136 } | |
137 | |
138 | |
139 /** accept all presenstation contexts for unknown SOP classes, | |
140 * i.e. UIDs appearing in the list of abstract syntaxes | |
141 * where no corresponding name is defined in the UID dictionary. | |
142 * @param params pointer to association parameters structure | |
143 * @param transferSyntax transfer syntax to accept | |
144 * @param acceptedRole SCU/SCP role to accept | |
145 */ | |
146 static OFCondition acceptUnknownContextsWithTransferSyntax( | |
147 T_ASC_Parameters * params, | |
148 const char* transferSyntax, | |
149 T_ASC_SC_ROLE acceptedRole) | |
150 { | |
151 OFCondition cond = EC_Normal; | |
152 int n, i, k; | |
153 DUL_PRESENTATIONCONTEXT *dpc; | |
154 T_ASC_PresentationContext pc; | |
155 OFBool accepted = OFFalse; | |
156 OFBool abstractOK = OFFalse; | |
157 | |
158 n = ASC_countPresentationContexts(params); | |
159 for (i = 0; i < n; i++) | |
160 { | |
161 cond = ASC_getPresentationContext(params, i, &pc); | |
162 if (cond.bad()) return cond; | |
163 abstractOK = OFFalse; | |
164 accepted = OFFalse; | |
165 | |
166 if (dcmFindNameOfUID(pc.abstractSyntax) == NULL) | |
167 { | |
168 abstractOK = OFTrue; | |
169 | |
170 /* check the transfer syntax */ | |
171 for (k = 0; (k < OFstatic_cast(int, pc.transferSyntaxCount)) && !accepted; k++) | |
172 { | |
173 if (strcmp(pc.proposedTransferSyntaxes[k], transferSyntax) == 0) | |
174 { | |
175 accepted = OFTrue; | |
176 } | |
177 } | |
178 } | |
3343
6e42d676401c
Fix issue #137 (C-STORE fails for unknown SOP Class although server is configured to accept any)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3249
diff
changeset
|
179 |
503 | 180 if (accepted) |
181 { | |
182 cond = ASC_acceptPresentationContext( | |
183 params, pc.presentationContextID, | |
184 transferSyntax, acceptedRole); | |
185 if (cond.bad()) return cond; | |
186 } else { | |
187 T_ASC_P_ResultReason reason; | |
188 | |
189 /* do not refuse if already accepted */ | |
190 dpc = findPresentationContextID(params->DULparams.acceptedPresentationContext, | |
191 pc.presentationContextID); | |
192 if ((dpc == NULL) || ((dpc != NULL) && (dpc->result != ASC_P_ACCEPTANCE))) | |
193 { | |
194 | |
195 if (abstractOK) { | |
196 reason = ASC_P_TRANSFERSYNTAXESNOTSUPPORTED; | |
197 } else { | |
198 reason = ASC_P_ABSTRACTSYNTAXNOTSUPPORTED; | |
199 } | |
200 /* | |
201 * If previously this presentation context was refused | |
202 * because of bad transfer syntax let it stay that way. | |
203 */ | |
204 if ((dpc != NULL) && (dpc->result == ASC_P_TRANSFERSYNTAXESNOTSUPPORTED)) | |
205 reason = ASC_P_TRANSFERSYNTAXESNOTSUPPORTED; | |
206 | |
207 cond = ASC_refusePresentationContext(params, pc.presentationContextID, reason); | |
208 if (cond.bad()) return cond; | |
209 } | |
210 } | |
211 } | |
212 return EC_Normal; | |
213 } | |
214 | |
215 | |
216 /** accept all presenstation contexts for unknown SOP classes, | |
217 * i.e. UIDs appearing in the list of abstract syntaxes | |
218 * where no corresponding name is defined in the UID dictionary. | |
219 * This method is passed a list of "preferred" transfer syntaxes. | |
220 * @param params pointer to association parameters structure | |
221 * @param transferSyntax transfer syntax to accept | |
222 * @param acceptedRole SCU/SCP role to accept | |
223 */ | |
224 static OFCondition acceptUnknownContextsWithPreferredTransferSyntaxes( | |
225 T_ASC_Parameters * params, | |
226 const char* transferSyntaxes[], int transferSyntaxCount, | |
3343
6e42d676401c
Fix issue #137 (C-STORE fails for unknown SOP Class although server is configured to accept any)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3249
diff
changeset
|
227 T_ASC_SC_ROLE acceptedRole) |
503 | 228 { |
229 OFCondition cond = EC_Normal; | |
230 /* | |
231 ** Accept in the order "least wanted" to "most wanted" transfer | |
232 ** syntax. Accepting a transfer syntax will override previously | |
233 ** accepted transfer syntaxes. | |
234 */ | |
235 for (int i = transferSyntaxCount - 1; i >= 0; i--) | |
236 { | |
237 cond = acceptUnknownContextsWithTransferSyntax(params, transferSyntaxes[i], acceptedRole); | |
238 if (cond.bad()) return cond; | |
239 } | |
240 return cond; | |
241 } | |
242 | |
243 | |
1073
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
244 |
62 | 245 namespace Orthanc |
0 | 246 { |
247 namespace Internals | |
248 { | |
249 OFCondition AssociationCleanup(T_ASC_Association *assoc) | |
250 { | |
251 OFCondition cond = ASC_dropSCPAssociation(assoc); | |
252 if (cond.bad()) | |
253 { | |
3998
b3f09bc9734b
sharing more code between the loggers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3965
diff
changeset
|
254 LOG(ERROR) << cond.text(); |
0 | 255 return cond; |
256 } | |
257 | |
258 cond = ASC_destroyAssociation(&assoc); | |
259 if (cond.bad()) | |
260 { | |
3998
b3f09bc9734b
sharing more code between the loggers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3965
diff
changeset
|
261 LOG(ERROR) << cond.text(); |
0 | 262 return cond; |
263 } | |
264 | |
265 return cond; | |
266 } | |
267 | |
268 | |
269 | |
270 CommandDispatcher* AcceptAssociation(const DicomServer& server, T_ASC_Network *net) | |
271 { | |
272 DcmAssociationConfiguration asccfg; | |
273 char buf[BUFSIZ]; | |
274 T_ASC_Association *assoc; | |
275 OFCondition cond; | |
276 OFString sprofile; | |
277 OFString temp_str; | |
278 | |
279 cond = ASC_receiveAssociation(net, &assoc, | |
280 /*opt_maxPDU*/ ASC_DEFAULTMAXPDU, | |
281 NULL, NULL, | |
282 /*opt_secureConnection*/ OFFalse, | |
283 DUL_NOBLOCK, 1); | |
284 | |
285 if (cond == DUL_NOASSOCIATIONREQUEST) | |
286 { | |
287 // Timeout | |
288 AssociationCleanup(assoc); | |
289 return NULL; | |
290 } | |
291 | |
292 // if some kind of error occured, take care of it | |
293 if (cond.bad()) | |
294 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
295 LOG(ERROR) << "Receiving Association failed: " << cond.text(); |
0 | 296 // no matter what kind of error occurred, we need to do a cleanup |
297 AssociationCleanup(assoc); | |
298 return NULL; | |
299 } | |
300 | |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
301 // Retrieve the AET and the IP address of the remote modality |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
302 std::string remoteAet; |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
303 std::string remoteIp; |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
304 std::string calledAet; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
305 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
306 { |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
307 DIC_AE remoteAet_C; |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
308 DIC_AE calledAet_C; |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
309 DIC_AE remoteIp_C; |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
310 DIC_AE calledIP_C; |
3118 | 311 |
312 if ( | |
313 #if DCMTK_VERSION_NUMBER >= 364 | |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
314 ASC_getAPTitles(assoc->params, remoteAet_C, sizeof(remoteAet_C), calledAet_C, sizeof(calledAet_C), NULL, 0).bad() || |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
315 ASC_getPresentationAddresses(assoc->params, remoteIp_C, sizeof(remoteIp_C), calledIP_C, sizeof(calledIP_C)).bad() |
3118 | 316 #else |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
317 ASC_getAPTitles(assoc->params, remoteAet_C, calledAet_C, NULL).bad() || |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
318 ASC_getPresentationAddresses(assoc->params, remoteIp_C, calledIP_C).bad() |
3118 | 319 #endif |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
320 ) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
321 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
322 T_ASC_RejectParameters rej = |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
323 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
324 ASC_RESULT_REJECTEDPERMANENT, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
325 ASC_SOURCE_SERVICEUSER, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
326 ASC_REASON_SU_NOREASON |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
327 }; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
328 ASC_rejectAssociation(assoc, &rej); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
329 AssociationCleanup(assoc); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
330 return NULL; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
331 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
332 |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
333 remoteIp = std::string(/*OFSTRING_GUARD*/(remoteIp_C)); |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
334 remoteAet = std::string(/*OFSTRING_GUARD*/(remoteAet_C)); |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
335 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
|
336 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
337 |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
338 LOG(INFO) << "Association Received from AET " << remoteAet |
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
339 << " on IP " << remoteIp; |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
340 |
0 | 341 |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
342 { |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
343 /* accept the abstract syntaxes for C-ECHO, C-FIND, C-MOVE, |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
344 and storage commitment, if presented */ |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
345 |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
346 std::vector<const char*> genericTransferSyntaxes; |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
347 genericTransferSyntaxes.push_back(UID_LittleEndianExplicitTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
348 genericTransferSyntaxes.push_back(UID_BigEndianExplicitTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
349 genericTransferSyntaxes.push_back(UID_LittleEndianImplicitTransferSyntax); |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
350 |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
351 std::vector<const char*> knownAbstractSyntaxes; |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
352 |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
353 // For C-ECHO (always enabled since Orthanc 1.6.0; in earlier |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
354 // versions, only enabled if C-STORE was also enabled) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
355 knownAbstractSyntaxes.push_back(UID_VerificationSOPClass); |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
356 |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
357 // For C-FIND |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
358 if (server.HasFindRequestHandlerFactory()) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
359 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
360 knownAbstractSyntaxes.push_back(UID_FINDPatientRootQueryRetrieveInformationModel); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
361 knownAbstractSyntaxes.push_back(UID_FINDStudyRootQueryRetrieveInformationModel); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
362 } |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
363 |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
364 if (server.HasWorklistRequestHandlerFactory()) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
365 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
366 knownAbstractSyntaxes.push_back(UID_FINDModalityWorklistInformationModel); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
367 } |
0 | 368 |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
369 // For C-MOVE |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
370 if (server.HasMoveRequestHandlerFactory()) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
371 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
372 knownAbstractSyntaxes.push_back(UID_MOVEStudyRootQueryRetrieveInformationModel); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
373 knownAbstractSyntaxes.push_back(UID_MOVEPatientRootQueryRetrieveInformationModel); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
374 } |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
375 |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
376 // For C-GET |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
377 if (server.HasGetRequestHandlerFactory()) |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
378 { |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
379 knownAbstractSyntaxes.push_back(UID_GETStudyRootQueryRetrieveInformationModel); |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
380 knownAbstractSyntaxes.push_back(UID_GETPatientRootQueryRetrieveInformationModel); |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
381 } |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
382 |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
383 cond = ASC_acceptContextsWithPreferredTransferSyntaxes( |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
384 assoc->params, |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
385 &knownAbstractSyntaxes[0], knownAbstractSyntaxes.size(), |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
386 &genericTransferSyntaxes[0], genericTransferSyntaxes.size()); |
1806
cd213ebcaefd
UnknownSopClassAccepted option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
387 if (cond.bad()) |
cd213ebcaefd
UnknownSopClassAccepted option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
388 { |
cd213ebcaefd
UnknownSopClassAccepted option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
389 LOG(INFO) << cond.text(); |
cd213ebcaefd
UnknownSopClassAccepted option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
390 AssociationCleanup(assoc); |
cd213ebcaefd
UnknownSopClassAccepted option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
391 return NULL; |
cd213ebcaefd
UnknownSopClassAccepted option
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1800
diff
changeset
|
392 } |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
393 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
394 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
395 /* storage commitment support, new in Orthanc 1.6.0 */ |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
396 if (server.HasStorageCommitmentRequestHandlerFactory()) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
397 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
398 /** |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
399 * "ASC_SC_ROLE_SCUSCP": The "SCU" role is needed to accept |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
400 * remote storage commitment requests, and the "SCP" role is |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
401 * needed to receive storage commitments answers. |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
402 **/ |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
403 const char* as[1] = { UID_StorageCommitmentPushModelSOPClass }; |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
404 cond = ASC_acceptContextsWithPreferredTransferSyntaxes( |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
405 assoc->params, as, 1, |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
406 &genericTransferSyntaxes[0], genericTransferSyntaxes.size(), ASC_SC_ROLE_SCUSCP); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
407 if (cond.bad()) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
408 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
409 LOG(INFO) << cond.text(); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
410 AssociationCleanup(assoc); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
411 return NULL; |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
412 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
413 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
414 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
415 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
416 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
417 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
418 /* accept the abstract syntaxes for C-STORE, if presented */ |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
419 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
420 std::vector<const char*> storageTransferSyntaxes; |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
421 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
422 // This is the list of the transfer syntaxes that were supported up to Orthanc 0.7.1 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
423 storageTransferSyntaxes.push_back(UID_LittleEndianExplicitTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
424 storageTransferSyntaxes.push_back(UID_BigEndianExplicitTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
425 storageTransferSyntaxes.push_back(UID_LittleEndianImplicitTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
426 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
427 // New transfer syntaxes supported since Orthanc 0.7.2 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
428 if (!server.HasApplicationEntityFilter() || |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
429 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Deflated)) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
430 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
431 storageTransferSyntaxes.push_back(UID_DeflatedExplicitVRLittleEndianTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
432 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
433 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
434 if (!server.HasApplicationEntityFilter() || |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
435 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Jpeg)) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
436 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
437 storageTransferSyntaxes.push_back(UID_JPEGProcess1TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
438 storageTransferSyntaxes.push_back(UID_JPEGProcess2_4TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
439 storageTransferSyntaxes.push_back(UID_JPEGProcess3_5TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
440 storageTransferSyntaxes.push_back(UID_JPEGProcess6_8TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
441 storageTransferSyntaxes.push_back(UID_JPEGProcess7_9TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
442 storageTransferSyntaxes.push_back(UID_JPEGProcess10_12TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
443 storageTransferSyntaxes.push_back(UID_JPEGProcess11_13TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
444 storageTransferSyntaxes.push_back(UID_JPEGProcess14TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
445 storageTransferSyntaxes.push_back(UID_JPEGProcess15TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
446 storageTransferSyntaxes.push_back(UID_JPEGProcess16_18TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
447 storageTransferSyntaxes.push_back(UID_JPEGProcess17_19TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
448 storageTransferSyntaxes.push_back(UID_JPEGProcess20_22TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
449 storageTransferSyntaxes.push_back(UID_JPEGProcess21_23TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
450 storageTransferSyntaxes.push_back(UID_JPEGProcess24_26TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
451 storageTransferSyntaxes.push_back(UID_JPEGProcess25_27TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
452 storageTransferSyntaxes.push_back(UID_JPEGProcess28TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
453 storageTransferSyntaxes.push_back(UID_JPEGProcess29TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
454 storageTransferSyntaxes.push_back(UID_JPEGProcess14SV1TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
455 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
456 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
457 if (!server.HasApplicationEntityFilter() || |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
458 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Jpeg2000)) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
459 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
460 storageTransferSyntaxes.push_back(UID_JPEG2000LosslessOnlyTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
461 storageTransferSyntaxes.push_back(UID_JPEG2000TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
462 storageTransferSyntaxes.push_back(UID_JPEG2000LosslessOnlyTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
463 storageTransferSyntaxes.push_back(UID_JPEG2000TransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
464 storageTransferSyntaxes.push_back(UID_JPEG2000Part2MulticomponentImageCompressionLosslessOnlyTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
465 storageTransferSyntaxes.push_back(UID_JPEG2000Part2MulticomponentImageCompressionTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
466 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
467 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
468 if (!server.HasApplicationEntityFilter() || |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
469 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_JpegLossless)) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
470 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
471 storageTransferSyntaxes.push_back(UID_JPEGLSLosslessTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
472 storageTransferSyntaxes.push_back(UID_JPEGLSLossyTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
473 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
474 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
475 if (!server.HasApplicationEntityFilter() || |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
476 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Jpip)) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
477 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
478 storageTransferSyntaxes.push_back(UID_JPIPReferencedTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
479 storageTransferSyntaxes.push_back(UID_JPIPReferencedDeflateTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
480 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
481 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
482 if (!server.HasApplicationEntityFilter() || |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
483 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Mpeg2)) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
484 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
485 storageTransferSyntaxes.push_back(UID_MPEG2MainProfileAtMainLevelTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
486 storageTransferSyntaxes.push_back(UID_MPEG2MainProfileAtHighLevelTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
487 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
488 |
3769
eb044cc49d51
compatibility with DCMTK 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3767
diff
changeset
|
489 #if DCMTK_VERSION_NUMBER >= 361 |
3646
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
490 // New in Orthanc 1.6.0 |
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
491 if (!server.HasApplicationEntityFilter() || |
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
492 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Mpeg4)) |
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
493 { |
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
494 storageTransferSyntaxes.push_back(UID_MPEG4BDcompatibleHighProfileLevel4_1TransferSyntax); |
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
495 storageTransferSyntaxes.push_back(UID_MPEG4HighProfileLevel4_1TransferSyntax); |
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
496 storageTransferSyntaxes.push_back(UID_MPEG4HighProfileLevel4_2_For2DVideoTransferSyntax); |
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
497 storageTransferSyntaxes.push_back(UID_MPEG4HighProfileLevel4_2_For3DVideoTransferSyntax); |
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
498 storageTransferSyntaxes.push_back(UID_MPEG4StereoHighProfileLevel4_2TransferSyntax); |
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
499 } |
3769
eb044cc49d51
compatibility with DCMTK 3.6.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3767
diff
changeset
|
500 #endif |
3646
5faf76511931
integration mainline->storage-commitment
Sebastien Jodogne <s.jodogne@gmail.com>
diff
changeset
|
501 |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
502 if (!server.HasApplicationEntityFilter() || |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
503 server.GetApplicationEntityFilter().IsAllowedTransferSyntax(remoteIp, remoteAet, calledAet, TransferSyntax_Rle)) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
504 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
505 storageTransferSyntaxes.push_back(UID_RLELosslessTransferSyntax); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
506 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
507 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
508 /* the array of Storage SOP Class UIDs that is defined within "dcmdata/libsrc/dcuid.cc" */ |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
509 size_t count = 0; |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
510 while (dcmAllStorageSOPClassUIDs[count] != NULL) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
511 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
512 count++; |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
513 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
514 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
515 #if DCMTK_VERSION_NUMBER >= 362 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
516 // The global variable "numberOfDcmAllStorageSOPClassUIDs" is |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
517 // only published if DCMTK >= 3.6.2: |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
518 // https://bitbucket.org/sjodogne/orthanc/issues/137 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
519 assert(static_cast<int>(count) == numberOfDcmAllStorageSOPClassUIDs); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
520 #endif |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
521 |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
522 if (!server.HasGetRequestHandlerFactory()) // dcmqrsrv.cc line 828 |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
523 { |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
524 // This branch exactly corresponds to Orthanc <= 1.6.1 (in |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
525 // which C-GET SCP was not supported) |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
526 cond = ASC_acceptContextsWithPreferredTransferSyntaxes( |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
527 assoc->params, dcmAllStorageSOPClassUIDs, count, |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
528 &storageTransferSyntaxes[0], storageTransferSyntaxes.size()); |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
529 if (cond.bad()) |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
530 { |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
531 LOG(INFO) << cond.text(); |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
532 AssociationCleanup(assoc); |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
533 return NULL; |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
534 } |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
535 } |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
536 else // see dcmqrsrv.cc lines 839 - 876 |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
537 { |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
538 /* accept storage syntaxes with proposed role */ |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
539 int npc = ASC_countPresentationContexts(assoc->params); |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
540 for (int i = 0; i < npc; i++) |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
541 { |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
542 T_ASC_PresentationContext pc; |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
543 ASC_getPresentationContext(assoc->params, i, &pc); |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
544 if (dcmIsaStorageSOPClassUID(pc.abstractSyntax)) |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
545 { |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
546 /** |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
547 * We are prepared to accept whatever role the caller |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
548 * proposes. Normally we can be the SCP of the Storage |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
549 * Service Class. When processing the C-GET operation |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
550 * we can be the SCU of the Storage Service Class. |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
551 **/ |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
552 const T_ASC_SC_ROLE role = pc.proposedRole; |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
553 |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
554 /** |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
555 * Accept in the order "least wanted" to "most wanted" |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
556 * transfer syntax. Accepting a transfer syntax will |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
557 * override previously accepted transfer syntaxes. |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
558 **/ |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
559 for (int k = static_cast<int>(storageTransferSyntaxes.size()) - 1; k >= 0; k--) |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
560 { |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
561 for (int j = 0; j < static_cast<int>(pc.transferSyntaxCount); j++) |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
562 { |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
563 /** |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
564 * If the transfer syntax was proposed then we can accept it |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
565 * appears in our supported list of transfer syntaxes |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
566 **/ |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
567 if (strcmp(pc.proposedTransferSyntaxes[j], storageTransferSyntaxes[k]) == 0) |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
568 { |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
569 cond = ASC_acceptPresentationContext( |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
570 assoc->params, pc.presentationContextID, storageTransferSyntaxes[k], role); |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
571 if (cond.bad()) |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
572 { |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
573 LOG(INFO) << cond.text(); |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
574 AssociationCleanup(assoc); |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
575 return NULL; |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
576 } |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
577 } |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
578 } |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
579 } |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
580 } |
3965
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
581 } /* for */ |
7f296ae25039
reviewed CommandDispatcher.cpp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3964
diff
changeset
|
582 } |
3612
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
583 |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
584 if (!server.HasApplicationEntityFilter() || |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
585 server.GetApplicationEntityFilter().IsUnknownSopClassAccepted(remoteIp, remoteAet, calledAet)) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
586 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
587 /* |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
588 * Promiscous mode is enabled: Accept everything not known not |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
589 * to be a storage SOP class. |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
590 **/ |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
591 cond = acceptUnknownContextsWithPreferredTransferSyntaxes( |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
592 assoc->params, &storageTransferSyntaxes[0], storageTransferSyntaxes.size(), ASC_SC_ROLE_DEFAULT); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
593 if (cond.bad()) |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
594 { |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
595 LOG(INFO) << cond.text(); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
596 AssociationCleanup(assoc); |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
597 return NULL; |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
598 } |
22eef03feed7
DANGEROUS changeset: Removing unnecessary transfer syntaxes for C-ECHO, C-FIND and C-MOVE
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3604
diff
changeset
|
599 } |
503 | 600 } |
601 | |
0 | 602 /* set our app title */ |
603 ASC_setAPTitles(assoc->params, NULL, NULL, server.GetApplicationEntityTitle().c_str()); | |
604 | |
605 /* acknowledge or reject this association */ | |
3118 | 606 #if DCMTK_VERSION_NUMBER >= 364 |
607 cond = ASC_getApplicationContextName(assoc->params, buf, sizeof(buf)); | |
608 #else | |
0 | 609 cond = ASC_getApplicationContextName(assoc->params, buf); |
3118 | 610 #endif |
611 | |
0 | 612 if ((cond.bad()) || strcmp(buf, UID_StandardApplicationContext) != 0) |
613 { | |
614 /* reject: the application context name is not supported */ | |
615 T_ASC_RejectParameters rej = | |
616 { | |
617 ASC_RESULT_REJECTEDPERMANENT, | |
618 ASC_SOURCE_SERVICEUSER, | |
619 ASC_REASON_SU_APPCONTEXTNAMENOTSUPPORTED | |
620 }; | |
621 | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
622 LOG(INFO) << "Association Rejected: Bad Application Context Name: " << buf; |
0 | 623 cond = ASC_rejectAssociation(assoc, &rej); |
624 if (cond.bad()) | |
625 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
626 LOG(INFO) << cond.text(); |
0 | 627 } |
628 AssociationCleanup(assoc); | |
629 return NULL; | |
630 } | |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
631 |
0 | 632 /* check the AETs */ |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
633 if (!server.IsMyAETitle(calledAet)) |
0 | 634 { |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
635 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
|
636 T_ASC_RejectParameters rej = |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
637 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
638 ASC_RESULT_REJECTEDPERMANENT, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
639 ASC_SOURCE_SERVICEUSER, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
640 ASC_REASON_SU_CALLEDAETITLENOTRECOGNIZED |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
641 }; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
642 ASC_rejectAssociation(assoc, &rej); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
643 AssociationCleanup(assoc); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
644 return NULL; |
0 | 645 } |
646 | |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
647 if (server.HasApplicationEntityFilter() && |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
648 !server.GetApplicationEntityFilter().IsAllowedConnection(remoteIp, remoteAet, calledAet)) |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
649 { |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
650 LOG(WARNING) << "Rejected association for remote AET " << remoteAet << " on IP " << remoteIp; |
1163
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
651 T_ASC_RejectParameters rej = |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
652 { |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
653 ASC_RESULT_REJECTEDPERMANENT, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
654 ASC_SOURCE_SERVICEUSER, |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
655 ASC_REASON_SU_CALLINGAETITLENOTRECOGNIZED |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
656 }; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
657 ASC_rejectAssociation(assoc, &rej); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
658 AssociationCleanup(assoc); |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
659 return NULL; |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
660 } |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
661 |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
662 if (opt_rejectWithoutImplementationUID && |
3db41779d8f9
abstraction to allow/prevent transfer syntaxes on AET basis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1085
diff
changeset
|
663 strlen(assoc->params->theirImplementationClassUID) == 0) |
0 | 664 { |
665 /* reject: the no implementation Class UID provided */ | |
666 T_ASC_RejectParameters rej = | |
667 { | |
668 ASC_RESULT_REJECTEDPERMANENT, | |
669 ASC_SOURCE_SERVICEUSER, | |
670 ASC_REASON_SU_NOREASON | |
671 }; | |
672 | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
673 LOG(INFO) << "Association Rejected: No Implementation Class UID provided"; |
0 | 674 cond = ASC_rejectAssociation(assoc, &rej); |
675 if (cond.bad()) | |
676 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
677 LOG(INFO) << cond.text(); |
0 | 678 } |
679 AssociationCleanup(assoc); | |
680 return NULL; | |
681 } | |
682 | |
683 { | |
684 cond = ASC_acknowledgeAssociation(assoc); | |
685 if (cond.bad()) | |
686 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
687 LOG(ERROR) << cond.text(); |
0 | 688 AssociationCleanup(assoc); |
689 return NULL; | |
690 } | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
691 LOG(INFO) << "Association Acknowledged (Max Send PDV: " << assoc->sendPDVLength << ")"; |
0 | 692 if (ASC_countAcceptedPresentationContexts(assoc->params) == 0) |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
693 LOG(INFO) << " (but no valid presentation contexts)"; |
0 | 694 } |
695 | |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
696 IApplicationEntityFilter* filter = server.HasApplicationEntityFilter() ? &server.GetApplicationEntityFilter() : NULL; |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
697 return new CommandDispatcher(server, assoc, remoteIp, remoteAet, calledAet, filter); |
0 | 698 } |
699 | |
2134
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
700 |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
701 CommandDispatcher::CommandDispatcher(const DicomServer& server, |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
702 T_ASC_Association* assoc, |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
703 const std::string& remoteIp, |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
704 const std::string& remoteAet, |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
705 const std::string& calledAet, |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
706 IApplicationEntityFilter* filter) : |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
707 server_(server), |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
708 assoc_(assoc), |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
709 remoteIp_(remoteIp), |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
710 remoteAet_(remoteAet), |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
711 calledAet_(calledAet), |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
712 filter_(filter) |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
713 { |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
714 associationTimeout_ = server.GetAssociationTimeout(); |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
715 elapsedTimeSinceLastCommand_ = 0; |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
716 } |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
717 |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
718 |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
719 CommandDispatcher::~CommandDispatcher() |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
720 { |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
721 try |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
722 { |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
723 AssociationCleanup(assoc_); |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
724 } |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
725 catch (...) |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
726 { |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
727 LOG(ERROR) << "Some association was not cleanly aborted"; |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
728 } |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
729 } |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
730 |
ddc75c6c712d
Avoid hard crash if not enough memory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
731 |
0 | 732 bool CommandDispatcher::Step() |
733 /* | |
734 * This function receives DIMSE commmands over the network connection | |
735 * and handles these commands correspondingly. Note that in case of | |
736 * storscp only C-ECHO-RQ and C-STORE-RQ commands can be processed. | |
737 */ | |
738 { | |
739 bool finished = false; | |
740 | |
741 // receive a DIMSE command over the network, with a timeout of 1 second | |
742 DcmDataset *statusDetail = NULL; | |
743 T_ASC_PresentationContextID presID = 0; | |
744 T_DIMSE_Message msg; | |
745 | |
746 OFCondition cond = DIMSE_receiveCommand(assoc_, DIMSE_NONBLOCKING, 1, &presID, &msg, &statusDetail); | |
747 elapsedTimeSinceLastCommand_++; | |
748 | |
749 // if the command which was received has extra status | |
750 // detail information, dump this information | |
751 if (statusDetail != NULL) | |
752 { | |
101 | 753 //LOG4CPP_WARN(Internals::GetLogger(), "Status Detail:" << OFendl << DcmObject::PrintHelper(*statusDetail)); |
0 | 754 delete statusDetail; |
755 } | |
756 | |
757 if (cond == DIMSE_OUTOFRESOURCES) | |
758 { | |
759 finished = true; | |
760 } | |
761 else if (cond == DIMSE_NODATAAVAILABLE) | |
762 { | |
763 // Timeout due to DIMSE_NONBLOCKING | |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
764 if (associationTimeout_ != 0 && |
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
765 elapsedTimeSinceLastCommand_ >= associationTimeout_) |
0 | 766 { |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
767 // This timeout is actually a association timeout |
0 | 768 finished = true; |
769 } | |
770 } | |
771 else if (cond == EC_Normal) | |
772 { | |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
773 // Reset the association timeout counter |
0 | 774 elapsedTimeSinceLastCommand_ = 0; |
775 | |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
776 // 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
|
777 bool supported = false; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
778 DicomRequestType request; |
0 | 779 switch (msg.CommandField) |
780 { | |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
781 case DIMSE_C_ECHO_RQ: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
782 request = DicomRequestType_Echo; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
783 supported = true; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
784 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
785 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
786 case DIMSE_C_STORE_RQ: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
787 request = DicomRequestType_Store; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
788 supported = true; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
789 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
790 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
791 case DIMSE_C_MOVE_RQ: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
792 request = DicomRequestType_Move; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
793 supported = true; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
794 break; |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
795 |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
796 case DIMSE_C_GET_RQ: |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
797 request = DicomRequestType_Get; |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
798 supported = true; |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
799 break; |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
800 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
801 case DIMSE_C_FIND_RQ: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
802 request = DicomRequestType_Find; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
803 supported = true; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
804 break; |
0 | 805 |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
806 case DIMSE_N_ACTION_RQ: |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
807 request = DicomRequestType_NAction; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
808 supported = true; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
809 break; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
810 |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
811 case DIMSE_N_EVENT_REPORT_RQ: |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
812 request = DicomRequestType_NEventReport; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
813 supported = true; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
814 break; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
815 |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
816 default: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
817 // we cannot handle this kind of message |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
818 cond = DIMSE_BADCOMMANDTYPE; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
819 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
|
820 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
821 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
822 |
0 | 823 |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
824 // 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
|
825 if (supported && |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
826 filter_ != NULL && |
1799
4f01c9d73f02
calledAet made available to all the handlers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1786
diff
changeset
|
827 !filter_->IsAllowedRequest(remoteIp_, remoteAet_, calledAet_, request)) |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
828 { |
2352
3ab96768d144
Fix issue 52 (DICOM level security association problems)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
829 LOG(WARNING) << "Rejected " << EnumerationToString(request) |
3ab96768d144
Fix issue 52 (DICOM level security association problems)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
830 << " request from remote DICOM modality with AET \"" |
3ab96768d144
Fix issue 52 (DICOM level security association problems)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
831 << remoteAet_ << "\" and hostname \"" << remoteIp_ << "\""; |
1085
b161593551db
Always allow incoming ECHO requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1073
diff
changeset
|
832 cond = DIMSE_ILLEGALASSOCIATION; |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
833 supported = false; |
1085
b161593551db
Always allow incoming ECHO requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1073
diff
changeset
|
834 finished = true; |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
835 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
836 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
837 // 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
|
838 if (supported) |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
839 { |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
840 // 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
|
841 cond = DIMSE_BADCOMMANDTYPE; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
842 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
843 switch (request) |
0 | 844 { |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
845 case DicomRequestType_Echo: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
846 cond = EchoScp(assoc_, &msg, presID); |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
847 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
848 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
849 case DicomRequestType_Store: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
850 if (server_.HasStoreRequestHandlerFactory()) // Should always be true |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
851 { |
3712
2a170a8f1faf
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3704
diff
changeset
|
852 std::unique_ptr<IStoreRequestHandler> handler |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
853 (server_.GetStoreRequestHandlerFactory().ConstructStoreRequestHandler()); |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
854 |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
855 if (handler.get() != NULL) |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
856 { |
3704
58f92b1c8061
Fix issue #167 (Job can't be cancelled - Handling of timeouts after established association)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3691
diff
changeset
|
857 cond = Internals::storeScp(assoc_, &msg, presID, *handler, remoteIp_, associationTimeout_); |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
858 } |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
859 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
860 break; |
0 | 861 |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
862 case DicomRequestType_Move: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
863 if (server_.HasMoveRequestHandlerFactory()) // Should always be true |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
864 { |
3712
2a170a8f1faf
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3704
diff
changeset
|
865 std::unique_ptr<IMoveRequestHandler> handler |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
866 (server_.GetMoveRequestHandlerFactory().ConstructMoveRequestHandler()); |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
867 |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
868 if (handler.get() != NULL) |
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
869 { |
3704
58f92b1c8061
Fix issue #167 (Job can't be cancelled - Handling of timeouts after established association)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3691
diff
changeset
|
870 cond = Internals::moveScp(assoc_, &msg, presID, *handler, remoteIp_, remoteAet_, calledAet_, associationTimeout_); |
1800
30e97a1f4093
callback for handling worklists with plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1799
diff
changeset
|
871 } |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
872 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
873 break; |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
874 |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
875 case DicomRequestType_Get: |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
876 if (server_.HasGetRequestHandlerFactory()) // Should always be true |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
877 { |
3964 | 878 std::unique_ptr<IGetRequestHandler> handler |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
879 (server_.GetGetRequestHandlerFactory().ConstructGetRequestHandler()); |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
880 |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
881 if (handler.get() != NULL) |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
882 { |
3953
620e87e9e816
c-get: fixing memory with failedUIDs_
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3920
diff
changeset
|
883 cond = Internals::getScp(assoc_, &msg, presID, *handler, remoteIp_, remoteAet_, calledAet_, associationTimeout_); |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
884 } |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
885 } |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3769
diff
changeset
|
886 break; |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
887 |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
888 case DicomRequestType_Find: |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
889 if (server_.HasFindRequestHandlerFactory() || // Should always be true |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
890 server_.HasWorklistRequestHandlerFactory()) |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
891 { |
3712
2a170a8f1faf
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3704
diff
changeset
|
892 std::unique_ptr<IFindRequestHandler> findHandler; |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
893 if (server_.HasFindRequestHandlerFactory()) |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
894 { |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
895 findHandler.reset(server_.GetFindRequestHandlerFactory().ConstructFindRequestHandler()); |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
896 } |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
897 |
3712
2a170a8f1faf
replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3704
diff
changeset
|
898 std::unique_ptr<IWorklistRequestHandler> worklistHandler; |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
899 if (server_.HasWorklistRequestHandlerFactory()) |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
900 { |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
901 worklistHandler.reset(server_.GetWorklistRequestHandlerFactory().ConstructWorklistRequestHandler()); |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
902 } |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1573
diff
changeset
|
903 |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2352
diff
changeset
|
904 cond = Internals::findScp(assoc_, &msg, presID, server_.GetRemoteModalities(), |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2352
diff
changeset
|
905 findHandler.get(), worklistHandler.get(), |
3704
58f92b1c8061
Fix issue #167 (Job can't be cancelled - Handling of timeouts after established association)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3691
diff
changeset
|
906 remoteIp_, remoteAet_, calledAet_, associationTimeout_); |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
907 } |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
908 break; |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
909 |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
910 case DicomRequestType_NAction: |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
911 cond = NActionScp(&msg, presID); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
912 break; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
913 |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
914 case DicomRequestType_NEventReport: |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
915 cond = NEventReportScp(&msg, presID); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
916 break; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
917 |
620
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
918 default: |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
919 // Should never happen |
4aa6f0d79947
security filter for dicom requests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
503
diff
changeset
|
920 break; |
0 | 921 } |
922 } | |
923 } | |
924 else | |
925 { | |
926 // Bad status, which indicates the closing of the connection by | |
927 // the peer or a network error | |
928 finished = true; | |
665 | 929 |
667
aa2ab67d913d
log error to log info
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
665
diff
changeset
|
930 LOG(INFO) << cond.text(); |
0 | 931 } |
932 | |
933 if (finished) | |
934 { | |
935 if (cond == DUL_PEERREQUESTEDRELEASE) | |
936 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
937 LOG(INFO) << "Association Release"; |
0 | 938 ASC_acknowledgeRelease(assoc_); |
939 } | |
940 else if (cond == DUL_PEERABORTEDASSOCIATION) | |
941 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
942 LOG(INFO) << "Association Aborted"; |
0 | 943 } |
944 else | |
945 { | |
946 OFString temp_str; | |
2352
3ab96768d144
Fix issue 52 (DICOM level security association problems)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
947 LOG(INFO) << "DIMSE failure (aborting association): " << cond.text(); |
0 | 948 /* some kind of error so abort the association */ |
949 ASC_abortAssociation(assoc_); | |
950 } | |
951 } | |
952 | |
953 return !finished; | |
954 } | |
955 | |
956 | |
1073
01414536c930
complete DICOM conformance
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
831
diff
changeset
|
957 OFCondition EchoScp(T_ASC_Association * assoc, T_DIMSE_Message * msg, T_ASC_PresentationContextID presID) |
0 | 958 { |
959 OFString temp_str; | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
960 LOG(INFO) << "Received Echo Request"; |
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
961 //LOG(DEBUG) << DIMSE_dumpMessage(temp_str, msg->msg.CEchoRQ, DIMSE_INCOMING, NULL, presID)); |
0 | 962 |
963 /* the echo succeeded !! */ | |
964 OFCondition cond = DIMSE_sendEchoResponse(assoc, presID, &msg->msg.CEchoRQ, STATUS_Success, NULL); | |
965 if (cond.bad()) | |
966 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
967 LOG(ERROR) << "Echo SCP Failed: " << cond.text(); |
0 | 968 } |
969 return cond; | |
970 } | |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
971 |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
972 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
973 static DcmDataset* ReadDataset(T_ASC_Association* assoc, |
3706
bd34b6ac5c08
timeouts in storage commitment SCU and SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3705
diff
changeset
|
974 const char* errorMessage, |
bd34b6ac5c08
timeouts in storage commitment SCU and SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3705
diff
changeset
|
975 int timeout) |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
976 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
977 DcmDataset *tmp = NULL; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
978 T_ASC_PresentationContextID presIdData; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
979 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
980 OFCondition cond = DIMSE_receiveDataSetInMemory( |
3706
bd34b6ac5c08
timeouts in storage commitment SCU and SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3705
diff
changeset
|
981 assoc, (timeout ? DIMSE_NONBLOCKING : DIMSE_BLOCKING), timeout, |
bd34b6ac5c08
timeouts in storage commitment SCU and SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3705
diff
changeset
|
982 &presIdData, &tmp, NULL, NULL); |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
983 if (!cond.good() || |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
984 tmp == NULL) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
985 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
986 throw OrthancException(ErrorCode_NetworkProtocol, errorMessage); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
987 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
988 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
989 return tmp; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
990 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
991 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
992 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
993 static std::string ReadString(DcmDataset& dataset, |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
994 const DcmTagKey& tag) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
995 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
996 const char* s = NULL; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
997 if (!dataset.findAndGetString(tag, s).good() || |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
998 s == NULL) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
999 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1000 char buf[64]; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1001 sprintf(buf, "Missing mandatory tag in dataset: (%04X,%04X)", |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1002 tag.getGroup(), tag.getElement()); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1003 throw OrthancException(ErrorCode_NetworkProtocol, buf); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1004 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1005 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1006 return std::string(s); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1007 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1008 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1009 |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1010 static void ReadSopSequence( |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1011 std::vector<std::string>& sopClassUids, |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1012 std::vector<std::string>& sopInstanceUids, |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1013 std::vector<StorageCommitmentFailureReason>* failureReasons, // Can be NULL |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1014 DcmDataset& dataset, |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1015 const DcmTagKey& tag, |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1016 bool mandatory) |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1017 { |
3614
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1018 sopClassUids.clear(); |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1019 sopInstanceUids.clear(); |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1020 |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1021 if (failureReasons) |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1022 { |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1023 failureReasons->clear(); |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1024 } |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1025 |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1026 DcmSequenceOfItems* sequence = NULL; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1027 if (!dataset.findAndGetSequence(tag, sequence).good() || |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1028 sequence == NULL) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1029 { |
3614
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1030 if (mandatory) |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1031 { |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1032 char buf[64]; |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1033 sprintf(buf, "Missing mandatory sequence in dataset: (%04X,%04X)", |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1034 tag.getGroup(), tag.getElement()); |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1035 throw OrthancException(ErrorCode_NetworkProtocol, buf); |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1036 } |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1037 else |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1038 { |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1039 return; |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1040 } |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1041 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1042 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1043 sopClassUids.reserve(sequence->card()); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1044 sopInstanceUids.reserve(sequence->card()); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1045 |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1046 if (failureReasons) |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1047 { |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1048 failureReasons->reserve(sequence->card()); |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1049 } |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1050 |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1051 for (unsigned long i = 0; i < sequence->card(); i++) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1052 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1053 const char* a = NULL; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1054 const char* b = NULL; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1055 if (!sequence->getItem(i)->findAndGetString(DCM_ReferencedSOPClassUID, a).good() || |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1056 !sequence->getItem(i)->findAndGetString(DCM_ReferencedSOPInstanceUID, b).good() || |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1057 a == NULL || |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1058 b == NULL) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1059 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1060 throw OrthancException(ErrorCode_NetworkProtocol, |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1061 "Missing Referenced SOP Class/Instance UID " |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1062 "in storage commitment dataset"); |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1063 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1064 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1065 sopClassUids.push_back(a); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1066 sopInstanceUids.push_back(b); |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1067 |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1068 if (failureReasons != NULL) |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1069 { |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1070 Uint16 reason; |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1071 if (!sequence->getItem(i)->findAndGetUint16(DCM_FailureReason, reason).good()) |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1072 { |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1073 throw OrthancException(ErrorCode_NetworkProtocol, |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1074 "Missing Failure Reason (0008,1197) " |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1075 "in storage commitment dataset"); |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1076 } |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1077 |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1078 failureReasons->push_back(static_cast<StorageCommitmentFailureReason>(reason)); |
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1079 } |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1080 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1081 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1082 |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1083 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1084 OFCondition CommandDispatcher::NActionScp(T_DIMSE_Message* msg, |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1085 T_ASC_PresentationContextID presID) |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1086 { |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1087 /** |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1088 * Starting with Orthanc 1.6.0, only storage commitment is |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1089 * supported with DICOM N-ACTION. This corresponds to the case |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1090 * where "Action Type ID" equals "1". |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1091 * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part04/sect_J.3.2.html |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1092 * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part07/chapter_10.html#table_10.1-4 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1093 **/ |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1094 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1095 if (msg->CommandField != DIMSE_N_ACTION_RQ /* value == 304 == 0x0130 */ || |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1096 !server_.HasStorageCommitmentRequestHandlerFactory()) |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1097 { |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1098 throw OrthancException(ErrorCode_InternalError); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1099 } |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1100 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1101 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1102 /** |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1103 * Check that the storage commitment request is correctly formatted. |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1104 **/ |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1105 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1106 const T_DIMSE_N_ActionRQ& request = msg->msg.NActionRQ; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1107 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1108 if (request.ActionTypeID != 1) |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1109 { |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1110 throw OrthancException(ErrorCode_NotImplemented, |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1111 "Only storage commitment is implemented for DICOM N-ACTION SCP"); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1112 } |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1113 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1114 if (std::string(request.RequestedSOPClassUID) != UID_StorageCommitmentPushModelSOPClass || |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1115 std::string(request.RequestedSOPInstanceUID) != UID_StorageCommitmentPushModelSOPInstance) |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1116 { |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1117 throw OrthancException(ErrorCode_NetworkProtocol, |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1118 "Unexpected incoming SOP class or instance UID for storage commitment"); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1119 } |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1120 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1121 if (request.DataSetType != DIMSE_DATASET_PRESENT) |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1122 { |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1123 throw OrthancException(ErrorCode_NetworkProtocol, |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1124 "Incoming storage commitment request without a dataset"); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1125 } |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1126 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1127 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1128 /** |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1129 * Extract the DICOM dataset that is associated with the DIMSE |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1130 * message. The content of this dataset is documented in "Table |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1131 * J.3-1. Storage Commitment Request - Action Information": |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1132 * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part04/sect_J.3.2.html#table_J.3-1 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1133 **/ |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1134 |
3767 | 1135 std::unique_ptr<DcmDataset> dataset( |
3706
bd34b6ac5c08
timeouts in storage commitment SCU and SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3705
diff
changeset
|
1136 ReadDataset(assoc_, "Cannot read the dataset in N-ACTION SCP", associationTimeout_)); |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1137 |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1138 std::string transactionUid = ReadString(*dataset, DCM_TransactionUID); |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1139 |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1140 std::vector<std::string> sopClassUid, sopInstanceUid; |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1141 ReadSopSequence(sopClassUid, sopInstanceUid, NULL, |
3614
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1142 *dataset, DCM_ReferencedSOPSequence, true /* mandatory */); |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1143 |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1144 LOG(INFO) << "Incoming storage commitment request, with transaction UID: " << transactionUid; |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1145 |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1146 for (size_t i = 0; i < sopClassUid.size(); i++) |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1147 { |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1148 LOG(INFO) << " (" << (i + 1) << "/" << sopClassUid.size() |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1149 << ") queried SOP Class/Instance UID: " |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1150 << sopClassUid[i] << " / " << sopInstanceUid[i]; |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1151 } |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1152 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1153 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1154 /** |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1155 * Call the Orthanc handler. The list of available DIMSE status |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1156 * codes can be found at: |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1157 * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part07/chapter_10.html#sect_10.1.4.1.10 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1158 **/ |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1159 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1160 DIC_US dimseStatus; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1161 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1162 try |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1163 { |
3767 | 1164 std::unique_ptr<IStorageCommitmentRequestHandler> handler |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1165 (server_.GetStorageCommitmentRequestHandlerFactory(). |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1166 ConstructStorageCommitmentRequestHandler()); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1167 |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1168 handler->HandleRequest(transactionUid, sopClassUid, sopInstanceUid, |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1169 remoteIp_, remoteAet_, calledAet_); |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1170 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1171 dimseStatus = 0; // Success |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1172 } |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1173 catch (OrthancException& e) |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1174 { |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1175 LOG(ERROR) << "Error while processing an incoming storage commitment request: " << e.What(); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1176 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1177 // Code 0x0110 - "General failure in processing the operation was encountered" |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1178 dimseStatus = STATUS_N_ProcessingFailure; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1179 } |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1180 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1181 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1182 /** |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1183 * Send the DIMSE status back to the SCU. |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1184 **/ |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1185 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1186 { |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1187 T_DIMSE_Message response; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1188 memset(&response, 0, sizeof(response)); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1189 response.CommandField = DIMSE_N_ACTION_RSP; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1190 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1191 T_DIMSE_N_ActionRSP& content = response.msg.NActionRSP; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1192 content.MessageIDBeingRespondedTo = request.MessageID; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1193 strncpy(content.AffectedSOPClassUID, UID_StorageCommitmentPushModelSOPClass, DIC_UI_LEN); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1194 content.DimseStatus = dimseStatus; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1195 strncpy(content.AffectedSOPInstanceUID, UID_StorageCommitmentPushModelSOPInstance, DIC_UI_LEN); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1196 content.ActionTypeID = 0; // Not present, as "O_NACTION_ACTIONTYPEID" not set in "opts" |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1197 content.DataSetType = DIMSE_DATASET_NULL; // Dataset is absent in storage commitment response |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1198 content.opts = O_NACTION_AFFECTEDSOPCLASSUID | O_NACTION_AFFECTEDSOPINSTANCEUID; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1199 |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1200 return DIMSE_sendMessageUsingMemoryData( |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1201 assoc_, presID, &response, NULL /* no dataset */, NULL /* dataObject */, |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1202 NULL /* callback */, NULL /* callback context */, NULL /* commandSet */); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1203 } |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3451
diff
changeset
|
1204 } |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1205 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1206 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1207 OFCondition CommandDispatcher::NEventReportScp(T_DIMSE_Message* msg, |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1208 T_ASC_PresentationContextID presID) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1209 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1210 /** |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1211 * Starting with Orthanc 1.6.0, handling N-EVENT-REPORT for |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1212 * storage commitment. |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1213 * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part04/sect_J.3.3.html |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1214 * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part07/chapter_10.html#table_10.1-1 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1215 **/ |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1216 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1217 if (msg->CommandField != DIMSE_N_EVENT_REPORT_RQ /* value == 256 == 0x0100 */ || |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1218 !server_.HasStorageCommitmentRequestHandlerFactory()) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1219 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1220 throw OrthancException(ErrorCode_InternalError); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1221 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1222 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1223 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1224 /** |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1225 * Check that the storage commitment report is correctly formatted. |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1226 **/ |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1227 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1228 const T_DIMSE_N_EventReportRQ& report = msg->msg.NEventReportRQ; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1229 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1230 if (report.EventTypeID != 1 /* successful */ && |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1231 report.EventTypeID != 2 /* failures exist */) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1232 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1233 throw OrthancException(ErrorCode_NotImplemented, |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1234 "Unknown event for DICOM N-EVENT-REPORT SCP"); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1235 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1236 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1237 if (std::string(report.AffectedSOPClassUID) != UID_StorageCommitmentPushModelSOPClass || |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1238 std::string(report.AffectedSOPInstanceUID) != UID_StorageCommitmentPushModelSOPInstance) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1239 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1240 throw OrthancException(ErrorCode_NetworkProtocol, |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1241 "Unexpected incoming SOP class or instance UID for storage commitment"); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1242 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1243 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1244 if (report.DataSetType != DIMSE_DATASET_PRESENT) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1245 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1246 throw OrthancException(ErrorCode_NetworkProtocol, |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1247 "Incoming storage commitment report without a dataset"); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1248 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1249 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1250 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1251 /** |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1252 * Extract the DICOM dataset that is associated with the DIMSE |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1253 * message. The content of this dataset is documented in "Table |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1254 * J.3-2. Storage Commitment Result - Event Information": |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1255 * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part04/sect_J.3.3.html#table_J.3-2 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1256 **/ |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1257 |
3767 | 1258 std::unique_ptr<DcmDataset> dataset( |
3706
bd34b6ac5c08
timeouts in storage commitment SCU and SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3705
diff
changeset
|
1259 ReadDataset(assoc_, "Cannot read the dataset in N-EVENT-REPORT SCP", associationTimeout_)); |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1260 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1261 std::string transactionUid = ReadString(*dataset, DCM_TransactionUID); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1262 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1263 std::vector<std::string> successSopClassUid, successSopInstanceUid; |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1264 ReadSopSequence(successSopClassUid, successSopInstanceUid, NULL, |
3614
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1265 *dataset, DCM_ReferencedSOPSequence, |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1266 (report.EventTypeID == 1) /* mandatory in the case of success */); |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1267 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1268 std::vector<std::string> failedSopClassUid, failedSopInstanceUid; |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1269 std::vector<StorageCommitmentFailureReason> failureReasons; |
3614
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1270 |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1271 if (report.EventTypeID == 2 /* failures exist */) |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1272 { |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1273 ReadSopSequence(failedSopClassUid, failedSopInstanceUid, &failureReasons, |
3614
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1274 *dataset, DCM_FailedSOPSequence, true); |
4543ffad256d
storage commitment requests/responses to/from self are working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3613
diff
changeset
|
1275 } |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1276 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1277 LOG(INFO) << "Incoming storage commitment report, with transaction UID: " << transactionUid; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1278 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1279 for (size_t i = 0; i < successSopClassUid.size(); i++) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1280 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1281 LOG(INFO) << " (success " << (i + 1) << "/" << successSopClassUid.size() |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1282 << ") SOP Class/Instance UID: " |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1283 << successSopClassUid[i] << " / " << successSopInstanceUid[i]; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1284 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1285 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1286 for (size_t i = 0; i < failedSopClassUid.size(); i++) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1287 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1288 LOG(INFO) << " (failure " << (i + 1) << "/" << failedSopClassUid.size() |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1289 << ") SOP Class/Instance UID: " |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1290 << failedSopClassUid[i] << " / " << failedSopInstanceUid[i]; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1291 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1292 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1293 /** |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1294 * Call the Orthanc handler. The list of available DIMSE status |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1295 * codes can be found at: |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1296 * http://dicom.nema.org/medical/dicom/2019a/output/chtml/part07/chapter_10.html#sect_10.1.4.1.10 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1297 **/ |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1298 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1299 DIC_US dimseStatus; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1300 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1301 try |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1302 { |
3767 | 1303 std::unique_ptr<IStorageCommitmentRequestHandler> handler |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1304 (server_.GetStorageCommitmentRequestHandlerFactory(). |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1305 ConstructStorageCommitmentRequestHandler()); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1306 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1307 handler->HandleReport(transactionUid, successSopClassUid, successSopInstanceUid, |
3736
0540b54324f1
StorageCommitmentReports
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3713
diff
changeset
|
1308 failedSopClassUid, failedSopInstanceUid, failureReasons, |
3613
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1309 remoteIp_, remoteAet_, calledAet_); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1310 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1311 dimseStatus = 0; // Success |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1312 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1313 catch (OrthancException& e) |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1314 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1315 LOG(ERROR) << "Error while processing an incoming storage commitment report: " << e.What(); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1316 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1317 // Code 0x0110 - "General failure in processing the operation was encountered" |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1318 dimseStatus = STATUS_N_ProcessingFailure; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1319 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1320 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1321 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1322 /** |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1323 * Send the DIMSE status back to the SCU. |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1324 **/ |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1325 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1326 { |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1327 T_DIMSE_Message response; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1328 memset(&response, 0, sizeof(response)); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1329 response.CommandField = DIMSE_N_EVENT_REPORT_RSP; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1330 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1331 T_DIMSE_N_EventReportRSP& content = response.msg.NEventReportRSP; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1332 content.MessageIDBeingRespondedTo = report.MessageID; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1333 strncpy(content.AffectedSOPClassUID, UID_StorageCommitmentPushModelSOPClass, DIC_UI_LEN); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1334 content.DimseStatus = dimseStatus; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1335 strncpy(content.AffectedSOPInstanceUID, UID_StorageCommitmentPushModelSOPInstance, DIC_UI_LEN); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1336 content.EventTypeID = 0; // Not present, as "O_NEVENTREPORT_EVENTTYPEID" not set in "opts" |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1337 content.DataSetType = DIMSE_DATASET_NULL; // Dataset is absent in storage commitment response |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1338 content.opts = O_NEVENTREPORT_AFFECTEDSOPCLASSUID | O_NEVENTREPORT_AFFECTEDSOPINSTANCEUID; |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1339 |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1340 return DIMSE_sendMessageUsingMemoryData( |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1341 assoc_, presID, &response, NULL /* no dataset */, NULL /* dataObject */, |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1342 NULL /* callback */, NULL /* callback context */, NULL /* commandSet */); |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1343 } |
c1e2b91c2ab4
all the abstractions for storage commitment are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3612
diff
changeset
|
1344 } |
0 | 1345 } |
1346 } |