blob: 82e0efb0d08cac24dd822188611f3552d53f0fa9 [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
Ahmed Abdelsalamf2984bb2020-11-20 18:56:09 +000019/** Default: 5-tuple + flowlabel without the "reverse" bit */
20#define IP_FLOW_HASH_DEFAULT (0x9F)
Neale Rannse4031132020-10-26 13:00:06 +000021
Ahmed Abdelsalamf2984bb2020-11-20 18:56:09 +000022#define foreach_flow_hash_bit_v1 \
23 _ (src, IP_FLOW_HASH_SRC_ADDR) \
24 _ (dst, IP_FLOW_HASH_DST_ADDR) \
25 _ (sport, IP_FLOW_HASH_SRC_PORT) \
26 _ (dport, IP_FLOW_HASH_DST_PORT) \
27 _ (proto, IP_FLOW_HASH_PROTO) \
28 _ (reverse, IP_FLOW_HASH_REVERSE_SRC_DST) \
29 _ (symmetric, IP_FLOW_HASH_SYMMETRIC)
Neale Rannse4031132020-10-26 13:00:06 +000030
Ahmed Abdelsalamf2984bb2020-11-20 18:56:09 +000031#define foreach_flow_hash_bit \
32 _ (src, 0, IP_FLOW_HASH_SRC_ADDR) \
33 _ (dst, 1, IP_FLOW_HASH_DST_ADDR) \
34 _ (sport, 2, IP_FLOW_HASH_SRC_PORT) \
35 _ (dport, 3, IP_FLOW_HASH_DST_PORT) \
36 _ (proto, 4, IP_FLOW_HASH_PROTO) \
37 _ (reverse, 5, IP_FLOW_HASH_REVERSE_SRC_DST) \
38 _ (symmetric, 6, IP_FLOW_HASH_SYMMETRIC) \
39 _ (flowlabel, 7, IP_FLOW_HASH_FL)
Neale Rannse4031132020-10-26 13:00:06 +000040
41/**
42 * A flow hash configuration is a mask of the flow hash options
43 */
Ahmed Abdelsalamf2984bb2020-11-20 18:56:09 +000044typedef enum flow_hash_config_t_
45{
46#define _(a, b, c) c = (1 << b),
47 foreach_flow_hash_bit
48#undef _
49} flow_hash_config_t;
Neale Rannse4031132020-10-26 13:00:06 +000050
51#endif /* __IP_TYPES_H__ */
52
53/*
54 * fd.io coding-style-patch-verification: ON
55 *
56 * Local Variables:
57 * eval: (c-set-style "gnu")
58 * End:
59 */