4 * Bart De Schuymer <bdschuym@pandora.be>
12 #include "../include/ebtables_u.h"
14 static struct option opts
[] =
19 static void print_help()
21 printf("Standard targets: DROP, ACCEPT, RETURN or CONTINUE;\n"
22 "The target can also be a user defined chain.\n");
25 static void init(struct ebt_entry_target
*t
)
27 ((struct ebt_standard_target
*)t
)->verdict
= EBT_CONTINUE
;
30 static int parse(int c
, char **argv
, int argc
, const struct ebt_u_entry
*entry
,
31 unsigned int *flags
, struct ebt_entry_target
**target
)
36 static void final_check(const struct ebt_u_entry
*entry
,
37 const struct ebt_entry_target
*target
, const char *name
,
38 unsigned int hookmask
, unsigned int time
)
42 static void print(const struct ebt_u_entry
*entry
,
43 const struct ebt_entry_target
*target
)
45 int verdict
= ((struct ebt_standard_target
*)target
)->verdict
;
48 struct ebt_u_entries
*entries
;
50 entries
= entry
->replace
->chains
[verdict
+ NF_BR_NUMHOOKS
];
51 printf("%s", entries
->name
);
54 if (verdict
== EBT_CONTINUE
)
56 else if (verdict
== EBT_ACCEPT
)
58 else if (verdict
== EBT_DROP
)
60 else if (verdict
== EBT_RETURN
)
63 ebt_print_bug("Bad standard target");
66 static int compare(const struct ebt_entry_target
*t1
,
67 const struct ebt_entry_target
*t2
)
69 return ((struct ebt_standard_target
*)t1
)->verdict
==
70 ((struct ebt_standard_target
*)t2
)->verdict
;
73 static struct ebt_u_target standard
=
76 .size
= sizeof(struct ebt_standard_target
) -
77 sizeof(struct ebt_entry_target
),
81 .final_check
= final_check
,
89 ebt_register_target(&standard
);