📄 assoc.h
字号:
/*** Copyright (C) 1993/1994, OFFIS, Oldenburg University and CERIUM** ** This software and supporting documentation were** developed by ** ** Institut OFFIS** Bereich Kommunikationssysteme** Westerstr. 10-12** 26121 Oldenburg, Germany** ** Fachbereich Informatik** Abteilung Prozessinformatik** Carl von Ossietzky Universitaet Oldenburg ** Ammerlaender Heerstr. 114-118** 26111 Oldenburg, Germany** ** CERIUM** Laboratoire SIM** Faculte de Medecine** 2 Avenue du Pr. Leon Bernard** 35043 Rennes Cedex, France** ** for CEN/TC251/WG4 as a contribution to the Radiological ** Society of North America (RSNA) 1993 Digital Imaging and ** Communications in Medicine (DICOM) Demonstration.** ** THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER OFFIS,** OLDENBURG UNIVERSITY NOR CERIUM MAKE ANY WARRANTY REGARDING ** THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR ** FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER ** DISEASES OR ITS CONFORMITY TO ANY SPECIFICATION. THE ** ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF THE SOFTWARE ** IS WITH THE USER. ** ** Copyright of the software and supporting documentation** is, unless otherwise stated, jointly owned by OFFIS,** Oldenburg University and CERIUM and free access is hereby** granted as a license to use this software, copy this** software and prepare derivative works based upon this** software. However, any distribution of this software** source code or supporting documentation or derivative** works (source code and supporting documentation) must** include the three paragraphs of this copyright notice. ** *//***** Author: Andrew Hewett Created: 03-06-93** ** Module: association**** Purpose: ** This file contains the routines which provide association management** for DICOM applications. It maintains structures which describe** active associations and provides access to association specific ** informtion. Also provided are routines for aiding association** negotiation (presentation contexts, abstract syntaxes, transfer** syntaxes, maximum PDU length, and other extended negotiation).**** This package uses the facilities of the DICOM Upper Layer for** receiving/sending association requests/responses.**** Each active association is represented by an T_ASC_Association** structure which contains all relevant information.**** Module Prefix: ASC_****** Last Update: $Author: meichel $** Update Date: $Date: 2005/12/08 16:02:06 $** Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmnet/include/dcmtk/dcmnet/assoc.h,v $** CVS/RCS Revision: $Revision: 1.24 $** Status: $State: Exp $**** CVS/RCS Log at end of file*/#ifndef ASSOCIATION_H#define ASSOCIATION_H#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first *//*** Required Include Files*/#include "dcmtk/dcmnet/dicom.h"#include "dcmtk/dcmnet/lst.h"#include "dcmtk/dcmnet/dul.h"/*** Constant Definitions*//* * There have been reports that smaller PDUs work better in some environments. * Allow a 4K minimum and a 128K maximum. Any further extension requires * modifications in the DUL code. */#define ASC_DEFAULTMAXPDU 16384 /* 16K is default if nothing else specified */#define ASC_MINIMUMPDUSIZE 4096#define ASC_MAXIMUMPDUSIZE 131072 /* 128K - we only handle this big *//*** Type Definitions*//*** Network initialization structure.** Is a wrapper for DUL functionality.*/enum T_ASC_NetworkRole{ NET_ACCEPTOR, /* Provider Only */ NET_REQUESTOR, /* User Only */ NET_ACCEPTORREQUESTOR /* User and Provider */};struct T_ASC_Network{ T_ASC_NetworkRole role; int acceptorPort; DUL_NETWORKKEY *network;};/*** Association negotiation parameters.***//* not defined anywhere (I think) but a hard limitation for now. * DICOM (1998) defines 22 transfer syntaxes, this upper limit * should allow for sufficiently many private transfer syntaxes. */#define DICOM_MAXTRANSFERSYNTAXES 50typedef DUL_PRESENTATIONCONTEXTID T_ASC_PresentationContextID;enum T_ASC_P_ResultReason{ /* Part 8, pp 45. */ ASC_P_ACCEPTANCE = 0, ASC_P_USERREJECTION = 1, ASC_P_NOREASON = 2, ASC_P_ABSTRACTSYNTAXNOTSUPPORTED = 3, ASC_P_TRANSFERSYNTAXESNOTSUPPORTED = 4, ASC_P_NOTYETNEGOTIATED = 255}; enum T_ASC_SC_ROLE{ ASC_SC_ROLE_DEFAULT, ASC_SC_ROLE_SCU, ASC_SC_ROLE_SCP, ASC_SC_ROLE_SCUSCP};struct T_ASC_PresentationContext{ T_ASC_PresentationContextID presentationContextID; DIC_UI abstractSyntax; unsigned char transferSyntaxCount; DIC_UI proposedTransferSyntaxes[DICOM_MAXTRANSFERSYNTAXES]; DIC_UI acceptedTransferSyntax; T_ASC_P_ResultReason resultReason; T_ASC_SC_ROLE proposedRole; T_ASC_SC_ROLE acceptedRole;};enum T_ASC_RejectParametersResult{ ASC_RESULT_REJECTEDPERMANENT = 1, ASC_RESULT_REJECTEDTRANSIENT = 2};enum T_ASC_RejectParametersSource{ ASC_SOURCE_SERVICEUSER = 1, ASC_SOURCE_SERVICEPROVIDER_ACSE_RELATED = 2, ASC_SOURCE_SERVICEPROVIDER_PRESENTATION_RELATED = 3};enum T_ASC_RejectParametersReason { /* the following values are coded by DUL */ /* Service User reasons */ ASC_REASON_SU_NOREASON = 0x0101, ASC_REASON_SU_APPCONTEXTNAMENOTSUPPORTED = 0x0102, ASC_REASON_SU_CALLINGAETITLENOTRECOGNIZED = 0x0103, ASC_REASON_SU_CALLEDAETITLENOTRECOGNIZED = 0x0107, /* Service Provider ACSE Related reasons */ ASC_REASON_SP_ACSE_NOREASON = 0x0201, ASC_REASON_SP_ACSE_PROTOCOLVERSIONNOTSUPPORTED = 0x0202, /* Service Provider Presentation Related reasons */ ASC_REASON_SP_PRES_TEMPORARYCONGESTION = 0x0301, ASC_REASON_SP_PRES_LOCALLIMITEXCEEDED = 0x0302};struct T_ASC_RejectParameters{ T_ASC_RejectParametersResult result; T_ASC_RejectParametersSource source; T_ASC_RejectParametersReason reason;};struct T_ASC_Parameters{ DIC_UI ourImplementationClassUID; DIC_SH ourImplementationVersionName; DIC_UI theirImplementationClassUID; DIC_SH theirImplementationVersionName; DUL_ModeCallback *modeCallback; DUL_ASSOCIATESERVICEPARAMETERS DULparams; /* * DICOM Upper Layer service parameters. They should only be * accessed via functions defined below. */ long ourMaxPDUReceiveSize; /* we say what we can receive */ long theirMaxPDUReceiveSize; /* they say what we can send */};/*** Association structure containing all association specific** information. */struct T_ASC_Association{ DUL_ASSOCIATIONKEY *DULassociation; T_ASC_Parameters *params; unsigned short nextMsgID; /* should be incremented by user */ unsigned long sendPDVLength; /* max length of PDV to send out */ unsigned char *sendPDVBuffer; /* buffer of size sendPDVLength */};/*** Public Function Prototypes*//** network instance creation function (constructor) * @param role association acceptor, requestor or both * @param acceptorPort acceptor port for incoming connections. * For association requestors, zero should be passed here. * @param timeout timeout for network operations, in seconds * @param network T_ASC_Network will be allocated and returned in this parameter * @param options network options. Only DUL_FULLDOMAINNAME is currently defined * as a possible option. * @return EC_Normal if successful, an error code otherwise */OFCondition ASC_initializeNetwork( T_ASC_NetworkRole role, int acceptorPort, int timeout, T_ASC_Network ** network, unsigned long options = 0);/** network instance destruction function (destructor) * @param network T_ASC_Network will be freed by this routine * @return EC_Normal if successful, an error code otherwise */ OFCondition ASC_dropNetwork(T_ASC_Network ** network);/* * Building Association parameters */OFConditionASC_createAssociationParameters( T_ASC_Parameters ** params, long maxReceivePDUSize);OFCondition ASC_destroyAssociationParameters( T_ASC_Parameters ** params);/* set transport layer type in association parameters */OFConditionASC_setTransportLayerType( T_ASC_Parameters * params, OFBool useSecureLayer);OFCondition ASC_setAPTitles( T_ASC_Parameters * params, const char* callingAPTitle, const char* calledAPTitle, const char* respondingAPTitle);OFCondition ASC_getAPTitles( T_ASC_Parameters * params, char* callingAPTitle, char* calledAPTitle, char* respondingAPTitle);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -