00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef COND_H
00030 #define COND_H
00031
00032 #include "dcmtk/config/osconfig.h"
00033 #include "dcmtk/ofstd/ofconsol.h"
00034 #include "dcmtk/dcmdata/dcerror.h"
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 const unsigned short ASCC_BADPRESENTATIONCONTEXTID = 0x101;
00071 const unsigned short ASCC_BADPRESENTATIONCONTEXTPOSITION = 0x102;
00072 const unsigned short ASCC_CODINGERROR = 0x103;
00073 const unsigned short ASCC_DUPLICATEPRESENTATIONCONTEXTID = 0x104;
00074 const unsigned short ASCC_MISSINGTRANSFERSYNTAX = 0x105;
00075 const unsigned short ASCC_NULLKEY = 0x106;
00076 const unsigned short ASCC_SHUTDOWNAPPLICATION = 0x107;
00077 const unsigned short ASCC_USERIDENTIFICATIONFAILED = 0x108;
00078 const unsigned short ASCC_SCPSCUROLESELECTIONFAILED = 0x109;
00079
00080
00081 extern const OFCondition ASC_BADPRESENTATIONCONTEXTID;
00082 extern const OFCondition ASC_MISSINGTRANSFERSYNTAX;
00083 extern const OFCondition ASC_NULLKEY;
00084 extern const OFCondition ASC_SHUTDOWNAPPLICATION;
00085 extern const OFCondition ASC_USERIDENTIFICATIONFAILED;
00086 extern const OFCondition ASC_SCPSCUROLESELECTIONFAILED;
00087
00088
00089 const unsigned short DIMSEC_BADCOMMANDTYPE = 0x201;
00090 const unsigned short DIMSEC_BADDATA = 0x202;
00091 const unsigned short DIMSEC_BADMESSAGE = 0x203;
00092 const unsigned short DIMSEC_BUILDFAILED = 0x204;
00093 const unsigned short DIMSEC_ILLEGALASSOCIATION = 0x205;
00094 const unsigned short DIMSEC_INVALIDPRESENTATIONCONTEXTID = 0x206;
00095 const unsigned short DIMSEC_NODATAAVAILABLE = 0x207;
00096 const unsigned short DIMSEC_NOVALIDPRESENTATIONCONTEXTID = 0x208;
00097 const unsigned short DIMSEC_NULLKEY = 0x209;
00098 const unsigned short DIMSEC_OUTOFRESOURCES = 0x20a;
00099 const unsigned short DIMSEC_PARSEFAILED = 0x20b;
00100 const unsigned short DIMSEC_READPDVFAILED = 0x20c;
00101 const unsigned short DIMSEC_RECEIVEFAILED = 0x20d;
00102 const unsigned short DIMSEC_SENDFAILED = 0x20e;
00103 const unsigned short DIMSEC_UNEXPECTEDPDVTYPE = 0x20f;
00104 const unsigned short DIMSEC_UNEXPECTEDREQUEST = 0x210;
00105 const unsigned short DIMSEC_UNEXPECTEDRESPONSE = 0x211;
00106 const unsigned short DIMSEC_UNSUPPORTEDTRANSFERSYNTAX = 0x212;
00107 const unsigned short DIMSEC_NODATADICT = 0x213;
00108
00109
00110 extern const OFCondition DIMSE_BADCOMMANDTYPE;
00111 extern const OFCondition DIMSE_BADDATA;
00112 extern const OFCondition DIMSE_BADMESSAGE;
00113 extern const OFCondition DIMSE_ILLEGALASSOCIATION;
00114 extern const OFCondition DIMSE_NODATAAVAILABLE;
00115 extern const OFCondition DIMSE_NOVALIDPRESENTATIONCONTEXTID;
00116 extern const OFCondition DIMSE_NULLKEY;
00117 extern const OFCondition DIMSE_OUTOFRESOURCES;
00118 extern const OFCondition DIMSE_PARSEFAILED;
00119 extern const OFCondition DIMSE_READPDVFAILED;
00120 extern const OFCondition DIMSE_RECEIVEFAILED;
00121 extern const OFCondition DIMSE_SENDFAILED;
00122 extern const OFCondition DIMSE_UNEXPECTEDPDVTYPE;
00123 extern const OFCondition DIMSE_NODATADICT;
00124
00125
00126 const unsigned short DULC_ASSOCIATIONREJECTED = 0x301;
00127 const unsigned short DULC_CODINGERROR = 0x302;
00128 const unsigned short DULC_FSMERROR = 0x303;
00129 const unsigned short DULC_ILLEGALACCEPT = 0x304;
00130 const unsigned short DULC_ILLEGALKEY = 0x305;
00131 const unsigned short DULC_ILLEGALPARAMETER = 0x306;
00132 const unsigned short DULC_ILLEGALPDU = 0x307;
00133 const unsigned short DULC_ILLEGALPDULENGTH = 0x308;
00134 const unsigned short DULC_ILLEGALREJECTREASON = 0x309;
00135 const unsigned short DULC_ILLEGALREJECTRESULT = 0x30a;
00136 const unsigned short DULC_ILLEGALREQUEST = 0x30b;
00137 const unsigned short DULC_ILLEGALSERVICEPARAMETER = 0x30c;
00138 const unsigned short DULC_INCORRECTBUFFERLENGTH = 0x30d;
00139 const unsigned short DULC_INSUFFICIENTBUFFERLENGTH = 0x30e;
00140 const unsigned short DULC_LISTERROR = 0x30f;
00141 const unsigned short DULC_NETWORKCLOSED = 0x310;
00142
00143 const unsigned short DULC_NOASSOCIATIONREQUEST = 0x312;
00144 const unsigned short DULC_NOPDVS = 0x313;
00145 const unsigned short DULC_NULLKEY = 0x314;
00146 const unsigned short DULC_PCTRANSLATIONFAILURE = 0x315;
00147 const unsigned short DULC_PDATAPDUARRIVED = 0x316;
00148 const unsigned short DULC_PEERABORTEDASSOCIATION = 0x317;
00149 const unsigned short DULC_PEERILLEGALXFERSYNTAXCOUNT = 0x318;
00150 const unsigned short DULC_PEERREQUESTEDRELEASE = 0x319;
00151 const unsigned short DULC_READTIMEOUT = 0x31a;
00152 const unsigned short DULC_REQUESTASSOCIATIONFAILED = 0x31b;
00153 const unsigned short DULC_TCPINITERROR = 0x31c;
00154 const unsigned short DULC_TCPIOERROR = 0x31d;
00155 const unsigned short DULC_TLSERROR = 0x31e;
00156 const unsigned short DULC_UNEXPECTEDPDU = 0x31f;
00157 const unsigned short DULC_UNKNOWNHOST = 0x320;
00158 const unsigned short DULC_UNRECOGNIZEDPDUTYPE = 0x321;
00159 const unsigned short DULC_UNSUPPORTEDPEERPROTOCOL = 0x322;
00160 const unsigned short DULC_WRONGDATATYPE = 0x323;
00161 const unsigned short DULC_TCPWRAPPER = 0x324;
00162 const unsigned short DULC_FORKEDCHILD = 0x325;
00163 const unsigned short DULC_CANNOTFORK = 0x326;
00164
00165
00166 extern const OFCondition DUL_ASSOCIATIONREJECTED;
00167 extern const OFCondition DUL_ILLEGALACCEPT;
00168 extern const OFCondition DUL_ILLEGALKEY;
00169 extern const OFCondition DUL_ILLEGALPDU;
00170 extern const OFCondition DUL_ILLEGALPDULENGTH;
00171 extern const OFCondition DUL_ILLEGALREQUEST;
00172 extern const OFCondition DUL_INCORRECTBUFFERLENGTH;
00173 extern const OFCondition DUL_INSUFFICIENTBUFFERLENGTH;
00174 extern const OFCondition DUL_LISTERROR;
00175 extern const OFCondition DUL_NETWORKCLOSED;
00176 extern const OFCondition DUL_NOASSOCIATIONREQUEST;
00177 extern const OFCondition DUL_NOPDVS;
00178 extern const OFCondition DUL_NULLKEY;
00179 extern const OFCondition DUL_PCTRANSLATIONFAILURE;
00180 extern const OFCondition DUL_PDATAPDUARRIVED;
00181 extern const OFCondition DUL_PEERABORTEDASSOCIATION;
00182 extern const OFCondition DUL_PEERREQUESTEDRELEASE;
00183 extern const OFCondition DUL_READTIMEOUT;
00184 extern const OFCondition DUL_REQUESTASSOCIATIONFAILED;
00185 extern const OFCondition DUL_UNEXPECTEDPDU;
00186 extern const OFCondition DUL_UNSUPPORTEDPEERPROTOCOL;
00187 extern const OFCondition DUL_WRONGDATATYPE;
00188
00189
00190
00191
00192 #define makeDcmnetCondition(A, B, C) makeOFCondition(OFM_dcmnet, (A), (B), (C))
00193
00194
00195
00196
00197
00198
00199
00200 #define makeDcmnetSubCondition(A, B, C, D) DimseCondition::push(OFM_dcmnet, (A), (B), (C), (D))
00201
00202
00207 class DimseCondition
00208 {
00209 public:
00210
00219 static OFString& dump(OFString& str, OFCondition cond);
00220
00229 static void dump(OFCondition cond, OFConsole& console = ofConsole);
00230
00237 static OFCondition push(
00238 unsigned short aModule,
00239 unsigned short aCode,
00240 OFStatus aStatus,
00241 const char *aText,
00242 OFCondition subCondition);
00243
00250 static OFCondition push(
00251 OFCondition newCondition,
00252 OFCondition subCondition);
00253
00254 };
00255
00256
00257
00258
00259 #ifndef OFCONDITION_STRICT_MODE
00260
00261
00262 typedef OFCondition CONDITION;
00263
00264
00265 #define SUCCESS(cond) ((cond).good())
00266
00267
00268 #define ASC_ASSOCIATIONREJECTED DUL_ASSOCIATIONREJECTED
00269 #define ASC_NORMAL EC_Normal
00270 #define ASC_PEERABORTEDASSOCIATION DUL_PEERABORTEDASSOCIATION
00271 #define ASC_PEERREQUESTEDRELEASE DUL_PEERREQUESTEDRELEASE
00272 #define ASC_READTIMEOUT DUL_READTIMEOUT
00273 #define DIMSE_NORMAL EC_Normal
00274 #define DIMSE_PEERABORTEDASSOCIATION DUL_PEERABORTEDASSOCIATION
00275 #define DIMSE_PEERREQUESTEDRELEASE DUL_PEERREQUESTEDRELEASE
00276
00277 #endif
00278
00279 #endif
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322