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 
27 {
28 public:
34  {
36  enum class Result
37  {
38  Acceptance = 0,
39  UserRejection = 1,
40  NoReason = 2,
41  AbstractSyntaxNotSupported = 3,
42  TransferSyntaxesNotSupported = 4,
43  };
44 
47  uint8_t id,
48  std::string const & abstract_syntax,
49  std::vector<std::string> const & transfer_syntaxes,
50  bool scu_role_support, bool scp_role_support,
51  Result result=Result::NoReason);
52 
55  std::string const & abstract_syntax,
56  std::vector<std::string> const & transfer_syntaxes,
57  bool scu_role_support, bool scp_role_support,
58  Result result=Result::NoReason);
59 
61  uint8_t id;
62 
64  std::string abstract_syntax;
65 
67  std::vector<std::string> transfer_syntaxes;
68 
71 
74 
77 
79  bool operator==(PresentationContext const & other) const;
80  };
81 
84  {
86  enum class Type
87  {
88  None = 0,
89  Username = 1,
90  UsernameAndPassword = 2,
91  Kerberos = 3,
92  SAML = 4
93  };
94 
95  UserIdentity();
96 
98  Type type, std::string const & primary_field,
99  std::string const & secondary_field);
100 
103 
105  std::string primary_field;
106 
108  std::string secondary_field;
109 
111  bool operator==(UserIdentity const & other) const;
112  };
113 
116 
119 
122  pdu::AAssociateAC const & pdu, AssociationParameters const & request);
123 
125  std::string const & get_called_ae_title() const;
126 
133  AssociationParameters & set_called_ae_title(std::string const & value);
134 
136  std::string const & get_calling_ae_title() const;
137 
144  AssociationParameters & set_calling_ae_title(std::string const & value);
145 
147  std::vector<PresentationContext> const & get_presentation_contexts() const;
148 
151  set_presentation_contexts(std::vector<PresentationContext> const & value);
152 
154  UserIdentity const & get_user_identity() const;
155 
157  AssociationParameters & set_user_identity_to_none();
158 
161  set_user_identity_to_username(std::string const & username);
162 
165  set_user_identity_to_username_and_password(
166  std::string const & username, std::string const & password);
167 
170  set_user_identity_to_kerberos(std::string const & ticket);
171 
174  set_user_identity_to_saml(std::string const & assertion);
175 
177  uint32_t get_maximum_length() const;
178 
183  AssociationParameters & set_maximum_length(uint32_t value);
184 
186  uint16_t get_maximum_number_operations_invoked() const;
187 
192  AssociationParameters & set_maximum_number_operations_invoked(uint16_t value);
193 
195  uint16_t get_maximum_number_operations_performed() const;
196 
201  AssociationParameters & set_maximum_number_operations_performed(uint16_t value);
202 
204  std::vector<pdu::SOPClassExtendedNegotiation>
205  get_sop_class_extended_negotiation() const;
206 
211  void set_sop_class_extended_negotiation(
212  std::vector<pdu::SOPClassExtendedNegotiation> const & value);
213 
215  std::vector<pdu::SOPClassCommonExtendedNegotiation>
216  get_sop_class_common_extended_negotiation() const;
217 
222  void set_sop_class_common_extended_negotiation(
223  std::vector<pdu::SOPClassCommonExtendedNegotiation> const & value);
224 
226  pdu::AAssociateRQ as_a_associate_rq() const;
227 
229  pdu::AAssociateAC as_a_associate_ac() const;
230 
232  bool operator==(AssociationParameters const & other) const;
233 
234 private:
235  std::string _called_ae_title;
236  std::string _calling_ae_title;
237  std::vector<PresentationContext> _presentation_contexts;
238  UserIdentity _user_identity;
239  uint32_t _maximum_length;
240  uint16_t _maximum_number_operations_invoked;
241  uint16_t _maximum_number_operations_performed;
242  std::vector<pdu::SOPClassExtendedNegotiation>
243  _sop_class_extended_negotiation;
244  std::vector<pdu::SOPClassCommonExtendedNegotiation>
245  _sop_class_common_extended_negotiation;
246 
248  AssociationParameters & _set_user_identity(UserIdentity const & value);
249 };
250 
251 }
252 
253 #endif // _061fafd4_982e_4a7e_9eb0_29e06443ebf3
uint8_t id
Identifier of the presentation context, must be odd.
Definition: AssociationParameters.h:61
bool scp_role_support
Support for SCP role.
Definition: AssociationParameters.h:73
User Identity, cf. PS3.8 D.3.3.7.
Definition: AssociationParameters.h:83
Definition: Association.h:24
Type
User identity type.
Definition: AssociationParameters.h:86
std::string abstract_syntax
Proposed abstract syntax.
Definition: AssociationParameters.h:64
Encapsulate association parameters.
Definition: AssociationParameters.h:26
A-ASSOCIATE-AC PDU, cf. PS 3.8, 9.3.3.
Definition: AAssociateAC.h:25
A-ASSOCIATE-RQ, cf. PS 3.8, 9.3.2.
Definition: AAssociateRQ.h:25
#define ODIL_API
Definition: odil.h:28
std::string primary_field
Primary identity field.
Definition: AssociationParameters.h:105
Result
Result of the presentation context negotiation.
Definition: AssociationParameters.h:36
std::string secondary_field
Secondary identity field.
Definition: AssociationParameters.h:108
std::vector< std::string > transfer_syntaxes
Proposed transfer syntaxes or accepted transfer syntax.
Definition: AssociationParameters.h:67
Result result
Result of the negotiation.
Definition: AssociationParameters.h:76
Type type
Identity type.
Definition: AssociationParameters.h:102
bool scu_role_support
Support for SCU role.
Definition: AssociationParameters.h:70
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:33