mirror of
https://github.com/torvalds/linux.git
synced 2024-11-08 21:21:47 +00:00
e9ce1cd3cf
This was simply making templates of functions and mostly causing a lot of code duplication in the classifier action modules. We solve this more cleanly by having a common "struct tcf_common" that hash worker functions contained once in act_api.c can work with. Callers work with real action objects that have the common struct plus their module specific struct members. You go from a common object to the higher level one using a "to_foo()" macro which makes use of container_of() to do the dirty work. This also kills off act_generic.h which was only used by act_simple.c and keeping it around was more work than the it's value. Signed-off-by: David S. Miller <davem@davemloft.net>
18 lines
309 B
C
18 lines
309 B
C
#ifndef __NET_TC_IPT_H
|
|
#define __NET_TC_IPT_H
|
|
|
|
#include <net/act_api.h>
|
|
|
|
struct xt_entry_target;
|
|
|
|
struct tcf_ipt {
|
|
struct tcf_common common;
|
|
u32 tcfi_hook;
|
|
char *tcfi_tname;
|
|
struct xt_entry_target *tcfi_t;
|
|
};
|
|
#define to_ipt(pc) \
|
|
container_of(pc, struct tcf_ipt, common)
|
|
|
|
#endif /* __NET_TC_IPT_H */
|