plugins_int.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005, Condor Engineering, Inc. 
00003  * All rights reserved.
00004  * 
00005  * Redistribution and use in source and binary forms, with or without 
00006  * modification, are permitted provided that the following conditions 
00007  * are met:
00008  * 
00009  * 1. Redistributions of source code must retain the above copyright 
00010  * notice, this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright 
00012  * notice, this list of conditions and the following disclaimer in the 
00013  * documentation and/or other materials provided with the distribution. 
00014  * 3. Neither the name of the Company (Condor Engineering, Inc) nor the
00015  * names of its contributors may be used to endorse or promote products 
00016  * derived from this software without specific prior written permission. 
00017  * 
00018  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00019  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00020  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
00021  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
00022  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
00023  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
00024  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
00025  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
00026  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00027  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00028  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029  * 
00030  */
00031 
00032 /*
00033  * Author: Gianluca Varenni <gianluca.varenni@gmail.com>
00034  */
00035 
00036 #ifndef __PLUGINS_INT_12202373443r4hrfr743938474984
00037 #define __PLUGINS_INT_12202373443r4hrfr743938474984
00038 
00039 #include "plugins.h"
00040 
00051 typedef struct _ntar_data_chunk
00052 {
00053     void *data; 
00054     size_t size;    
00055     struct _ntar_data_chunk *next;  
00056 }
00057     ntar_data_chunk;
00058 
00059 
00074 typedef int (*plugin_init)(void **plugin_state);
00075 
00087 typedef int (*plugin_destroy)(void *plugin_state);
00088 
00115 typedef int (*plugin_write_data)(void *plugin_state, void* data, void* data_buffer, size_t *pbuffer_size);
00116 
00151 typedef int (*plugin_write_option)(void *plugin_state, ntar_option *option, void *opt_buffer, size_t *pbuffer_size);
00152 
00167 typedef int (*plugin_validate_option)(void *plugin_state, ntar_option *option);
00168 
00191 typedef int (*plugin_read_data)(void *plugin_state, int byte_order, void *raw_data, size_t raw_data_size, void** data_buffer, size_t *pbuffer_size, size_t *poption_start);
00192 
00215 typedef int (*plugin_read_option)(void *plugin_state, option_header *opt_header, int byte_order, void* opt_buffer, size_t *pbuffer_size);
00216 
00221 typedef struct _ntar_plugin_data
00222 {
00223     u_int32                     block_type;
00224     plugin_init                 init;
00225     plugin_destroy              destroy;
00226     plugin_write_data           write_data;
00227     plugin_write_option         write_option;
00228     plugin_validate_option      validate_option;
00229     plugin_read_data            read_data;
00230     plugin_read_option          read_option;
00231 }
00232     ntar_plugin_data;
00233 
00241 ntar_plugin_data* get_plugin_data(u_int32 block_id);
00242 
00243 #include "plugin_idb_int.h"
00244 #include "plugin_pktb_int.h"
00245 #include "plugin_spb_int.h"
00246 /*****************************************
00247  * other plugin private includes go here *
00248  ****************************************/
00249 
00255 extern ntar_plugin_data ntar_plugins[];
00256 
00262 #endif /* __PLUGINS_INT_12202373443r4hrfr743938474984 */
00263 

NTAR documentation. Copyright (c) 2004 - 2005 Condor Engineering, Inc. All rights reserved.