@ -29,6 +29,7 @@
# include "app-layer-dnp3.h"
# include "app-layer-dnp3-objects.h"
# include "output-json-dnp3-objects.h"
# include "output-json.h"
# ifdef HAVE_LIBJANSSON
@ -2133,7 +2134,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > filename_size + 1 ] ;
memcpy ( tmpbuf , data - > filename , data - > filename_size ) ;
tmpbuf [ data - > filename_size ] = ' \0 ' ;
json_object_set_new ( js , " filename " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " filename " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " filename " , json_string ( " " ) ) ;
}
@ -2145,7 +2146,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > data_size + 1 ] ;
memcpy ( tmpbuf , data - > data , data - > data_size ) ;
tmpbuf [ data - > data_size ] = ' \0 ' ;
json_object_set_new ( js , " data " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " data " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " data " , json_string ( " " ) ) ;
}
@ -2169,7 +2170,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > username_size + 1 ] ;
memcpy ( tmpbuf , data - > username , data - > username_size ) ;
tmpbuf [ data - > username_size ] = ' \0 ' ;
json_object_set_new ( js , " username " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " username " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " username " , json_string ( " " ) ) ;
}
@ -2179,7 +2180,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > password_size + 1 ] ;
memcpy ( tmpbuf , data - > password , data - > password_size ) ;
tmpbuf [ data - > password_size ] = ' \0 ' ;
json_object_set_new ( js , " password " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " password " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " password " , json_string ( " " ) ) ;
}
@ -2211,7 +2212,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > filename_size + 1 ] ;
memcpy ( tmpbuf , data - > filename , data - > filename_size ) ;
tmpbuf [ data - > filename_size ] = ' \0 ' ;
json_object_set_new ( js , " filename " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " filename " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " filename " , json_string ( " " ) ) ;
}
@ -2235,7 +2236,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > optional_text_len + 1 ] ;
memcpy ( tmpbuf , data - > optional_text , data - > optional_text_len ) ;
tmpbuf [ data - > optional_text_len ] = ' \0 ' ;
json_object_set_new ( js , " optional_text " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " optional_text " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " optional_text " , json_string ( " " ) ) ;
}
@ -2253,7 +2254,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > file_data_len + 1 ] ;
memcpy ( tmpbuf , data - > file_data , data - > file_data_len ) ;
tmpbuf [ data - > file_data_len ] = ' \0 ' ;
json_object_set_new ( js , " file_data " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " file_data " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " file_data " , json_string ( " " ) ) ;
}
@ -2273,7 +2274,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > optional_text_len + 1 ] ;
memcpy ( tmpbuf , data - > optional_text , data - > optional_text_len ) ;
tmpbuf [ data - > optional_text_len ] = ' \0 ' ;
json_object_set_new ( js , " optional_text " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " optional_text " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " optional_text " , json_string ( " " ) ) ;
}
@ -2301,7 +2302,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > filename_size + 1 ] ;
memcpy ( tmpbuf , data - > filename , data - > filename_size ) ;
tmpbuf [ data - > filename_size ] = ' \0 ' ;
json_object_set_new ( js , " filename " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " filename " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " filename " , json_string ( " " ) ) ;
}
@ -2315,7 +2316,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > file_specification_len + 1 ] ;
memcpy ( tmpbuf , data - > file_specification , data - > file_specification_len ) ;
tmpbuf [ data - > file_specification_len ] = ' \0 ' ;
json_object_set_new ( js , " file_specification " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " file_specification " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " file_specification " , json_string ( " " ) ) ;
}
@ -2341,7 +2342,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
}
case DNP3_OBJECT_CODE ( 83 , 1 ) : {
DNP3ObjectG83V1 * data = point - > data ;
json_object_set_new ( js , " data->vendor_code " , json_s tring( data - > vendor_code ) ) ;
json_object_set_new ( js , " data->vendor_code " , SCJsonS tring( data - > vendor_code ) ) ;
json_object_set_new ( js , " object_id " ,
json_integer ( data - > object_id ) ) ;
json_object_set_new ( js , " length " ,
@ -2486,7 +2487,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > error_text_len + 1 ] ;
memcpy ( tmpbuf , data - > error_text , data - > error_text_len ) ;
tmpbuf [ data - > error_text_len ] = ' \0 ' ;
json_object_set_new ( js , " error_text " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " error_text " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " error_text " , json_string ( " " ) ) ;
}
@ -2540,7 +2541,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > username_len + 1 ] ;
memcpy ( tmpbuf , data - > username , data - > username_len ) ;
tmpbuf [ data - > username_len ] = ' \0 ' ;
json_object_set_new ( js , " username " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " username " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " username " , json_string ( " " ) ) ;
}
@ -2572,7 +2573,7 @@ void OutputJsonDNP3SetItem(json_t *js, DNP3Object *object,
char tmpbuf [ data - > username_len + 1 ] ;
memcpy ( tmpbuf , data - > username , data - > username_len ) ;
tmpbuf [ data - > username_len ] = ' \0 ' ;
json_object_set_new ( js , " username " , json_s tring( tmpbuf ) ) ;
json_object_set_new ( js , " username " , SCJsonS tring( tmpbuf ) ) ;
} else {
json_object_set_new ( js , " username " , json_string ( " " ) ) ;
}