p1.c: Add symbols useful to IP protocol modules
[vpp.git] / vnet / vnet / plugin / p1.c
1 /*
2  * Copyright (c) 2015 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  * This file and in fact the entire directory shouldn't even exist.
17  * Vnet ought to be a dynamic library. 
18
19  * Unfortunately, various things malfunction when we try to go there. 
20  * Plugin DLL's end up with their own copies of critical
21  * data structures. No one of these problems would be tough to fix, 
22  * but there are quite a number of them.
23  */
24
25 /* 
26  * Make certain that plugin .dll's which reference the following functions
27  * can find them...
28  */
29
30 #define foreach_plugin_reference                \
31 _(unformat_vnet_hw_interface)                   \
32 _(unformat_vnet_sw_interface)                   \
33 _(vnet_hw_interface_rx_redirect_to_node)        \
34 _(vnet_config_add_feature)                      \
35 _(vnet_config_del_feature)                      \
36 _(vnet_get_main)                                \
37 _(_vlib_init_function_l2_init)                  \
38 _(_vlib_init_function_pg_init)                  \
39 _(_vlib_init_function_ip_main_init)             \
40 _(_vlib_init_function_ethernet_init)            \
41 _(_vlib_init_function_ethernet_arp_init)        \
42 _(l2input_intf_bitmap_enable)                   \
43 _(ip4_main)                                     \
44 _(ip6_main)                                     \
45 _(format_ip4_address)                           \
46 _(unformat_ip4_address)                         \
47 _(ip4_address_compare)                          \
48 _(ip6_address_compare)                          \
49 _(format_ip6_address)                           \
50 _(format_ip6_address_and_length)                \
51 _(udp_register_dst_port)                        \
52 _(ethernet_register_input_type)                 \
53 _(ethernet_set_flags)                           \
54 _(format_ip6_address)                           \
55 _(unformat_ip6_address)                         \
56 _(ip6_main)                                     \
57 _(find_ip6_fib_by_table_index_or_id)            \
58 _(format_ethernet_address)                      \
59 _(unformat_ethernet_address)                    \
60 _(unformat_ethernet_interface)                  \
61 _(ethernet_register_l2_input)                   \
62 _(ethernet_register_l3_redirect)                \
63 _(unformat_pg_payload)                          \
64 _(format_ip4_address_and_length)                \
65 _(ip_incremental_checksum)                      \
66 _(ethernet_sw_interface_set_l2_mode)            \
67 _(vnet_create_loopback_interface)               \
68 _(ethernet_set_rx_redirect)                     \
69 _(ethernet_set_flags)                           \
70 _(ethernet_get_main)                            \
71 _(ethernet_get_interface)                       \
72 _(vnet_hw_interface_set_flags)                  \
73 _(vnet_sw_interface_set_flags)                  \
74 _(vnet_create_sw_interface)                     \
75 _(vnet_delete_sw_interface)                     \
76 _(vnet_get_main)                                \
77 _(pg_stream_add)                                \
78 _(pg_stream_del)                                \
79 _(pg_stream_enable_disable)                     \
80 _(pg_main)                                      \
81 _(ip_main)                                      \
82 _(log)                                          \
83 _(unformat_pg_edit)                             \
84 _(unformat_tcp_udp_port)                        \
85 _(unformat_pg_number)                           \
86 _(_vlib_init_function_ip4_lookup_init)          \
87 _(_vlib_init_function_ip6_lookup_init)          \
88 _(ip4_register_protocol)                        \
89 _(ip6_register_protocol)                        \
90 _(ip_csum_and_memcpy)
91
92 #if DPDK > 0
93 #define foreach_dpdk_plugin_reference           \
94 _(dpdk_set_next_node)                           \
95 _(dpdk_worker_thread)                           \
96 _(dpdk_io_thread)                               \
97 _(dpdk_frame_queue_dequeue)                     \
98 _(vlib_get_handoff_queue_elt)                   \
99 _(dpdk_get_handoff_node_index)                  \
100 _(dpdk_set_flowcontrol_callback)                \
101 _(dpdk_interface_tx_vector)                     \
102 _(rte_calloc)                                   \
103 _(rte_free)                                     \
104 _(rte_malloc)                                   \
105 _(post_sw_interface_set_flags)                  \
106 _(dpdk_get_admin_up_down_in_progress)           \
107 _(efd_config)
108 #else
109 #define foreach_dpdk_plugin_reference
110 #endif
111
112 #if IPV6SR > 0
113 #define foreach_ip6_sr_plugin_reference         \
114 _(vnet_register_sr_app_callback)                \
115 _(format_ip6_sr_header)
116 #else
117 #define foreach_ip6_sr_plugin_reference
118 #endif 
119
120 #define _(a) void a (void);
121 foreach_plugin_reference
122 foreach_dpdk_plugin_reference
123 foreach_ip6_sr_plugin_reference
124 #undef _
125
126 void *vnet_library_plugin_references[] =
127   {
128 #define _(a) &a,
129     foreach_plugin_reference
130     foreach_dpdk_plugin_reference
131     foreach_ip6_sr_plugin_reference
132 #undef _
133   };
134
135 void vnet_library_plugin_reference(void) { }