Azinix

ucode-1.c

Go to the documentation of this file.
00001 #include "evl.h"
00002 
00003 /* \defgroup ucode Examples of Ucode */
00004 
00005 static char *storage = "Persistent data for Uc_BasicTest";
00006 
00007 /* \brief Simple examples of a C plugin 
00008 
00009   \ingroup ucode */
00010 
00011 int
00012 Uc_BasicTest (Evl_Manager_t * mgr, Pkt_ProcessPkt_t * pp, void **mystate, void *argument )
00013 {
00014   printf ( "Entering Uc_BasicTest\n" );
00015   printf( "The argument passed in is %s\n", (char *) argument );
00016   printf ("The manager has %d rules\n", mgr->numAllRules);
00017   if (*mystate == NULL)
00018     {
00019       printf( "First call to Uc_BasicTest, allocating persistent storage\n");
00020       *mystate = (void *) malloc ( strlen (storage) + 1);
00021       strcpy (*mystate, storage);
00022     }
00023   return 0;
00024 }