[prelude-cvslog] r10381 - in libprelude/branches/libprelude-easy-bindings/src: . idmef-wrappers-gen include
noreply at prelude-ids.org
noreply at prelude-ids.org
Mon Mar 10 11:51:13 CET 2008
Author: yoann
Date: 2008-03-10 11:51:06 +0100 (Mon, 10 Mar 2008)
New Revision: 10381
Modified:
libprelude/branches/libprelude-easy-bindings/src/common.c
libprelude/branches/libprelude-easy-bindings/src/idmef-class.c
libprelude/branches/libprelude-easy-bindings/src/idmef-message-read.c
libprelude/branches/libprelude-easy-bindings/src/idmef-path.c
libprelude/branches/libprelude-easy-bindings/src/idmef-tree-wrap.c
libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFMessageReadH.pm
libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFMessageWriteH.pm
libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeData.pm
libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeWrapC.pm
libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeWrapH.pm
libprelude/branches/libprelude-easy-bindings/src/include/common.h
libprelude/branches/libprelude-easy-bindings/src/include/idmef-class.h
libprelude/branches/libprelude-easy-bindings/src/include/idmef-message-read.h
libprelude/branches/libprelude-easy-bindings/src/include/idmef-message-write.h
libprelude/branches/libprelude-easy-bindings/src/include/idmef-tree-data.h
libprelude/branches/libprelude-easy-bindings/src/include/idmef-tree-wrap.h
libprelude/branches/libprelude-easy-bindings/src/include/prelude-extract.h
Log:
Merge ../libprelude
Modified: libprelude/branches/libprelude-easy-bindings/src/common.c
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/common.c 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/common.c 2008-03-10 10:51:06 UTC (rev 10381)
@@ -493,8 +493,6 @@
int _idmef_message_assign_missing(prelude_client_t *client, idmef_message_t *msg)
{
- int ret;
- idmef_time_t *time;
idmef_alert_t *alert;
idmef_heartbeat_t *heartbeat;
prelude_ident_t *ident = prelude_client_get_unique_ident(client);
Modified: libprelude/branches/libprelude-easy-bindings/src/idmef-class.c
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/idmef-class.c 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/idmef-class.c 2008-03-10 10:51:06 UTC (rev 10381)
@@ -88,13 +88,13 @@
return ret;
list = object_data[class].children_list;
-
- if ( list ) {
- for ( i = 0; list[i].name; i++ )
- if ( strcasecmp(list[i].name, name) == 0)
- return i;
- }
+ if ( list ) {
+ for ( i = 0; list[i].name; i++ )
+ if ( strcasecmp(list[i].name, name) == 0)
+ return i;
+ }
+
return prelude_error_verbose(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD, "Unknown IDMEF child '%s'", name);
}
@@ -230,6 +230,18 @@
+int idmef_class_destroy_child(void *ptr, idmef_class_id_t class, idmef_class_child_id_t child, int n)
+{
+ int ret;
+
+ ret = is_child_valid(class, child);
+ if ( ret < 0 )
+ return ret;
+
+ return object_data[class].destroy_child(ptr, child, n);
+}
+
+
int idmef_class_copy(idmef_class_id_t class, const void *src, void *dst)
{
int ret;
Modified: libprelude/branches/libprelude-easy-bindings/src/idmef-message-read.c
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/idmef-message-read.c 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/idmef-message-read.c 2008-03-10 10:51:06 UTC (rev 10381)
@@ -1,3 +1,4 @@
+
/*****
*
* Copyright (C) 2001,2002,2003,2004,2005 PreludeIDS Technologies. All Rights Reserved.
Modified: libprelude/branches/libprelude-easy-bindings/src/idmef-path.c
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/idmef-path.c 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/idmef-path.c 2008-03-10 10:51:06 UTC (rev 10381)
@@ -330,17 +330,26 @@
if ( ret < 0 )
return;
- prelude_list_for_each_safe(head, tmp, bkp) {
- obj = prelude_linked_object_get_object(tmp);
- idmef_class_destroy(idmef_class_get_child_class(class, elem->position), obj);
- }
+ prelude_list_for_each_safe(head, tmp, bkp) {
+ obj = prelude_linked_object_get_object(tmp);
+
+ /*
+ * The object might be referenced from other place than
+ * this message, in which case idmef_class_destroy()
+ * will only decrease it's reference count.
+ *
+ * We manually call prelude_list_del_init() in order to
+ * disassociate the object from the message.
+ */
+ prelude_list_del_init(tmp);
+ idmef_class_destroy(idmef_class_get_child_class(class, elem->position), obj);
+ }
}
-
static int _idmef_path_set(const idmef_path_t *path, idmef_message_t *message, idmef_value_t *value, prelude_bool_t *delete_list)
{
+ void *ptr;
int i, ret, index;
- void *ptr, *child;
idmef_value_type_id_t tid;
const idmef_path_element_t *elem;
idmef_class_id_t class, parent_class;
@@ -350,7 +359,6 @@
for ( i = 0; i < path->depth; i++ ) {
elem = &path->elem[i];
-
index = elem->index;
/*
@@ -367,20 +375,29 @@
if ( *delete_list ) {
*delete_list = FALSE;
delete_listed_child(ptr, class, elem);
+
+ if ( ! value )
+ return 0;
}
}
- ret = idmef_class_new_child(ptr, class, elem->position, index, &child);
- if ( ret < 0 )
- return ret;
-
- ptr = child;
parent_class = class;
- class = idmef_class_get_child_class(class, elem->position);
- assert( ! (class < 0 && i < path->depth - 1) );
+ if ( value || i < (path->depth - 1) ) {
+ ret = idmef_class_new_child(ptr, class, elem->position, index, &ptr);
+ if ( ret < 0 )
+ return ret;
+
+ class = idmef_class_get_child_class(class, elem->position);
+ assert( ! (class < 0 && i < path->depth - 1) );
+ }
}
+ if ( ! value )
+ return idmef_class_destroy_child(ptr, parent_class,
+ path->elem[path->depth - 1].position,
+ path->elem[path->depth - 1].index);
+
tid = idmef_class_get_child_value_type(parent_class, path->elem[path->depth - 1].position);
if ( tid != idmef_value_get_type(value) && _idmef_value_cast(value, tid, class) < 0 )
return prelude_error_verbose(PRELUDE_ERROR_GENERIC, "IDMEF path copy of type '%s' to '%s' is forbidden",
@@ -448,19 +465,21 @@
int idmef_path_set(const idmef_path_t *path, idmef_message_t *message, idmef_value_t *value)
{
prelude_bool_t delete_list = TRUE;
- const idmef_path_element_t *elem = &path->elem[path->depth - 1];
+ if ( path->depth < 1 )
+ return prelude_error_verbose(PRELUDE_ERROR_GENERIC, "Path with depth of 0 are not allowed");
+
/*
* Allow raw list copy (example: alert.source = alert.source,
* alert.source(>>) = alert.source, alert.source(<<) = alert.source.
*/
- if ( idmef_value_is_list(value) ) {
+ if ( value && idmef_value_is_list(value) ) {
value_list_t vl;
vl.path = path;
vl.message = message;
vl.delete_list = TRUE;
- vl.reversed = (elem->index == IDMEF_LIST_PREPEND) ? TRUE : FALSE;
+ vl.reversed = (path->elem[path->depth - 1].index == IDMEF_LIST_PREPEND) ? TRUE : FALSE;
return do_idmef_value_iterate(value, &vl);
}
Modified: libprelude/branches/libprelude-easy-bindings/src/idmef-tree-wrap.c
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/idmef-tree-wrap.c 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/idmef-tree-wrap.c 2008-03-10 10:51:06 UTC (rev 10381)
@@ -1918,6 +1918,35 @@
}
}
+int _idmef_additional_data_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_additional_data_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ ptr->type = 0;
+ return 0;
+
+ case 1:
+ if ( ptr->meaning ) {
+ prelude_string_destroy(ptr->meaning);
+ ptr->meaning = NULL;
+ }
+
+ return 0;
+
+ case 2:
+ idmef_data_destroy_internal(&ptr->data);
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_additional_data_destroy_internal(idmef_additional_data_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -2301,6 +2330,39 @@
}
}
+int _idmef_reference_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_reference_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ ptr->origin = 0;
+ return 0;
+
+ case 1:
+ prelude_string_destroy_internal(&ptr->name);
+ return 0;
+
+ case 2:
+ prelude_string_destroy_internal(&ptr->url);
+ return 0;
+
+ case 3:
+ if ( ptr->meaning ) {
+ prelude_string_destroy(ptr->meaning);
+ ptr->meaning = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_reference_destroy_internal(idmef_reference_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -2778,6 +2840,62 @@
}
}
+int _idmef_classification_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_classification_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->ident ) {
+ prelude_string_destroy(ptr->ident);
+ ptr->ident = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ prelude_string_destroy_internal(&ptr->text);
+ return 0;
+
+ case 2: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->reference_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_reference_t, list);
+ idmef_reference_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->reference_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_reference_t, list);
+ idmef_reference_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_classification_destroy_internal(idmef_classification_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -3234,6 +3352,51 @@
}
}
+int _idmef_user_id_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_user_id_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->ident ) {
+ prelude_string_destroy(ptr->ident);
+ ptr->ident = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ ptr->type = 0;
+ return 0;
+
+ case 2:
+ if ( ptr->tty ) {
+ prelude_string_destroy(ptr->tty);
+ ptr->tty = NULL;
+ }
+
+ return 0;
+
+ case 3:
+ if ( ptr->name ) {
+ prelude_string_destroy(ptr->name);
+ ptr->name = NULL;
+ }
+
+ return 0;
+
+ case 4:
+ ptr->number_is_set = 0;
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_user_id_destroy_internal(idmef_user_id_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -3806,6 +3969,62 @@
}
}
+int _idmef_user_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_user_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->ident ) {
+ prelude_string_destroy(ptr->ident);
+ ptr->ident = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ ptr->category = 0;
+ return 0;
+
+ case 2: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->user_id_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_user_id_t, list);
+ idmef_user_id_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->user_id_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_user_id_t, list);
+ idmef_user_id_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_user_destroy_internal(idmef_user_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -4255,6 +4474,55 @@
}
}
+int _idmef_address_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_address_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->ident ) {
+ prelude_string_destroy(ptr->ident);
+ ptr->ident = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ ptr->category = 0;
+ return 0;
+
+ case 2:
+ if ( ptr->vlan_name ) {
+ prelude_string_destroy(ptr->vlan_name);
+ ptr->vlan_name = NULL;
+ }
+
+ return 0;
+
+ case 3:
+ ptr->vlan_num_is_set = 0;
+ return 0;
+
+ case 4:
+ prelude_string_destroy_internal(&ptr->address);
+ return 0;
+
+ case 5:
+ if ( ptr->netmask ) {
+ prelude_string_destroy(ptr->netmask);
+ ptr->netmask = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_address_destroy_internal(idmef_address_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -4944,6 +5212,105 @@
}
}
+int _idmef_process_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_process_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->ident ) {
+ prelude_string_destroy(ptr->ident);
+ ptr->ident = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ prelude_string_destroy_internal(&ptr->name);
+ return 0;
+
+ case 2:
+ ptr->pid_is_set = 0;
+ return 0;
+
+ case 3:
+ if ( ptr->path ) {
+ prelude_string_destroy(ptr->path);
+ ptr->path = NULL;
+ }
+
+ return 0;
+
+ case 4: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->arg_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, prelude_string_t, list);
+ prelude_string_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->arg_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, prelude_string_t, list);
+ prelude_string_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ case 5: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->env_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, prelude_string_t, list);
+ prelude_string_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->env_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, prelude_string_t, list);
+ prelude_string_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_process_destroy_internal(idmef_process_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -5700,6 +6067,70 @@
}
}
+int _idmef_web_service_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_web_service_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ prelude_string_destroy_internal(&ptr->url);
+ return 0;
+
+ case 1:
+ if ( ptr->cgi ) {
+ prelude_string_destroy(ptr->cgi);
+ ptr->cgi = NULL;
+ }
+
+ return 0;
+
+ case 2:
+ if ( ptr->http_method ) {
+ prelude_string_destroy(ptr->http_method);
+ ptr->http_method = NULL;
+ }
+
+ return 0;
+
+ case 3: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->arg_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, prelude_string_t, list);
+ prelude_string_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->arg_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, prelude_string_t, list);
+ prelude_string_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_web_service_destroy_internal(idmef_web_service_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -6252,6 +6683,79 @@
}
}
+int _idmef_snmp_service_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_snmp_service_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->oid ) {
+ prelude_string_destroy(ptr->oid);
+ ptr->oid = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ ptr->message_processing_model_is_set = 0;
+ return 0;
+
+ case 2:
+ ptr->security_model_is_set = 0;
+ return 0;
+
+ case 3:
+ if ( ptr->security_name ) {
+ prelude_string_destroy(ptr->security_name);
+ ptr->security_name = NULL;
+ }
+
+ return 0;
+
+ case 4:
+ ptr->security_level_is_set = 0;
+ return 0;
+
+ case 5:
+ if ( ptr->context_name ) {
+ prelude_string_destroy(ptr->context_name);
+ ptr->context_name = NULL;
+ }
+
+ return 0;
+
+ case 6:
+ if ( ptr->context_engine_id ) {
+ prelude_string_destroy(ptr->context_engine_id);
+ ptr->context_engine_id = NULL;
+ }
+
+ return 0;
+
+ case 7:
+ if ( ptr->command ) {
+ prelude_string_destroy(ptr->command);
+ ptr->command = NULL;
+ }
+
+ return 0;
+
+ case 8:
+ if ( ptr->community ) {
+ prelude_string_destroy(ptr->community);
+ ptr->community = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_snmp_service_destroy_internal(idmef_snmp_service_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -7146,6 +7650,91 @@
}
}
+int _idmef_service_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_service_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->ident ) {
+ prelude_string_destroy(ptr->ident);
+ ptr->ident = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ ptr->ip_version_is_set = 0;
+ return 0;
+
+ case 2:
+ ptr->iana_protocol_number_is_set = 0;
+ return 0;
+
+ case 3:
+ if ( ptr->iana_protocol_name ) {
+ prelude_string_destroy(ptr->iana_protocol_name);
+ ptr->iana_protocol_name = NULL;
+ }
+
+ return 0;
+
+ case 4:
+ if ( ptr->name ) {
+ prelude_string_destroy(ptr->name);
+ ptr->name = NULL;
+ }
+
+ return 0;
+
+ case 5:
+ ptr->port_is_set = 0;
+ return 0;
+
+ case 6:
+ if ( ptr->portlist ) {
+ prelude_string_destroy(ptr->portlist);
+ ptr->portlist = NULL;
+ }
+
+ return 0;
+
+ case 7:
+ if ( ptr->protocol ) {
+ prelude_string_destroy(ptr->protocol);
+ ptr->protocol = NULL;
+ }
+
+ return 0;
+
+ case 8:
+ if ( ptr->type != IDMEF_SERVICE_TYPE_WEB )
+ return 0;
+
+ idmef_web_service_destroy(ptr->specific.web_service);
+ ptr->specific.web_service = NULL;
+ ptr->type = 0;
+
+ return 0;
+
+ case 9:
+ if ( ptr->type != IDMEF_SERVICE_TYPE_SNMP )
+ return 0;
+
+ idmef_snmp_service_destroy(ptr->specific.snmp_service);
+ ptr->specific.snmp_service = NULL;
+ ptr->type = 0;
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_service_destroy_internal(idmef_service_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -8204,6 +8793,78 @@
}
}
+int _idmef_node_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_node_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->ident ) {
+ prelude_string_destroy(ptr->ident);
+ ptr->ident = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ ptr->category = 0;
+ return 0;
+
+ case 2:
+ if ( ptr->location ) {
+ prelude_string_destroy(ptr->location);
+ ptr->location = NULL;
+ }
+
+ return 0;
+
+ case 3:
+ if ( ptr->name ) {
+ prelude_string_destroy(ptr->name);
+ ptr->name = NULL;
+ }
+
+ return 0;
+
+ case 4: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->address_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_address_t, list);
+ idmef_address_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->address_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_address_t, list);
+ idmef_address_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_node_destroy_internal(idmef_node_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -8821,6 +9482,71 @@
}
}
+int _idmef_source_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_source_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->ident ) {
+ prelude_string_destroy(ptr->ident);
+ ptr->ident = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ ptr->spoofed = 0;
+ return 0;
+
+ case 2:
+ if ( ptr->interface ) {
+ prelude_string_destroy(ptr->interface);
+ ptr->interface = NULL;
+ }
+
+ return 0;
+
+ case 3:
+ if ( ptr->node ) {
+ idmef_node_destroy(ptr->node);
+ ptr->node = NULL;
+ }
+
+ return 0;
+
+ case 4:
+ if ( ptr->user ) {
+ idmef_user_destroy(ptr->user);
+ ptr->user = NULL;
+ }
+
+ return 0;
+
+ case 5:
+ if ( ptr->process ) {
+ idmef_process_destroy(ptr->process);
+ ptr->process = NULL;
+ }
+
+ return 0;
+
+ case 6:
+ if ( ptr->service ) {
+ idmef_service_destroy(ptr->service);
+ ptr->service = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_source_destroy_internal(idmef_source_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -9559,6 +10285,58 @@
}
}
+int _idmef_file_access_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_file_access_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->user_id ) {
+ idmef_user_id_destroy(ptr->user_id);
+ ptr->user_id = NULL;
+ }
+
+ return 0;
+
+ case 1: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->permission_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, prelude_string_t, list);
+ prelude_string_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->permission_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, prelude_string_t, list);
+ prelude_string_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_file_access_destroy_internal(idmef_file_access_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -9953,6 +10731,47 @@
}
}
+int _idmef_inode_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_inode_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->change_time ) {
+ idmef_time_destroy(ptr->change_time);
+ ptr->change_time = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ ptr->number_is_set = 0;
+ return 0;
+
+ case 2:
+ ptr->major_device_is_set = 0;
+ return 0;
+
+ case 3:
+ ptr->minor_device_is_set = 0;
+ return 0;
+
+ case 4:
+ ptr->c_major_device_is_set = 0;
+ return 0;
+
+ case 5:
+ ptr->c_minor_device_is_set = 0;
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_inode_destroy_internal(idmef_inode_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -10561,6 +11380,35 @@
}
}
+int _idmef_checksum_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_checksum_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ prelude_string_destroy_internal(&ptr->value);
+ return 0;
+
+ case 1:
+ if ( ptr->key ) {
+ prelude_string_destroy(ptr->key);
+ ptr->key = NULL;
+ }
+
+ return 0;
+
+ case 2:
+ ptr->algorithm = 0;
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_checksum_destroy_internal(idmef_checksum_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -11115,6 +11963,184 @@
}
}
+int _idmef_file_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_file_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->ident ) {
+ prelude_string_destroy(ptr->ident);
+ ptr->ident = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ prelude_string_destroy_internal(&ptr->name);
+ return 0;
+
+ case 2:
+ prelude_string_destroy_internal(&ptr->path);
+ return 0;
+
+ case 3:
+ if ( ptr->create_time ) {
+ idmef_time_destroy(ptr->create_time);
+ ptr->create_time = NULL;
+ }
+
+ return 0;
+
+ case 4:
+ if ( ptr->modify_time ) {
+ idmef_time_destroy(ptr->modify_time);
+ ptr->modify_time = NULL;
+ }
+
+ return 0;
+
+ case 5:
+ if ( ptr->access_time ) {
+ idmef_time_destroy(ptr->access_time);
+ ptr->access_time = NULL;
+ }
+
+ return 0;
+
+ case 6:
+ ptr->data_size_is_set = 0;
+ return 0;
+
+ case 7:
+ ptr->disk_size_is_set = 0;
+ return 0;
+
+ case 8: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->file_access_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_file_access_t, list);
+ idmef_file_access_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->file_access_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_file_access_t, list);
+ idmef_file_access_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ case 9: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->linkage_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_linkage_t, list);
+ idmef_linkage_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->linkage_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_linkage_t, list);
+ idmef_linkage_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ case 10:
+ if ( ptr->inode ) {
+ idmef_inode_destroy(ptr->inode);
+ ptr->inode = NULL;
+ }
+
+ return 0;
+
+ case 11: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->checksum_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_checksum_t, list);
+ idmef_checksum_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->checksum_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_checksum_t, list);
+ idmef_checksum_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ case 12:
+ ptr->category = 0;
+ return 0;
+
+ case 13:
+ ptr->fstype_is_set = 0;
+ return 0;
+
+ case 14:
+ if ( ptr->file_type ) {
+ prelude_string_destroy(ptr->file_type);
+ ptr->file_type = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_file_destroy_internal(idmef_file_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -12554,6 +13580,39 @@
}
}
+int _idmef_linkage_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_linkage_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ ptr->category = 0;
+ return 0;
+
+ case 1:
+ prelude_string_destroy_internal(&ptr->name);
+ return 0;
+
+ case 2:
+ prelude_string_destroy_internal(&ptr->path);
+ return 0;
+
+ case 3:
+ if ( ptr->file ) {
+ idmef_file_destroy(ptr->file);
+ ptr->file = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_linkage_destroy_internal(idmef_linkage_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -13065,6 +14124,102 @@
}
}
+int _idmef_target_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_target_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->ident ) {
+ prelude_string_destroy(ptr->ident);
+ ptr->ident = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ ptr->decoy = 0;
+ return 0;
+
+ case 2:
+ if ( ptr->interface ) {
+ prelude_string_destroy(ptr->interface);
+ ptr->interface = NULL;
+ }
+
+ return 0;
+
+ case 3:
+ if ( ptr->node ) {
+ idmef_node_destroy(ptr->node);
+ ptr->node = NULL;
+ }
+
+ return 0;
+
+ case 4:
+ if ( ptr->user ) {
+ idmef_user_destroy(ptr->user);
+ ptr->user = NULL;
+ }
+
+ return 0;
+
+ case 5:
+ if ( ptr->process ) {
+ idmef_process_destroy(ptr->process);
+ ptr->process = NULL;
+ }
+
+ return 0;
+
+ case 6:
+ if ( ptr->service ) {
+ idmef_service_destroy(ptr->service);
+ ptr->service = NULL;
+ }
+
+ return 0;
+
+ case 7: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->file_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_file_t, list);
+ idmef_file_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->file_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_file_t, list);
+ idmef_file_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_target_destroy_internal(idmef_target_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -13924,6 +15079,99 @@
}
}
+int _idmef_analyzer_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_analyzer_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->analyzerid ) {
+ prelude_string_destroy(ptr->analyzerid);
+ ptr->analyzerid = NULL;
+ }
+
+ return 0;
+
+ case 1:
+ if ( ptr->name ) {
+ prelude_string_destroy(ptr->name);
+ ptr->name = NULL;
+ }
+
+ return 0;
+
+ case 2:
+ if ( ptr->manufacturer ) {
+ prelude_string_destroy(ptr->manufacturer);
+ ptr->manufacturer = NULL;
+ }
+
+ return 0;
+
+ case 3:
+ if ( ptr->model ) {
+ prelude_string_destroy(ptr->model);
+ ptr->model = NULL;
+ }
+
+ return 0;
+
+ case 4:
+ if ( ptr->version ) {
+ prelude_string_destroy(ptr->version);
+ ptr->version = NULL;
+ }
+
+ return 0;
+
+ case 5:
+ if ( ptr->class ) {
+ prelude_string_destroy(ptr->class);
+ ptr->class = NULL;
+ }
+
+ return 0;
+
+ case 6:
+ if ( ptr->ostype ) {
+ prelude_string_destroy(ptr->ostype);
+ ptr->ostype = NULL;
+ }
+
+ return 0;
+
+ case 7:
+ if ( ptr->osversion ) {
+ prelude_string_destroy(ptr->osversion);
+ ptr->osversion = NULL;
+ }
+
+ return 0;
+
+ case 8:
+ if ( ptr->node ) {
+ idmef_node_destroy(ptr->node);
+ ptr->node = NULL;
+ }
+
+ return 0;
+
+ case 9:
+ if ( ptr->process ) {
+ idmef_process_destroy(ptr->process);
+ ptr->process = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_analyzer_destroy_internal(idmef_analyzer_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -14873,6 +16121,31 @@
}
}
+int _idmef_alertident_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_alertident_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ prelude_string_destroy_internal(&ptr->alertident);
+ return 0;
+
+ case 1:
+ if ( ptr->analyzerid ) {
+ prelude_string_destroy(ptr->analyzerid);
+ ptr->analyzerid = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_alertident_destroy_internal(idmef_alertident_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -15207,6 +16480,39 @@
}
}
+int _idmef_impact_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_impact_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ ptr->severity_is_set = 0;
+ return 0;
+
+ case 1:
+ ptr->completion_is_set = 0;
+ return 0;
+
+ case 2:
+ ptr->type = 0;
+ return 0;
+
+ case 3:
+ if ( ptr->description ) {
+ prelude_string_destroy(ptr->description);
+ ptr->description = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_impact_destroy_internal(idmef_impact_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -15652,6 +16958,31 @@
}
}
+int _idmef_action_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_action_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ ptr->category = 0;
+ return 0;
+
+ case 1:
+ if ( ptr->description ) {
+ prelude_string_destroy(ptr->description);
+ ptr->description = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_action_destroy_internal(idmef_action_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -15956,6 +17287,23 @@
}
}
+int _idmef_confidence_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_confidence_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ ptr->rating = 0;
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_confidence_destroy_internal(idmef_confidence_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -16277,6 +17625,66 @@
}
}
+int _idmef_assessment_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_assessment_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->impact ) {
+ idmef_impact_destroy(ptr->impact);
+ ptr->impact = NULL;
+ }
+
+ return 0;
+
+ case 1: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->action_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_action_t, list);
+ idmef_action_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->action_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_action_t, list);
+ idmef_action_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ case 2:
+ if ( ptr->confidence ) {
+ idmef_confidence_destroy(ptr->confidence);
+ ptr->confidence = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_assessment_destroy_internal(idmef_assessment_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -16763,6 +18171,62 @@
}
}
+int _idmef_tool_alert_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_tool_alert_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ prelude_string_destroy_internal(&ptr->name);
+ return 0;
+
+ case 1:
+ if ( ptr->command ) {
+ prelude_string_destroy(ptr->command);
+ ptr->command = NULL;
+ }
+
+ return 0;
+
+ case 2: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->alertident_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_alertident_t, list);
+ idmef_alertident_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->alertident_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_alertident_t, list);
+ idmef_alertident_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_tool_alert_destroy_internal(idmef_tool_alert_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -17235,6 +18699,54 @@
}
}
+int _idmef_correlation_alert_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_correlation_alert_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ prelude_string_destroy_internal(&ptr->name);
+ return 0;
+
+ case 1: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->alertident_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_alertident_t, list);
+ idmef_alertident_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->alertident_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_alertident_t, list);
+ idmef_alertident_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_correlation_alert_destroy_internal(idmef_correlation_alert_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -17599,6 +19111,35 @@
}
}
+int _idmef_overflow_alert_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_overflow_alert_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ prelude_string_destroy_internal(&ptr->program);
+ return 0;
+
+ case 1:
+ ptr->size_is_set = 0;
+ return 0;
+
+ case 2:
+ if ( ptr->buffer ) {
+ idmef_data_destroy(ptr->buffer);
+ ptr->buffer = NULL;
+ }
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_overflow_alert_destroy_internal(idmef_overflow_alert_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -18202,6 +19743,217 @@
}
}
+int _idmef_alert_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_alert_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->messageid ) {
+ prelude_string_destroy(ptr->messageid);
+ ptr->messageid = NULL;
+ }
+
+ return 0;
+
+ case 1: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->analyzer_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_analyzer_t, list);
+ idmef_analyzer_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->analyzer_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_analyzer_t, list);
+ idmef_analyzer_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ case 2:
+ idmef_time_destroy_internal(&ptr->create_time);
+ return 0;
+
+ case 3:
+ if ( ptr->classification ) {
+ idmef_classification_destroy(ptr->classification);
+ ptr->classification = NULL;
+ }
+
+ return 0;
+
+ case 4:
+ if ( ptr->detect_time ) {
+ idmef_time_destroy(ptr->detect_time);
+ ptr->detect_time = NULL;
+ }
+
+ return 0;
+
+ case 5:
+ if ( ptr->analyzer_time ) {
+ idmef_time_destroy(ptr->analyzer_time);
+ ptr->analyzer_time = NULL;
+ }
+
+ return 0;
+
+ case 6: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->source_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_source_t, list);
+ idmef_source_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->source_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_source_t, list);
+ idmef_source_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ case 7: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->target_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_target_t, list);
+ idmef_target_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->target_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_target_t, list);
+ idmef_target_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ case 8:
+ if ( ptr->assessment ) {
+ idmef_assessment_destroy(ptr->assessment);
+ ptr->assessment = NULL;
+ }
+
+ return 0;
+
+ case 9: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->additional_data_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_additional_data_t, list);
+ idmef_additional_data_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->additional_data_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_additional_data_t, list);
+ idmef_additional_data_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ case 10:
+ if ( ptr->type != IDMEF_ALERT_TYPE_TOOL )
+ return 0;
+
+ idmef_tool_alert_destroy(ptr->detail.tool_alert);
+ ptr->detail.tool_alert = NULL;
+ ptr->type = 0;
+
+ return 0;
+
+ case 11:
+ if ( ptr->type != IDMEF_ALERT_TYPE_CORRELATION )
+ return 0;
+
+ idmef_correlation_alert_destroy(ptr->detail.correlation_alert);
+ ptr->detail.correlation_alert = NULL;
+ ptr->type = 0;
+
+ return 0;
+
+ case 12:
+ if ( ptr->type != IDMEF_ALERT_TYPE_OVERFLOW )
+ return 0;
+
+ idmef_overflow_alert_destroy(ptr->detail.overflow_alert);
+ ptr->detail.overflow_alert = NULL;
+ ptr->type = 0;
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_alert_destroy_internal(idmef_alert_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -19774,6 +21526,105 @@
}
}
+int _idmef_heartbeat_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_heartbeat_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ if ( ptr->messageid ) {
+ prelude_string_destroy(ptr->messageid);
+ ptr->messageid = NULL;
+ }
+
+ return 0;
+
+ case 1: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->analyzer_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_analyzer_t, list);
+ idmef_analyzer_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->analyzer_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_analyzer_t, list);
+ idmef_analyzer_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ case 2:
+ idmef_time_destroy_internal(&ptr->create_time);
+ return 0;
+
+ case 3:
+ if ( ptr->analyzer_time ) {
+ idmef_time_destroy(ptr->analyzer_time);
+ ptr->analyzer_time = NULL;
+ }
+
+ return 0;
+
+ case 4:
+ ptr->heartbeat_interval_is_set = 0;
+ return 0;
+
+ case 5: {
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->additional_data_list, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, idmef_additional_data_t, list);
+ idmef_additional_data_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->additional_data_list, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, idmef_additional_data_t, list);
+ idmef_additional_data_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ }
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_heartbeat_destroy_internal(idmef_heartbeat_t *ptr)
{
prelude_return_if_fail(ptr);
@@ -20493,6 +22344,43 @@
}
}
+int _idmef_message_destroy_child(void *p, idmef_class_child_id_t child, int n)
+{
+ idmef_message_t *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) {
+
+ case 0:
+ prelude_string_destroy_internal(&ptr->version);
+ return 0;
+
+ case 1:
+ if ( ptr->type != IDMEF_MESSAGE_TYPE_ALERT )
+ return 0;
+
+ idmef_alert_destroy(ptr->message.alert);
+ ptr->message.alert = NULL;
+ ptr->type = 0;
+
+ return 0;
+
+ case 2:
+ if ( ptr->type != IDMEF_MESSAGE_TYPE_HEARTBEAT )
+ return 0;
+
+ idmef_heartbeat_destroy(ptr->message.heartbeat);
+ ptr->message.heartbeat = NULL;
+ ptr->type = 0;
+
+ return 0;
+
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ }
+}
+
static void idmef_message_destroy_internal(idmef_message_t *ptr)
{
prelude_return_if_fail(ptr);
Modified: libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFMessageReadH.pm
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFMessageReadH.pm 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFMessageReadH.pm 2008-03-10 10:51:06 UTC (rev 10381)
@@ -25,9 +25,9 @@
use strict;
use IDMEFTree;
-sub header
+sub header
{
- my $self = shift;
+ my $self = shift;
$self->output("
/*****
@@ -69,9 +69,9 @@
");
}
-sub footer
+sub footer
{
- my $self = shift;
+ my $self = shift;
$self->output("
@@ -83,11 +83,11 @@
");
}
-sub struct
+sub struct
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
$self->output("
int idmef_$struct->{short_typename}_read($struct->{typename} *$struct->{short_typename}, prelude_msg_t *msg);\n");
Modified: libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFMessageWriteH.pm
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFMessageWriteH.pm 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFMessageWriteH.pm 2008-03-10 10:51:06 UTC (rev 10381)
@@ -25,9 +25,9 @@
use strict;
use IDMEFTree;
-sub header
+sub header
{
- my $self = shift;
+ my $self = shift;
$self->output("
/*****
@@ -70,9 +70,9 @@
");
}
-sub footer
+sub footer
{
- my $self = shift;
+ my $self = shift;
$self->output("
@@ -84,11 +84,11 @@
");
}
-sub struct
+sub struct
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
$self->output("int idmef_$struct->{short_typename}_write($struct->{typename} *$struct->{short_typename}, prelude_msgbuf_t *msg);\n");
}
Modified: libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeData.pm
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeData.pm 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeData.pm 2008-03-10 10:51:06 UTC (rev 10381)
@@ -23,101 +23,102 @@
@ISA = qw/Generate/;
use strict;
-use IDMEFTree;
+use IDMEFTree;
-sub header
+sub header
{
- my $self = shift;
+ my $self = shift;
$self->output("
/* Auto-generated by the GenerateIDMEFTreeData package */
typedef struct \{
- const char *name;
- prelude_bool_t list;
- idmef_value_type_id_t type;
- idmef_class_id_t class;
+ const char *name;
+ prelude_bool_t list;
+ idmef_value_type_id_t type;
+ idmef_class_id_t class;
\} children_list_t;
");
}
-sub struct
+sub struct
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
- my $name;
- my $list;
- my $object;
- my $object_type;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
+ my $name;
+ my $list;
+ my $object;
+ my $object_type;
$self->output("const children_list_t idmef_$struct->{short_typename}_children_list[] = \{\n");
foreach my $field ( @{ $struct->{field_list} } ) {
- if ( $field->{metatype} == &METATYPE_UNION ) {
+ if ( $field->{metatype} == &METATYPE_UNION ) {
- foreach my $member ( @{ $field->{member_list} } ) {
+ foreach my $member ( @{ $field->{member_list} } ) {
- $self->output(" \{ \"$member->{name}\", 0, IDMEF_VALUE_TYPE_CLASS, IDMEF_CLASS_ID_" . uc("$member->{short_typename}") . " \},\n");
- }
+ $self->output(" \{ \"$member->{name}\", 0, IDMEF_VALUE_TYPE_CLASS, IDMEF_CLASS_ID_" . uc("$member->{short_typename}") . " \},\n");
+ }
- } else {
+ } else {
- $list = 0;
- $name = $field->{name};
+ $list = 0;
+ $name = $field->{name};
- if ( $field->{metatype} & &METATYPE_NORMAL) {
+ if ( $field->{metatype} & &METATYPE_NORMAL) {
- if ( $field->{metatype} & &METATYPE_PRIMITIVE ) {
- $object = "IDMEF_VALUE_TYPE_" . uc("$field->{value_type}");
- $object_type = 0;
+ if ( $field->{metatype} & &METATYPE_PRIMITIVE ) {
+ $object = "IDMEF_VALUE_TYPE_" . uc("$field->{value_type}");
+ $object_type = 0;
- } elsif ( $field->{metatype} & &METATYPE_STRUCT ) {
- $object = "IDMEF_VALUE_TYPE_CLASS";
- $object_type = "IDMEF_CLASS_ID_" . uc("$field->{short_typename}");
+ } elsif ( $field->{metatype} & &METATYPE_STRUCT ) {
+ $object = "IDMEF_VALUE_TYPE_CLASS";
+ $object_type = "IDMEF_CLASS_ID_" . uc("$field->{short_typename}");
- } elsif ( $field->{metatype} & &METATYPE_ENUM ) {
- $object = "IDMEF_VALUE_TYPE_ENUM";
- $object_type = "IDMEF_CLASS_ID_" . uc("$field->{short_typename}");
- }
+ } elsif ( $field->{metatype} & &METATYPE_ENUM ) {
+ $object = "IDMEF_VALUE_TYPE_ENUM";
+ $object_type = "IDMEF_CLASS_ID_" . uc("$field->{short_typename}");
+ }
- } elsif ( $field->{metatype} & &METATYPE_LIST ) {
- $list = 1;
- $name = $field->{short_name};
+ } elsif ( $field->{metatype} & &METATYPE_LIST ) {
+ $list = 1;
+ $name = $field->{short_name};
- if ( $field->{metatype} & &METATYPE_PRIMITIVE ) {
- $object = "IDMEF_VALUE_TYPE_" . uc("$field->{value_type}");
- $object_type = 0;
+ if ( $field->{metatype} & &METATYPE_PRIMITIVE ) {
+ $object = "IDMEF_VALUE_TYPE_" . uc("$field->{value_type}");
+ $object_type = 0;
- } else {
- $object = "IDMEF_VALUE_TYPE_CLASS";
- $object_type = "IDMEF_CLASS_ID_" . uc("$field->{short_typename}");
- }
- }
+ } else {
+ $object = "IDMEF_VALUE_TYPE_CLASS";
+ $object_type = "IDMEF_CLASS_ID_" . uc("$field->{short_typename}");
+ }
+ }
- $self->output(" \{ \"$name\", $list, $object, $object_type \},\n");
- }
+ $self->output(" \{ \"$name\", $list, $object, $object_type \},\n");
+ }
}
$self->output("\};\n\n");
}
-sub footer
+sub footer
{
- my $self = shift;
- my $tree = shift;
- my $last_id = -1;
+ my $self = shift;
+ my $tree = shift;
+ my $last_id = -1;
$self->output("
typedef struct \{
- const char *name;
+ const char *name;
size_t children_list_elem;
- const children_list_t *children_list;
- int (*get_child)(void *ptr, idmef_class_child_id_t child, void **ret);
- int (*new_child)(void *ptr, idmef_class_child_id_t child, int n, void **ret);
- int (*to_numeric)(const char *name);
- const char *(*to_string)(int val);
+ const children_list_t *children_list;
+ int (*get_child)(void *ptr, idmef_class_child_id_t child, void **ret);
+ int (*new_child)(void *ptr, idmef_class_child_id_t child, int n, void **ret);
+ int (*destroy_child)(void *ptr, idmef_class_child_id_t child, int n);
+ int (*to_numeric)(const char *name);
+ const char *(*to_string)(int val);
int (*copy)(const void *src, void *dst);
int (*clone)(const void *src, void **dst);
int (*compare)(const void *obj1, const void *obj2);
@@ -128,44 +129,46 @@
const object_data_t object_data[] = \{
");
-
+
foreach my $obj ( sort { $a->{id} <=> $b->{id} } map { ($_->{obj_type} != &OBJ_PRE_DECLARED ? $_ : () ) } @{ $tree->{obj_list} } ) {
- for ( my $i = $last_id + 1; $i < $obj->{id}; $i++ ) {
- $self->output(" \{ \"(unassigned)\", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL \}, /* ID: $i */\n");
- }
+ for ( my $i = $last_id + 1; $i < $obj->{id}; $i++ ) {
+ $self->output(" \{ \"(unassigned)\", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL \}, /* ID: $i */\n");
+ }
- $last_id = $obj->{id};
+ $last_id = $obj->{id};
- $self->output(" \{ ",
- "\"$obj->{short_typename}\", ",
- "sizeof(idmef_$obj->{short_typename}_children_list) / sizeof(*idmef_$obj->{short_typename}_children_list), ",
- "idmef_$obj->{short_typename}_children_list, ",
- "_idmef_$obj->{short_typename}_get_child, ",
- "_idmef_$obj->{short_typename}_new_child, ",
- "NULL, ",
- "NULL, ",
- "(void *) idmef_$obj->{short_typename}_copy, ",
- "(void *) idmef_$obj->{short_typename}_clone, ",
- "(void *) idmef_$obj->{short_typename}_compare, ",
- "(void *) idmef_$obj->{short_typename}_ref, ",
+ $self->output(" \{ ",
+ "\"$obj->{short_typename}\", ",
+ "sizeof(idmef_$obj->{short_typename}_children_list) / sizeof(*idmef_$obj->{short_typename}_children_list), ",
+ "idmef_$obj->{short_typename}_children_list, ",
+ "_idmef_$obj->{short_typename}_get_child, ",
+ "_idmef_$obj->{short_typename}_new_child, ",
+ "_idmef_$obj->{short_typename}_destroy_child, ",
+ "NULL, ",
+ "NULL, ",
+ "(void *) idmef_$obj->{short_typename}_copy, ",
+ "(void *) idmef_$obj->{short_typename}_clone, ",
+ "(void *) idmef_$obj->{short_typename}_compare, ",
+ "(void *) idmef_$obj->{short_typename}_ref, ",
"(void *) idmef_$obj->{short_typename}_destroy \}, ",
- "/* ID: $obj->{id} */\n") if ( $obj->{obj_type} == &OBJ_STRUCT );
+ "/* ID: $obj->{id} */\n") if ( $obj->{obj_type} == &OBJ_STRUCT );
- $self->output(" \{ ",
- "\"$obj->{short_typename}\", ",
- "0, ",
- "NULL, ",
- "NULL, ",
- "NULL, ",
- "(void *) idmef_$obj->{short_typename}_to_numeric, ",
- "(void *) idmef_$obj->{short_typename}_to_string, ",
- "NULL, ",
- "NULL, ",
- "NULL, ",
- "NULL ",
- "\}, ",
- "/* ID: $obj->{id} */\n") if ( $obj->{obj_type} == &OBJ_ENUM );
+ $self->output(" \{ ",
+ "\"$obj->{short_typename}\", ",
+ "0, ",
+ "NULL, ",
+ "NULL, ",
+ "NULL, ",
+ "NULL, ",
+ "(void *) idmef_$obj->{short_typename}_to_numeric, ",
+ "(void *) idmef_$obj->{short_typename}_to_string, ",
+ "NULL, ",
+ "NULL, ",
+ "NULL, ",
+ "NULL ",
+ "\}, ",
+ "/* ID: $obj->{id} */\n") if ( $obj->{obj_type} == &OBJ_ENUM );
}
$self->output(" \{ NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL \}\n");
Modified: libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeWrapC.pm
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeWrapC.pm 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeWrapC.pm 2008-03-10 10:51:06 UTC (rev 10381)
@@ -476,6 +476,158 @@
");
}
+
+
+sub struct_destroy_child
+{
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
+ my $n = 0;
+
+ $self->output("
+int _idmef_$struct->{short_typename}_destroy_child(void *p, idmef_class_child_id_t child, int n)
+\{
+ $struct->{typename} *ptr = p;
+
+ prelude_return_val_if_fail(p, prelude_error(PRELUDE_ERROR_ASSERTION));
+
+ switch ( child ) \{
+");
+
+ foreach my $field ( @{ $struct->{field_list} } ) {
+
+ if ( $field->{metatype} & &METATYPE_LIST ) {
+ my $type = "";
+
+ if ( $field->{typename} eq "idmef_time_t" ||
+ $field->{typename} eq "idmef_data_t" ||
+ $field->{typename} eq "prelude_string_t" ) {
+ $type = "$field->{short_typename}"
+ } else {
+ $type = "idmef_$field->{short_typename}"
+ }
+
+ $self->output("
+ case $n: \{
+ int i = 0;
+ prelude_list_t *tmp;
+
+ if ( n >= 0 ) {
+ prelude_list_for_each(&ptr->$field->{name}, tmp) {
+ if ( i++ == n ) {
+ void *b = prelude_list_entry(tmp, $field->{typename}, list);
+ ${type}_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != n )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ } else {
+ int pos = (-n) - 1; /* With negative value, -1 is the base, translate to 0 */
+
+ prelude_list_for_each_reversed(&ptr->$field->{name}, tmp) {
+ if ( i++ == pos ) {
+ void *b = prelude_list_entry(tmp, $field->{typename}, list);
+ ${type}_destroy(b);
+ return 0;
+ }
+ }
+
+ if ( i != pos )
+ return prelude_error(PRELUDE_ERROR_IDMEF_TREE_INDEX_UNDEFINED);
+ }
+ \}
+");
+ } elsif ( $field->{metatype} & &METATYPE_UNION ) {
+
+ foreach my $member ( @{ $field->{member_list} } ) {
+ $self->output("
+ case $n:
+ if ( ptr->$field->{var} != $member->{value} )
+ return 0;
+
+ idmef_$member->{short_typename}_destroy(ptr->$field->{name}.$member->{name});
+ ptr->$field->{name}.$member->{name} = NULL;
+ ptr->$field->{var} = 0;
+
+ return 0;
+");
+ $n++;
+ }
+
+ } elsif ( $field->{metatype} & &METATYPE_NORMAL ) {
+ if ( $field->{metatype} & &METATYPE_OPTIONAL_INT ) {
+ $self->output("
+ case $n:
+ ptr->$field->{name}_is_set = 0;
+ return 0;
+");
+ }
+
+ elsif ( $field->{ptr} ) {
+ my $type = "";
+
+ if ( $field->{typename} eq "idmef_time_t" ||
+ $field->{typename} eq "idmef_data_t" ||
+ $field->{typename} eq "prelude_string_t" ) {
+ $type = "$field->{short_typename}"
+ } else {
+ $type = "idmef_$field->{short_typename}"
+ }
+
+ $self->output("
+ case $n:
+ if ( ptr->$field->{name} ) {
+ ${type}_destroy(ptr->$field->{name});
+ ptr->$field->{name} = NULL;
+ }
+
+ return 0;
+");
+ }
+
+ else {
+ my $code = "";
+
+ if ( $field->{metatype} & &METATYPE_ENUM) {
+ $code = "ptr->$field->{name} = 0";
+ }
+
+ elsif ( ! ($field->{metatype} & &METATYPE_STRUCT) ) {
+ $n++;
+ next;
+ }
+ elsif ( $field->{typename} eq "idmef_time_t" ||
+ $field->{typename} eq "idmef_data_t" ||
+ $field->{typename} eq "prelude_string_t" ) {
+ $code = "$field->{short_typename}_destroy_internal(&ptr->$field->{name})"
+ } else {
+ $code = "idmef_$field->{short_typename}_destroy_internal(&ptr->$field->{name})"
+ }
+
+ $self->output("
+ case $n:
+ ${code};
+ return 0;
+");
+ }
+
+ }
+
+ $n++;
+ }
+
+ $self->output("
+ default:
+ return prelude_error(PRELUDE_ERROR_IDMEF_CLASS_UNKNOWN_CHILD);
+ \}
+\}
+");
+}
+
+
sub struct_new_child
{
my $self = shift;
@@ -1497,6 +1649,7 @@
$self->struct_ref($tree, $struct);
$self->struct_get_child($tree, $struct);
$self->struct_new_child($tree, $struct);
+ $self->struct_destroy_child($tree, $struct);
$self->struct_destroy_internal($tree, $struct);
$self->struct_destroy($tree, $struct);
$self->struct_fields($tree, $struct);
Modified: libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeWrapH.pm
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeWrapH.pm 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/idmef-wrappers-gen/GenerateIDMEFTreeWrapH.pm 2008-03-10 10:51:06 UTC (rev 10381)
@@ -25,9 +25,9 @@
use strict;
use IDMEFTree;
-sub header
+sub header
{
- my $self = shift;
+ my $self = shift;
$self->output("
/*****
@@ -80,9 +80,9 @@
");
}
-sub footer
+sub footer
{
- my $self = shift;
+ my $self = shift;
$self->output("
void idmef_message_set_pmsg(idmef_message_t *message, prelude_msg_t *msg);
@@ -99,11 +99,11 @@
$self->output("#endif /* _LIBPRELUDE_IDMEF_TREE_WRAP */\n");
}
-sub struct_definition
+sub struct_definition
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
$self->output("\n\n/*\n");
$self->output(" * $_\n") foreach ( @{ $struct->{desc} } );
@@ -114,11 +114,11 @@
") unless ( $tree->{pre_declareds}->{$struct->{typename}} );
}
-sub struct_constructor
+sub struct_constructor
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
$self->output("int idmef_$struct->{short_typename}_new($struct->{typename} **ret);\n");
$self->output("int idmef_$struct->{short_typename}_copy(const $struct->{typename} *src, $struct->{typename} *dst);\n");
@@ -126,11 +126,11 @@
$self->output("int idmef_$struct->{short_typename}_compare(const $struct->{typename} *obj1, const $struct->{typename} *obj2);\n");
}
-sub struct_ref
+sub struct_ref
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
$struct->{refcount} or return;
@@ -138,50 +138,60 @@
}
-sub struct_get_child
+sub struct_destroy_child
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
- my $n = 0;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
+ my $n = 0;
+ $self->output("int _idmef_$struct->{short_typename}_destroy_child(void *p, idmef_class_child_id_t child, int n);\n");
+}
+
+sub struct_get_child
+{
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
+ my $n = 0;
+
$self->output("int _idmef_$struct->{short_typename}_get_child(void *p, idmef_class_child_id_t child, void **childptr);\n");
}
-sub struct_new_child
+sub struct_new_child
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
- my $n = 0;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
+ my $n = 0;
$self->output("int _idmef_$struct->{short_typename}_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);\n");
}
-sub struct_destroy
+sub struct_destroy
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
$self->output("void idmef_$struct->{short_typename}_destroy($struct->{typename} *ptr);\n");
}
-sub struct_field_normal
+sub struct_field_normal
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
- my $field = shift;
- my $name = shift || $field->{name};
- my $ptr = "";
- my $refer = "";
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
+ my $field = shift;
+ my $name = shift || $field->{name};
+ my $ptr = "";
+ my $refer = "";
$ptr = "*", $refer = "*" if ( $field->{metatype} & &METATYPE_STRUCT );
$refer = "*" if ( $field->{metatype} & &METATYPE_OPTIONAL_INT );
if ( $field->{metatype} & &METATYPE_OPTIONAL_INT ) {
- $self->output("void idmef_$struct->{short_typename}_unset_${name}($struct->{typename} *ptr);\n");
+ $self->output("void idmef_$struct->{short_typename}_unset_${name}($struct->{typename} *ptr);\n");
}
$self->output("$field->{typename} ${refer}idmef_$struct->{short_typename}_get_${name}($struct->{typename} *ptr);\n");
@@ -189,38 +199,38 @@
my $field_name = ($name eq "class") ? "class_str" : $name;
$self->output("void idmef_$struct->{short_typename}_set_${name}($struct->{typename} *ptr, $field->{typename} ${ptr}${field_name});\n");
-
+
$self->output("int idmef_$struct->{short_typename}_new_${name}($struct->{typename} *ptr, $field->{typename} **ret);\n");
-
+
$self->output("\n");
}
-sub struct_field_union
+sub struct_field_union
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
- my $field = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
+ my $field = shift;
$self->output("$field->{typename} idmef_$struct->{short_typename}_get_$field->{var}($struct->{typename} *ptr);\n");
foreach my $member ( @{ $field->{member_list} } ) {
- $self->struct_field_normal($tree, $struct,
- { metatype => &METATYPE_STRUCT,
- name => "$field->{name}.$member->{name}",
- typename => $member->{typename},
- short_typename => $member->{short_typename},
- ptr => $member->{ptr}
- }, $member->{name});
+ $self->struct_field_normal($tree, $struct,
+ { metatype => &METATYPE_STRUCT,
+ name => "$field->{name}.$member->{name}",
+ typename => $member->{typename},
+ short_typename => $member->{short_typename},
+ ptr => $member->{ptr}
+ }, $member->{name});
}
}
-sub struct_field_list
+sub struct_field_list
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
- my $field = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
+ my $field = shift;
$self->output(
"$field->{typename} *idmef_$struct->{short_typename}_get_next_$field->{short_name}($struct->{typename} *$struct->{short_typename}, $field->{typename} *$field->{short_typename}_cur);
@@ -230,24 +240,24 @@
");
}
-sub struct_fields
+sub struct_fields
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
foreach my $field ( @{ $struct->{field_list} } ) {
- $self->struct_field_normal($tree, $struct, $field) if ( $field->{metatype} & &METATYPE_NORMAL );
- $self->struct_field_list($tree, $struct, $field) if ( $field->{metatype} & &METATYPE_LIST );
- $self->struct_field_union($tree, $struct, $field) if ( $field->{metatype} & &METATYPE_UNION );
+ $self->struct_field_normal($tree, $struct, $field) if ( $field->{metatype} & &METATYPE_NORMAL );
+ $self->struct_field_list($tree, $struct, $field) if ( $field->{metatype} & &METATYPE_LIST );
+ $self->struct_field_union($tree, $struct, $field) if ( $field->{metatype} & &METATYPE_UNION );
}
}
-sub struct
+sub struct
{
- my $self = shift;
- my $tree = shift;
- my $struct = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $struct = shift;
$self->struct_definition($tree, $struct);
$self->struct_constructor($tree, $struct);
@@ -256,34 +266,35 @@
$self->output("\n#ifndef SWIG\n");
$self->struct_get_child($tree, $struct);
$self->struct_new_child($tree, $struct);
+ $self->struct_destroy_child($tree, $struct);
$self->output("#endif\n\n");
$self->struct_destroy($tree, $struct);
$self->struct_fields($tree, $struct);
}
-sub enum
+sub enum
{
- my $self = shift;
- my $tree = shift;
- my $enum = shift;
- my $cnt = 0;
+ my $self = shift;
+ my $tree = shift;
+ my $enum = shift;
+ my $cnt = 0;
foreach ( @{ $enum->{desc} } ) {
- if ( $cnt == 0 ) {
- $self->output("typedef enum {\n");
+ if ( $cnt == 0 ) {
+ $self->output("typedef enum {\n");
- } elsif ( $cnt + 1 == @{ $enum->{desc} } ) {
- $self->output("\} $enum->{typename};\n");
+ } elsif ( $cnt + 1 == @{ $enum->{desc} } ) {
+ $self->output("\} $enum->{typename};\n");
- } else {
- my $val = $_;
-
- $val =~ s/\(.*\)//;
- $self->output("$val\n");
- }
+ } else {
+ my $val = $_;
- $cnt++;
+ $val =~ s/\(.*\)//;
+ $self->output("$val\n");
+ }
+
+ $cnt++;
}
$self->output("\n\n");
@@ -292,11 +303,11 @@
$self->output("\n\n");
}
-sub pre_declared
+sub pre_declared
{
- my $self = shift;
- my $tree = shift;
- my $pre_declared = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $pre_declared = shift;
if ( $pre_declared->{metatype} & &METATYPE_STRUCT ) {
$self->output("
@@ -311,14 +322,14 @@
}
}
-sub obj
+sub obj
{
- my $self = shift;
- my $tree = shift;
- my $obj = shift;
+ my $self = shift;
+ my $tree = shift;
+ my $obj = shift;
push(@{ $self->{type_list} }, [ "IDMEF_CLASS_ID_" . uc("$obj->{short_typename}") => $obj->{id} ])
- if ( $obj->{obj_type} != &OBJ_PRE_DECLARED );
+ if ( $obj->{obj_type} != &OBJ_PRE_DECLARED );
}
1;
Modified: libprelude/branches/libprelude-easy-bindings/src/include/common.h
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/include/common.h 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/include/common.h 2008-03-10 10:51:06 UTC (rev 10381)
@@ -43,6 +43,9 @@
#include <time.h>
+#ifdef __cplusplus
+ extern "C" {
+#endif
#define prelude_return_val_if_fail(cond, val) do { \
if ( ! (cond) ) { \
@@ -92,5 +95,8 @@
void _prelude_unload_file(unsigned char *fdata, size_t size);
+#ifdef __cplusplus
+ }
+#endif
#endif /* _LIBPRELUDE_COMMON_H */
Modified: libprelude/branches/libprelude-easy-bindings/src/include/idmef-class.h
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/include/idmef-class.h 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/include/idmef-class.h 2008-03-10 10:51:06 UTC (rev 10381)
@@ -59,7 +59,9 @@
int idmef_class_new_child(void *ptr, idmef_class_id_t classid, idmef_class_child_id_t child, int n, void **childptr);
+int idmef_class_destroy_child(void *ptr, idmef_class_id_t classid, idmef_class_child_id_t child, int n);
+
/*
*
*/
Modified: libprelude/branches/libprelude-easy-bindings/src/include/idmef-message-read.h
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/include/idmef-message-read.h 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/include/idmef-message-read.h 2008-03-10 10:51:06 UTC (rev 10381)
@@ -31,7 +31,11 @@
#include "prelude-inttypes.h"
#include "prelude-msgbuf.h"
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -96,6 +100,7 @@
int idmef_message_read(idmef_message_t *message, prelude_msg_t *msg);
+
#ifdef __cplusplus
}
#endif
Modified: libprelude/branches/libprelude-easy-bindings/src/include/idmef-message-write.h
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/include/idmef-message-write.h 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/include/idmef-message-write.h 2008-03-10 10:51:06 UTC (rev 10381)
@@ -67,6 +67,7 @@
int idmef_heartbeat_write(idmef_heartbeat_t *heartbeat, prelude_msgbuf_t *msg);
int idmef_message_write(idmef_message_t *message, prelude_msgbuf_t *msg);
+
#ifdef __cplusplus
}
#endif
Modified: libprelude/branches/libprelude-easy-bindings/src/include/idmef-tree-data.h
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/include/idmef-tree-data.h 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/include/idmef-tree-data.h 2008-03-10 10:51:06 UTC (rev 10381)
@@ -2,10 +2,10 @@
/* Auto-generated by the GenerateIDMEFTreeData package */
typedef struct {
- const char *name;
- prelude_bool_t list;
- idmef_value_type_id_t type;
- idmef_class_id_t class;
+ const char *name;
+ prelude_bool_t list;
+ idmef_value_type_id_t type;
+ idmef_class_id_t class;
} children_list_t;
const children_list_t idmef_additional_data_children_list[] = {
@@ -256,13 +256,14 @@
typedef struct {
- const char *name;
+ const char *name;
size_t children_list_elem;
- const children_list_t *children_list;
- int (*get_child)(void *ptr, idmef_class_child_id_t child, void **ret);
- int (*new_child)(void *ptr, idmef_class_child_id_t child, int n, void **ret);
- int (*to_numeric)(const char *name);
- const char *(*to_string)(int val);
+ const children_list_t *children_list;
+ int (*get_child)(void *ptr, idmef_class_child_id_t child, void **ret);
+ int (*new_child)(void *ptr, idmef_class_child_id_t child, int n, void **ret);
+ int (*destroy_child)(void *ptr, idmef_class_child_id_t child, int n);
+ int (*to_numeric)(const char *name);
+ const char *(*to_string)(int val);
int (*copy)(const void *src, void *dst);
int (*clone)(const void *src, void **dst);
int (*compare)(const void *obj1, const void *obj2);
@@ -275,56 +276,56 @@
{ "(unassigned)", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, /* ID: 0 */
{ "(unassigned)", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, /* ID: 1 */
{ "(unassigned)", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, /* ID: 2 */
- { "additional_data_type", 0, NULL, NULL, NULL, (void *) idmef_additional_data_type_to_numeric, (void *) idmef_additional_data_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 3 */
- { "additional_data", sizeof(idmef_additional_data_children_list) / sizeof(*idmef_additional_data_children_list), idmef_additional_data_children_list, _idmef_additional_data_get_child, _idmef_additional_data_new_child, NULL, NULL, (void *) idmef_additional_data_copy, (void *) idmef_additional_data_clone, (void *) idmef_additional_data_compare, (void *) idmef_additional_data_ref, (void *) idmef_additional_data_destroy }, /* ID: 4 */
- { "reference_origin", 0, NULL, NULL, NULL, (void *) idmef_reference_origin_to_numeric, (void *) idmef_reference_origin_to_string, NULL, NULL, NULL, NULL }, /* ID: 5 */
- { "classification", sizeof(idmef_classification_children_list) / sizeof(*idmef_classification_children_list), idmef_classification_children_list, _idmef_classification_get_child, _idmef_classification_new_child, NULL, NULL, (void *) idmef_classification_copy, (void *) idmef_classification_clone, (void *) idmef_classification_compare, (void *) idmef_classification_ref, (void *) idmef_classification_destroy }, /* ID: 6 */
- { "user_id_type", 0, NULL, NULL, NULL, (void *) idmef_user_id_type_to_numeric, (void *) idmef_user_id_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 7 */
- { "user_id", sizeof(idmef_user_id_children_list) / sizeof(*idmef_user_id_children_list), idmef_user_id_children_list, _idmef_user_id_get_child, _idmef_user_id_new_child, NULL, NULL, (void *) idmef_user_id_copy, (void *) idmef_user_id_clone, (void *) idmef_user_id_compare, (void *) idmef_user_id_ref, (void *) idmef_user_id_destroy }, /* ID: 8 */
- { "user_category", 0, NULL, NULL, NULL, (void *) idmef_user_category_to_numeric, (void *) idmef_user_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 9 */
- { "user", sizeof(idmef_user_children_list) / sizeof(*idmef_user_children_list), idmef_user_children_list, _idmef_user_get_child, _idmef_user_new_child, NULL, NULL, (void *) idmef_user_copy, (void *) idmef_user_clone, (void *) idmef_user_compare, (void *) idmef_user_ref, (void *) idmef_user_destroy }, /* ID: 10 */
- { "address_category", 0, NULL, NULL, NULL, (void *) idmef_address_category_to_numeric, (void *) idmef_address_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 11 */
- { "address", sizeof(idmef_address_children_list) / sizeof(*idmef_address_children_list), idmef_address_children_list, _idmef_address_get_child, _idmef_address_new_child, NULL, NULL, (void *) idmef_address_copy, (void *) idmef_address_clone, (void *) idmef_address_compare, (void *) idmef_address_ref, (void *) idmef_address_destroy }, /* ID: 12 */
- { "process", sizeof(idmef_process_children_list) / sizeof(*idmef_process_children_list), idmef_process_children_list, _idmef_process_get_child, _idmef_process_new_child, NULL, NULL, (void *) idmef_process_copy, (void *) idmef_process_clone, (void *) idmef_process_compare, (void *) idmef_process_ref, (void *) idmef_process_destroy }, /* ID: 13 */
- { "web_service", sizeof(idmef_web_service_children_list) / sizeof(*idmef_web_service_children_list), idmef_web_service_children_list, _idmef_web_service_get_child, _idmef_web_service_new_child, NULL, NULL, (void *) idmef_web_service_copy, (void *) idmef_web_service_clone, (void *) idmef_web_service_compare, (void *) idmef_web_service_ref, (void *) idmef_web_service_destroy }, /* ID: 14 */
- { "snmp_service", sizeof(idmef_snmp_service_children_list) / sizeof(*idmef_snmp_service_children_list), idmef_snmp_service_children_list, _idmef_snmp_service_get_child, _idmef_snmp_service_new_child, NULL, NULL, (void *) idmef_snmp_service_copy, (void *) idmef_snmp_service_clone, (void *) idmef_snmp_service_compare, (void *) idmef_snmp_service_ref, (void *) idmef_snmp_service_destroy }, /* ID: 15 */
- { "service_type", 0, NULL, NULL, NULL, (void *) idmef_service_type_to_numeric, (void *) idmef_service_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 16 */
- { "service", sizeof(idmef_service_children_list) / sizeof(*idmef_service_children_list), idmef_service_children_list, _idmef_service_get_child, _idmef_service_new_child, NULL, NULL, (void *) idmef_service_copy, (void *) idmef_service_clone, (void *) idmef_service_compare, (void *) idmef_service_ref, (void *) idmef_service_destroy }, /* ID: 17 */
- { "node_category", 0, NULL, NULL, NULL, (void *) idmef_node_category_to_numeric, (void *) idmef_node_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 18 */
- { "node", sizeof(idmef_node_children_list) / sizeof(*idmef_node_children_list), idmef_node_children_list, _idmef_node_get_child, _idmef_node_new_child, NULL, NULL, (void *) idmef_node_copy, (void *) idmef_node_clone, (void *) idmef_node_compare, (void *) idmef_node_ref, (void *) idmef_node_destroy }, /* ID: 19 */
- { "source_spoofed", 0, NULL, NULL, NULL, (void *) idmef_source_spoofed_to_numeric, (void *) idmef_source_spoofed_to_string, NULL, NULL, NULL, NULL }, /* ID: 20 */
- { "source", sizeof(idmef_source_children_list) / sizeof(*idmef_source_children_list), idmef_source_children_list, _idmef_source_get_child, _idmef_source_new_child, NULL, NULL, (void *) idmef_source_copy, (void *) idmef_source_clone, (void *) idmef_source_compare, (void *) idmef_source_ref, (void *) idmef_source_destroy }, /* ID: 21 */
- { "file_access", sizeof(idmef_file_access_children_list) / sizeof(*idmef_file_access_children_list), idmef_file_access_children_list, _idmef_file_access_get_child, _idmef_file_access_new_child, NULL, NULL, (void *) idmef_file_access_copy, (void *) idmef_file_access_clone, (void *) idmef_file_access_compare, (void *) idmef_file_access_ref, (void *) idmef_file_access_destroy }, /* ID: 22 */
- { "inode", sizeof(idmef_inode_children_list) / sizeof(*idmef_inode_children_list), idmef_inode_children_list, _idmef_inode_get_child, _idmef_inode_new_child, NULL, NULL, (void *) idmef_inode_copy, (void *) idmef_inode_clone, (void *) idmef_inode_compare, (void *) idmef_inode_ref, (void *) idmef_inode_destroy }, /* ID: 23 */
- { "file_category", 0, NULL, NULL, NULL, (void *) idmef_file_category_to_numeric, (void *) idmef_file_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 24 */
- { "file_fstype", 0, NULL, NULL, NULL, (void *) idmef_file_fstype_to_numeric, (void *) idmef_file_fstype_to_string, NULL, NULL, NULL, NULL }, /* ID: 25 */
- { "file", sizeof(idmef_file_children_list) / sizeof(*idmef_file_children_list), idmef_file_children_list, _idmef_file_get_child, _idmef_file_new_child, NULL, NULL, (void *) idmef_file_copy, (void *) idmef_file_clone, (void *) idmef_file_compare, (void *) idmef_file_ref, (void *) idmef_file_destroy }, /* ID: 26 */
- { "linkage_category", 0, NULL, NULL, NULL, (void *) idmef_linkage_category_to_numeric, (void *) idmef_linkage_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 27 */
- { "linkage", sizeof(idmef_linkage_children_list) / sizeof(*idmef_linkage_children_list), idmef_linkage_children_list, _idmef_linkage_get_child, _idmef_linkage_new_child, NULL, NULL, (void *) idmef_linkage_copy, (void *) idmef_linkage_clone, (void *) idmef_linkage_compare, (void *) idmef_linkage_ref, (void *) idmef_linkage_destroy }, /* ID: 28 */
- { "target_decoy", 0, NULL, NULL, NULL, (void *) idmef_target_decoy_to_numeric, (void *) idmef_target_decoy_to_string, NULL, NULL, NULL, NULL }, /* ID: 29 */
- { "target", sizeof(idmef_target_children_list) / sizeof(*idmef_target_children_list), idmef_target_children_list, _idmef_target_get_child, _idmef_target_new_child, NULL, NULL, (void *) idmef_target_copy, (void *) idmef_target_clone, (void *) idmef_target_compare, (void *) idmef_target_ref, (void *) idmef_target_destroy }, /* ID: 30 */
- { "analyzer", sizeof(idmef_analyzer_children_list) / sizeof(*idmef_analyzer_children_list), idmef_analyzer_children_list, _idmef_analyzer_get_child, _idmef_analyzer_new_child, NULL, NULL, (void *) idmef_analyzer_copy, (void *) idmef_analyzer_clone, (void *) idmef_analyzer_compare, (void *) idmef_analyzer_ref, (void *) idmef_analyzer_destroy }, /* ID: 31 */
- { "alertident", sizeof(idmef_alertident_children_list) / sizeof(*idmef_alertident_children_list), idmef_alertident_children_list, _idmef_alertident_get_child, _idmef_alertident_new_child, NULL, NULL, (void *) idmef_alertident_copy, (void *) idmef_alertident_clone, (void *) idmef_alertident_compare, (void *) idmef_alertident_ref, (void *) idmef_alertident_destroy }, /* ID: 32 */
- { "impact_severity", 0, NULL, NULL, NULL, (void *) idmef_impact_severity_to_numeric, (void *) idmef_impact_severity_to_string, NULL, NULL, NULL, NULL }, /* ID: 33 */
- { "impact_completion", 0, NULL, NULL, NULL, (void *) idmef_impact_completion_to_numeric, (void *) idmef_impact_completion_to_string, NULL, NULL, NULL, NULL }, /* ID: 34 */
- { "impact_type", 0, NULL, NULL, NULL, (void *) idmef_impact_type_to_numeric, (void *) idmef_impact_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 35 */
- { "impact", sizeof(idmef_impact_children_list) / sizeof(*idmef_impact_children_list), idmef_impact_children_list, _idmef_impact_get_child, _idmef_impact_new_child, NULL, NULL, (void *) idmef_impact_copy, (void *) idmef_impact_clone, (void *) idmef_impact_compare, (void *) idmef_impact_ref, (void *) idmef_impact_destroy }, /* ID: 36 */
- { "action_category", 0, NULL, NULL, NULL, (void *) idmef_action_category_to_numeric, (void *) idmef_action_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 37 */
- { "action", sizeof(idmef_action_children_list) / sizeof(*idmef_action_children_list), idmef_action_children_list, _idmef_action_get_child, _idmef_action_new_child, NULL, NULL, (void *) idmef_action_copy, (void *) idmef_action_clone, (void *) idmef_action_compare, (void *) idmef_action_ref, (void *) idmef_action_destroy }, /* ID: 38 */
- { "confidence_rating", 0, NULL, NULL, NULL, (void *) idmef_confidence_rating_to_numeric, (void *) idmef_confidence_rating_to_string, NULL, NULL, NULL, NULL }, /* ID: 39 */
- { "confidence", sizeof(idmef_confidence_children_list) / sizeof(*idmef_confidence_children_list), idmef_confidence_children_list, _idmef_confidence_get_child, _idmef_confidence_new_child, NULL, NULL, (void *) idmef_confidence_copy, (void *) idmef_confidence_clone, (void *) idmef_confidence_compare, (void *) idmef_confidence_ref, (void *) idmef_confidence_destroy }, /* ID: 40 */
- { "assessment", sizeof(idmef_assessment_children_list) / sizeof(*idmef_assessment_children_list), idmef_assessment_children_list, _idmef_assessment_get_child, _idmef_assessment_new_child, NULL, NULL, (void *) idmef_assessment_copy, (void *) idmef_assessment_clone, (void *) idmef_assessment_compare, (void *) idmef_assessment_ref, (void *) idmef_assessment_destroy }, /* ID: 41 */
- { "tool_alert", sizeof(idmef_tool_alert_children_list) / sizeof(*idmef_tool_alert_children_list), idmef_tool_alert_children_list, _idmef_tool_alert_get_child, _idmef_tool_alert_new_child, NULL, NULL, (void *) idmef_tool_alert_copy, (void *) idmef_tool_alert_clone, (void *) idmef_tool_alert_compare, (void *) idmef_tool_alert_ref, (void *) idmef_tool_alert_destroy }, /* ID: 42 */
- { "correlation_alert", sizeof(idmef_correlation_alert_children_list) / sizeof(*idmef_correlation_alert_children_list), idmef_correlation_alert_children_list, _idmef_correlation_alert_get_child, _idmef_correlation_alert_new_child, NULL, NULL, (void *) idmef_correlation_alert_copy, (void *) idmef_correlation_alert_clone, (void *) idmef_correlation_alert_compare, (void *) idmef_correlation_alert_ref, (void *) idmef_correlation_alert_destroy }, /* ID: 43 */
- { "overflow_alert", sizeof(idmef_overflow_alert_children_list) / sizeof(*idmef_overflow_alert_children_list), idmef_overflow_alert_children_list, _idmef_overflow_alert_get_child, _idmef_overflow_alert_new_child, NULL, NULL, (void *) idmef_overflow_alert_copy, (void *) idmef_overflow_alert_clone, (void *) idmef_overflow_alert_compare, (void *) idmef_overflow_alert_ref, (void *) idmef_overflow_alert_destroy }, /* ID: 44 */
- { "alert_type", 0, NULL, NULL, NULL, (void *) idmef_alert_type_to_numeric, (void *) idmef_alert_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 45 */
- { "alert", sizeof(idmef_alert_children_list) / sizeof(*idmef_alert_children_list), idmef_alert_children_list, _idmef_alert_get_child, _idmef_alert_new_child, NULL, NULL, (void *) idmef_alert_copy, (void *) idmef_alert_clone, (void *) idmef_alert_compare, (void *) idmef_alert_ref, (void *) idmef_alert_destroy }, /* ID: 46 */
- { "heartbeat", sizeof(idmef_heartbeat_children_list) / sizeof(*idmef_heartbeat_children_list), idmef_heartbeat_children_list, _idmef_heartbeat_get_child, _idmef_heartbeat_new_child, NULL, NULL, (void *) idmef_heartbeat_copy, (void *) idmef_heartbeat_clone, (void *) idmef_heartbeat_compare, (void *) idmef_heartbeat_ref, (void *) idmef_heartbeat_destroy }, /* ID: 47 */
- { "message_type", 0, NULL, NULL, NULL, (void *) idmef_message_type_to_numeric, (void *) idmef_message_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 48 */
- { "message", sizeof(idmef_message_children_list) / sizeof(*idmef_message_children_list), idmef_message_children_list, _idmef_message_get_child, _idmef_message_new_child, NULL, NULL, (void *) idmef_message_copy, (void *) idmef_message_clone, (void *) idmef_message_compare, (void *) idmef_message_ref, (void *) idmef_message_destroy }, /* ID: 49 */
- { "reference", sizeof(idmef_reference_children_list) / sizeof(*idmef_reference_children_list), idmef_reference_children_list, _idmef_reference_get_child, _idmef_reference_new_child, NULL, NULL, (void *) idmef_reference_copy, (void *) idmef_reference_clone, (void *) idmef_reference_compare, (void *) idmef_reference_ref, (void *) idmef_reference_destroy }, /* ID: 50 */
+ { "additional_data_type", 0, NULL, NULL, NULL, NULL, (void *) idmef_additional_data_type_to_numeric, (void *) idmef_additional_data_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 3 */
+ { "additional_data", sizeof(idmef_additional_data_children_list) / sizeof(*idmef_additional_data_children_list), idmef_additional_data_children_list, _idmef_additional_data_get_child, _idmef_additional_data_new_child, _idmef_additional_data_destroy_child, NULL, NULL, (void *) idmef_additional_data_copy, (void *) idmef_additional_data_clone, (void *) idmef_additional_data_compare, (void *) idmef_additional_data_ref, (void *) idmef_additional_data_destroy }, /* ID: 4 */
+ { "reference_origin", 0, NULL, NULL, NULL, NULL, (void *) idmef_reference_origin_to_numeric, (void *) idmef_reference_origin_to_string, NULL, NULL, NULL, NULL }, /* ID: 5 */
+ { "classification", sizeof(idmef_classification_children_list) / sizeof(*idmef_classification_children_list), idmef_classification_children_list, _idmef_classification_get_child, _idmef_classification_new_child, _idmef_classification_destroy_child, NULL, NULL, (void *) idmef_classification_copy, (void *) idmef_classification_clone, (void *) idmef_classification_compare, (void *) idmef_classification_ref, (void *) idmef_classification_destroy }, /* ID: 6 */
+ { "user_id_type", 0, NULL, NULL, NULL, NULL, (void *) idmef_user_id_type_to_numeric, (void *) idmef_user_id_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 7 */
+ { "user_id", sizeof(idmef_user_id_children_list) / sizeof(*idmef_user_id_children_list), idmef_user_id_children_list, _idmef_user_id_get_child, _idmef_user_id_new_child, _idmef_user_id_destroy_child, NULL, NULL, (void *) idmef_user_id_copy, (void *) idmef_user_id_clone, (void *) idmef_user_id_compare, (void *) idmef_user_id_ref, (void *) idmef_user_id_destroy }, /* ID: 8 */
+ { "user_category", 0, NULL, NULL, NULL, NULL, (void *) idmef_user_category_to_numeric, (void *) idmef_user_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 9 */
+ { "user", sizeof(idmef_user_children_list) / sizeof(*idmef_user_children_list), idmef_user_children_list, _idmef_user_get_child, _idmef_user_new_child, _idmef_user_destroy_child, NULL, NULL, (void *) idmef_user_copy, (void *) idmef_user_clone, (void *) idmef_user_compare, (void *) idmef_user_ref, (void *) idmef_user_destroy }, /* ID: 10 */
+ { "address_category", 0, NULL, NULL, NULL, NULL, (void *) idmef_address_category_to_numeric, (void *) idmef_address_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 11 */
+ { "address", sizeof(idmef_address_children_list) / sizeof(*idmef_address_children_list), idmef_address_children_list, _idmef_address_get_child, _idmef_address_new_child, _idmef_address_destroy_child, NULL, NULL, (void *) idmef_address_copy, (void *) idmef_address_clone, (void *) idmef_address_compare, (void *) idmef_address_ref, (void *) idmef_address_destroy }, /* ID: 12 */
+ { "process", sizeof(idmef_process_children_list) / sizeof(*idmef_process_children_list), idmef_process_children_list, _idmef_process_get_child, _idmef_process_new_child, _idmef_process_destroy_child, NULL, NULL, (void *) idmef_process_copy, (void *) idmef_process_clone, (void *) idmef_process_compare, (void *) idmef_process_ref, (void *) idmef_process_destroy }, /* ID: 13 */
+ { "web_service", sizeof(idmef_web_service_children_list) / sizeof(*idmef_web_service_children_list), idmef_web_service_children_list, _idmef_web_service_get_child, _idmef_web_service_new_child, _idmef_web_service_destroy_child, NULL, NULL, (void *) idmef_web_service_copy, (void *) idmef_web_service_clone, (void *) idmef_web_service_compare, (void *) idmef_web_service_ref, (void *) idmef_web_service_destroy }, /* ID: 14 */
+ { "snmp_service", sizeof(idmef_snmp_service_children_list) / sizeof(*idmef_snmp_service_children_list), idmef_snmp_service_children_list, _idmef_snmp_service_get_child, _idmef_snmp_service_new_child, _idmef_snmp_service_destroy_child, NULL, NULL, (void *) idmef_snmp_service_copy, (void *) idmef_snmp_service_clone, (void *) idmef_snmp_service_compare, (void *) idmef_snmp_service_ref, (void *) idmef_snmp_service_destroy }, /* ID: 15 */
+ { "service_type", 0, NULL, NULL, NULL, NULL, (void *) idmef_service_type_to_numeric, (void *) idmef_service_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 16 */
+ { "service", sizeof(idmef_service_children_list) / sizeof(*idmef_service_children_list), idmef_service_children_list, _idmef_service_get_child, _idmef_service_new_child, _idmef_service_destroy_child, NULL, NULL, (void *) idmef_service_copy, (void *) idmef_service_clone, (void *) idmef_service_compare, (void *) idmef_service_ref, (void *) idmef_service_destroy }, /* ID: 17 */
+ { "node_category", 0, NULL, NULL, NULL, NULL, (void *) idmef_node_category_to_numeric, (void *) idmef_node_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 18 */
+ { "node", sizeof(idmef_node_children_list) / sizeof(*idmef_node_children_list), idmef_node_children_list, _idmef_node_get_child, _idmef_node_new_child, _idmef_node_destroy_child, NULL, NULL, (void *) idmef_node_copy, (void *) idmef_node_clone, (void *) idmef_node_compare, (void *) idmef_node_ref, (void *) idmef_node_destroy }, /* ID: 19 */
+ { "source_spoofed", 0, NULL, NULL, NULL, NULL, (void *) idmef_source_spoofed_to_numeric, (void *) idmef_source_spoofed_to_string, NULL, NULL, NULL, NULL }, /* ID: 20 */
+ { "source", sizeof(idmef_source_children_list) / sizeof(*idmef_source_children_list), idmef_source_children_list, _idmef_source_get_child, _idmef_source_new_child, _idmef_source_destroy_child, NULL, NULL, (void *) idmef_source_copy, (void *) idmef_source_clone, (void *) idmef_source_compare, (void *) idmef_source_ref, (void *) idmef_source_destroy }, /* ID: 21 */
+ { "file_access", sizeof(idmef_file_access_children_list) / sizeof(*idmef_file_access_children_list), idmef_file_access_children_list, _idmef_file_access_get_child, _idmef_file_access_new_child, _idmef_file_access_destroy_child, NULL, NULL, (void *) idmef_file_access_copy, (void *) idmef_file_access_clone, (void *) idmef_file_access_compare, (void *) idmef_file_access_ref, (void *) idmef_file_access_destroy }, /* ID: 22 */
+ { "inode", sizeof(idmef_inode_children_list) / sizeof(*idmef_inode_children_list), idmef_inode_children_list, _idmef_inode_get_child, _idmef_inode_new_child, _idmef_inode_destroy_child, NULL, NULL, (void *) idmef_inode_copy, (void *) idmef_inode_clone, (void *) idmef_inode_compare, (void *) idmef_inode_ref, (void *) idmef_inode_destroy }, /* ID: 23 */
+ { "file_category", 0, NULL, NULL, NULL, NULL, (void *) idmef_file_category_to_numeric, (void *) idmef_file_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 24 */
+ { "file_fstype", 0, NULL, NULL, NULL, NULL, (void *) idmef_file_fstype_to_numeric, (void *) idmef_file_fstype_to_string, NULL, NULL, NULL, NULL }, /* ID: 25 */
+ { "file", sizeof(idmef_file_children_list) / sizeof(*idmef_file_children_list), idmef_file_children_list, _idmef_file_get_child, _idmef_file_new_child, _idmef_file_destroy_child, NULL, NULL, (void *) idmef_file_copy, (void *) idmef_file_clone, (void *) idmef_file_compare, (void *) idmef_file_ref, (void *) idmef_file_destroy }, /* ID: 26 */
+ { "linkage_category", 0, NULL, NULL, NULL, NULL, (void *) idmef_linkage_category_to_numeric, (void *) idmef_linkage_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 27 */
+ { "linkage", sizeof(idmef_linkage_children_list) / sizeof(*idmef_linkage_children_list), idmef_linkage_children_list, _idmef_linkage_get_child, _idmef_linkage_new_child, _idmef_linkage_destroy_child, NULL, NULL, (void *) idmef_linkage_copy, (void *) idmef_linkage_clone, (void *) idmef_linkage_compare, (void *) idmef_linkage_ref, (void *) idmef_linkage_destroy }, /* ID: 28 */
+ { "target_decoy", 0, NULL, NULL, NULL, NULL, (void *) idmef_target_decoy_to_numeric, (void *) idmef_target_decoy_to_string, NULL, NULL, NULL, NULL }, /* ID: 29 */
+ { "target", sizeof(idmef_target_children_list) / sizeof(*idmef_target_children_list), idmef_target_children_list, _idmef_target_get_child, _idmef_target_new_child, _idmef_target_destroy_child, NULL, NULL, (void *) idmef_target_copy, (void *) idmef_target_clone, (void *) idmef_target_compare, (void *) idmef_target_ref, (void *) idmef_target_destroy }, /* ID: 30 */
+ { "analyzer", sizeof(idmef_analyzer_children_list) / sizeof(*idmef_analyzer_children_list), idmef_analyzer_children_list, _idmef_analyzer_get_child, _idmef_analyzer_new_child, _idmef_analyzer_destroy_child, NULL, NULL, (void *) idmef_analyzer_copy, (void *) idmef_analyzer_clone, (void *) idmef_analyzer_compare, (void *) idmef_analyzer_ref, (void *) idmef_analyzer_destroy }, /* ID: 31 */
+ { "alertident", sizeof(idmef_alertident_children_list) / sizeof(*idmef_alertident_children_list), idmef_alertident_children_list, _idmef_alertident_get_child, _idmef_alertident_new_child, _idmef_alertident_destroy_child, NULL, NULL, (void *) idmef_alertident_copy, (void *) idmef_alertident_clone, (void *) idmef_alertident_compare, (void *) idmef_alertident_ref, (void *) idmef_alertident_destroy }, /* ID: 32 */
+ { "impact_severity", 0, NULL, NULL, NULL, NULL, (void *) idmef_impact_severity_to_numeric, (void *) idmef_impact_severity_to_string, NULL, NULL, NULL, NULL }, /* ID: 33 */
+ { "impact_completion", 0, NULL, NULL, NULL, NULL, (void *) idmef_impact_completion_to_numeric, (void *) idmef_impact_completion_to_string, NULL, NULL, NULL, NULL }, /* ID: 34 */
+ { "impact_type", 0, NULL, NULL, NULL, NULL, (void *) idmef_impact_type_to_numeric, (void *) idmef_impact_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 35 */
+ { "impact", sizeof(idmef_impact_children_list) / sizeof(*idmef_impact_children_list), idmef_impact_children_list, _idmef_impact_get_child, _idmef_impact_new_child, _idmef_impact_destroy_child, NULL, NULL, (void *) idmef_impact_copy, (void *) idmef_impact_clone, (void *) idmef_impact_compare, (void *) idmef_impact_ref, (void *) idmef_impact_destroy }, /* ID: 36 */
+ { "action_category", 0, NULL, NULL, NULL, NULL, (void *) idmef_action_category_to_numeric, (void *) idmef_action_category_to_string, NULL, NULL, NULL, NULL }, /* ID: 37 */
+ { "action", sizeof(idmef_action_children_list) / sizeof(*idmef_action_children_list), idmef_action_children_list, _idmef_action_get_child, _idmef_action_new_child, _idmef_action_destroy_child, NULL, NULL, (void *) idmef_action_copy, (void *) idmef_action_clone, (void *) idmef_action_compare, (void *) idmef_action_ref, (void *) idmef_action_destroy }, /* ID: 38 */
+ { "confidence_rating", 0, NULL, NULL, NULL, NULL, (void *) idmef_confidence_rating_to_numeric, (void *) idmef_confidence_rating_to_string, NULL, NULL, NULL, NULL }, /* ID: 39 */
+ { "confidence", sizeof(idmef_confidence_children_list) / sizeof(*idmef_confidence_children_list), idmef_confidence_children_list, _idmef_confidence_get_child, _idmef_confidence_new_child, _idmef_confidence_destroy_child, NULL, NULL, (void *) idmef_confidence_copy, (void *) idmef_confidence_clone, (void *) idmef_confidence_compare, (void *) idmef_confidence_ref, (void *) idmef_confidence_destroy }, /* ID: 40 */
+ { "assessment", sizeof(idmef_assessment_children_list) / sizeof(*idmef_assessment_children_list), idmef_assessment_children_list, _idmef_assessment_get_child, _idmef_assessment_new_child, _idmef_assessment_destroy_child, NULL, NULL, (void *) idmef_assessment_copy, (void *) idmef_assessment_clone, (void *) idmef_assessment_compare, (void *) idmef_assessment_ref, (void *) idmef_assessment_destroy }, /* ID: 41 */
+ { "tool_alert", sizeof(idmef_tool_alert_children_list) / sizeof(*idmef_tool_alert_children_list), idmef_tool_alert_children_list, _idmef_tool_alert_get_child, _idmef_tool_alert_new_child, _idmef_tool_alert_destroy_child, NULL, NULL, (void *) idmef_tool_alert_copy, (void *) idmef_tool_alert_clone, (void *) idmef_tool_alert_compare, (void *) idmef_tool_alert_ref, (void *) idmef_tool_alert_destroy }, /* ID: 42 */
+ { "correlation_alert", sizeof(idmef_correlation_alert_children_list) / sizeof(*idmef_correlation_alert_children_list), idmef_correlation_alert_children_list, _idmef_correlation_alert_get_child, _idmef_correlation_alert_new_child, _idmef_correlation_alert_destroy_child, NULL, NULL, (void *) idmef_correlation_alert_copy, (void *) idmef_correlation_alert_clone, (void *) idmef_correlation_alert_compare, (void *) idmef_correlation_alert_ref, (void *) idmef_correlation_alert_destroy }, /* ID: 43 */
+ { "overflow_alert", sizeof(idmef_overflow_alert_children_list) / sizeof(*idmef_overflow_alert_children_list), idmef_overflow_alert_children_list, _idmef_overflow_alert_get_child, _idmef_overflow_alert_new_child, _idmef_overflow_alert_destroy_child, NULL, NULL, (void *) idmef_overflow_alert_copy, (void *) idmef_overflow_alert_clone, (void *) idmef_overflow_alert_compare, (void *) idmef_overflow_alert_ref, (void *) idmef_overflow_alert_destroy }, /* ID: 44 */
+ { "alert_type", 0, NULL, NULL, NULL, NULL, (void *) idmef_alert_type_to_numeric, (void *) idmef_alert_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 45 */
+ { "alert", sizeof(idmef_alert_children_list) / sizeof(*idmef_alert_children_list), idmef_alert_children_list, _idmef_alert_get_child, _idmef_alert_new_child, _idmef_alert_destroy_child, NULL, NULL, (void *) idmef_alert_copy, (void *) idmef_alert_clone, (void *) idmef_alert_compare, (void *) idmef_alert_ref, (void *) idmef_alert_destroy }, /* ID: 46 */
+ { "heartbeat", sizeof(idmef_heartbeat_children_list) / sizeof(*idmef_heartbeat_children_list), idmef_heartbeat_children_list, _idmef_heartbeat_get_child, _idmef_heartbeat_new_child, _idmef_heartbeat_destroy_child, NULL, NULL, (void *) idmef_heartbeat_copy, (void *) idmef_heartbeat_clone, (void *) idmef_heartbeat_compare, (void *) idmef_heartbeat_ref, (void *) idmef_heartbeat_destroy }, /* ID: 47 */
+ { "message_type", 0, NULL, NULL, NULL, NULL, (void *) idmef_message_type_to_numeric, (void *) idmef_message_type_to_string, NULL, NULL, NULL, NULL }, /* ID: 48 */
+ { "message", sizeof(idmef_message_children_list) / sizeof(*idmef_message_children_list), idmef_message_children_list, _idmef_message_get_child, _idmef_message_new_child, _idmef_message_destroy_child, NULL, NULL, (void *) idmef_message_copy, (void *) idmef_message_clone, (void *) idmef_message_compare, (void *) idmef_message_ref, (void *) idmef_message_destroy }, /* ID: 49 */
+ { "reference", sizeof(idmef_reference_children_list) / sizeof(*idmef_reference_children_list), idmef_reference_children_list, _idmef_reference_get_child, _idmef_reference_new_child, _idmef_reference_destroy_child, NULL, NULL, (void *) idmef_reference_copy, (void *) idmef_reference_clone, (void *) idmef_reference_compare, (void *) idmef_reference_ref, (void *) idmef_reference_destroy }, /* ID: 50 */
{ "(unassigned)", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, /* ID: 51 */
- { "checksum", sizeof(idmef_checksum_children_list) / sizeof(*idmef_checksum_children_list), idmef_checksum_children_list, _idmef_checksum_get_child, _idmef_checksum_new_child, NULL, NULL, (void *) idmef_checksum_copy, (void *) idmef_checksum_clone, (void *) idmef_checksum_compare, (void *) idmef_checksum_ref, (void *) idmef_checksum_destroy }, /* ID: 52 */
- { "checksum_algorithm", 0, NULL, NULL, NULL, (void *) idmef_checksum_algorithm_to_numeric, (void *) idmef_checksum_algorithm_to_string, NULL, NULL, NULL, NULL }, /* ID: 53 */
+ { "checksum", sizeof(idmef_checksum_children_list) / sizeof(*idmef_checksum_children_list), idmef_checksum_children_list, _idmef_checksum_get_child, _idmef_checksum_new_child, _idmef_checksum_destroy_child, NULL, NULL, (void *) idmef_checksum_copy, (void *) idmef_checksum_clone, (void *) idmef_checksum_compare, (void *) idmef_checksum_ref, (void *) idmef_checksum_destroy }, /* ID: 52 */
+ { "checksum_algorithm", 0, NULL, NULL, NULL, NULL, (void *) idmef_checksum_algorithm_to_numeric, (void *) idmef_checksum_algorithm_to_string, NULL, NULL, NULL, NULL }, /* ID: 53 */
{ NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
};
Modified: libprelude/branches/libprelude-easy-bindings/src/include/idmef-tree-wrap.h
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/include/idmef-tree-wrap.h 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/include/idmef-tree-wrap.h 2008-03-10 10:51:06 UTC (rev 10381)
@@ -90,6 +90,7 @@
#ifndef SWIG
int _idmef_additional_data_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_additional_data_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_additional_data_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_additional_data_destroy(idmef_additional_data_t *ptr);
@@ -146,6 +147,7 @@
#ifndef SWIG
int _idmef_reference_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_reference_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_reference_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_reference_destroy(idmef_reference_t *ptr);
@@ -189,6 +191,7 @@
#ifndef SWIG
int _idmef_classification_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_classification_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_classification_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_classification_destroy(idmef_classification_t *ptr);
@@ -246,6 +249,7 @@
#ifndef SWIG
int _idmef_user_id_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_user_id_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_user_id_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_user_id_destroy(idmef_user_id_t *ptr);
@@ -305,6 +309,7 @@
#ifndef SWIG
int _idmef_user_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_user_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_user_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_user_destroy(idmef_user_t *ptr);
@@ -371,6 +376,7 @@
#ifndef SWIG
int _idmef_address_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_address_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_address_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_address_destroy(idmef_address_t *ptr);
@@ -426,6 +432,7 @@
#ifndef SWIG
int _idmef_process_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_process_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_process_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_process_destroy(idmef_process_t *ptr);
@@ -478,6 +485,7 @@
#ifndef SWIG
int _idmef_web_service_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_web_service_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_web_service_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_web_service_destroy(idmef_web_service_t *ptr);
@@ -530,6 +538,7 @@
#ifndef SWIG
int _idmef_snmp_service_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_snmp_service_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_snmp_service_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_snmp_service_destroy(idmef_snmp_service_t *ptr);
@@ -620,6 +629,7 @@
#ifndef SWIG
int _idmef_service_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_service_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_service_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_service_destroy(idmef_service_t *ptr);
@@ -714,6 +724,7 @@
#ifndef SWIG
int _idmef_node_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_node_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_node_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_node_destroy(idmef_node_t *ptr);
@@ -780,6 +791,7 @@
#ifndef SWIG
int _idmef_source_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_source_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_source_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_source_destroy(idmef_source_t *ptr);
@@ -835,6 +847,7 @@
#ifndef SWIG
int _idmef_file_access_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_file_access_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_file_access_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_file_access_destroy(idmef_file_access_t *ptr);
@@ -872,6 +885,7 @@
#ifndef SWIG
int _idmef_inode_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_inode_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_inode_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_inode_destroy(idmef_inode_t *ptr);
@@ -950,6 +964,7 @@
#ifndef SWIG
int _idmef_checksum_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_checksum_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_checksum_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_checksum_destroy(idmef_checksum_t *ptr);
@@ -1039,6 +1054,7 @@
#ifndef SWIG
int _idmef_file_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_file_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_file_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_file_destroy(idmef_file_t *ptr);
@@ -1143,6 +1159,7 @@
#ifndef SWIG
int _idmef_linkage_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_linkage_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_linkage_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_linkage_destroy(idmef_linkage_t *ptr);
@@ -1205,6 +1222,7 @@
#ifndef SWIG
int _idmef_target_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_target_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_target_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_target_destroy(idmef_target_t *ptr);
@@ -1274,6 +1292,7 @@
#ifndef SWIG
int _idmef_analyzer_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_analyzer_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_analyzer_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_analyzer_destroy(idmef_analyzer_t *ptr);
@@ -1342,6 +1361,7 @@
#ifndef SWIG
int _idmef_alertident_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_alertident_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_alertident_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_alertident_destroy(idmef_alertident_t *ptr);
@@ -1417,6 +1437,7 @@
#ifndef SWIG
int _idmef_impact_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_impact_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_impact_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_impact_destroy(idmef_impact_t *ptr);
@@ -1475,6 +1496,7 @@
#ifndef SWIG
int _idmef_action_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_action_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_action_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_action_destroy(idmef_action_t *ptr);
@@ -1522,6 +1544,7 @@
#ifndef SWIG
int _idmef_confidence_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_confidence_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_confidence_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_confidence_destroy(idmef_confidence_t *ptr);
@@ -1557,6 +1580,7 @@
#ifndef SWIG
int _idmef_assessment_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_assessment_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_assessment_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_assessment_destroy(idmef_assessment_t *ptr);
@@ -1596,6 +1620,7 @@
#ifndef SWIG
int _idmef_tool_alert_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_tool_alert_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_tool_alert_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_tool_alert_destroy(idmef_tool_alert_t *ptr);
@@ -1634,6 +1659,7 @@
#ifndef SWIG
int _idmef_correlation_alert_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_correlation_alert_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_correlation_alert_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_correlation_alert_destroy(idmef_correlation_alert_t *ptr);
@@ -1669,6 +1695,7 @@
#ifndef SWIG
int _idmef_overflow_alert_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_overflow_alert_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_overflow_alert_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_overflow_alert_destroy(idmef_overflow_alert_t *ptr);
@@ -1740,6 +1767,7 @@
#ifndef SWIG
int _idmef_alert_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_alert_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_alert_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_alert_destroy(idmef_alert_t *ptr);
@@ -1825,6 +1853,7 @@
#ifndef SWIG
int _idmef_heartbeat_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_heartbeat_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_heartbeat_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_heartbeat_destroy(idmef_heartbeat_t *ptr);
@@ -1894,6 +1923,7 @@
#ifndef SWIG
int _idmef_message_get_child(void *p, idmef_class_child_id_t child, void **childptr);
int _idmef_message_new_child(void *p, idmef_class_child_id_t child, int n, void **ret);
+int _idmef_message_destroy_child(void *p, idmef_class_child_id_t child, int n);
#endif
void idmef_message_destroy(idmef_message_t *ptr);
Modified: libprelude/branches/libprelude-easy-bindings/src/include/prelude-extract.h
===================================================================
--- libprelude/branches/libprelude-easy-bindings/src/include/prelude-extract.h 2008-03-10 10:50:41 UTC (rev 10380)
+++ libprelude/branches/libprelude-easy-bindings/src/include/prelude-extract.h 2008-03-10 10:51:06 UTC (rev 10381)
@@ -43,7 +43,11 @@
#include <string.h> /* for memmove */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
/*
* Using memmove make the generated code substencially slower,
* we seen difference from 20MB/s to 200MB/s from the memmove version
@@ -251,4 +255,8 @@
return 0;
}
+#ifdef __cplusplus
+ }
+#endif
+
#endif /* _LIBPRELUDE_EXTRACT_H */
More information about the Prelude-cvslog
mailing list