summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Jones <jimmyjones2@gmx.co.uk>2014-07-26 21:48:38 +0100
committerEric Leblond <eric@regit.org>2014-08-11 22:15:25 +0200
commit4f267553aede76dc91133ba88c69f8b8faf00b72 (patch)
tree3459f0016fe9f0d6993379454e49dbc977691428
parentd1b0208f5838ccde1ee0c29111be39a6e6f37c70 (diff)
Fix JSON output on big endian systems
Signed-off-by: Jimmy Jones <jimmyjones2@gmx.co.uk>
-rw-r--r--output/ulogd_output_JSON.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/output/ulogd_output_JSON.c b/output/ulogd_output_JSON.c
index e7ac642..3ad2620 100644
--- a/output/ulogd_output_JSON.c
+++ b/output/ulogd_output_JSON.c
@@ -158,7 +158,11 @@ static int json_interp(struct ulogd_pluginstance *upi)
break;
case ULOGD_RET_BOOL:
case ULOGD_RET_INT8:
+ json_object_set_new(msg, field_name, json_integer(key->u.value.i8));
+ break;
case ULOGD_RET_INT16:
+ json_object_set_new(msg, field_name, json_integer(key->u.value.i16));
+ break;
case ULOGD_RET_INT32:
json_object_set_new(msg, field_name, json_integer(key->u.value.i32));
break;
@@ -171,10 +175,17 @@ static int json_interp(struct ulogd_pluginstance *upi)
json_object_set_new(msg, "action", json_string("blocked"));
break;
}
+ json_object_set_new(msg, field_name, json_integer(key->u.value.ui8));
+ break;
case ULOGD_RET_UINT16:
+ json_object_set_new(msg, field_name, json_integer(key->u.value.ui16));
+ break;
case ULOGD_RET_UINT32:
+ json_object_set_new(msg, field_name, json_integer(key->u.value.ui32));
+ break;
case ULOGD_RET_UINT64:
json_object_set_new(msg, field_name, json_integer(key->u.value.ui64));
+ break;
default:
/* don't know how to interpret this key. */
break;