blob: 04777320f38a65828d38de4572388f9a1d84555f [file] [log] [blame]
Neale Rannse4031132020-10-26 13:00:06 +00001/*
2 * Copyright (c) 2019 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef __IP_FLOW_HASH_H__
17#define __IP_FLOW_HASH_H__
18
19/** Flow hash configuration */
20#define IP_FLOW_HASH_SRC_ADDR (1<<0)
21#define IP_FLOW_HASH_DST_ADDR (1<<1)
22#define IP_FLOW_HASH_PROTO (1<<2)
23#define IP_FLOW_HASH_SRC_PORT (1<<3)
24#define IP_FLOW_HASH_DST_PORT (1<<4)
25#define IP_FLOW_HASH_REVERSE_SRC_DST (1<<5)
26#define IP_FLOW_HASH_SYMMETRIC (1<<6)
27
28/** Default: 5-tuple without the "reverse" bit */
29#define IP_FLOW_HASH_DEFAULT (0x1F)
30
31#define foreach_flow_hash_bit \
32_(src, IP_FLOW_HASH_SRC_ADDR) \
33_(dst, IP_FLOW_HASH_DST_ADDR) \
34_(sport, IP_FLOW_HASH_SRC_PORT) \
35_(dport, IP_FLOW_HASH_DST_PORT) \
36_(proto, IP_FLOW_HASH_PROTO) \
37_(reverse, IP_FLOW_HASH_REVERSE_SRC_DST) \
38_(symmetric, IP_FLOW_HASH_SYMMETRIC)
39
40/**
41 * A flow hash configuration is a mask of the flow hash options
42 */
43typedef u32 flow_hash_config_t;
44
45#endif /* __IP_TYPES_H__ */
46
47/*
48 * fd.io coding-style-patch-verification: ON
49 *
50 * Local Variables:
51 * eval: (c-set-style "gnu")
52 * End:
53 */