Support packets in flight
[samplevnf.git] / VNFs / DPPD-PROX / hash_entry_types.h
1 /*
2 // Copyright (c) 2010-2017 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 #ifndef _HASH_ENTRY_TYPES_H_
18 #define _HASH_ENTRY_TYPES_H_
19
20 #include <rte_ether.h>
21 #include "prox_compat.h"
22
23 struct ether_addr_port {
24         prox_rte_ether_addr     mac;
25         uint8_t                 pad;
26         uint8_t                 out_idx;
27 };
28
29 struct next_hop {
30         uint32_t                ip_dst;
31         uint32_t                mpls;
32         union {
33                 uint64_t               mac_port_8bytes;
34                 struct ether_addr_port mac_port;
35         };
36 };
37
38 struct next_hop6 {
39         uint8_t                ip_dst[16];
40         uint32_t               mpls;
41         union {
42                 uint64_t               mac_port_8bytes;
43                 struct ether_addr_port mac_port;
44         };
45 };
46
47 struct cpe_data {
48         uint16_t qinq_svlan;
49         uint16_t qinq_cvlan;
50         uint32_t user;
51         union {
52                 uint64_t               mac_port_8bytes;
53                 struct ether_addr_port mac_port;
54                 uint8_t                mac_port_b[8];
55         };
56         uint64_t tsc;
57 };
58
59 struct cpe_key {
60         union {
61                 uint32_t ip;
62                 uint8_t ip_bytes[4];
63         };
64         uint32_t gre_id;
65 } __attribute__((__packed__));
66
67 struct qinq_gre_data {
68         uint32_t gre_id;
69         uint32_t user;
70 } __attribute__((__packed__));
71
72 #endif /* _HASH_ENTRY_TYPES_H_ */