// Header file for stats plugin
//
// Keeps track of number of packets with protocol types
// icmp, tcp and udp.
//

#define stats_ID	100;

//
// Structure that defines an instance of the plugin class.
// Include declarations for per instance data.
//
struct stats_instance {
	struct rp_instance rootinstance;	// do not touch

	// add declarations for per instance data here
	int icmpCnt;		// number of icmp packets seen recently
	int tcpCnt;		// number of icmp packets seen recently
	int udpCnt;		// number of icmp packets seen recently
	int icmpTot;		// total number of icmp packets seen
	int tcpTot;		// total number of tcp packets seen
	int udpTot;		// total number of udp packets seen
};


//
// Standard function declarations for the plugin. Change ONLY the names.
//
void stats_init_class();
struct rp_class *stats_get_class();
struct rp_instance *stats_create_instance(struct rp_class *, u_int32_t);
void stats_handle_packet(struct rp_instance *, void *);
void stats_free_instance(struct rp_instance *);
void stats_bind_instance(struct rp_instance *);
void stats_unbind_instance(struct rp_instance *);
int  stats_handle_msg(struct rp_instance *, 
				void *, u_int8_t, u_int8_t, u_int8_t *);
int stats (struct lkm_table *, int, int, struct kernel_plugin_fct_struct *);
int stats_load(struct lkm_table *, int);
int stats_unload(struct lkm_table *, int);
