/* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * Copyright (C) 2013-2019 iopsys Software Solutions AB * Author Mohamed Kallel * Author Ahmed Zribi * Copyright (C) 2012 Luka Perkov */ #include #include #include #include "cwmp.h" #include "external.h" #include "log.h" #include "jshn.h" static json_object *jshn_obj = NULL; static int jshn_message_parse(char **policy, int size, char **tb, char *msg) { int i; json_object *obj; jshn_obj = json_tokener_parse(msg); if (jshn_obj == NULL || is_error(jshn_obj) || json_object_get_type(jshn_obj) != json_type_object) { jshn_obj = NULL; return -1; } for (i=0; i