module versioning
authorBart De Schuymer <bdschuym@pandora.be>
Tue, 3 Jun 2003 19:16:53 +0000 (19:16 +0000)
committerBart De Schuymer <bdschuym@pandora.be>
Tue, 3 Jun 2003 19:16:53 +0000 (19:16 +0000)
extensions/ebt_802_3.c
extensions/ebt_arp.c
extensions/ebt_ip.c
extensions/ebt_log.c
extensions/ebt_mark.c
extensions/ebt_mark_m.c
extensions/ebt_nat.c
extensions/ebt_pkttype.c
extensions/ebt_redirect.c
extensions/ebt_vlan.c

index 953a115..181c7ae 100644 (file)
@@ -32,6 +32,7 @@ static void init(struct ebt_entry_match *match)
 
        info->invflags = 0;
        info->bitmask = 0;
+       match->version = VERSIONIZE(1,0);
 }
 
 static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry,
index a4a4105..3e86419 100644 (file)
@@ -69,6 +69,7 @@ static void init(struct ebt_entry_match *match)
 
        arpinfo->invflags = 0;
        arpinfo->bitmask = 0;
+       match->version = VERSIONIZE(1,0);
 }
 
 /* defined in ebt_ip.c */
index 1e1504c..618e7ec 100644 (file)
@@ -230,6 +230,7 @@ static void init(struct ebt_entry_match *match)
 
        ipinfo->invflags = 0;
        ipinfo->bitmask = 0;
+       match->version = VERSIONIZE(1,0);
 }
 
 #define OPT_SOURCE 0x01
index 3c2409f..18ac5dc 100644 (file)
@@ -87,6 +87,7 @@ static void init(struct ebt_entry_watcher *watcher)
        loginfo->bitmask = 0;
        loginfo->prefix[0] = '\0';
        loginfo->loglevel = LOG_NOTICE;
+       watcher->version = VERSIONIZE(1,0);
 }
 
 #define OPT_PREFIX 0x01
@@ -176,15 +177,15 @@ static int compare(const struct ebt_entry_watcher *w1,
 
 static struct ebt_u_watcher log_watcher =
 {
-       EBT_LOG_WATCHER,
-       sizeof(struct ebt_log_info),
-       print_help,
-       init,
-       parse,
-       final_check,
-       print,
-       compare,
-       opts
+       .name           = EBT_LOG_WATCHER,
+       .size           = sizeof(struct ebt_log_info),
+       .help           = print_help,
+       .init           = init,
+       .parse          = parse,
+       .final_check    = final_check,
+       .print          = print,
+       .compare        = compare,
+       .extra_ops      = opts,
 };
 
 static void _init(void) __attribute__ ((constructor));
index 8696348..0b6da74 100644 (file)
@@ -32,6 +32,7 @@ static void init(struct ebt_entry_target *target)
        markinfo->target = EBT_ACCEPT;
        markinfo->mark = 0;
        mark_supplied = 0;
+       target->version = VERSIONIZE(1,0);
 }
 
 #define OPT_MARK_TARGET   0x01
index 4fdc41d..073dac8 100644 (file)
@@ -28,6 +28,7 @@ static void init(struct ebt_entry_match *match)
        markinfo->mask    = 0;
        markinfo->invert  = 0;
        markinfo->bitmask = 0;
+       match->version = VERSIONIZE(1,0);
 }
 
 #define OPT_MARK 0x01
index c627714..7a32def 100644 (file)
@@ -50,7 +50,7 @@ static void init_s(struct ebt_entry_target *target)
 
        to_source_supplied = 0;
        natinfo->target = EBT_ACCEPT;
-       return;
+       target->version = VERSIONIZE(1,0);
 }
 
 static void init_d(struct ebt_entry_target *target)
index e129996..e0de38d 100644 (file)
@@ -46,6 +46,7 @@ static void init(struct ebt_entry_match *match)
        struct ebt_pkttype_info *pt = (struct ebt_pkttype_info *)match->data;
 
        pt->invert = 0;
+       match->version = VERSIONIZE(1,0);
 }
 
 static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry,
index d74d46d..bfa5380 100644 (file)
@@ -25,7 +25,7 @@ static void init(struct ebt_entry_target *target)
           (struct ebt_redirect_info *)target->data;
 
        redirectinfo->target = EBT_ACCEPT;
-       return;
+       target->version = VERSIONIZE(1,0);
 }
 
 #define OPT_REDIRECT_TARGET  0x01
index f7bec62..e95a79d 100644 (file)
@@ -76,10 +76,6 @@ static struct option opts[] = {
 
 struct ethertypeent *ethent;
 
-/*
- * Print out local help by "ebtables -h <match name>" 
- */
-
 static void print_help()
 {
 #define HELP_TITLE "802.1Q VLAN extension"
@@ -97,33 +93,19 @@ static void print_help()
               OPT_VLAN_FLAGS & OPT_VLAN_ENCAP ? "[!] " : "");
 }
 
-/*
- * Initialization function 
- */
 static void init(struct ebt_entry_match *match)
 {
        struct ebt_vlan_info *vlaninfo =
            (struct ebt_vlan_info *) match->data;
-       /*
-        * Set initial values 
-        */
+
        vlaninfo->id = 1;       /* Default VID for VLAN-tagged 802.1Q frames */
        vlaninfo->prio = 0;
        vlaninfo->encap = 0;
        vlaninfo->invflags = 0;
        vlaninfo->bitmask = 0;
+       match->version = VERSIONIZE(1,0);
 }
 
-
-/*
- * Parse passed arguments values (ranges, flags, etc...)
- * int c - parameter number from static struct option opts[]
- * int argc - total amout of arguments (std argc value)
- * int argv - arguments (std argv value)
- * const struct ebt_u_entry *entry - default ebtables entry set
- * unsigned int *flags -
- * struct ebt_entry_match **match - 
- */
 static int
 parse(int c,
       char **argv,
@@ -184,9 +166,6 @@ parse(int c,
        return 1;
 }
 
-/*
- * Final check - logical conditions
- */
 static void
 final_check(const struct ebt_u_entry *entry,
            const struct ebt_entry_match *match,
@@ -222,9 +201,6 @@ final_check(const struct ebt_u_entry *entry,
        }
 }
 
-/*
- * Print line when listing rules by ebtables -L 
- */
 static void
 print(const struct ebt_u_entry *entry, const struct ebt_entry_match *match)
 {