DCMTK
Version 3.6.4
OFFIS DICOM Toolkit
|
Class that encapsulates an SCP configuration that is needed in order to configure the service negotiation behavior (presentation contexts, AE title, listening port, etc) as well as some runtime configuration like the DIMSE timeout. More...
Public Member Functions | |
DcmSCPConfig () | |
Constructor, sets configuration's default values. | |
~DcmSCPConfig () | |
Destructor, cleans up memory. | |
DcmSCPConfig (const DcmSCPConfig &old) | |
copy constructor, performs deep copy. More... | |
DcmSCPConfig & | operator= (const DcmSCPConfig &obj) |
assignment operator, performs deep copy. More... | |
OFCondition | evaluateIncomingAssociation (T_ASC_Association &assoc) const |
This method evaluates an incoming association request according presentation context settings maintained by this configuration. More... | |
OFCondition | addPresentationContext (const OFString &abstractSyntax, const OFList< OFString > &xferSyntaxes, const T_ASC_SC_ROLE role=ASC_SC_ROLE_DEFAULT, const OFString &profile="DEFAULT") |
Add abstract syntax to presentation contexts the SCP is able to negotiate with SCUs. More... | |
void | setPort (const Uint16 port) |
Set SCP's TCP/IP listening port. More... | |
void | setAETitle (const OFString &aetitle) |
Set AE title of the server. More... | |
void | setRespondWithCalledAETitle (const OFBool useCalled) |
Set SCP to use the called AE title from the SCU request for the response, i.e. the SCP will always respond with setting its own name to the one the SCU used for calling. More... | |
OFCondition | loadAssociationCfgFile (const OFString &assocFile) |
Loads association configuration file. More... | |
OFCondition | setAndCheckAssociationProfile (const OFString &profileName) |
If an association profile should be selected, either by loading an association configuration file or using the addPresentationContext() function, one of those can be selected and checked for validity using this method. More... | |
OFString | getActiveAssociationProfile () const |
Returns the name of the currently active association profile. More... | |
OFCondition | checkAssociationProfile (const OFString &profileName, OFString &mangledName) const |
The profile with the given name is checked for validity using this method. More... | |
void | forceAssociationRefuse (const OFBool doRefuse) |
Force every association request to be refused by SCP, no matter what the SCU is offering. More... | |
void | setMaxReceivePDULength (const Uint32 maxRecPDU) |
Set maximum PDU size the SCP is able to receive. More... | |
void | setConnectionBlockingMode (const DUL_BLOCKOPTIONS blockingMode) |
Set whether waiting for a TCP/IP connection should be blocking or non-blocking. More... | |
void | setDIMSEBlockingMode (const T_DIMSE_BlockingMode blockingMode) |
Set whether DIMSE messaging should be blocking or non-blocking. More... | |
void | setDIMSETimeout (const Uint32 dimseTimeout) |
Set the timeout to be waited for incoming DIMSE message packets. More... | |
void | setACSETimeout (const Uint32 acseTimeout) |
Set the timeout used during ACSE messaging protocol. More... | |
void | setConnectionTimeout (const Uint32 timeout) |
Set the timeout that should be waited for connection requests. More... | |
void | setVerbosePCMode (const OFBool mode) |
Set whether to show presentation contexts in verbose or debug mode. More... | |
void | setHostLookupEnabled (const OFBool mode) |
Enables or disables looking up the host name from a connecting system. More... | |
void | setProgressNotificationMode (const OFBool mode) |
Set the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling DcmSCP::notifySENDProgress() and DcmSCP::notifyRECEIVEProgress(), respectively. More... | |
void | setAlwaysAcceptDefaultRole (const OFBool enabled) |
Option to always accept a default role as association acceptor. More... | |
Uint16 | getPort () const |
Returns TCP/IP port number SCP listens for new connection requests. More... | |
const OFString & | getAETitle () const |
Returns SCP's own AE title. More... | |
OFBool | getRespondWithCalledAETitle () const |
Returns whether SCP uses the called AE title from SCU requests to respond to connection requests instead of a configured AE title. More... | |
OFBool | getRefuseAssociation () const |
Returns whether SCP should refuse any association request no matter what the SCU proposes. More... | |
Uint32 | getMaxReceivePDULength () const |
Returns maximum PDU length configured to be received by SCP. More... | |
DUL_BLOCKOPTIONS | getConnectionBlockingMode () const |
Returns whether receiving of TCP/IP connection requests is done in blocking or unblocking mode. More... | |
T_DIMSE_BlockingMode | getDIMSEBlockingMode () const |
Returns whether receiving of DIMSE messages is done in blocking or unblocking mode. More... | |
Uint32 | getDIMSETimeout () const |
Returns DIMSE timeout (only applicable in blocking mode) More... | |
Uint32 | getACSETimeout () const |
Returns ACSE timeout. More... | |
Uint32 | getConnectionTimeout () const |
Returns connection timeout. More... | |
OFBool | getVerbosePCMode () const |
Returns the verbose presentation context mode configured specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode. More... | |
OFBool | getHostLookupEnabled () const |
Returns whether a connecting system's host name is looked up. More... | |
OFBool | getProgressNotificationMode () const |
Returns the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling DcmSCP::notifySENDProgress() and DcmSCP::notifyRECEIVEProgress(), respectively. More... | |
void | dumpPresentationContexts (STD_NAMESPACE ostream &out, OFString profileName="") |
Dump presentation contexts to given output stream, useful for debugging. More... | |
Protected Member Functions | |
OFString | mangleProfileName (const OFString &profile) const |
Mangles a given string into valid profile name. More... | |
OFString | numToString (const size_t num) const |
Convert number to string. More... | |
OFCondition | addNewTSList (const OFString &tsListName, const OFList< OFString > &ts) |
Add given list of transfers syntaxes under given name to SCP's association configuration. More... | |
Protected Attributes | |
DcmAssociationConfiguration | m_assocConfig |
Association configuration. More... | |
OFString | m_assocCfgProfileName |
Profile in association configuration that should be used. More... | |
Uint16 | m_port |
Port on which the SCP is listening for association requests. The default port is 104. | |
OFString | m_aetitle |
AE title to be used for responding to SCU (default: DCMTK_SCP). More... | |
OFBool | m_refuseAssociation |
Indicates if the application shall refuse any association attempt regardless of what the SCU proposes. More... | |
Uint32 | m_maxReceivePDULength |
Maximum PDU size the SCP is able to receive. More... | |
DUL_BLOCKOPTIONS | m_connectionBlockingMode |
Blocking mode for TCP/IP connection requests. More... | |
T_DIMSE_BlockingMode | m_dimseBlockingMode |
Blocking mode for DIMSE operations. More... | |
Uint32 | m_dimseTimeout |
Timeout for DIMSE operations in seconds. More... | |
Uint32 | m_acseTimeout |
Timeout for ACSE operations in seconds. More... | |
OFBool | m_verbosePCMode |
Verbose PC mode. More... | |
Uint32 | m_connectionTimeout |
Timeout in seconds that should be waited for an incoming TCP/IP connection until the call returns. More... | |
OFBool | m_respondWithCalledAETitle |
If set, the AE title as received in the request (called AE title) is used in response (default: OFTrue). More... | |
OFBool | m_progressNotificationMode |
Progress notification mode (default: OFTrue) | |
Class that encapsulates an SCP configuration that is needed in order to configure the service negotiation behavior (presentation contexts, AE title, listening port, etc) as well as some runtime configuration like the DIMSE timeout.
The configuration, however, is not updated to reflect any runtime connection information, e.g. information about the current SCU connected or the like. The presentation context configuration is held in profiles. Per default, the name of the active association configuration is DEFAULT.
DcmSCPConfig::DcmSCPConfig | ( | const DcmSCPConfig & | old | ) |
copy constructor, performs deep copy.
old | item to be copied |
|
protected |
Add given list of transfers syntaxes under given name to SCP's association configuration.
tsListName | [in] The name of the transfer syntax list to create |
ts | [in] The list of transfer snytaxes to add |
OFCondition DcmSCPConfig::addPresentationContext | ( | const OFString & | abstractSyntax, |
const OFList< OFString > & | xferSyntaxes, | ||
const T_ASC_SC_ROLE | role = ASC_SC_ROLE_DEFAULT , |
||
const OFString & | profile = "DEFAULT" |
||
) |
Add abstract syntax to presentation contexts the SCP is able to negotiate with SCUs.
abstractSyntax | [in] The UID of the abstract syntax (e.g. SOP class) to add |
xferSyntaxes | [in] List of transfer syntaxes (UIDs) that should be supported for the given abstract syntax name |
role | [in] The role to be negotiated |
profile | [in] The profile the abstract syntax should be added to. The default is to add it to the DcmSCP's internal standard profile called "DEFAULT". |
OFCondition DcmSCPConfig::checkAssociationProfile | ( | const OFString & | profileName, |
OFString & | mangledName | ||
) | const |
The profile with the given name is checked for validity using this method.
profileName | [in] The name of the association profile which should be checked |
mangledName | [out] The mangled profile name |
void DcmSCPConfig::dumpPresentationContexts | ( | STD_NAMESPACE ostream & | out, |
OFString | profileName = "" |
||
) |
Dump presentation contexts to given output stream, useful for debugging.
out | [out] The output stream |
profileName | [in] The profile to dump. If empty (default), the currently selected profile is dumped. |
OFCondition DcmSCPConfig::evaluateIncomingAssociation | ( | T_ASC_Association & | assoc | ) | const |
This method evaluates an incoming association request according presentation context settings maintained by this configuration.
assoc | T_ASC_Association structure to be evaluated |
void DcmSCPConfig::forceAssociationRefuse | ( | const OFBool | doRefuse | ) |
Force every association request to be refused by SCP, no matter what the SCU is offering.
doRefuse | [in] If OFTrue, every association is being refused. DcmSCP's default is not to refuse every association. |
Uint32 DcmSCPConfig::getACSETimeout | ( | ) | const |
Returns ACSE timeout.
OFString DcmSCPConfig::getActiveAssociationProfile | ( | ) | const |
Returns the name of the currently active association profile.
const OFString& DcmSCPConfig::getAETitle | ( | ) | const |
Returns SCP's own AE title.
Only used if the SCP is not configured to respond with the called AE title the SCU uses for association negotiation, see setRespondWithCalledAETitle().
DUL_BLOCKOPTIONS DcmSCPConfig::getConnectionBlockingMode | ( | ) | const |
Returns whether receiving of TCP/IP connection requests is done in blocking or unblocking mode.
Uint32 DcmSCPConfig::getConnectionTimeout | ( | ) | const |
Returns connection timeout.
T_DIMSE_BlockingMode DcmSCPConfig::getDIMSEBlockingMode | ( | ) | const |
Returns whether receiving of DIMSE messages is done in blocking or unblocking mode.
Uint32 DcmSCPConfig::getDIMSETimeout | ( | ) | const |
Returns DIMSE timeout (only applicable in blocking mode)
OFBool DcmSCPConfig::getHostLookupEnabled | ( | ) | const |
Returns whether a connecting system's host name is looked up.
Uint32 DcmSCPConfig::getMaxReceivePDULength | ( | ) | const |
Returns maximum PDU length configured to be received by SCP.
Uint16 DcmSCPConfig::getPort | ( | ) | const |
Returns TCP/IP port number SCP listens for new connection requests.
OFBool DcmSCPConfig::getProgressNotificationMode | ( | ) | const |
Returns the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling DcmSCP::notifySENDProgress() and DcmSCP::notifyRECEIVEProgress(), respectively.
The progress notification is enabled by default.
OFBool DcmSCPConfig::getRefuseAssociation | ( | ) | const |
Returns whether SCP should refuse any association request no matter what the SCU proposes.
OFBool DcmSCPConfig::getRespondWithCalledAETitle | ( | ) | const |
Returns whether SCP uses the called AE title from SCU requests to respond to connection requests instead of a configured AE title.
OFBool DcmSCPConfig::getVerbosePCMode | ( | ) | const |
Returns the verbose presentation context mode configured specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode.
The latter is the default.
OFCondition DcmSCPConfig::loadAssociationCfgFile | ( | const OFString & | assocFile | ) |
Loads association configuration file.
assocFile | [in] The filename of the association configuration to be loaded. The association configuration file must be valid for an SCP. |
Mangles a given string into valid profile name.
Removes all spaces, and converts lower case to upper case characters.
profile | [in] The unmangled profile name |
|
protected |
Convert number to string.
num | [in] The integer number to convert |
DcmSCPConfig& DcmSCPConfig::operator= | ( | const DcmSCPConfig & | obj | ) |
assignment operator, performs deep copy.
obj | the config to copy from |
void DcmSCPConfig::setACSETimeout | ( | const Uint32 | acseTimeout | ) |
Set the timeout used during ACSE messaging protocol.
acseTimeout | [in] ACSE timeout in seconds. |
void DcmSCPConfig::setAETitle | ( | const OFString & | aetitle | ) |
Set AE title of the server.
aetitle | [in] The AE title of the server. By default, all SCU association requests calling another AE title will be rejected. This behavior can be changed by using the setRespondWithCalledAETitle() method. |
void DcmSCPConfig::setAlwaysAcceptDefaultRole | ( | const OFBool | enabled | ) |
Option to always accept a default role as association acceptor.
If OFFalse (default) the acceptor will reject a presentation context proposed with Default role (no role selection at all) when it is configured for role SCP only. If this option is set to OFTrue then such presentation contexts will be accepted in Default role (i.e. acceptor does not return role selection for this presentation context at all). Overall, if set to OFTrue, there are no requestor proposals possible that lead to a complete rejection of a presentation context. See also role documentation in dul.h.
enabled | If OFTrue, do not reject Default role proposals when configured for SCP role. OFFalse (default behaviour): Reject such proposals. |
OFCondition DcmSCPConfig::setAndCheckAssociationProfile | ( | const OFString & | profileName | ) |
If an association profile should be selected, either by loading an association configuration file or using the addPresentationContext() function, one of those can be selected and checked for validity using this method.
profileName | [in] The name of the association profile which must be configured before being selected here |
void DcmSCPConfig::setConnectionBlockingMode | ( | const DUL_BLOCKOPTIONS | blockingMode | ) |
Set whether waiting for a TCP/IP connection should be blocking or non-blocking.
In non-blocking mode, the networking routines will wait for specified connection timeout, see setConnectionTimeout() function. In blocking mode, no timeout is set but the operating system's network routines will be used to read from the socket for incoming data. In the worst case, this may be a long time until that call returns. The default of DcmSCP is blocking mode.
blockingMode | [in] Either DUL_BLOCK for blocking mode or DUL_NOBLOCK for non-blocking mode |
void DcmSCPConfig::setConnectionTimeout | ( | const Uint32 | timeout | ) |
Set the timeout that should be waited for connection requests.
Only relevant in non-blocking mode (default).
timeout | [in] TCP/IP connection timeout in seconds. |
void DcmSCPConfig::setDIMSEBlockingMode | ( | const T_DIMSE_BlockingMode | blockingMode | ) |
Set whether DIMSE messaging should be blocking or non-blocking.
In non-blocking mode, the networking routines will wait for DIMSE messages for the specified DIMSE timeout time, see setDIMSETimeout() function. In blocking mode, no timeout is set but the operating system's network routines will be used to read from the socket for new data. In the worst case, this may be a long time until that call returns. The default of DcmSCP is blocking mode.
blockingMode | [in] Either DIMSE_BLOCKING for blocking mode or DIMSE_NONBLOCKING for non-blocking mode |
void DcmSCPConfig::setDIMSETimeout | ( | const Uint32 | dimseTimeout | ) |
Set the timeout to be waited for incoming DIMSE message packets.
This is only relevant for DIMSE blocking mode messaging (see also setDIMSEBlockingMode().
dimseTimeout | [in] DIMSE receive timeout in seconds |
void DcmSCPConfig::setHostLookupEnabled | ( | const OFBool | mode | ) |
Enables or disables looking up the host name from a connecting system.
Note that this sets a GLOBAL flag in DCMTK, i.e. the behavior changes for all servers. This should be changed in the future.
mode | [in] OFTrue, if host name lookup should be enabled, OFFalse for disabling it. |
void DcmSCPConfig::setMaxReceivePDULength | ( | const Uint32 | maxRecPDU | ) |
Set maximum PDU size the SCP is able to receive.
This size is sent in association response message to SCU.
maxRecPDU | [in] The maximum PDU size to use in bytes |
void DcmSCPConfig::setPort | ( | const Uint16 | port | ) |
Set SCP's TCP/IP listening port.
port | [in] The port number to listen on. Note that usually on Unix-like systems only root user is permitted to open ports below 1024. |
void DcmSCPConfig::setProgressNotificationMode | ( | const OFBool | mode | ) |
Set the mode that specifies whether the progress of sending and receiving DIMSE messages is notified by calling DcmSCP::notifySENDProgress() and DcmSCP::notifyRECEIVEProgress(), respectively.
The progress notification is enabled by default.
mode | [in] Disable progress notification if OFFalse |
void DcmSCPConfig::setRespondWithCalledAETitle | ( | const OFBool | useCalled | ) |
Set SCP to use the called AE title from the SCU request for the response, i.e. the SCP will always respond with setting its own name to the one the SCU used for calling.
Overrides any AE title eventually set with setAETitle().
useCalled | [in] If OFTrue, the SCP will use the called AE title from the request for responding. DcmSCP's default is OFFalse. |
void DcmSCPConfig::setVerbosePCMode | ( | const OFBool | mode | ) |
Set whether to show presentation contexts in verbose or debug mode.
mode | [in] Show presentation contexts in verbose mode if OFTrue. By default, the presentation contexts are shown in debug mode. |
|
protected |
Timeout for ACSE operations in seconds.
Maximum time during association negotiation which is given for the SCU to follow the ACSE protocol.
|
protected |
AE title to be used for responding to SCU (default: DCMTK_SCP).
This value is not evaluated if the the SCP is configured to respond to any association requests with the name the SCU used as called AE title (which is the SCP's default behavior); see setRespondWithCalledAETitle().
|
protected |
Profile in association configuration that should be used.
By default, a profile called "DEFAULT" is used.
|
protected |
Association configuration.
May be filled from association configuration file or by adding presentation contexts by calling addPresentationContext() (or both)
|
protected |
Blocking mode for TCP/IP connection requests.
If non-blocking mode is enabled, the SCP is waiting for new DIMSE data a specific (m_connectionTimeout) amount of time and then returns if not data arrives. In blocking mode, the SCP is calling the underlying operating system function for receiving data from the socket directly, which may return after a very long time (or never...), depending on the system's network configuration. Default is blocking mode.
|
protected |
Timeout in seconds that should be waited for an incoming TCP/IP connection until the call returns.
It is only relevant if the the SCP is set to non-blocking connection mode. Otherwise, the timeout is ignored. Default is 1000 seconds.
|
protected |
Blocking mode for DIMSE operations.
If DIMSE non-blocking mode is enabled, the SCP is waiting for new DIMSE data a specific (m_dimseTimeout) amount of time and then returns if not data arrives. In blocking mode the SCP is calling the underlying operating system function for receiving data from the socket directly, which may return after a very long time, depending on the system's network configuration.
|
protected |
Timeout for DIMSE operations in seconds.
Maximum time in DIMSE non-blocking mode to wait for incoming DIMSE data.
|
protected |
Maximum PDU size the SCP is able to receive.
This value is sent to the SCU during association negotiation.
|
protected |
Indicates if the application shall refuse any association attempt regardless of what the SCU proposes.
|
protected |
If set, the AE title as received in the request (called AE title) is used in response (default: OFTrue).
|
protected |
Verbose PC mode.
Flags specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode.