33 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/ofstd/ofcond.h"
37 #define DUL_TYPENEGOTIATIONOFUSERIDENTITY (unsigned char)0x58
40 enum T_ASC_UserIdentityNegotiationMode
42 ASC_USER_IDENTITY_NONE = 0,
43 ASC_USER_IDENTITY_USER = 1,
44 ASC_USER_IDENTITY_USER_PASSWORD = 2,
45 ASC_USER_IDENTITY_KERBEROS = 3,
46 ASC_USER_IDENTITY_SAML = 4,
47 ASC_USER_IDENTITY_UNKNOWN
65 virtual unsigned char pduType()
const =0;
93 unsigned long& bytesRead,
94 unsigned long availData) =0;
102 unsigned long& lengthWritten)
const =0;
107 virtual void clear() =0;
113 virtual void dump(STD_NAMESPACE ostream& outstream)
const =0;
149 virtual void clear();
170 const Uint16& length);
178 const Uint16& length);
188 Uint16& resultLen)
const;
198 Uint16& resultLen)
const;
222 unsigned long& lengthWritten)
const;
239 unsigned long &bytesRead,
240 unsigned long availData);
246 void dump(STD_NAMESPACE ostream& outstream)
const;
297 virtual void clear();
305 const Uint16& rspLen);
315 Uint16& resultLen)
const;
329 unsigned long& lengthWritten)
const;
340 unsigned long &bytesRead,
341 unsigned long availData);
347 void dump(STD_NAMESPACE ostream& outstream)
const;
UserIdentityNegotiationSubItemAC()
Constructor, creates an empty user identity response structure.
virtual OFCondition parseFromBuffer(unsigned char *readBuffer, unsigned long &bytesRead, unsigned long availData)=0
Parse item from buffer.
void setReqPosResponse(const OFBool &reqPosRsp)
Enables/disables requesting a positive response from the server.
virtual void dump(STD_NAMESPACE ostream &outstream) const =0
Dump content of this user identity sub item to output stream.
virtual void clear()=0
Clears member variables and frees memory.
void setIdentityType(const T_ASC_UserIdentityNegotiationMode &mode)
Sets identity type to be used.
T_ASC_UserIdentityNegotiationMode m_userIdentityType
User Identity Type: 1 (username), 2 (username/password), 3 (kerberos), 4 (SAML)
Uint16 getServerResponse(char *&targetBuffer, Uint16 &resultLen) const
Returns content of server response field Memory is allocated by this function and must be freed by th...
~UserIdentityNegotiationSubItemAC()
Destructor, frees memory.
virtual unsigned char getItemType() const
Returns item type, which is constantly 0x58.
virtual unsigned char pduType() const =0
Denotes whether instance is part of a request (DUL_TYPEASSOCIATERQ) or acknowledge PDU (DUL_TYPEASSOC...
void dump(STD_NAMESPACE ostream &outstream) const
Dump content of this user identity sub item to output stream.
const unsigned char m_reserved
Reserved field, should be always sent with value 0 (default)
void dump(STD_NAMESPACE ostream &outstream) const
Dump content of this user identity sub item to output stream.
virtual ~UserIdentityNegotiationSubItem()
Destructor, nothing to clean up.
UserIdentityNegotiationSubItem()
Constructor.
~UserIdentityNegotiationSubItemRQ()
Destructor, nothing to clean up.
virtual void clear()
Clears member variables and frees memory.
OFCondition streamedLength(unsigned long &length) const
Computes total length of item if streamed into buffer.
unsigned char m_posRspRequested
If 1, positive response is requested from server. Set to 0 otherwise.
T_ASC_UserIdentityNegotiationMode getIdentityType()
Returns identity type that will be used.
Uint16 m_secFieldLength
Length of primary value field in bytes.
OFCondition stream(unsigned char *targetBuffer, unsigned long &lengthWritten) const
Stream the package into a byte stream for network transmission.
OFCondition streamedLength(unsigned long &length) const
Computes total length of item if streamed into buffer.
virtual OFCondition stream(unsigned char *targetBuffer, unsigned long &lengthWritten) const =0
Stream the package into a byte stream for network transmission.
OFBool isPosResponseRequested()
Informs (the server) whether a positive response was requested.
Uint16 getSecField(char *&resultBuf, Uint16 &resultLen) const
Returns content of secondary field.
OFCondition parseFromBuffer(unsigned char *readBuffer, unsigned long &bytesRead, unsigned long availData)
Parse sub item from buffer.
Uint16 m_rspLength
Length of server response in bytes.
UserIdentityNegotiationSubItemAC & operator=(const UserIdentityNegotiationSubItemAC &rhs)
Assignment operator, does a deep copy of a class instance.
UserIdentityNegotiationSubItemRQ & operator=(const UserIdentityNegotiationSubItemRQ &rhs)
Assignment operator, does a deep copy of a class instance.
char * m_primField
Buffer for primary value field.
Uint16 getPrimField(char *&resultBuf, Uint16 &resultLen) const
Returns content of primary field.
UserIdentityNegotiationSubItemRQ()
Constructor.
void setPrimField(const char *buffer, const Uint16 &length)
Sets content of primary field.
const unsigned char m_itemType
Item type of this user item.
void setServerResponse(const char *rsp, const Uint16 &rspLen)
Sets server response value.
virtual OFCondition streamedLength(unsigned long &length) const =0
Computes total length of item if streamed to a buffer.
char * m_serverRsp
Buffer for server response.
virtual void clear()
Clears member variables and frees memory.
Abstract base class for User Identity Negotiation user items.
OFCondition stream(unsigned char *targetBuffer, unsigned long &lengthWritten) const
Stream the package into a byte stream for network transmission.
Class for User Identity Negotiation request user item.
char * m_secField
Buffer for secondary value field.
virtual unsigned char getReserved() const
Returns reserved field, which is 0 in this implementation (see DICOM standard)
Uint16 m_primFieldLength
Length of primary value field in bytes.
void setSecField(const char *buffer, const Uint16 &length)
Sets content of secondary field.
OFCondition parseFromBuffer(unsigned char *readBuffer, unsigned long &bytesRead, unsigned long availData)
Parse sub item from buffer.
unsigned char pduType() const
Denotes that instance is part of a request (DUL_TYPEASSOCIATERQ)
General purpose class for condition codes.
unsigned char pduType() const
Denotes that instance is part of a request (DUL_TYPEASSOCIATEAC)