diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
---|---|---|
committer | <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
commit | 19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch) | |
tree | 40b1cb534496a7f1ca0f5c314a523c69f1fee464 /include/net/flow.h | |
parent | 7206675c40394c78a90e74812bbdbf8cf3cca1be (diff) |
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'include/net/flow.h')
-rw-r--r-- | include/net/flow.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/include/net/flow.h b/include/net/flow.h new file mode 100644 index 000000000..dff77fc6a --- /dev/null +++ b/include/net/flow.h @@ -0,0 +1,95 @@ +/* + * + * Flow based forwarding rules (usage: firewalling, etc) + * + */ + +#ifndef _NET_FLOW_H +#define _NET_FLOW_H + +struct flowi { + int proto; /* {TCP, UDP, ICMP} */ + + union { + struct { + __u32 daddr; + __u32 saddr; + } ip4_u; + + struct { + struct in6_addr * daddr; + struct in6_addr * saddr; + } ip6_u; + } nl_u; + + struct device *dev; + + union { + struct { + __u16 sport; + __u16 dport; + } ports; + + struct { + __u8 type; + __u8 code; + } icmpt; + + unsigned long data; + } uli_u; +}; + +#define FLOWR_NODECISION 0 /* rule not appliable to flow */ +#define FLOWR_SELECT 1 /* flow must follow this rule */ +#define FLOWR_CLEAR 2 /* priority level clears flow */ +#define FLOWR_ERROR 3 + +struct fl_acc_args { + int type; + + +#define FL_ARG_FORWARD 1 +#define FL_ARG_ORIGIN 2 + + union { + struct sk_buff *skb; + struct { + struct sock *sk; + struct flowi *flow; + } fl_o; + } fl_u; +}; + + +struct pkt_filter { + atomic_t refcnt; + unsigned int offset; + __u32 value; + __u32 mask; + struct pkt_filter *next; +}; + +#define FLR_INPUT 1 +#define FLR_OUTPUT 2 + +struct flow_filter { + int type; + union { + struct pkt_filter *filter; + struct sock *sk; + } u; +}; + +struct flow_rule { + struct flow_rule_ops *ops; + unsigned char private[0]; +}; + +struct flow_rule_ops { + int (*accept)(struct rt6_info *rt, + struct rt6_info *rule, + struct fl_acc_args *args, + struct rt6_info **nrt); +}; + +#endif |