dul.h

来自「转化为DIB位图再显示出来的dicom文件C++代码」· C头文件 代码 · 共 573 行 · 第 1/2 页

H
573
字号
/*          Copyright (C) 1993, 1994, RSNA and Washington University          The software and supporting documentation for the Radiological          Society of North America (RSNA) 1993, 1994 Digital Imaging and          Communications in Medicine (DICOM) Demonstration were developed          at the                  Electronic Radiology Laboratory                  Mallinckrodt Institute of Radiology                  Washington University School of Medicine                  510 S. Kingshighway Blvd.                  St. Louis, MO 63110          as part of the 1993, 1994 DICOM Central Test Node project for, and          under contract with, the Radiological Society of North America.          THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER RSNA NOR          WASHINGTON UNIVERSITY MAKE ANY WARRANTY ABOUT 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          jointly owned by RSNA and Washington University, 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          the copyright notice.*//* Copyright marker.  Copyright will be inserted above.  Do not remove *//*** @$=@$=@$=*//***				DICOM 93**		    Electronic Radiology Laboratory**		  Mallinckrodt Institute of Radiology**		Washington University School of Medicine**** Module Name(s):** Author, Date:	Stephen M. Moore, 14-Apr-1993** Intent:		This file defines the public structures and constants**			and the function prototypes for the DUL (DICOM Upper**			Layer) facility.** Last Update:		$Author: meichel $, $Date: 2005/12/12 15:15:08 $** Source File:		$RCSfile: dul.h,v $** Revision:		$Revision: 1.23 $** Status:		$State: Exp $*/#ifndef DUL_IS_IN#define DUL_IS_IN 1#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */#include "dcmtk/ofstd/ofglobal.h"#include "dcmtk/ofstd/oftypes.h"#include "dcmtk/ofstd/ofcast.h"#include "dcmtk/dcmnet/extneg.h"#include "dcmtk/dcmnet/dicom.h"class DcmTransportConnection;class DcmTransportLayer;class LST_HEAD;/** Global flag to enable/disable reverse DNS lookup when accepting *  associations.  If disabled, the numerical IP address instead of the symbolic hostname *  is stored in the callingPresentationAddress field of the association parameters *  structure.  Most DICOM applications (except imagectn) don't need the symbolic *  hostname anyway, and the reverse DNS lookup can cause a long timeout. */extern OFGlobal<OFBool> dcmDisableGethostbyaddr; /* default OFFalse *//**  Global timeout (seconds) for connecting to remote hosts. *   Default value is -1 which selects infinite timeout, i.e. blocking connect(). */extern OFGlobal<Sint32> dcmConnectionTimeout;   /* default -1 *//** This global flag allows to set an already opened socket file descriptor *  which will be used by dcmnet the next time receiveTransportConnectionTCP() *  is called. Useful for use with proxy applications, but inherently thread unsafe! */extern OFGlobal<int> dcmExternalSocketHandle;   /* default -1 *//** When compiled with WITH_TCPWRAPPER, DCMTK server processes may use the *  TCP wrapper library to enforce access control - see hosts_access(5). *  If this global flag is non-NULL, the TCP wrapper is enabled and the *  string pointed to is used as the daemon name.  If the flag is NULL, *  no access control is performed. */extern OFGlobal<const char *> dcmTCPWrapperDaemonName;   /* default NULL *//* Global option flag for compatibility with DCMTK releases prior to 3.0  * Default (0) is automatic handling, which should work in most cases. */extern OFGlobal<unsigned long> dcmEnableBackwardCompatibility;#ifndef DUL_KEYS#define DUL_KEYS 1typedef void DUL_NETWORKKEY;typedef void DUL_ASSOCIATIONKEY;typedef unsigned char DUL_PRESENTATIONCONTEXTID;#endif/*  Define a structure containing fixed length fields that can *  be used for requesting or accepting an association.  The *  lengths of "titles" and "names" are specified by the DICOM *  protocol document.  The fields in the structure are made *  longer to allow for zero-terminators.  DICOM doesn't know *  about node names, but the DUL_ package needs them. */#define DUL_LEN_TITLE  OFstatic_cast(size_t, 16)	/* required by DICOM protocol	 */#define DUL_LEN_NAME   OFstatic_cast(size_t, 64)	/* required by DICOM protocol	 */#define DUL_LEN_UID    OFstatic_cast(size_t, 64)	/* required by DICOM protocol	 */#define DUL_LEN_NODE   OFstatic_cast(size_t, 127)	/* should be "big enough"	 *//* DICOM PDU Types */#define DUL_TYPEASSOCIATERQ		OFstatic_cast(unsigned char, 0x01)#define DUL_TYPEASSOCIATEAC		OFstatic_cast(unsigned char, 0x02)#define	DUL_TYPEASSOCIATERJ		OFstatic_cast(unsigned char, 0x03)#define	DUL_TYPEDATA			OFstatic_cast(unsigned char, 0x04)#define	DUL_TYPERELEASERQ		OFstatic_cast(unsigned char, 0x05)#define	DUL_TYPERELEASERP		OFstatic_cast(unsigned char, 0x06)#define	DUL_TYPEABORT			OFstatic_cast(unsigned char, 0x07)#define DUL_MAXTYPE			OFstatic_cast(unsigned char, 0x07)/** pure virtual base class for DUL mode callbacks */class DUL_ModeCallback{public:  /// destructor  virtual ~DUL_ModeCallback() {}  /** callback method   *  @param mode DUL compatibility mode passed in callback   */  virtual void callback(unsigned long mode) = 0;};typedef struct {    char applicationContextName[DUL_LEN_NAME + 1];    char callingAPTitle[DUL_LEN_TITLE + 1];    char calledAPTitle[DUL_LEN_TITLE + 1];    char respondingAPTitle[DUL_LEN_TITLE + 1];    unsigned long maxPDU;    unsigned short result;    unsigned short resultSource;    unsigned short diagnostic;    char callingPresentationAddress[64];    char calledPresentationAddress[64];    LST_HEAD *requestedPresentationContext;    LST_HEAD *acceptedPresentationContext;    unsigned short maximumOperationsInvoked;    unsigned short maximumOperationsPerformed;    char callingImplementationClassUID[DICOM_UI_LENGTH + 1];    char callingImplementationVersionName[16 + 1];    char calledImplementationClassUID[DICOM_UI_LENGTH + 1];    char calledImplementationVersionName[16 + 1];    unsigned long peerMaxPDU;    SOPClassExtendedNegotiationSubItemList *requestedExtNegList;    SOPClassExtendedNegotiationSubItemList *acceptedExtNegList;    OFBool useSecureLayer;}   DUL_ASSOCIATESERVICEPARAMETERS;typedef enum {    DUL_SC_ROLE_DEFAULT,    DUL_SC_ROLE_SCU,    DUL_SC_ROLE_SCP,    DUL_SC_ROLE_SCUSCP}   DUL_SC_ROLE;#define	DUL_PRESENTATION_ACCEPT			0#define	DUL_PRESENTATION_REJECT_USER		1#define	DUL_PRESENTATION_REJECT_NOREASON	2#define	DUL_PRESENTATION_REJECT_ABSTRACT_SYNTAX	3#define	DUL_PRESENTATION_REJECT_TRANSFER_SYNTAX	4typedef OFList<char *> DUL_TRANSFERSYNTAXLIST;typedef struct {    void *reserved[2];    DUL_PRESENTATIONCONTEXTID presentationContextID;    char abstractSyntax[DUL_LEN_UID + 1];    LST_HEAD *proposedTransferSyntax;    char acceptedTransferSyntax[DUL_LEN_UID + 1];    unsigned char result;    DUL_SC_ROLE proposedSCRole;    DUL_SC_ROLE acceptedSCRole;}   DUL_PRESENTATIONCONTEXT;typedef struct {    void *reserved[2];    char transferSyntax[DUL_LEN_UID + 1];}   DUL_TRANSFERSYNTAX;typedef struct dul_abortitems {    unsigned char result;    unsigned char source;    unsigned char reason;}   DUL_ABORTITEMS;typedef enum {    DUL_COMMANDPDV,		/* A command PDV inside a data PDU */    DUL_DATASETPDV}				/* A data set PDV inside a data PDU */    DUL_DATAPDV;typedef enum {    DUL_BLOCK,			/* Block on an operation (read, request) */    DUL_NOBLOCK}				/* Or return immediately if nothing avail */    DUL_BLOCKOPTIONS;typedef struct {    unsigned long fragmentLength;    unsigned char presentationContextID;    DUL_DATAPDV pdvType;    OFBool lastPDV;    void *data;}   DUL_PDV;typedef struct {    unsigned long count;    void *scratch;    unsigned long scratchLength;    DUL_ABORTITEMS abort;    DUL_PDV *pdv;}   DUL_PDVLIST;/*  Define the bits that go in the options field for InitializeNetwork****  The low two bits define the byte order of messages at the DICOM**  level.  This does not define the order of user data inside of a**  DICOM PDU.*/#define	DUL_ORDERMASK		0x03	/* The bottom two bits */#define	DUL_ORDERLITTLEENDIAN	0x01#define	DUL_ORDERBIGENDIAN	0x02#define	DUL_DOMAINMASK		0x04#define	DUL_FULLDOMAINNAME	0x04#define	DUL_AEREQUESTOR		"AE REQUESTOR"#define	DUL_AEACCEPTOR		"AE ACCEPTOR"#define	DUL_AEBOTH		"AE BOTH"/*  These macros define results and reasons for rejecting an association**  request.  Result is permanent or transient.  There are a number of**  different reasons for rejecting requests that occur at different layers */#define	DUL_REJ_RSLTPERMANENT		0x01#define	DUL_REJ_RSLTTRANSIENT		0x02/*  These macros define parameters used to construct an ABORT PDU.**  These include the source of the abort (SCU or SCP) and the**  reason for the abort.*/#define	DUL_SCU_INITIATED_ABORT	0x00#define	DUL_SCP_INITIATED_ABORT	0x02#define DUL_ABORTSERVICEUSER		0x00#define DUL_ABORTSERVICEPROVIDER	0x02#define	DUL_ABORTNOREASON		0x00#define	DUL_ABORTUNRECOGNIZEDPDU	0x01#define	DUL_ABORTUNEXPECTEDPDU		0x02#define	DUL_ABORTUNRECOGNIZEDPDUPARAM	0x04#define	DUL_ABORTUNEXPECTEDPDUPARAM	0x05#define	DUL_ABORTINVALIDPDUPARAM	0x06/*  These macros define parameters used to construct a REJECT PDU.**  These include the source of the reject (DICOM UL service-user,**  (DICOM UL service-provider) and the reason for the reject.*/#define	DUL_REJECT_PERMANENT		0x01#define	DUL_REJECT_TRANSIENT		0x02

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?