Merge "tools: Support multiple version of DPDK build"
[samplevnf.git] / common / VIL / l2l3_stack / l3fwd_common.h
1 /*
2 // Copyright (c) 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 /**
18 * @file
19 * L3fwd common header file for LPM IPv4 and IPv6 stack initialization
20 */
21
22 #ifndef L3FWD_COMMON_H
23 #define L3FWD_COMMON_H
24
25 /* Standard Libraries */
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <stdint.h>
29 #include <inttypes.h>
30 #include <sys/types.h>
31 #include <sys/queue.h>
32 #include <sys/param.h>
33 #include <string.h>
34 #include <stdarg.h>
35 #include <errno.h>
36 #include <signal.h>
37 #include <stdbool.h>
38 #include <getopt.h>
39 #include <unistd.h>
40
41 /* DPDK RTE Libraries */
42 #include <rte_common.h>
43 #include <rte_hash.h>
44 #include <rte_jhash.h>
45 #include <rte_port.h>
46 #include <rte_vect.h>
47 #include <rte_byteorder.h>
48 #include <rte_log.h>
49 #include <rte_memory.h>
50 #include <rte_memcpy.h>
51 #include <rte_memzone.h>
52 #include <rte_eal.h>
53 #include <rte_per_lcore.h>
54 #include <rte_launch.h>
55 #include <rte_atomic.h>
56 #include <rte_cycles.h>
57 #include <rte_prefetch.h>
58 #include <rte_lcore.h>
59 #include <rte_per_lcore.h>
60 #include <rte_branch_prediction.h>
61 #include <rte_interrupts.h>
62 #include <rte_pci.h>
63 #include <rte_random.h>
64 #include <rte_debug.h>
65 #include <rte_ether.h>
66 #include <rte_ethdev.h>
67 #include <rte_ring.h>
68 #include <rte_mempool.h>
69 #include <rte_mbuf.h>
70 #include <rte_ip.h>
71 #include <rte_tcp.h>
72 #include <rte_udp.h>
73 #include <rte_table_hash.h>
74 #include <rte_table.h>
75 #include <rte_table_lpm.h>
76 #include <rte_string_fns.h>
77 #include <rte_cpuflags.h>
78 #include <l3fwd_lpm4.h>
79 #include <l3fwd_lpm6.h>
80 #include <rte_table_lpm_ipv6.h>
81
82 /**
83 * Define the Macros
84 */
85 #define MAX_ROUTES 4             /**< MAX route that can be added*/
86 #define L3FWD_DEBUG 1            /**< if set, enables the fast path logs */
87 #define MULTIPATH_FEAT 1   /**< if set, enables the ECMP Multicast feature */
88
89 //#define IPPROTO_ICMPV6 58 /**< Protocol ID for ICMPv6 */
90
91 /**
92 * L3fwd initilazation for creating IPv4 and IPv6 LPM table.
93 */
94 void l3fwd_init(void);
95
96 /**
97 * L3fwd IPv4 LPM table population, it calls IPv4 route add function which stores all the route in LPM table
98 */
99 void populate_lpm4_table_routes(void);
100
101 /**
102 * L3fwd IPv6 LPM table population, it calls IPv6 route add function which stores all the route in LPM6 table
103 */
104 void populate_lpm6_table_routes(void);
105
106 /**
107 * L3fwd LPM table population for both IPv4 and IPv6.
108 */
109 void populate_lpm_routes(void);
110
111 #endif