Mercurial > hg > orthanc
annotate OrthancFramework/Sources/DicomNetworking/DicomServer.h @ 4437:d9473bd5ed43
upgrade to year 2021
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 06 Jan 2021 17:27:28 +0100 |
parents | fcbac3e8ac1c |
children | 5209a9ff6e38 |
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:
690
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4432
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
10 * the License, or (at your option) any later version. |
136 | 11 * |
0 | 12 * This program is distributed in the hope that it will be useful, but |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
15 * Lesser General Public License for more details. |
0 | 16 * |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
18 * License along with this program. If not, see |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
0 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
2380
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
25 #if ORTHANC_ENABLE_DCMTK_NETWORKING != 1 |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
26 # error The macro ORTHANC_ENABLE_DCMTK_NETWORKING must be set to 1 |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
27 #endif |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
28 |
4430
f5d44e30b429
testing DICOM TLS in Orthanc SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
29 #if !defined(ORTHANC_ENABLE_SSL) |
f5d44e30b429
testing DICOM TLS in Orthanc SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
30 # error The macro ORTHANC_ENABLE_SSL must be defined |
f5d44e30b429
testing DICOM TLS in Orthanc SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
31 #endif |
f5d44e30b429
testing DICOM TLS in Orthanc SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
32 |
0 | 33 #include "IFindRequestHandlerFactory.h" |
34 #include "IMoveRequestHandlerFactory.h" | |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
35 #include "IGetRequestHandlerFactory.h" |
0 | 36 #include "IStoreRequestHandlerFactory.h" |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
37 #include "IWorklistRequestHandlerFactory.h" |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
38 #include "IStorageCommitmentRequestHandlerFactory.h" |
0 | 39 #include "IApplicationEntityFilter.h" |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
40 #include "RemoteModalityParameters.h" |
0 | 41 |
42 #include <boost/shared_ptr.hpp> | |
43 #include <boost/noncopyable.hpp> | |
44 | |
1682
6414043df7d8
integration mainline->db-changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1681
diff
changeset
|
45 |
62 | 46 namespace Orthanc |
0 | 47 { |
48 class DicomServer : public boost::noncopyable | |
49 { | |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
50 public: |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
51 // WARNING: The methods of this class must be thread-safe |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
52 class IRemoteModalities : public boost::noncopyable |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
53 { |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
54 public: |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
55 virtual ~IRemoteModalities() |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
56 { |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
57 } |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
58 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
59 virtual bool IsSameAETitle(const std::string& aet1, |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
60 const std::string& aet2) = 0; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
61 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
62 virtual bool LookupAETitle(RemoteModalityParameters& modality, |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
63 const std::string& aet) = 0; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
64 }; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
65 |
0 | 66 private: |
67 struct PImpl; | |
68 boost::shared_ptr<PImpl> pimpl_; | |
69 | |
70 bool checkCalledAet_; | |
71 std::string aet_; | |
72 uint16_t port_; | |
73 bool continue_; | |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
74 uint32_t associationTimeout_; |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
75 IRemoteModalities* modalities_; |
0 | 76 IFindRequestHandlerFactory* findRequestHandlerFactory_; |
77 IMoveRequestHandlerFactory* moveRequestHandlerFactory_; | |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
78 IGetRequestHandlerFactory* getRequestHandlerFactory_; |
0 | 79 IStoreRequestHandlerFactory* storeRequestHandlerFactory_; |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
80 IWorklistRequestHandlerFactory* worklistRequestHandlerFactory_; |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
81 IStorageCommitmentRequestHandlerFactory* storageCommitmentFactory_; |
0 | 82 IApplicationEntityFilter* applicationEntityFilter_; |
83 | |
4430
f5d44e30b429
testing DICOM TLS in Orthanc SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
84 static void ServerThread(DicomServer* server, |
f5d44e30b429
testing DICOM TLS in Orthanc SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
85 bool useDicomTls); |
f5d44e30b429
testing DICOM TLS in Orthanc SCP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4119
diff
changeset
|
86 |
0 | 87 public: |
88 DicomServer(); | |
89 | |
90 ~DicomServer(); | |
91 | |
128 | 92 void SetPortNumber(uint16_t port); |
93 uint16_t GetPortNumber() const; | |
0 | 94 |
2069
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
95 void SetAssociationTimeout(uint32_t seconds); |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
96 uint32_t GetAssociationTimeout() const; |
0 | 97 |
98 void SetCalledApplicationEntityTitleCheck(bool check); | |
99 bool HasCalledApplicationEntityTitleCheck() const; | |
100 | |
101 void SetApplicationEntityTitle(const std::string& aet); | |
102 const std::string& GetApplicationEntityTitle() const; | |
103 | |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
104 void SetRemoteModalities(IRemoteModalities& modalities); |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
105 IRemoteModalities& GetRemoteModalities() const; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
106 |
0 | 107 void SetFindRequestHandlerFactory(IFindRequestHandlerFactory& handler); |
108 bool HasFindRequestHandlerFactory() const; | |
109 IFindRequestHandlerFactory& GetFindRequestHandlerFactory() const; | |
110 | |
111 void SetMoveRequestHandlerFactory(IMoveRequestHandlerFactory& handler); | |
112 bool HasMoveRequestHandlerFactory() const; | |
113 IMoveRequestHandlerFactory& GetMoveRequestHandlerFactory() const; | |
114 | |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
115 void SetGetRequestHandlerFactory(IGetRequestHandlerFactory& handler); |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
116 bool HasGetRequestHandlerFactory() const; |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
117 IGetRequestHandlerFactory& GetGetRequestHandlerFactory() const; |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
118 |
0 | 119 void SetStoreRequestHandlerFactory(IStoreRequestHandlerFactory& handler); |
120 bool HasStoreRequestHandlerFactory() const; | |
121 IStoreRequestHandlerFactory& GetStoreRequestHandlerFactory() const; | |
122 | |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
123 void SetWorklistRequestHandlerFactory(IWorklistRequestHandlerFactory& handler); |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
124 bool HasWorklistRequestHandlerFactory() const; |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
125 IWorklistRequestHandlerFactory& GetWorklistRequestHandlerFactory() const; |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
126 |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
127 void SetStorageCommitmentRequestHandlerFactory(IStorageCommitmentRequestHandlerFactory& handler); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
128 bool HasStorageCommitmentRequestHandlerFactory() const; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
129 IStorageCommitmentRequestHandlerFactory& GetStorageCommitmentRequestHandlerFactory() const; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
130 |
0 | 131 void SetApplicationEntityFilter(IApplicationEntityFilter& handler); |
132 bool HasApplicationEntityFilter() const; | |
133 IApplicationEntityFilter& GetApplicationEntityFilter() const; | |
134 | |
135 void Start(); | |
136 | |
137 void Stop(); | |
690
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
138 |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
139 bool IsMyAETitle(const std::string& aet) const; |
0 | 140 }; |
141 | |
142 } |