From 423261613b2ee9e8f6484b757d000fade6b80fe4 Mon Sep 17 00:00:00 2001 From: Gerard Wagener Date: Mon, 3 Dec 2018 09:39:44 +0100 Subject: [PATCH] set type of data that is delivered --- client/d4.c | 2 +- client/d4.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/d4.c b/client/d4.c index d777cbf..5023813 100644 --- a/client/d4.c +++ b/client/d4.c @@ -91,7 +91,7 @@ void d4_prepare_header(d4_t* d4) d4->header.version = atoi(d4->conf[VERSION]); //FIXME length handling strncpy((char*)&(d4->header.uuid), d4->conf[UUID], SZUUID); - //TODO set type + d4->header.type = atoi(d4->conf[TYPE]); } void d4_update_header(d4_t* d4, ssize_t nread) { diff --git a/client/d4.h b/client/d4.h index 71a7e58..9f1a30c 100644 --- a/client/d4.h +++ b/client/d4.h @@ -1,7 +1,7 @@ #ifndef D4_H #define D4_H -#define ND4PARAMS 6 +#define ND4PARAMS 7 #define NERRORS 100 #define SZCONFVALUE 1024 #define SZERRVALUE 1024 @@ -59,7 +59,7 @@ typedef struct d4_s { * d4-conf/collector */ -const char* d4params[] = {"uuid", "snaplen", "key", "version", "source", "destination"}; +const char* d4params[] = {"uuid", "snaplen", "key", "version", "source", "destination","type"}; #define UUID 0 #define SNAPLEN 1 @@ -67,5 +67,6 @@ const char* d4params[] = {"uuid", "snaplen", "key", "version", "source", "destin #define VERSION 3 #define SOURCE 4 #define DESTINATION 5 +#define TYPE 6 #endif