[IPV6] MIP6: Add Mobility header definition.
[deliverable/linux.git] / include / net / flow.h
CommitLineData
1da177e4
LT
1/*
2 *
3 * Generic internet FLOW.
4 *
5 */
6
7#ifndef _NET_FLOW_H
8#define _NET_FLOW_H
9
10#include <linux/in6.h>
11#include <asm/atomic.h>
12
13struct flowi {
14 int oif;
15 int iif;
16
17 union {
18 struct {
19 __u32 daddr;
20 __u32 saddr;
21 __u32 fwmark;
22 __u8 tos;
23 __u8 scope;
24 } ip4_u;
25
26 struct {
27 struct in6_addr daddr;
28 struct in6_addr saddr;
29 __u32 flowlabel;
30 } ip6_u;
31
32 struct {
c4ea94ab
SW
33 __le16 daddr;
34 __le16 saddr;
1da177e4
LT
35 __u32 fwmark;
36 __u8 scope;
37 } dn_u;
38 } nl_u;
39#define fld_dst nl_u.dn_u.daddr
40#define fld_src nl_u.dn_u.saddr
41#define fld_fwmark nl_u.dn_u.fwmark
42#define fld_scope nl_u.dn_u.scope
43#define fl6_dst nl_u.ip6_u.daddr
44#define fl6_src nl_u.ip6_u.saddr
45#define fl6_flowlabel nl_u.ip6_u.flowlabel
46#define fl4_dst nl_u.ip4_u.daddr
47#define fl4_src nl_u.ip4_u.saddr
48#define fl4_fwmark nl_u.ip4_u.fwmark
49#define fl4_tos nl_u.ip4_u.tos
50#define fl4_scope nl_u.ip4_u.scope
51
52 __u8 proto;
53 __u8 flags;
54#define FLOWI_FLAG_MULTIPATHOLDROUTE 0x01
55 union {
56 struct {
57 __u16 sport;
58 __u16 dport;
59 } ports;
60
61 struct {
62 __u8 type;
63 __u8 code;
64 } icmpt;
65
66 struct {
c4ea94ab
SW
67 __le16 sport;
68 __le16 dport;
1da177e4
LT
69 __u8 objnum;
70 __u8 objnamel; /* Not 16 bits since max val is 16 */
71 __u8 objname[16]; /* Not zero terminated */
72 } dnports;
73
74 __u32 spi;
2b741653
MN
75
76#ifdef CONFIG_IPV6_MIP6
77 struct {
78 __u8 type;
79 } mht;
80#endif
1da177e4
LT
81 } uli_u;
82#define fl_ip_sport uli_u.ports.sport
83#define fl_ip_dport uli_u.ports.dport
84#define fl_icmp_type uli_u.icmpt.type
85#define fl_icmp_code uli_u.icmpt.code
86#define fl_ipsec_spi uli_u.spi
2b741653
MN
87#ifdef CONFIG_IPV6_MIP6
88#define fl_mh_type uli_u.mht.type
89#endif
b6340fcd 90 __u32 secid; /* used by xfrm; see secid.txt */
1da177e4
LT
91} __attribute__((__aligned__(BITS_PER_LONG/8)));
92
93#define FLOW_DIR_IN 0
94#define FLOW_DIR_OUT 1
95#define FLOW_DIR_FWD 2
96
df71837d 97struct sock;
e0d1caa7 98typedef void (*flow_resolve_t)(struct flowi *key, u16 family, u8 dir,
1da177e4
LT
99 void **objp, atomic_t **obj_refp);
100
e0d1caa7 101extern void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir,
df71837d 102 flow_resolve_t resolver);
1da177e4
LT
103extern void flow_cache_flush(void);
104extern atomic_t flow_cache_genid;
105
106#endif
This page took 0.15886 seconds and 5 git commands to generate.