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,
arpinfo->invflags = 0;
arpinfo->bitmask = 0;
- match->version = VERSIONIZE(1,0);
}
/* defined in ebt_ip.c */
ipinfo->invflags = 0;
ipinfo->bitmask = 0;
- match->version = VERSIONIZE(1,0);
}
#define OPT_SOURCE 0x01
loginfo->bitmask = 0;
loginfo->prefix[0] = '\0';
loginfo->loglevel = LOG_NOTICE;
- watcher->version = VERSIONIZE(1,0);
}
#define OPT_PREFIX 0x01
static struct ebt_u_watcher log_watcher =
{
- .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,
+ EBT_LOG_WATCHER,
+ sizeof(struct ebt_log_info),
+ print_help,
+ init,
+ parse,
+ final_check,
+ print,
+ compare,
+ opts
};
static void _init(void) __attribute__ ((constructor));
markinfo->target = EBT_ACCEPT;
markinfo->mark = 0;
mark_supplied = 0;
- target->version = VERSIONIZE(1,0);
}
#define OPT_MARK_TARGET 0x01
markinfo->mask = 0;
markinfo->invert = 0;
markinfo->bitmask = 0;
- match->version = VERSIONIZE(1,0);
}
#define OPT_MARK 0x01
to_source_supplied = 0;
natinfo->target = EBT_ACCEPT;
- target->version = VERSIONIZE(1,0);
+ return;
}
static void init_d(struct ebt_entry_target *target)
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,
(struct ebt_redirect_info *)target->data;
redirectinfo->target = EBT_ACCEPT;
- target->version = VERSIONIZE(1,0);
+ return;
}
#define OPT_REDIRECT_TARGET 0x01
struct ethertypeent *ethent;
+/*
+ * Print out local help by "ebtables -h <match name>"
+ */
+
static void print_help()
{
#define HELP_TITLE "802.1Q VLAN extension"
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,
return 1;
}
+/*
+ * Final check - logical conditions
+ */
static void
final_check(const struct ebt_u_entry *entry,
const struct ebt_entry_match *match,
}
}
+/*
+ * Print line when listing rules by ebtables -L
+ */
static void
print(const struct ebt_u_entry *entry, const struct ebt_entry_match *match)
{