Mercurial > hg > orthanc
annotate Core/DicomNetworking/DicomServer.h @ 2461:47029de27a74
fix for openbsd
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 04 Jan 2018 20:02:35 +0100 |
parents | 878b59270859 |
children | 4e43e67f8ecf |
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 |
2447
878b59270859
upgrade to year 2018
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2382
diff
changeset
|
5 * Copyright (C) 2017-2018 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 | |
34 #pragma once | |
35 | |
2380
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
36 #if ORTHANC_ENABLE_DCMTK_NETWORKING != 1 |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
37 # 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
|
38 #endif |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
39 |
0 | 40 #include "IFindRequestHandlerFactory.h" |
41 #include "IMoveRequestHandlerFactory.h" | |
42 #include "IStoreRequestHandlerFactory.h" | |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
43 #include "IWorklistRequestHandlerFactory.h" |
0 | 44 #include "IApplicationEntityFilter.h" |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
45 #include "RemoteModalityParameters.h" |
0 | 46 |
47 #include <boost/shared_ptr.hpp> | |
48 #include <boost/noncopyable.hpp> | |
49 | |
1682
6414043df7d8
integration mainline->db-changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1681
diff
changeset
|
50 |
62 | 51 namespace Orthanc |
0 | 52 { |
53 class DicomServer : public boost::noncopyable | |
54 { | |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
55 public: |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
56 // 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
|
57 class IRemoteModalities : public boost::noncopyable |
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 public: |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
60 virtual ~IRemoteModalities() |
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 } |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
63 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
64 virtual bool IsSameAETitle(const std::string& aet1, |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
65 const std::string& aet2) = 0; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
66 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
67 virtual bool LookupAETitle(RemoteModalityParameters& modality, |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
68 const std::string& aet) = 0; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
69 }; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
70 |
0 | 71 private: |
72 struct PImpl; | |
73 boost::shared_ptr<PImpl> pimpl_; | |
74 | |
75 bool checkCalledAet_; | |
76 std::string aet_; | |
77 uint16_t port_; | |
78 bool continue_; | |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
79 uint32_t associationTimeout_; |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
80 IRemoteModalities* modalities_; |
0 | 81 IFindRequestHandlerFactory* findRequestHandlerFactory_; |
82 IMoveRequestHandlerFactory* moveRequestHandlerFactory_; | |
83 IStoreRequestHandlerFactory* storeRequestHandlerFactory_; | |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
84 IWorklistRequestHandlerFactory* worklistRequestHandlerFactory_; |
0 | 85 IApplicationEntityFilter* applicationEntityFilter_; |
86 | |
1681
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1675
diff
changeset
|
87 static void ServerThread(DicomServer* server); |
0 | 88 |
89 public: | |
90 DicomServer(); | |
91 | |
92 ~DicomServer(); | |
93 | |
128 | 94 void SetPortNumber(uint16_t port); |
95 uint16_t GetPortNumber() const; | |
0 | 96 |
2069
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
97 void SetAssociationTimeout(uint32_t seconds); |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
98 uint32_t GetAssociationTimeout() const; |
0 | 99 |
100 void SetCalledApplicationEntityTitleCheck(bool check); | |
101 bool HasCalledApplicationEntityTitleCheck() const; | |
102 | |
103 void SetApplicationEntityTitle(const std::string& aet); | |
104 const std::string& GetApplicationEntityTitle() const; | |
105 | |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
106 void SetRemoteModalities(IRemoteModalities& modalities); |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
107 IRemoteModalities& GetRemoteModalities() const; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
108 |
0 | 109 void SetFindRequestHandlerFactory(IFindRequestHandlerFactory& handler); |
110 bool HasFindRequestHandlerFactory() const; | |
111 IFindRequestHandlerFactory& GetFindRequestHandlerFactory() const; | |
112 | |
113 void SetMoveRequestHandlerFactory(IMoveRequestHandlerFactory& handler); | |
114 bool HasMoveRequestHandlerFactory() const; | |
115 IMoveRequestHandlerFactory& GetMoveRequestHandlerFactory() const; | |
116 | |
117 void SetStoreRequestHandlerFactory(IStoreRequestHandlerFactory& handler); | |
118 bool HasStoreRequestHandlerFactory() const; | |
119 IStoreRequestHandlerFactory& GetStoreRequestHandlerFactory() const; | |
120 | |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
121 void SetWorklistRequestHandlerFactory(IWorklistRequestHandlerFactory& handler); |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
122 bool HasWorklistRequestHandlerFactory() const; |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
123 IWorklistRequestHandlerFactory& GetWorklistRequestHandlerFactory() const; |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
124 |
0 | 125 void SetApplicationEntityFilter(IApplicationEntityFilter& handler); |
126 bool HasApplicationEntityFilter() const; | |
127 IApplicationEntityFilter& GetApplicationEntityFilter() const; | |
128 | |
129 void Start(); | |
130 | |
131 void Stop(); | |
690
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
132 |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
133 bool IsMyAETitle(const std::string& aet) const; |
0 | 134 }; |
135 | |
136 } |