DCMTK  Version 3.6.7
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DcmSCPConfig Class Reference

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...
 
DcmSCPConfigoperator= (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 OFStringgetAETitle () 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...
 
OFBool transportLayerEnabled () const
 Returns true if an external transport layer (e.g. More...
 
DcmTransportLayergetTransportLayer () const
 Returns pointer to the transport layer object in use. More...
 
void setTransportLayer (DcmTransportLayer *tlayer)
 set an explicit transport layer (e.g. 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.
 
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).
 
OFBool m_progressNotificationMode
 Progress notification mode (default: OFTrue)
 
DcmTransportLayerm_tLayer
 The transport layer in use for communication (e.g. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DcmSCPConfig()

DcmSCPConfig::DcmSCPConfig ( const DcmSCPConfig old)

copy constructor, performs deep copy.

Parameters
olditem to be copied

Member Function Documentation

◆ addNewTSList()

OFCondition DcmSCPConfig::addNewTSList ( const OFString tsListName,
const OFList< OFString > &  ts 
)
protected

Add given list of transfers syntaxes under given name to SCP's association configuration.

Parameters
tsListName[in] The name of the transfer syntax list to create
ts[in] The list of transfer snytaxes to add
Returns
EC_Normal if adding was successful, error otherwise

◆ addPresentationContext()

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.

Parameters
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".
Returns
EC_Normal if adding was successful, an error code otherwise

◆ checkAssociationProfile()

OFCondition DcmSCPConfig::checkAssociationProfile ( const OFString profileName,
OFString mangledName 
) const

The profile with the given name is checked for validity using this method.

Parameters
profileName[in] The name of the association profile which should be checked
mangledName[out] The mangled profile name
Returns
EC_Normal if profile is a valid SCP profile, error otherwise

◆ dumpPresentationContexts()

void DcmSCPConfig::dumpPresentationContexts ( STD_NAMESPACE ostream &  out,
OFString  profileName = "" 
)

Dump presentation contexts to given output stream, useful for debugging.

Parameters
out[out] The output stream
profileName[in] The profile to dump. If empty (default), the currently selected profile is dumped.

◆ evaluateIncomingAssociation()

OFCondition DcmSCPConfig::evaluateIncomingAssociation ( T_ASC_Association assoc) const

This method evaluates an incoming association request according presentation context settings maintained by this configuration.

Parameters
assocT_ASC_Association structure to be evaluated
Returns
EC_Normal if successful, an error code otherwise

◆ forceAssociationRefuse()

void DcmSCPConfig::forceAssociationRefuse ( const OFBool  doRefuse)

Force every association request to be refused by SCP, no matter what the SCU is offering.

Parameters
doRefuse[in] If OFTrue, every association is being refused. DcmSCP's default is not to refuse every association.

◆ getACSETimeout()

Uint32 DcmSCPConfig::getACSETimeout ( ) const

Returns ACSE timeout.

Returns
ACSE timeout in seconds

◆ getActiveAssociationProfile()

OFString DcmSCPConfig::getActiveAssociationProfile ( ) const

Returns the name of the currently active association profile.

Returns
The name of the association profile that is currently active

◆ getAETitle()

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().

Returns
The configured AE title

◆ getConnectionBlockingMode()

DUL_BLOCKOPTIONS DcmSCPConfig::getConnectionBlockingMode ( ) const

Returns whether receiving of TCP/IP connection requests is done in blocking or unblocking mode.

Returns
DUL_BLOCK if in blocking mode, otherwise DUL_NOBLOCK

◆ getConnectionTimeout()

Uint32 DcmSCPConfig::getConnectionTimeout ( ) const

Returns connection timeout.

Returns
TCP/IP connection timeout in seconds

◆ getDIMSEBlockingMode()

T_DIMSE_BlockingMode DcmSCPConfig::getDIMSEBlockingMode ( ) const

Returns whether receiving of DIMSE messages is done in blocking or unblocking mode.

Returns
DIMSE_BLOCKING if in blocking mode, otherwise DIMSE_NONBLOCKING

◆ getDIMSETimeout()

Uint32 DcmSCPConfig::getDIMSETimeout ( ) const

Returns DIMSE timeout (only applicable in blocking mode)

Returns
DIMSE timeout in seconds

◆ getHostLookupEnabled()

OFBool DcmSCPConfig::getHostLookupEnabled ( ) const

Returns whether a connecting system's host name is looked up.

Returns
OFTrue, if host name lookup is enabled, OFFalse otherwise

◆ getMaxReceivePDULength()

Uint32 DcmSCPConfig::getMaxReceivePDULength ( ) const

Returns maximum PDU length configured to be received by SCP.

Returns
Maximum PDU length in bytes

◆ getPort()

Uint16 DcmSCPConfig::getPort ( ) const

Returns TCP/IP port number SCP listens for new connection requests.

Returns
The port number

◆ getProgressNotificationMode()

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.

Returns
The current progress notification mode, enabled if OFTrue

◆ getRefuseAssociation()

OFBool DcmSCPConfig::getRefuseAssociation ( ) const

Returns whether SCP should refuse any association request no matter what the SCU proposes.

Returns
OFTrue, if SCP is configured to refuse every association

◆ getRespondWithCalledAETitle()

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.

Returns
OFTrue, if the SCU's calling AE title is utilized, OFFalse otherwise

◆ getTransportLayer()

DcmTransportLayer* DcmSCPConfig::getTransportLayer ( ) const

Returns pointer to the transport layer object in use.

Returns
pointer to the transport layer object in use, may be NULL.

◆ getVerbosePCMode()

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.

Returns
The verbose presentation context mode configured

◆ loadAssociationCfgFile()

OFCondition DcmSCPConfig::loadAssociationCfgFile ( const OFString assocFile)

Loads association configuration file.

Parameters
assocFile[in] The filename of the association configuration to be loaded. The association configuration file must be valid for an SCP.
Returns
EC_Normal if loading was successful, error otherwise

◆ mangleProfileName()

OFString DcmSCPConfig::mangleProfileName ( const OFString profile) const
protected

Mangles a given string into valid profile name.

Removes all spaces, and converts lower case to upper case characters.

Parameters
profile[in] The unmangled profile name
Returns
The mangled profile name

◆ numToString()

OFString DcmSCPConfig::numToString ( const size_t  num) const
protected

Convert number to string.

Parameters
num[in] The integer number to convert
Returns
The string representing the given number

◆ operator=()

DcmSCPConfig& DcmSCPConfig::operator= ( const DcmSCPConfig obj)

assignment operator, performs deep copy.

Parameters
objthe config to copy from
Returns
Reference to "this" object

◆ setACSETimeout()

void DcmSCPConfig::setACSETimeout ( const Uint32  acseTimeout)

Set the timeout used during ACSE messaging protocol.

Parameters
acseTimeout[in] ACSE timeout in seconds.

◆ setAETitle()

void DcmSCPConfig::setAETitle ( const OFString aetitle)

Set AE title of the server.

Parameters
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.

◆ setAlwaysAcceptDefaultRole()

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.

Parameters
enabledIf OFTrue, do not reject Default role proposals when configured for SCP role. OFFalse (default behaviour): Reject such proposals.

◆ setAndCheckAssociationProfile()

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.

Parameters
profileName[in] The name of the association profile which must be configured before being selected here
Returns
EC_Normal if selecting/checking was successful, an error code otherwise

◆ setConnectionBlockingMode()

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.

Parameters
blockingMode[in] Either DUL_BLOCK for blocking mode or DUL_NOBLOCK for non-blocking mode

◆ setConnectionTimeout()

void DcmSCPConfig::setConnectionTimeout ( const Uint32  timeout)

Set the timeout that should be waited for connection requests.

Only relevant in non-blocking mode (default).

Parameters
timeout[in] TCP/IP connection timeout in seconds.

◆ setDIMSEBlockingMode()

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.

Parameters
blockingMode[in] Either DIMSE_BLOCKING for blocking mode or DIMSE_NONBLOCKING for non-blocking mode

◆ setDIMSETimeout()

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().

Parameters
dimseTimeout[in] DIMSE receive timeout in seconds

◆ setHostLookupEnabled()

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.

Parameters
mode[in] OFTrue, if host name lookup should be enabled, OFFalse for disabling it.

◆ setMaxReceivePDULength()

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.

Parameters
maxRecPDU[in] The maximum PDU size to use in bytes

◆ setPort()

void DcmSCPConfig::setPort ( const Uint16  port)

Set SCP's TCP/IP listening port.

Parameters
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.

◆ setProgressNotificationMode()

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.

Parameters
mode[in] Disable progress notification if OFFalse

◆ setRespondWithCalledAETitle()

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().

Parameters
useCalled[in] If OFTrue, the SCP will use the called AE title from the request for responding. DcmSCP's default is OFFalse.

◆ setTransportLayer()

void DcmSCPConfig::setTransportLayer ( DcmTransportLayer tlayer)

set an explicit transport layer (e.g.

for TLS communication) to use

Parameters
tlayer[in] The transport layer object. This function does not take ownership of tlayer.

◆ setVerbosePCMode()

void DcmSCPConfig::setVerbosePCMode ( const OFBool  mode)

Set whether to show presentation contexts in verbose or debug mode.

Parameters
mode[in] Show presentation contexts in verbose mode if OFTrue. By default, the presentation contexts are shown in debug mode.

◆ transportLayerEnabled()

OFBool DcmSCPConfig::transportLayerEnabled ( ) const

Returns true if an external transport layer (e.g.

TLS) is enabled, false if the default, transparent layer is used.

Returns
true if an external transport layer is enabled

Member Data Documentation

◆ m_acseTimeout

Uint32 DcmSCPConfig::m_acseTimeout
protected

Timeout for ACSE operations in seconds.

Maximum time during association negotiation which is given for the SCU to follow the ACSE protocol.

◆ m_aetitle

OFString DcmSCPConfig::m_aetitle
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().

◆ m_assocCfgProfileName

OFString DcmSCPConfig::m_assocCfgProfileName
protected

Profile in association configuration that should be used.

By default, a profile called "DEFAULT" is used.

◆ m_assocConfig

DcmAssociationConfiguration DcmSCPConfig::m_assocConfig
protected

Association configuration.

May be filled from association configuration file or by adding presentation contexts by calling addPresentationContext() (or both)

◆ m_connectionBlockingMode

DUL_BLOCKOPTIONS DcmSCPConfig::m_connectionBlockingMode
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.

◆ m_connectionTimeout

Uint32 DcmSCPConfig::m_connectionTimeout
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.

◆ m_dimseBlockingMode

T_DIMSE_BlockingMode DcmSCPConfig::m_dimseBlockingMode
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.

◆ m_dimseTimeout

Uint32 DcmSCPConfig::m_dimseTimeout
protected

Timeout for DIMSE operations in seconds.

Maximum time in DIMSE non-blocking mode to wait for incoming DIMSE data.

◆ m_maxReceivePDULength

Uint32 DcmSCPConfig::m_maxReceivePDULength
protected

Maximum PDU size the SCP is able to receive.

This value is sent to the SCU during association negotiation.

◆ m_tLayer

DcmTransportLayer* DcmSCPConfig::m_tLayer
protected

The transport layer in use for communication (e.g.

for TLS). Default is NULL for the normal TCP layer.

◆ m_verbosePCMode

OFBool DcmSCPConfig::m_verbosePCMode
protected

Verbose PC mode.

Flags specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode.


The documentation for this class was generated from the following file:


Generated on Thu Apr 28 2022 for DCMTK Version 3.6.7 by Doxygen 1.9.1