4 #include "../include/ebtables_u.h"
6 static struct option opts[] =
11 static void print_help()
13 printf("Standard targets: DROP, ACCEPT, RETURN or CONTINUE;\n"
14 "The target can also be a user defined chain.\n");
17 static void init(struct ebt_entry_target *t)
19 ((struct ebt_standard_target *)t)->verdict = EBT_CONTINUE;
22 static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry,
23 unsigned int *flags, struct ebt_entry_target **target)
28 static void final_check(const struct ebt_u_entry *entry,
29 const struct ebt_entry_target *target, const char *name,
30 unsigned int hookmask, unsigned int time)
34 struct ebt_u_entries *nr_to_chain(int nr);
36 static void print(const struct ebt_u_entry *entry,
37 const struct ebt_entry_target *target)
39 int verdict = ((struct ebt_standard_target *)target)->verdict;
42 struct ebt_u_entries *entries;
44 entries = nr_to_chain(verdict + NF_BR_NUMHOOKS);
45 printf("%s", entries->name);
48 if (verdict == EBT_CONTINUE)
50 else if (verdict == EBT_ACCEPT)
52 else if (verdict == EBT_DROP)
54 else if (verdict == EBT_RETURN)
57 print_bug("Bad standard target");
60 static int compare(const struct ebt_entry_target *t1,
61 const struct ebt_entry_target *t2)
63 return ((struct ebt_standard_target *)t1)->verdict ==
64 ((struct ebt_standard_target *)t2)->verdict;
67 static struct ebt_u_target standard =
69 .name = EBT_STANDARD_TARGET,
70 .size = sizeof(struct ebt_standard_target) -
71 sizeof(struct ebt_entry_target),
75 .final_check = final_check,
81 static void _init(void) __attribute__ ((constructor));
82 static void _init(void)
84 register_target(&standard);