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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef __IP_FLOW_HASH_H__
17 #define __IP_FLOW_HASH_H__
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)
28 /** Default: 5-tuple without the "reverse" bit */
29 #define IP_FLOW_HASH_DEFAULT (0x1F)
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)
41 * A flow hash configuration is a mask of the flow hash options
43 typedef u32 flow_hash_config_t;
45 #endif /* __IP_TYPES_H__ */
48 * fd.io coding-style-patch-verification: ON
51 * eval: (c-set-style "gnu")