e2cbcb3ce330e9228dd7a686137e400b40746dce
[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
22 struct ether_addr_port {
23         struct ether_addr       mac;
24         uint8_t                 pad;
25         uint8_t                 out_idx;
26 };
27
28 struct next_hop {
29         uint32_t                ip_dst;
30         uint32_t                mpls;
31         union {
32                 uint64_t               mac_port_8bytes;
33                 struct ether_addr_port mac_port;
34         };
35 };
36
37 struct next_hop6 {
38         uint8_t                ip_dst[16];
39         uint32_t               mpls;
40         union {
41                 uint64_t               mac_port_8bytes;
42                 struct ether_addr_port mac_port;
43         };
44 };
45
46 struct cpe_data {
47         uint16_t qinq_svlan;
48         uint16_t qinq_cvlan;
49         uint32_t user;
50         union {
51                 uint64_t               mac_port_8bytes;
52                 struct ether_addr_port mac_port;
53                 uint8_t                mac_port_b[8];
54         };
55         uint64_t tsc;
56 };
57
58 struct cpe_key {
59         union {
60                 uint32_t ip;
61                 uint8_t ip_bytes[4];
62         };
63         uint32_t gre_id;
64 } __attribute__((__packed__));
65
66 struct qinq_gre_data {
67         uint32_t gre_id;
68         uint32_t user;
69 } __attribute__((__packed__));
70
71 #endif /* _HASH_ENTRY_TYPES_H_ */