summaryrefslogtreecommitdiffstats
path: root/runtime/msg.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-09-26 12:41:50 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-09-26 12:41:50 +0200
commita8b1e96d7bf91d97646789c1805587ca1ebba3e9 (patch)
treefea136da0c5c290c953d8b80a4b233a96de5d247 /runtime/msg.h
parent039e23df84ed435ebd674ff5bcad6098b5038664 (diff)
parentb810f0dd3ade85efeb7dc9b99fade798764d0ac2 (diff)
downloadrsyslog-a8b1e96d7bf91d97646789c1805587ca1ebba3e9.tar.gz
rsyslog-a8b1e96d7bf91d97646789c1805587ca1ebba3e9.tar.bz2
rsyslog-a8b1e96d7bf91d97646789c1805587ca1ebba3e9.zip
Merge branch 'v7-stable-mmrfc5424addhmac'
Conflicts: Makefile.am configure.ac runtime/msg.c runtime/rsyslog.h
Diffstat (limited to 'runtime/msg.h')
-rw-r--r--runtime/msg.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/runtime/msg.h b/runtime/msg.h
index 1d9e2c70..ed15622a 100644
--- a/runtime/msg.h
+++ b/runtime/msg.h
@@ -30,6 +30,7 @@
#include <pthread.h>
#include <libestr.h>
+#include <stdint.h>
#include <json.h>
#include "obj.h"
#include "syslogd-types.h"
@@ -85,7 +86,8 @@ struct msg {
char *pszTIMESTAMP3339; /* TIMESTAMP as RFC3339 formatted string (32 charcters at most) */
char *pszTIMESTAMP_MySQL;/* TIMESTAMP as MySQL formatted string (always 14 charcters) */
char *pszTIMESTAMP_PgSQL;/* TIMESTAMP as PgSQL formatted string (always 21 characters) */
- cstr_t *pCSStrucData; /* STRUCTURED-DATA */
+ uchar *pszStrucData; /* STRUCTURED-DATA */
+ uint16_t lenStrucData; /* (cached) length of STRUCTURED-DATA */
cstr_t *pCSAPPNAME; /* APP-NAME */
cstr_t *pCSPROCID; /* PROCID */
cstr_t *pCSMSGID; /* MSGID */
@@ -143,6 +145,9 @@ struct msg {
#define NEEDS_ACLCHK_U 0x080 /* check UDP ACLs after DNS resolution has been done in main queue consumer */
#define NO_PRI_IN_RAW 0x100 /* rawmsg does not include a PRI (Solaris!), but PRI is already set correctly in the msg object */
+/* (syslog) protocol types */
+#define MSG_LEGACY_PROTOCOL 0
+#define MSG_RFC5424_PROTOCOL 1
/* function prototypes
*/
@@ -165,6 +170,8 @@ void MsgSetTAG(msg_t *pMsg, uchar* pszBuf, size_t lenBuf);
void MsgSetRuleset(msg_t *pMsg, ruleset_t*);
rsRetVal MsgSetFlowControlType(msg_t *pMsg, flowControl_t eFlowCtl);
rsRetVal MsgSetStructuredData(msg_t *pMsg, char* pszStrucData);
+rsRetVal MsgAddToStructuredData(msg_t *pMsg, uchar *toadd, rs_size_t len);
+void MsgGetStructuredData(msg_t *pM, uchar **pBuf, rs_size_t *len);
rsRetVal msgSetFromSockinfo(msg_t *pThis, struct sockaddr_storage *sa);
void MsgSetRcvFrom(msg_t *pMsg, prop_t*);
void MsgSetRcvFromStr(msg_t *pMsg, uchar* pszRcvFrom, int, prop_t **);
@@ -221,6 +228,18 @@ msgUnsetJSON(msg_t *pMsg, uchar *varname) {
return msgDelJSON(pMsg, varname+1);
}
+static inline int
+msgGetProtocolVersion(msg_t *pM)
+{
+ return(pM->iProtocolVersion);
+}
+
+/* returns non-zero if the message has structured data, 0 otherwise */
+static inline sbool
+MsgHasStructuredData(msg_t *pM)
+{
+ return (pM->pszStrucData == NULL) ? 0 : 1;
+}
/* ------------------------------ some inline functions ------------------------------ */