00001
00058 #ifndef __LIB3195_SYSLOGMESSAGE_H_INCLUDED__
00059 #define __LIB3195_SYSLOGMESSAGE_H_INCLUDED__ 1
00060
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif
00064
00065 #define srSLMGCHECKVALIDOBJECT_API(x) {if((x) == NULL) return SR_RET_NULL_POINTER_PROVIDED; if((x)->OID != OIDsrSLMG) return SR_RET_INVALID_HANDLE;}
00066 #define srSLMGCHECKVALIDOBJECT(x) {assert((x) != NULL);assert((x)->OID == OIDsrSLMG);}
00067
00068 #if (FEATURE_LISTENER == 1) || (FEATURE_MSGAPI == 1)
00069
00070 enum srSLMGFormat_
00071 {
00072 srSLMGFmt_Invalid = 0,
00076 srSLMGFmt_3164RAW = 100,
00077 srSLMGFmt_3164WELLFORMED = 101,
00078 srSLMGFmt_SIGN_12 = 200
00079 };
00080 typedef enum srSLMGFormat_ srSLMGFormat;
00081
00082 enum srSLMGTimStampType_
00083 {
00084 srSLMG_TimStamp_INVALID = 0,
00085 srSLMG_TimStamp_3164 = 1,
00086 srSLMG_TimStamp_3339 = 2
00087 };
00088 typedef enum srSLMGTimStampType_ srSLMGTimStampType;
00089
00095 struct srSLMGObject
00096 {
00097 srObjID OID;
00098 unsigned char *pszRawMsg;
00099 int bOwnRawMsgBuf;
00100 unsigned char *pszRemoteHost;
00101 int bOwnRemoteHostBuf;
00102 srSLMGFormat iFormat;
00103 # if FEATURE_MSGAPI == 1
00104 int iFacility;
00105 int iSeverity;
00106 unsigned char* pszHostname;
00107 unsigned char* pszTag;
00108 unsigned char* pszMsg;
00109 int bOwnMsg;
00110 unsigned char* pszLanguage;
00112
00113
00114
00115 srSLMGTimStampType iTimStampType;
00116 int iTimStampYear;
00117 int iTimStampMonth;
00118 int iTimStampDay;
00119 int iTimStampHour;
00120 int iTimStampMinute;
00121 int iTimStampSecond;
00122 int iTimStampSecFrac;
00123 int iTimStampSecFracPrecision;
00124 int iTimStampOffsetHour;
00125 int iTimStampOffsetMinute;
00126 char cTimStampOffsetMode;
00127 int bTimStampIncludesTZ;
00128 char *pszTimeStamp;
00130 # endif
00131 };
00132 typedef struct srSLMGObject srSLMGObj;
00133
00134
00143 srRetVal srSLMGConstruct(srSLMGObj **ppThis);
00144
00148 void srSLMGDestroy(srSLMGObj *pThis);
00149
00155 srRetVal srSLMGGetPriority(srSLMGObj *pThis, int *piPrio);
00156
00162 srRetVal srSLMGGetFacility(srSLMGObj *pThis, int *piFac);
00163
00180 srRetVal srSLMGGetRemoteHost(srSLMGObj *pThis, char**ppsz);
00181
00196 srRetVal srSLMGGetHostname(srSLMGObj *pThis, char**ppsz);
00197
00213 srRetVal srSLMGGetTag(srSLMGObj *pThis, unsigned char**ppsz);
00214
00230 srRetVal srSLMGGetMSG(srSLMGObj *pThis, unsigned char**ppsz);
00231
00237 srRetVal srSLMGParseMesg(srSLMGObj *pThis);
00238
00254 srRetVal srSLMGGetRawMSG(srSLMGObj *pThis, unsigned char**ppsz);
00255
00268 srRetVal srSLMGSetRemoteHostIP(srSLMGObj *pThis, char *pszRemHostIP, int bCopyRemHost);
00269
00280 srRetVal srSLMGSetRawMsg(srSLMGObj *pThis, char *pszRawMsg, int bCopyRawMsg);
00281
00292 srRetVal srSLMGSetMSG(srSLMGObj *pThis, char *pszMSG, int bCopyMSG);
00293
00297 srRetVal srSLMGSetTIMESTAMPtoCurrent(srSLMGObj *pThis);
00298
00302 srRetVal srSLMGSetHOSTNAMEtoCurrent(srSLMGObj* pThis);
00303
00318 srRetVal srSLMGFormatRawMsg(srSLMGObj *pThis, srSLMGFormat iFmtToUse);
00319
00324 srRetVal srSLMGSetSeverity(srSLMGObj* pThis, int iNewVal);
00325
00330 srRetVal srSLMGSetFacility(srSLMGObj* pThis, int iNewVal);
00331
00340 srRetVal srSLMGSetTAG(srSLMGObj* pThis, char* pszNewTag);
00341
00342
00343 #endif
00344
00345 #ifdef __cplusplus
00346 };
00347 #endif
00348
00349 #endif