DCMTK
Version 3.6.1 20120515
OFFIS DICOM Toolkit
|
Base class for implementing a DICOM Service Class Provider (SCP). More...
Public Member Functions | |
DcmSCP () | |
Constructor. | |
virtual | ~DcmSCP () |
Virtual destructor, frees internal memory. | |
virtual OFCondition | listen () |
Starts providing the implemented services to SCUs. | |
virtual 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. | |
void | setPort (const Uint16 port) |
Set SCP's TCP/IP listening port. | |
void | setAETitle (const OFString &aetitle) |
Set AETitle of the server. | |
void | setRespondWithCalledAETitle (const OFBool useCalled) |
Set SCP to use the called AETitle from the SCU request for the response, i.e. the SCP will always respond with setting it's own name to the one the SCU used for calling. | |
virtual OFCondition | loadAssociationCfgFile (const OFString &assocFile) |
Loads association configuration file. | |
virtual OFCondition | setAndCheckAssociationProfile (const OFString &profileName) |
If an association profile should be selected, either by loading an associaton configuration file or using the addAbstractSyntax() function, one of those can be selected and checked for validity using this method. | |
void | forceAssociationRefuse (const OFBool doRefuse) |
Force every association request to be refused by SCP, no matter what the SCU is offering. | |
void | setMaxReceivePDULength (const Uint32 maxRecPDU) |
Set maximum PDU size the SCP is able to receive. | |
OFCondition | enableMultiProcessMode (int argc=0, char *argv[]=NULL) |
Enable multi-process mode for SCP. | |
void | setMaxAssociations (const Uint16 maxAssocs) |
Set number of maximum simultanous associations. | |
void | setConnectionBlockingMode (const DUL_BLOCKOPTIONS blockingMode) |
Set whether waiting for a TCP/IP connection should be blocking or non-blocking. | |
void | setDIMSEBlockingMode (const T_DIMSE_BlockingMode blockingMode) |
Set whether DIMSE messaging should be blocking or non-blocking. | |
void | setDIMSETimeout (const Uint32 dimseTimeout) |
Set the timeout to be waited for incoming DIMSE message packets. | |
void | setACSETimeout (const Uint32 acseTimeout) |
Set the timeout used during ACSE messaging protocol. | |
void | setConnnectionTimeout (const Uint32 timeout) |
Set the timeout that should be waited for connection requests. | |
void | setVerbosePCMode (const OFBool mode) |
Set whether to show presentation contexts in verbose or debug mode. | |
Uint16 | getPort () const |
Returns TCP/IP port number SCP listens for new connection requests. | |
const OFString & | getAETitle () const |
Returns SCP's own AE title. | |
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. | |
OFBool | getRefuseAssociation () const |
Returns whether SCP should refuse any association request no matter what the SCU proposes. | |
Uint32 | getMaxReceivePDULength () const |
Returns maximum PDU length configured to be received by SCP. | |
OFBool | getSingleProcess () const |
Returns whether SCP is running in single or multi-process mode. | |
Uint16 | getMaxAssociations () const |
Returns number of maximum simultanous connections permitted. | |
DUL_BLOCKOPTIONS | getConnectionBlockingMode () const |
Returns whether receiving of TCP/IP connection requests is done in blocking or unblocking mode. | |
T_DIMSE_BlockingMode | getDIMSEBlockingMode () const |
Returns whether receiving of DIMSE messages is done in blocking or unblocking mode. | |
Uint32 | getDIMSETimeout () const |
Returns DIMSE timeout (only applicable in blocking mode) | |
Uint32 | getACSETimeout () const |
Returns ACSE timeout. | |
Uint32 | getConnnectionTimeout () const |
Returns connection timeout. | |
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. | |
OFBool | isConnected () const |
Returns whether SCP is currently connected. | |
Uint16 | numAssociations () const |
Returns number of associations currently running. | |
OFString | getCalledAETitle () const |
Returns AE Title the SCU used as called AE Title in associaton request. | |
OFString | getPeerAETitle () const |
Returns AE Title (calling AE Title) the SCU used for association request. | |
OFString | getPeerIP () const |
Returns IP address of connected SCU. | |
Uint32 | getPeerMaxPDULength () const |
Returns maximum PDU size the communication peer (i.e. the SCU) is able to receive. | |
Protected Member Functions | |
virtual OFCondition | handleIncomingCommand (T_DIMSE_Message *incomingMsg, const DcmPresentationContextInfo &presContextInfo) |
Handle incoming command set and react accordingly, e.g. sending response via DIMSE_sendXXXResponse(). | |
virtual void | notifyAssociationRequest (const T_ASC_Parameters ¶ms, DcmSCPActionType &desiredAction) |
Overwrite this function to be notified about an incoming association request. | |
virtual void | notifyAssociationAcknowledge () |
Overwrite this function to be notified about an incoming association request. | |
virtual void | notifyReleaseRequest () |
Overwrite this function to be notified about an incoming association release request. | |
virtual void | notifyAbortRequest () |
Overwrite this function to be notified about an incoming association abort request. | |
virtual void | notifyAssociationTermination () |
Overwrite this function to be notified when an association is terminated. | |
virtual void | notifyDIMSEError (const OFCondition &cond) |
Overwrite this function to be notified when a DIMSE error occurs. | |
virtual OFBool | stopAfterCurrentAssociation () |
Overwrite this function to change the behavior of the listen() method. | |
virtual OFCondition | sendActionResponse (const T_ASC_PresentationContextID presID, const Uint16 messageID, const OFString &sopClassUID, const OFString &sopInstanceUID, const Uint16 actionTypeID, DcmDataset *rspDataset, const Uint16 rspStatusCode) |
Respond to the N-Action request. | |
virtual OFCondition | sendSTOREResponse (const T_ASC_PresentationContextID presID, T_DIMSE_C_StoreRQ &reqMessage, T_DIMSE_C_StoreRSP &rspMessage, DcmDataset *statusDetail) |
Respond to storage request. | |
virtual OFCondition | handleECHORequest (T_DIMSE_C_EchoRQ &reqMessage, const T_ASC_PresentationContextID presID) |
Standard handler for Verification Service Class (DICOM Echo). | |
virtual OFCondition | handleEVENTREPORTRequest (T_DIMSE_N_EventReportRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset, Uint16 &eventTypeID) |
Receives N-EVENT-REPORT request on the currently opened association and sends a corresponding response. | |
virtual OFCondition | handleACTIONRequest (T_DIMSE_N_ActionRQ &reqMessage, const T_ASC_PresentationContextID presID, DcmDataset *&reqDataset, Uint16 &actionTypeID) |
Receives N-ACTION request and sends a corresponding response. | |
virtual OFCondition | sendEVENTREPORTRequest (const T_ASC_PresentationContextID presID, const OFString &sopInstanceUID, const Uint16 messageID, const Uint16 eventTypeID, DcmDataset *reqDataset, Uint16 &rspStatusCode) |
sends N-EVENT-REPORT request on the current association and receives a corresponding response. | |
virtual Uint16 | checkEVENTREPORTRequest (T_DIMSE_N_EventReportRQ &reqMessage, DcmDataset *reqDataset) |
Check given N-EVENT-REPORT request and dataset for validity. | |
virtual OFBool | calledAETitleAccepted (const OFString &callingAE, const OFString &calledAE) |
Function that checks for each association request, whether the combination of calling and called AE title proposed by the SCU is accepted. | |
void | findPresentationContext (const T_ASC_PresentationContextID presID, OFString &abstractSyntax, OFString &transferSyntax) |
This call returns the presentation context belonging to the given presentation context ID. | |
virtual OFCondition | waitForAssociation (T_ASC_Network *network) |
This function takes care of receiving, negotiating and accepting/refusing an association request. | |
virtual void | cleanChildren () |
This function takes care of removing items referring to (terminated) subprocesses from the table which stores all subprocess information. | |
virtual OFCondition | negotiateAssociation () |
This function checks all presentation contexts proposed by the SCU whether they are supported or not. | |
virtual void | addProcessToTable (const int pid) |
This function adds a process to the table that stores process information (only relevant for multi-process mode under Unix-like systems) | |
virtual void | removeProcessFromTable (const int pid) |
This function removes one particular item from the table which stores all subprocess information. | |
virtual void | refuseAssociation (const DcmRefuseReasonType reason) |
This function takes care of refusing an assocation request. | |
virtual void | handleAssociation () |
This function takes care of handling the other DICOM application's request. | |
OFCondition | sendDIMSEMessage (const T_ASC_PresentationContextID presID, T_DIMSE_Message *msg, DcmDataset *dataObject, DIMSE_ProgressCallback callback, void *callbackContext, DcmDataset **commandSet=NULL) |
Sends a DIMSE command and possibly also a dataset from a data object via network to another DICOM application. | |
OFCondition | receiveDIMSECommand (T_ASC_PresentationContextID *presID, T_DIMSE_Message *msg, DcmDataset **statusDetail, DcmDataset **commandSet=NULL, const Uint32 timeout=0) |
Receive DIMSE command (excluding dataset!) over the currently open association. | |
OFCondition | receiveDIMSEDataset (T_ASC_PresentationContextID *presID, DcmDataset **dataObject, DIMSE_ProgressCallback callback, void *callbackContext) |
Receives one dataset (of instance data) via network from another DICOM application. | |
Private Member Functions | |
DcmSCP (const DcmSCP &src) | |
Private undefined copy constructor. | |
DcmSCP & | operator= (const DcmSCP &src) |
Private undefined assignment operator. | |
void | dropAndDestroyAssociation () |
Drops association and clears internal structures to free memory. | |
Private Attributes | |
T_ASC_Association * | m_assoc |
Current association run by this SCP. | |
DcmAssociationConfiguration * | m_assocConfig |
Association configuration. | |
OFString | m_assocCfgProfileName |
Profile in association configuration that should be used. | |
Uint16 | m_port |
Port on which the SCP is listening for association requests. The default port is 104. | |
OFString | m_aetitle |
AETitle to be used for responding to SCU (default: DCMTK_SCP). | |
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. | |
OFBool | m_singleProcess |
Indicates if SCP is run in single process mode or not. | |
OFBool | m_forkedChild |
Indicates, that this process was spawn as child from a parent process needed for multiprocess mode under Windows operating systems. | |
Uint16 | m_maxAssociations |
Maximum number of association for multi-process mode. | |
DUL_BLOCKOPTIONS | m_connectionBlockingMode |
Blocking mode for TCP/IP connection requests. | |
T_DIMSE_BlockingMode | m_dimseBlockingMode |
Blocking mode for DIMSE operations. | |
Uint32 | m_dimseTimeout |
Timeout for DIMSE operations in seconds. | |
Uint32 | m_acseTimeout |
Timeout for ACSE operations in seconds. | |
OFBool | m_verbosePCMode |
Verbose PC mode. | |
Uint32 | m_connectionTimeout |
Timeout in seconds that should be waited for an incoming TCP/IP connection until the call returns. | |
OFList< DcmProcessSlotType * > | m_processTable |
Table of processes for non-single process mode. | |
OFBool | m_respondWithCalledAETitle |
If set, the AE Title as received in the request (called AE Title) is used in response (default: OFTrue). |
Base class for implementing a DICOM Service Class Provider (SCP).
Derived classes can add the presentation contexts they want to support, set further parameters (port, peer hostname, etc. as desired) and then call DcmSCP's listen() method to start the server. For incoming associations and DIMSE messages, a derived class can define the behaviour of the server. The DcmSCP base class is capable of responding to C-ECHO requests (Verification SOP Class).
DcmSCP::DcmSCP | ( | ) |
Constructor.
Initializies internal member variables.
DcmSCP::DcmSCP | ( | const DcmSCP & | src | ) | [private] |
Private undefined copy constructor.
Shall never be called.
src | Source object |
virtual OFCondition DcmSCP::addPresentationContext | ( | const OFString & | abstractSyntax, |
const OFList< OFString > | xferSyntaxes, | ||
const T_ASC_SC_ROLE | role = ASC_SC_ROLE_DEFAULT , |
||
const OFString & | profile = "DEFAULT" |
||
) | [virtual] |
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 snytax should be added to. The default is to add it to the DcmSCP's internal standard profile called "DEFAULT". |
virtual void DcmSCP::addProcessToTable | ( | const int | pid | ) | [protected, virtual] |
This function adds a process to the table that stores process information (only relevant for multi-process mode under Unix-like systems)
pid | [in] The process ID of the sub-process which was just started |
virtual OFBool DcmSCP::calledAETitleAccepted | ( | const OFString & | callingAE, |
const OFString & | calledAE | ||
) | [protected, virtual] |
Function that checks for each association request, whether the combination of calling and called AE title proposed by the SCU is accepted.
The standard behaviour is to either accept any AE title (if the corresponding option is set) or to only accept the one set with setAETitle(). In the former case, the function also adopts the SCP's AETitle to the one used by the SCU. The method can be overwritten to have full control about which AE title combinations are accepted by the SCP.
callingAE | [in] The AE title the SCU uses as Calling AE Title |
calledAE | [in] The AE title the SCU uses as Called AE Title |
virtual Uint16 DcmSCP::checkEVENTREPORTRequest | ( | T_DIMSE_N_EventReportRQ & | reqMessage, |
DcmDataset * | reqDataset | ||
) | [protected, virtual] |
Check given N-EVENT-REPORT request and dataset for validity.
This method is called by handleEVENTREPORTRequest() before sending the response in order to determine the DIMSE status code to be used for the response message.
reqMessage | [in] The N-EVENT-REPORT request message data structure |
reqDataset | [in] The N-EVENT-REPORT request dataset received. Might be NULL. |
virtual void DcmSCP::cleanChildren | ( | ) | [protected, virtual] |
This function takes care of removing items referring to (terminated) subprocesses from the table which stores all subprocess information.
This function does not make sense for Windows operating systems where the SCP does not have any control over additionally created processes.
OFCondition DcmSCP::enableMultiProcessMode | ( | int | argc = 0 , |
char * | argv[] = NULL |
||
) |
Enable multi-process mode for SCP.
For every incoming association, a new process is started. For Unix this is done with the fork() command that creates a copy of the process running and continues executing the code after the fork() call seamlessly. For Windows CreateProcess() is used given the command line specified in the function's parameters. A handle of the open TCP/IP connection is passed to the created process, which is then responsible for handling the association. After process fork/creation, DcmSCP is ready for listening to new connection requests.
argc | [in] Number of command line arguments (only Windows) |
argv | [in] Command line (only Windows) |
void DcmSCP::findPresentationContext | ( | const T_ASC_PresentationContextID | presID, |
OFString & | abstractSyntax, | ||
OFString & | transferSyntax | ||
) | [protected] |
This call returns the presentation context belonging to the given presentation context ID.
presID | [in] The presentation context ID to look for |
abstractSyntax | [out] The abstract syntax (UID) for that ID. Empty, if such a presentation context does not exist. |
transferSyntax | [out] The transfer syntax (UID) for that ID. Empty, if such a presentation context does not exist. |
void DcmSCP::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 DcmSCP::getACSETimeout | ( | ) | const |
Returns ACSE timeout.
const OFString& DcmSCP::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().
OFString DcmSCP::getCalledAETitle | ( | ) | const |
Returns AE Title the SCU used as called AE Title in associaton request.
DUL_BLOCKOPTIONS DcmSCP::getConnectionBlockingMode | ( | ) | const |
Returns whether receiving of TCP/IP connection requests is done in blocking or unblocking mode.
Uint32 DcmSCP::getConnnectionTimeout | ( | ) | const |
Returns connection timeout.
T_DIMSE_BlockingMode DcmSCP::getDIMSEBlockingMode | ( | ) | const |
Returns whether receiving of DIMSE messages is done in blocking or unblocking mode.
Uint32 DcmSCP::getDIMSETimeout | ( | ) | const |
Returns DIMSE timeout (only applicable in blocking mode)
Uint16 DcmSCP::getMaxAssociations | ( | ) | const |
Returns number of maximum simultanous connections permitted.
Only makes sense for Unix operating systems. For Windows, the number of maximum connections is either "unlimited" or 1. Use getSingleProcess() in that case to find out if SCP is permitting more than one connection.
Uint32 DcmSCP::getMaxReceivePDULength | ( | ) | const |
Returns maximum PDU length configured to be received by SCP.
OFString DcmSCP::getPeerAETitle | ( | ) | const |
Returns AE Title (calling AE Title) the SCU used for association request.
OFString DcmSCP::getPeerIP | ( | ) | const |
Returns IP address of connected SCU.
Uint32 DcmSCP::getPeerMaxPDULength | ( | ) | const |
Returns maximum PDU size the communication peer (i.e. the SCU) is able to receive.
Uint16 DcmSCP::getPort | ( | ) | const |
Returns TCP/IP port number SCP listens for new connection requests.
OFBool DcmSCP::getRefuseAssociation | ( | ) | const |
Returns whether SCP should refuse any association request no matter what the SCU proposes.
OFBool DcmSCP::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 DcmSCP::getSingleProcess | ( | ) | const |
Returns whether SCP is running in single or multi-process mode.
OFBool DcmSCP::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.
virtual OFCondition DcmSCP::handleACTIONRequest | ( | T_DIMSE_N_ActionRQ & | reqMessage, |
const T_ASC_PresentationContextID | presID, | ||
DcmDataset *& | reqDataset, | ||
Uint16 & | actionTypeID | ||
) | [protected, virtual] |
Receives N-ACTION request and sends a corresponding response.
reqMessage | [in] The N-ACTION request message that was received |
presID | [in] The presentation context to be used. By default, the presentation context of the request is used. |
reqDataset | [out] Pointer to the dataset received |
actionTypeID | [out] Action Type ID from the command set received |
virtual void DcmSCP::handleAssociation | ( | ) | [protected, virtual] |
This function takes care of handling the other DICOM application's request.
After having accomplished all necessary steps, the association will be dropped and destroyed.
virtual OFCondition DcmSCP::handleECHORequest | ( | T_DIMSE_C_EchoRQ & | reqMessage, |
const T_ASC_PresentationContextID | presID | ||
) | [protected, virtual] |
Standard handler for Verification Service Class (DICOM Echo).
Returns echo response (i.e. whether C-ECHO could be responded to with status success).
reqMessage | [in] The C-ECHO request message that was received |
presID | [in] The presentation context to be used. By default, the presentation context of the request is used. |
virtual OFCondition DcmSCP::handleEVENTREPORTRequest | ( | T_DIMSE_N_EventReportRQ & | reqMessage, |
const T_ASC_PresentationContextID | presID, | ||
DcmDataset *& | reqDataset, | ||
Uint16 & | eventTypeID | ||
) | [protected, virtual] |
Receives N-EVENT-REPORT request on the currently opened association and sends a corresponding response.
Calls checkEVENTREPORTRequest() in order to determine the DIMSE status code to be used for the N-EVENT-REPORT response.
reqMessage | [in] The N-EVENT-REPORT request message that was received |
presID | [in] The presentation context to be used. By default, the presentation context of the request is used. |
reqDataset | [out] Pointer to the dataset received |
eventTypeID | [out] Event Type ID from the command set received |
virtual OFCondition DcmSCP::handleIncomingCommand | ( | T_DIMSE_Message * | incomingMsg, |
const DcmPresentationContextInfo & | presContextInfo | ||
) | [protected, virtual] |
Handle incoming command set and react accordingly, e.g. sending response via DIMSE_sendXXXResponse().
The standard handler only knows how to handle an Echo request by calling handleEchoRequest(). This function is most likely to be implemented by a derived class implementing a specific SCP behaviour.
incomingMsg | The DIMSE message received |
presContextInfo | The presentation context the message was received on. |
OFBool DcmSCP::isConnected | ( | ) | const |
Returns whether SCP is currently connected.
If in multi-process mode, the "father" process should always return false here, because connection is always handled by child process.
virtual OFCondition DcmSCP::listen | ( | ) | [virtual] |
Starts providing the implemented services to SCUs.
After calling this method the SCP is listening for connection requests.
virtual OFCondition DcmSCP::loadAssociationCfgFile | ( | const OFString & | assocFile | ) | [virtual] |
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. |
virtual OFCondition DcmSCP::negotiateAssociation | ( | ) | [protected, virtual] |
This function checks all presentation contexts proposed by the SCU whether they are supported or not.
It is not an error if no common presentation context could be identified with the SCU; only issues like problems in memory management etc. are reported as an error. This function does not send a response message to the SCU. This is done in other functions.
virtual void DcmSCP::notifyAbortRequest | ( | ) | [protected, virtual] |
Overwrite this function to be notified about an incoming association abort request.
The standard handler only outputs some information to the logger.
virtual void DcmSCP::notifyAssociationAcknowledge | ( | ) | [protected, virtual] |
Overwrite this function to be notified about an incoming association request.
The standard handler only outputs some information to the logger.
virtual void DcmSCP::notifyAssociationRequest | ( | const T_ASC_Parameters & | params, |
DcmSCPActionType & | desiredAction | ||
) | [protected, virtual] |
Overwrite this function to be notified about an incoming association request.
The standard handler only outputs some information to the logger.
params | The association parameters that were received. |
desiredAction | The desired action how to handle this association request. |
virtual void DcmSCP::notifyAssociationTermination | ( | ) | [protected, virtual] |
Overwrite this function to be notified when an association is terminated.
The standard handler only outputs some information to the logger.
virtual void DcmSCP::notifyDIMSEError | ( | const OFCondition & | cond | ) | [protected, virtual] |
Overwrite this function to be notified when a DIMSE error occurs.
The standard handler only outputs error information to the logger.
cond | [in] The DIMSE error occured. |
virtual void DcmSCP::notifyReleaseRequest | ( | ) | [protected, virtual] |
Overwrite this function to be notified about an incoming association release request.
The standard handler only outputs some information to the logger.
Uint16 DcmSCP::numAssociations | ( | ) | const |
Returns number of associations currently running.
Only applicable in Unix-like operating systems. Can only be greater than one when running in multi-process mode.
Private undefined assignment operator.
Shall never be called.
src | Source object |
OFCondition DcmSCP::receiveDIMSECommand | ( | T_ASC_PresentationContextID * | presID, |
T_DIMSE_Message * | msg, | ||
DcmDataset ** | statusDetail, | ||
DcmDataset ** | commandSet = NULL , |
||
const Uint32 | timeout = 0 |
||
) | [protected] |
Receive DIMSE command (excluding dataset!) over the currently open association.
presID | [out] Contains in the end the ID of the presentation context which was specified in the DIMSE command received |
msg | [out] The message received |
statusDetail | [out] If a non-NULL value is passed this variable will in the end contain detailed information with regard to the status information which is captured in the status element (0000,0900). Note that the value for element (0000,0900) is not contained in this return value but in internal msg. For details on the structure of this object, see DICOM standard part 7, annex C). |
commandSet | [out] If this parameter is not NULL, it will return a copy of the DIMSE command which was received from the other DICOM application. The caller is responsible to de-allocate the returned object! |
timeout | [in] If this parameter is not 0, it specifies the timeout (in seconds) to be used for receiving the DIMSE command. Otherwise, the default timeout value is used (see setDIMSETimeout()). |
OFCondition DcmSCP::receiveDIMSEDataset | ( | T_ASC_PresentationContextID * | presID, |
DcmDataset ** | dataObject, | ||
DIMSE_ProgressCallback | callback, | ||
void * | callbackContext | ||
) | [protected] |
Receives one dataset (of instance data) via network from another DICOM application.
presID | [out] Contains in the end the ID of the presentation context which was used in the PDVs that were received on the network. If the PDVs show different presentation context IDs, this function will return an error. |
dataObject | [out] Contains in the end the information which was received over the network |
callback | [in] Pointer to a function which shall be called to indicate progress |
callbackContext | [in] Pointer to data which shall be passed to the progress indicating function |
virtual void DcmSCP::refuseAssociation | ( | const DcmRefuseReasonType | reason | ) | [protected, virtual] |
This function takes care of refusing an assocation request.
reason | [in] The reason why the association request will be refused and that will be reported to the SCU. |
virtual void DcmSCP::removeProcessFromTable | ( | const int | pid | ) | [protected, virtual] |
This function removes one particular item from the table which stores all subprocess information.
The corresponding process item to be deleted will be identified by its process ID. This function is only applicable for multi-process mode under Unix-like systems.
pid | [in] Process ID. |
virtual OFCondition DcmSCP::sendActionResponse | ( | const T_ASC_PresentationContextID | presID, |
const Uint16 | messageID, | ||
const OFString & | sopClassUID, | ||
const OFString & | sopInstanceUID, | ||
const Uint16 | actionTypeID, | ||
DcmDataset * | rspDataset, | ||
const Uint16 | rspStatusCode | ||
) | [protected, virtual] |
Respond to the N-Action request.
presID | [in] The presentation context ID to respond to |
messageID | [in] The message ID being responded to |
sopClassUID | [in] The affected SOP class UID |
sopInstanceUID | [in] The affected SOP instance UID |
actionTypeID | [in] The type of action performed |
rspDataset | [in] The response dataset |
rspStatusCode | [in] The status of the response code. 0 means success, others can found in the DICOM standard. |
OFCondition DcmSCP::sendDIMSEMessage | ( | const T_ASC_PresentationContextID | presID, |
T_DIMSE_Message * | msg, | ||
DcmDataset * | dataObject, | ||
DIMSE_ProgressCallback | callback, | ||
void * | callbackContext, | ||
DcmDataset ** | commandSet = NULL |
||
) | [protected] |
Sends a DIMSE command and possibly also a dataset from a data object via network to another DICOM application.
presID | [in] Presentation context ID to be used for message |
msg | [in] Structure that represents a certain DIMSE command which shall be sent |
dataObject | [in] The instance data which shall be sent to the other DICOM application; NULL, if there is none |
callback | [in] Pointer to a function which shall be called to indicate progress |
callbackContext | [in] Pointer to data which shall be passed to the progress indicating function |
commandSet | [out] If this parameter is not NULL it will return a copy of the DIMSE command which is sent to the other DICOM application |
virtual OFCondition DcmSCP::sendEVENTREPORTRequest | ( | const T_ASC_PresentationContextID | presID, |
const OFString & | sopInstanceUID, | ||
const Uint16 | messageID, | ||
const Uint16 | eventTypeID, | ||
DcmDataset * | reqDataset, | ||
Uint16 & | rspStatusCode | ||
) | [protected, virtual] |
sends N-EVENT-REPORT request on the current association and receives a corresponding response.
presID | [in] The ID of the presentation context to be used for sending the request message. Should not be 0. |
sopInstanceUID | [in] The requested SOP Instance UID |
messageID | [in] The request message ID |
eventTypeID | [in] The event type ID to be used |
reqDataset | [in] The request dataset to be sent |
rspStatusCode | [out] The response status code received. 0 means success, others can be found in the DICOM standard. |
virtual OFCondition DcmSCP::sendSTOREResponse | ( | const T_ASC_PresentationContextID | presID, |
T_DIMSE_C_StoreRQ & | reqMessage, | ||
T_DIMSE_C_StoreRSP & | rspMessage, | ||
DcmDataset * | statusDetail | ||
) | [protected, virtual] |
Respond to storage request.
presID | [in] The presentation context ID to respond to |
reqMessage | [in] The C-STORE request that is responded to |
rspMessage | [in] The C-STORE response to be sent |
statusDetail | [in] The status detail to be sent |
void DcmSCP::setACSETimeout | ( | const Uint32 | acseTimeout | ) |
Set the timeout used during ACSE messaging protocol.
acseTimeout | [in] ACSE timeout in seconds. |
void DcmSCP::setAETitle | ( | const OFString & | aetitle | ) |
Set AETitle of the server.
aetitle | [in] The AETitle of the server. By default, all SCU association requests calling another AETitle will be rejected. This behaviour can be changed by using the setRespondWithCalledAETitle() method. |
virtual OFCondition DcmSCP::setAndCheckAssociationProfile | ( | const OFString & | profileName | ) | [virtual] |
If an association profile should be selected, either by loading an associaton configuration file or using the addAbstractSyntax() 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 DcmSCP::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 DcmSCP::setConnnectionTimeout | ( | 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 DcmSCP::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 DcmSCP::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 DcmSCP::setMaxAssociations | ( | const Uint16 | maxAssocs | ) |
Set number of maximum simultanous associations.
Only works for Unix and with multi-process mode enabled.
maxAssocs | [in] Maximum number of simultanous associations |
void DcmSCP::setMaxReceivePDULength | ( | const Uint32 | maxRecPDU | ) |
Set maximum PDU size the SCP is able to receive.
This size is sent in associaton response message to SCU.
maxRecPDU | [in] The maximum PDU size to use in bytes |
void DcmSCP::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 DcmSCP::setRespondWithCalledAETitle | ( | const OFBool | useCalled | ) |
Set SCP to use the called AETitle from the SCU request for the response, i.e. the SCP will always respond with setting it's own name to the one the SCU used for calling.
Overrides any AETitle 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 DcmSCP::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. |
virtual OFBool DcmSCP::stopAfterCurrentAssociation | ( | ) | [protected, virtual] |
virtual OFCondition DcmSCP::waitForAssociation | ( | T_ASC_Network * | network | ) | [protected, virtual] |
This function takes care of receiving, negotiating and accepting/refusing an association request.
Additionally, if negotiation was successful, it handles any incoming DIMSE commands by calling handleAssociation(). An error is only returned, if something goes wrong. Therefore, refusing an association because of wrong application context name or no common presentation contexts with the SCU does NOT lead to an error.
network | [in] Contains network parameters |
Uint32 DcmSCP::m_acseTimeout [private] |
Timeout for ACSE operations in seconds.
Maximum time during association negotiation which is given for the SCU to follow the ACSE protocol.
OFString DcmSCP::m_aetitle [private] |
AETitle 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 assocation requests with the name the SCU used as Called AE Title (which is the SCP's default behaviour); see setRespondWithCalledAETitle().
OFString DcmSCP::m_assocCfgProfileName [private] |
Profile in association configuration that should be used.
By default, a profile called "DEFAULT" is used.
DcmAssociationConfiguration* DcmSCP::m_assocConfig [private] |
Association configuration.
May be filled from association configuration file or by adding presentation contexts by calling addPresentationContext() (or both)
DUL_BLOCKOPTIONS DcmSCP::m_connectionBlockingMode [private] |
Blocking mode for TCP/IP connection requests.
If non-blocking mode is enabled, the SCP is wating 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.
Uint32 DcmSCP::m_connectionTimeout [private] |
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.
T_DIMSE_BlockingMode DcmSCP::m_dimseBlockingMode [private] |
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.
Uint32 DcmSCP::m_dimseTimeout [private] |
Timeout for DIMSE operations in seconds.
Maximum time in DIMSE non-blocking mode to wait for incoming DIMSE data.
OFBool DcmSCP::m_forkedChild [private] |
Indicates, that this process was spawn as child from a parent process needed for multiprocess mode under Windows operating systems.
Uint16 DcmSCP::m_maxAssociations [private] |
Maximum number of association for multi-process mode.
This member is only evaluated under Unix. For Windows there is no mechanism to restrict the number of simultanous associations in multi-process mode, thus only permitting "unlimited" associations.
Uint32 DcmSCP::m_maxReceivePDULength [private] |
Maximum PDU size the SCP is able to receive.
This value is sent to the SCU during association negotiation.
OFList<DcmProcessSlotType *> DcmSCP::m_processTable [private] |
Table of processes for non-single process mode.
This member is only applicable when the SCP is running under Unix and multi-process mode.
OFBool DcmSCP::m_refuseAssociation [private] |
Indicates if the application shall refuse any association attempt regardless of what the SCU proposes.
OFBool DcmSCP::m_respondWithCalledAETitle [private] |
If set, the AE Title as received in the request (called AE Title) is used in response (default: OFTrue).
OFBool DcmSCP::m_singleProcess [private] |
Indicates if SCP is run in single process mode or not.
In multi-process mode, the SCP starts a new process for any incoming association request. The association is then completetly handled by the "child" process while the parent process keeps listening for new associations. Under Unix, multi-process mode uses the fork command to spawn a process which is an exact copy of the parent and continues code execution after the fork command. For Windows, the programmer of the derived class is responsible for setting the command line needed for the internal "CreateProcess" call. The command line arguments are specified with function enableMultiProcessMode().
OFBool DcmSCP::m_verbosePCMode [private] |
Verbose PC mode.
Flags specifying whether details on the presentation contexts (negotiated during association setup) should be shown in verbose or debug mode.