Odil
A C++11 library for the DICOM standard
AssociationParameters.h
Go to the documentation of this file.
1 /*************************************************************************
2  * odil - Copyright (C) Universite de Strasbourg
3  * Distributed under the terms of the CeCILL-B license, as published by
4  * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5  * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6  * for details.
7  ************************************************************************/
8 
9 #ifndef _061fafd4_982e_4a7e_9eb0_29e06443ebf3
10 #define _061fafd4_982e_4a7e_9eb0_29e06443ebf3
11 
12 #include <cstdint>
13 #include <string>
14 #include <vector>
15 
16 #include "odil/odil.h"
17 #include "odil/pdu/AAssociateAC.h"
18 #include "odil/pdu/AAssociateRQ.h"
21 
22 namespace odil
23 {
24 
26 class ODIL_API AssociationParameters
27 {
28 public:
33  struct ODIL_API PresentationContext
34  {
36  enum class Result
37  {
38  Acceptance = 0,
39  UserRejection = 1,
40  NoReason = 2,
41  AbstractSyntaxNotSupported = 3,
42  TransferSyntaxesNotSupported = 4,
43  };
44 
45  enum class Role
46  {
47  Unspecified, // No information specified in a query
48  None, // No role accepted in a response
49  SCU,
50  SCP,
51  Both,
52  };
53 
56  uint8_t id,
57  std::string const & abstract_syntax,
58  std::vector<std::string> const & transfer_syntaxes,
59  Role role,
60  Result result=Result::NoReason);
61 
64  std::string const & abstract_syntax,
65  std::vector<std::string> const & transfer_syntaxes,
66  Role role,
67  Result result=Result::NoReason);
68 
70  uint8_t id;
71 
73  std::string abstract_syntax;
74 
76  std::vector<std::string> transfer_syntaxes;
77 
79  Role role;
80 
82  Result result;
83 
85  bool operator==(PresentationContext const & other) const;
86  };
87 
89  struct ODIL_API UserIdentity
90  {
92  enum class Type
93  {
94  None = 0,
95  Username = 1,
96  UsernameAndPassword = 2,
97  Kerberos = 3,
98  SAML = 4
99  };
100 
102 
103  UserIdentity(
104  Type type, std::string const & primary_field,
105  std::string const & secondary_field);
106 
108  Type type;
109 
111  std::string primary_field;
112 
114  std::string secondary_field;
115 
117  bool operator==(UserIdentity const & other) const;
118  };
119 
122 
125 
128  pdu::AAssociateAC const & pdu, AssociationParameters const & request);
129 
131  std::string const & get_called_ae_title() const;
132 
139  AssociationParameters & set_called_ae_title(std::string const & value);
140 
142  std::string const & get_calling_ae_title() const;
143 
150  AssociationParameters & set_calling_ae_title(std::string const & value);
151 
153  std::vector<PresentationContext> const & get_presentation_contexts() const;
154 
157  set_presentation_contexts(std::vector<PresentationContext> const & value);
158 
160  UserIdentity const & get_user_identity() const;
161 
163  AssociationParameters & set_user_identity_to_none();
164 
167  set_user_identity_to_username(std::string const & username);
168 
171  set_user_identity_to_username_and_password(
172  std::string const & username, std::string const & password);
173 
176  set_user_identity_to_kerberos(std::string const & ticket);
177 
180  set_user_identity_to_saml(std::string const & assertion);
181 
183  uint32_t get_maximum_length() const;
184 
189  AssociationParameters & set_maximum_length(uint32_t value);
190 
192  uint16_t get_maximum_number_operations_invoked() const;
193 
198  AssociationParameters & set_maximum_number_operations_invoked(uint16_t value);
199 
201  uint16_t get_maximum_number_operations_performed() const;
202 
207  AssociationParameters & set_maximum_number_operations_performed(uint16_t value);
208 
210  std::vector<pdu::SOPClassExtendedNegotiation>
211  get_sop_class_extended_negotiation() const;
212 
217  void set_sop_class_extended_negotiation(
218  std::vector<pdu::SOPClassExtendedNegotiation> const & value);
219 
221  std::vector<pdu::SOPClassCommonExtendedNegotiation>
222  get_sop_class_common_extended_negotiation() const;
223 
228  void set_sop_class_common_extended_negotiation(
229  std::vector<pdu::SOPClassCommonExtendedNegotiation> const & value);
230 
232  pdu::AAssociateRQ as_a_associate_rq() const;
233 
235  pdu::AAssociateAC as_a_associate_ac() const;
236 
238  bool operator==(AssociationParameters const & other) const;
239 
240 private:
241  std::string _called_ae_title;
242  std::string _calling_ae_title;
243  std::vector<PresentationContext> _presentation_contexts;
244  UserIdentity _user_identity;
245  uint32_t _maximum_length;
246  uint16_t _maximum_number_operations_invoked;
247  uint16_t _maximum_number_operations_performed;
248  std::vector<pdu::SOPClassExtendedNegotiation>
249  _sop_class_extended_negotiation;
250  std::vector<pdu::SOPClassCommonExtendedNegotiation>
251  _sop_class_common_extended_negotiation;
252 
254  AssociationParameters & _set_user_identity(UserIdentity const & value);
255 };
256 
257 }
258 
259 #endif // _061fafd4_982e_4a7e_9eb0_29e06443ebf3
odil::AssociationParameters::PresentationContext
Presentation Context, cf. PS 3.8, 9.3.2.2, PS 3.8, 9.3.3.2, PS 3.7, D.3.3.4.1 and PS 3....
Definition: AssociationParameters.h:45
odil::AssociationParameters::UserIdentity::Type
Type
User identity type.
Definition: AssociationParameters.h:104
odil::operator==
bool operator==(Value::DataSets const &left, Value::DataSets const &right)
Equality test.
AAssociateAC.h
odil::AssociationParameters::PresentationContext::Result
Result
Result of the presentation context negotiation.
Definition: AssociationParameters.h:54
odil
Definition: Association.h:24
odil::AssociationParameters::UserIdentity
User Identity, cf. PS3.8 D.3.3.7.
Definition: AssociationParameters.h:101
ODIL_API
#define ODIL_API
Definition: odil.h:28
odil::pdu::AAssociateAC
A-ASSOCIATE-AC PDU, cf. PS 3.8, 9.3.3.
Definition: AAssociateAC.h:37
odil::AssociationParameters
Encapsulate association parameters.
Definition: AssociationParameters.h:32
odil::pdu::AAssociateRQ
A-ASSOCIATE-RQ, cf. PS 3.8, 9.3.2.
Definition: AAssociateRQ.h:37
SOPClassCommonExtendedNegotiation.h
odil.h
SOPClassExtendedNegotiation.h
odil::webservices::Type
Type
Type of the request or response (use for WADO & QIDO).
Definition: Utils.h:38
odil::AssociationParameters::PresentationContext::Role
Role
Definition: AssociationParameters.h:63
odil::SCU
Base class for all Service Class Users.
Definition: SCU.h:27
odil::SCP
Base class for all Service Class Providers.
Definition: SCP.h:30
AAssociateRQ.h