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
00030
00031
00032
00033
00034 #ifndef COND_H
00035 #define COND_H
00036
00037 #include "dcmtk/config/osconfig.h"
00038 #include "dcmtk/ofstd/ofconsol.h"
00039 #include "dcmtk/dcmdata/dcerror.h"
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
00071
00072
00073
00074
00075 const unsigned short ASCC_BADPRESENTATIONCONTEXTID = 0x101;
00076 const unsigned short ASCC_BADPRESENTATIONCONTEXTPOSITION = 0x102;
00077 const unsigned short ASCC_CODINGERROR = 0x103;
00078 const unsigned short ASCC_DUPLICATEPRESENTATIONCONTEXTID = 0x104;
00079 const unsigned short ASCC_MISSINGTRANSFERSYNTAX = 0x105;
00080 const unsigned short ASCC_NULLKEY = 0x106;
00081 const unsigned short ASCC_SHUTDOWNAPPLICATION = 0x107;
00082
00083
00084 extern const OFCondition ASC_BADPRESENTATIONCONTEXTID;
00085 extern const OFCondition ASC_MISSINGTRANSFERSYNTAX;
00086 extern const OFCondition ASC_NULLKEY;
00087 extern const OFCondition ASC_SHUTDOWNAPPLICATION;
00088
00089
00090 const unsigned short DIMSEC_BADCOMMANDTYPE = 0x201;
00091 const unsigned short DIMSEC_BADDATA = 0x202;
00092 const unsigned short DIMSEC_BADMESSAGE = 0x203;
00093 const unsigned short DIMSEC_BUILDFAILED = 0x204;
00094 const unsigned short DIMSEC_ILLEGALASSOCIATION = 0x205;
00095 const unsigned short DIMSEC_INVALIDPRESENTATIONCONTEXTID = 0x206;
00096 const unsigned short DIMSEC_NODATAAVAILABLE = 0x207;
00097 const unsigned short DIMSEC_NOVALIDPRESENTATIONCONTEXTID = 0x208;
00098 const unsigned short DIMSEC_NULLKEY = 0x209;
00099 const unsigned short DIMSEC_OUTOFRESOURCES = 0x20a;
00100 const unsigned short DIMSEC_PARSEFAILED = 0x20b;
00101 const unsigned short DIMSEC_READPDVFAILED = 0x20c;
00102 const unsigned short DIMSEC_RECEIVEFAILED = 0x20d;
00103 const unsigned short DIMSEC_SENDFAILED = 0x20e;
00104 const unsigned short DIMSEC_UNEXPECTEDPDVTYPE = 0x20f;
00105 const unsigned short DIMSEC_UNEXPECTEDREQUEST = 0x210;
00106 const unsigned short DIMSEC_UNEXPECTEDRESPONSE = 0x211;
00107 const unsigned short DIMSEC_UNSUPPORTEDTRANSFERSYNTAX = 0x212;
00108 const unsigned short DIMSEC_NODATADICT = 0x213;
00109
00110
00111 extern const OFCondition DIMSE_BADCOMMANDTYPE;
00112 extern const OFCondition DIMSE_BADDATA;
00113 extern const OFCondition DIMSE_BADMESSAGE;
00114 extern const OFCondition DIMSE_ILLEGALASSOCIATION;
00115 extern const OFCondition DIMSE_NODATAAVAILABLE;
00116 extern const OFCondition DIMSE_NOVALIDPRESENTATIONCONTEXTID;
00117 extern const OFCondition DIMSE_NULLKEY;
00118 extern const OFCondition DIMSE_OUTOFRESOURCES;
00119 extern const OFCondition DIMSE_PARSEFAILED;
00120 extern const OFCondition DIMSE_READPDVFAILED;
00121 extern const OFCondition DIMSE_RECEIVEFAILED;
00122 extern const OFCondition DIMSE_SENDFAILED;
00123 extern const OFCondition DIMSE_UNEXPECTEDPDVTYPE;
00124 extern const OFCondition DIMSE_NODATADICT;
00125
00126
00127 const unsigned short DULC_ASSOCIATIONREJECTED = 0x301;
00128 const unsigned short DULC_CODINGERROR = 0x302;
00129 const unsigned short DULC_FSMERROR = 0x303;
00130 const unsigned short DULC_ILLEGALACCEPT = 0x304;
00131 const unsigned short DULC_ILLEGALKEY = 0x305;
00132 const unsigned short DULC_ILLEGALPARAMETER = 0x306;
00133 const unsigned short DULC_ILLEGALPDU = 0x307;
00134 const unsigned short DULC_ILLEGALPDULENGTH = 0x308;
00135 const unsigned short DULC_ILLEGALREJECTREASON = 0x309;
00136 const unsigned short DULC_ILLEGALREJECTRESULT = 0x30a;
00137 const unsigned short DULC_ILLEGALREQUEST = 0x30b;
00138 const unsigned short DULC_ILLEGALSERVICEPARAMETER = 0x30c;
00139 const unsigned short DULC_INCORRECTBUFFERLENGTH = 0x30d;
00140 const unsigned short DULC_INSUFFICIENTBUFFERLENGTH = 0x30e;
00141 const unsigned short DULC_LISTERROR = 0x30f;
00142 const unsigned short DULC_NETWORKCLOSED = 0x310;
00143
00144 const unsigned short DULC_NOASSOCIATIONREQUEST = 0x312;
00145 const unsigned short DULC_NOPDVS = 0x313;
00146 const unsigned short DULC_NULLKEY = 0x314;
00147 const unsigned short DULC_PCTRANSLATIONFAILURE = 0x315;
00148 const unsigned short DULC_PDATAPDUARRIVED = 0x316;
00149 const unsigned short DULC_PEERABORTEDASSOCIATION = 0x317;
00150 const unsigned short DULC_PEERILLEGALXFERSYNTAXCOUNT = 0x318;
00151 const unsigned short DULC_PEERREQUESTEDRELEASE = 0x319;
00152 const unsigned short DULC_READTIMEOUT = 0x31a;
00153 const unsigned short DULC_REQUESTASSOCIATIONFAILED = 0x31b;
00154 const unsigned short DULC_TCPINITERROR = 0x31c;
00155 const unsigned short DULC_TCPIOERROR = 0x31d;
00156 const unsigned short DULC_TLSERROR = 0x31e;
00157 const unsigned short DULC_UNEXPECTEDPDU = 0x31f;
00158 const unsigned short DULC_UNKNOWNHOST = 0x320;
00159 const unsigned short DULC_UNRECOGNIZEDPDUTYPE = 0x321;
00160 const unsigned short DULC_UNSUPPORTEDPEERPROTOCOL = 0x322;
00161 const unsigned short DULC_WRONGDATATYPE = 0x323;
00162 const unsigned short DULC_TCPWRAPPER = 0x324;
00163 const unsigned short DULC_FORKEDCHILD = 0x325;
00164 const unsigned short DULC_CANNOTFORK = 0x326;
00165
00166
00167 extern const OFCondition DUL_ASSOCIATIONREJECTED;
00168 extern const OFCondition DUL_ILLEGALACCEPT;
00169 extern const OFCondition DUL_ILLEGALKEY;
00170 extern const OFCondition DUL_ILLEGALPDU;
00171 extern const OFCondition DUL_ILLEGALPDULENGTH;
00172 extern const OFCondition DUL_ILLEGALREQUEST;
00173 extern const OFCondition DUL_INCORRECTBUFFERLENGTH;
00174 extern const OFCondition DUL_INSUFFICIENTBUFFERLENGTH;
00175 extern const OFCondition DUL_LISTERROR;
00176 extern const OFCondition DUL_NETWORKCLOSED;
00177 extern const OFCondition DUL_NOASSOCIATIONREQUEST;
00178 extern const OFCondition DUL_NOPDVS;
00179 extern const OFCondition DUL_NULLKEY;
00180 extern const OFCondition DUL_PCTRANSLATIONFAILURE;
00181 extern const OFCondition DUL_PDATAPDUARRIVED;
00182 extern const OFCondition DUL_PEERABORTEDASSOCIATION;
00183 extern const OFCondition DUL_PEERREQUESTEDRELEASE;
00184 extern const OFCondition DUL_READTIMEOUT;
00185 extern const OFCondition DUL_REQUESTASSOCIATIONFAILED;
00186 extern const OFCondition DUL_UNEXPECTEDPDU;
00187 extern const OFCondition DUL_UNSUPPORTEDPEERPROTOCOL;
00188 extern const OFCondition DUL_WRONGDATATYPE;
00189
00190
00191
00192
00193 #define makeDcmnetCondition(A, B, C) makeOFCondition(OFM_dcmnet, (A), (B), (C))
00194
00195
00196
00197
00198
00199
00200
00201 #define makeDcmnetSubCondition(A, B, C, D) DimseCondition::push(OFM_dcmnet, (A), (B), (C), (D))
00202
00203
00208 class DimseCondition
00209 {
00210 public:
00211
00219 static void dump(OFCondition cond, OFConsole& console = ofConsole);
00220
00227 static OFCondition push(
00228 unsigned short aModule,
00229 unsigned short aCode,
00230 OFStatus aStatus,
00231 const char *aText,
00232 OFCondition subCondition);
00233
00240 static OFCondition push(
00241 OFCondition newCondition,
00242 OFCondition subCondition);
00243
00244 };
00245
00246
00247
00248
00249 #ifndef OFCONDITION_STRICT_MODE
00250
00251
00252 typedef OFCondition CONDITION;
00253
00254
00255 #define SUCCESS(cond) ((cond).good())
00256
00257
00258 #define ASC_ASSOCIATIONREJECTED DUL_ASSOCIATIONREJECTED
00259 #define ASC_NORMAL EC_Normal
00260 #define ASC_PEERABORTEDASSOCIATION DUL_PEERABORTEDASSOCIATION
00261 #define ASC_PEERREQUESTEDRELEASE DUL_PEERREQUESTEDRELEASE
00262 #define ASC_READTIMEOUT DUL_READTIMEOUT
00263 #define DIMSE_NORMAL EC_Normal
00264 #define DIMSE_PEERABORTEDASSOCIATION DUL_PEERABORTEDASSOCIATION
00265 #define DIMSE_PEERREQUESTEDRELEASE DUL_PEERREQUESTEDRELEASE
00266
00267 #endif
00268
00269 #endif
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293