comparison OrthancFramework/Sources/DicomNetworking/Internals/FindScp.cpp @ 4482:8efeaba1b7f9

new configuration options: "DicomAlwaysAllowFind" and "DicomAlwaysAllowGet"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 28 Jan 2021 15:54:30 +0100
parents d9473bd5ed43
children 7053502fbf97
comparison
equal deleted inserted replaced
4481:fe7c2be5bce2 4482:8efeaba1b7f9
127 { 127 {
128 namespace 128 namespace
129 { 129 {
130 struct FindScpData 130 struct FindScpData
131 { 131 {
132 DicomServer::IRemoteModalities* modalities_;
133 IFindRequestHandler* findHandler_; 132 IFindRequestHandler* findHandler_;
134 IWorklistRequestHandler* worklistHandler_; 133 IWorklistRequestHandler* worklistHandler_;
135 DicomFindAnswers answers_; 134 DicomFindAnswers answers_;
136 DcmDataset* lastRequest_; 135 DcmDataset* lastRequest_;
137 const std::string* remoteIp_; 136 const std::string* remoteIp_;
138 const std::string* remoteAet_; 137 const std::string* remoteAet_;
139 const std::string* calledAet_; 138 const std::string* calledAet_;
140 139
141 FindScpData() : 140 FindScpData() :
142 modalities_(NULL),
143 findHandler_(NULL), 141 findHandler_(NULL),
144 worklistHandler_(NULL), 142 worklistHandler_(NULL),
145 answers_(false), 143 answers_(false),
146 lastRequest_(NULL), 144 lastRequest_(NULL),
147 remoteIp_(NULL), 145 remoteIp_(NULL),
225 223
226 /** 224 /**
227 * Ensure that the remote modality is known to Orthanc for C-FIND requests. 225 * Ensure that the remote modality is known to Orthanc for C-FIND requests.
228 **/ 226 **/
229 227
230 assert(data.modalities_ != NULL);
231 if (!data.modalities_->LookupAETitle(modality, *data.remoteAet_))
232 {
233 throw OrthancException(ErrorCode_UnknownModality,
234 "Modality with AET \"" + (*data.remoteAet_) +
235 "\" is not defined in the \"DicomModalities\" configuration option");
236 }
237
238
239 if (sopClassUid == UID_FINDModalityWorklistInformationModel) 228 if (sopClassUid == UID_FINDModalityWorklistInformationModel)
240 { 229 {
241 data.answers_.SetWorklist(true); 230 data.answers_.SetWorklist(true);
242 231
243 if (data.worklistHandler_ != NULL) 232 if (data.worklistHandler_ != NULL)
357 346
358 347
359 OFCondition Internals::findScp(T_ASC_Association * assoc, 348 OFCondition Internals::findScp(T_ASC_Association * assoc,
360 T_DIMSE_Message * msg, 349 T_DIMSE_Message * msg,
361 T_ASC_PresentationContextID presID, 350 T_ASC_PresentationContextID presID,
362 DicomServer::IRemoteModalities& modalities,
363 IFindRequestHandler* findHandler, 351 IFindRequestHandler* findHandler,
364 IWorklistRequestHandler* worklistHandler, 352 IWorklistRequestHandler* worklistHandler,
365 const std::string& remoteIp, 353 const std::string& remoteIp,
366 const std::string& remoteAet, 354 const std::string& remoteAet,
367 const std::string& calledAet, 355 const std::string& calledAet,
368 int timeout) 356 int timeout)
369 { 357 {
370 FindScpData data; 358 FindScpData data;
371 data.modalities_ = &modalities;
372 data.findHandler_ = findHandler; 359 data.findHandler_ = findHandler;
373 data.worklistHandler_ = worklistHandler; 360 data.worklistHandler_ = worklistHandler;
374 data.lastRequest_ = NULL; 361 data.lastRequest_ = NULL;
375 data.remoteIp_ = &remoteIp; 362 data.remoteIp_ = &remoteIp;
376 data.remoteAet_ = &remoteAet; 363 data.remoteAet_ = &remoteAet;