From OSLab

Labs: libipt_cs577.c

/* libipt_cs577.c */
#include <getopt.h>
#include <iptables.h>

static void init(struct ipt_entry_match *m, unsigned int *nfcache)
{
    *nfcache |= NFC_UNKNOWN;     /* Can't cache this */
}

static int parse(int c, char **argv, int invert, unsigned int *flags,
                 const struct ipt_entry *entry,
                 unsigned int *nfcache, struct ipt_entry_match **match)
{ 
    return 0; 
}

static void final_check(unsigned int flags) { }

static struct option opts[] = { { .name = 0 } };

static struct iptables_match cs577 = {
    .name            = "cs577",
    .version         = IPTABLES_VERSION,
    .init            = &init,
    .parse           = &parse,
    .final_check     = &final_check,
    .extra_opts      = opts
};

void _init(void)
{
   register_match(&cs577);
}
Retrieved from http://www.oslab.info/index.php/Labs/Libipt
Page last modified on November 28, 2006, at 02:51 PM EST