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
00090 enum srSLMGSource_
00091 {
00092 srSLMG_Source_INVALID = 0,
00093 srSLMG_Source_OWNGenerated = 1,
00094 srSLMG_Source_BEEPRAW = 2,
00095 srSLMG_Source_BEEPCOOKED = 3,
00096 srSLMG_Source_UDP = 4,
00097 srSLMG_Source_UX_DFLT_DOMSOCK = 5,
00098 };
00099 typedef enum srSLMGSource_ srSLMGSource;
00100
00106 struct srSLMGObject
00107 {
00108 srObjID OID;
00109 unsigned char *pszRawMsg;
00110 int bOwnRawMsgBuf;
00111 unsigned char *pszRemoteHost;
00112 int bOwnRemoteHostBuf;
00113 srSLMGFormat iFormat;
00114 srSLMGSource iSource;
00115 # if FEATURE_MSGAPI == 1
00116 int iFacility;
00117 int iSeverity;
00118 unsigned char* pszHostname;
00119 unsigned char* pszTag;
00120 unsigned char* pszMsg;
00121 int bOwnMsg;
00122 unsigned char* pszLanguage;
00124
00125
00126
00127 srSLMGTimStampType iTimStampType;
00128 int iTimStampYear;
00129 int iTimStampMonth;
00130 int iTimStampDay;
00131 int iTimStampHour;
00132 int iTimStampMinute;
00133 int iTimStampSecond;
00134 int iTimStampSecFrac;
00135 int iTimStampSecFracPrecision;
00136 int iTimStampOffsetHour;
00137 int iTimStampOffsetMinute;
00138 char cTimStampOffsetMode;
00139 int bTimStampIncludesTZ;
00140 char *pszTimeStamp;
00142 # endif
00143 };
00144 typedef struct srSLMGObject srSLMGObj;
00145
00146
00155 srRetVal srSLMGConstruct(srSLMGObj **ppThis);
00156
00160 void srSLMGDestroy(srSLMGObj *pThis);
00161
00167 srRetVal srSLMGGetPriority(srSLMGObj *pThis, int *piPrio);
00168
00174 srRetVal srSLMGGetFacility(srSLMGObj *pThis, int *piFac);
00175
00196 srRetVal srSLMGGetRemoteHost(srSLMGObj *pThis, char**ppsz);
00197
00212 srRetVal srSLMGGetHostname(srSLMGObj *pThis, char**ppsz);
00213
00229 srRetVal srSLMGGetTag(srSLMGObj *pThis, unsigned char**ppsz);
00230
00246 srRetVal srSLMGGetMSG(srSLMGObj *pThis, unsigned char**ppsz);
00247
00253 srRetVal srSLMGParseMesg(srSLMGObj *pThis);
00254
00270 srRetVal srSLMGGetRawMSG(srSLMGObj *pThis, unsigned char**ppsz);
00271
00284 srRetVal srSLMGSetRemoteHostIP(srSLMGObj *pThis, char *pszRemHostIP, int bCopyRemHost);
00285
00296 srRetVal srSLMGSetRawMsg(srSLMGObj *pThis, char *pszRawMsg, int bCopyRawMsg);
00297
00308 srRetVal srSLMGSetMSG(srSLMGObj *pThis, char *pszMSG, int bCopyMSG);
00309
00313 srRetVal srSLMGSetTIMESTAMPtoCurrent(srSLMGObj *pThis);
00314
00318 srRetVal srSLMGSetHOSTNAMEtoCurrent(srSLMGObj* pThis);
00319
00334 srRetVal srSLMGFormatRawMsg(srSLMGObj *pThis, srSLMGFormat iFmtToUse);
00335
00340 srRetVal srSLMGSetSeverity(srSLMGObj* pThis, int iNewVal);
00341
00346 srRetVal srSLMGSetFacility(srSLMGObj* pThis, int iNewVal);
00347
00356 srRetVal srSLMGSetTAG(srSLMGObj* pThis, char* pszNewTag);
00357
00358
00359 #endif
00360
00361 #ifdef __cplusplus
00362 };
00363 #endif
00364
00365 #endif