cmake: move functions to src/cmake
[vpp.git] / src / vnet / CMakeLists.txt
1 # Copyright (c) 2018 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 add_definitions (-DWITH_LIBSSL=1)
15 include_directories(${OPENSSL_INCLUDE_DIR})
16
17 set(VNET_SRCS
18   adj/adj_bfd.c
19   adj/adj.c
20   adj/adj_delegate.c
21   adj/adj_glean.c
22   adj/adj_l2.c
23   adj/adj_mcast.c
24   adj/adj_midchain.c
25   adj/adj_nbr.c
26   adj/adj_nsh.c
27   adj/rewrite.c
28   bfd/bfd_api.c
29   bfd/bfd_cli.c
30   bfd/bfd_main.c
31   bfd/bfd_protocol.c
32   bfd/bfd_udp.c
33   bier/bier_api.c
34   bier/bier_bift_table.c
35   bier/bier_bit_string.c
36   bier/bier_disp_dispatch_node.c
37   bier/bier_disp_entry.c
38   bier/bier_disp_lookup_node.c
39   bier/bier_disp_table.c
40   bier/bier_drop.c
41   bier/bier_entry.c
42   bier/bier_fmask.c
43   bier/bier_fmask_db.c
44   bier/bier_imp.c
45   bier/bier_imp_node.c
46   bier/bier_input.c
47   bier/bier_lookup.c
48   bier/bier_output.c
49   bier/bier_table.c
50   bier/bier_test.c
51   bier/bier_types.c
52   bier/bier_update.c
53   bonding/bond_api.c
54   bonding/cli.c
55   bonding/device.c
56   bonding/node.c
57   buffer.c
58   classify/classify_api.c
59   classify/flow_classify.c
60   classify/flow_classify_node.c
61   classify/in_out_acl.c
62   classify/ip_classify.c
63   classify/policer_classify.c
64   classify/vnet_classify.c
65   config.c
66   cop/cop_api.c
67   cop/cop.c
68   cop/ip4_whitelist.c
69   cop/ip6_whitelist.c
70   cop/node1.c
71   devices/af_packet/af_packet_api.c
72   devices/af_packet/af_packet.c
73   devices/af_packet/cli.c
74   devices/af_packet/device.c
75   devices/af_packet/node.c
76   devices/devices.c
77   devices/netlink.c
78   devices/netmap/cli.c
79   devices/netmap/device.c
80   devices/netmap/netmap_api.c
81   devices/netmap/netmap.c
82   devices/netmap/node.c
83   devices/pipe/pipe_api.c
84   devices/pipe/pipe.c
85   devices/tap/cli.c
86   devices/tap/tap.c
87   devices/tap/tapv2_api.c
88   devices/virtio/device.c
89   devices/virtio/node.c
90   devices/virtio/vhost_user_api.c
91   devices/virtio/vhost_user.c
92   devices/virtio/vhost_user_input.c
93   devices/virtio/vhost_user_output.c
94   devices/virtio/virtio.c
95   dhcp/client.c
96   dhcp/dhcp4_proxy_node.c
97   dhcp/dhcp6_client_common_dp.c
98   dhcp/dhcp6_ia_na_client_cp.c
99   dhcp/dhcp6_ia_na_client_dp.c
100   dhcp/dhcp6_pd_client_cp.c
101   dhcp/dhcp6_pd_client_dp.c
102   dhcp/dhcp6_proxy_node.c
103   dhcp/dhcp_api.c
104   dhcp/dhcp_client_detect.c
105   dhcp/dhcp_proxy.c
106   dns/dns.c
107   dns/reply_node.c
108   dns/request_node.c
109   dns/resolver_process.c
110   dpo/classify_dpo.c
111   dpo/dpo.c
112   dpo/drop_dpo.c
113   dpo/dvr_dpo.c
114   dpo/interface_rx_dpo.c
115   dpo/interface_tx_dpo.c
116   dpo/ip6_ll_dpo.c
117   dpo/ip_null_dpo.c
118   dpo/l3_proxy_dpo.c
119   dpo/load_balance.c
120   dpo/load_balance_map.c
121   dpo/lookup_dpo.c
122   dpo/mpls_disposition.c
123   dpo/mpls_label_dpo.c
124   dpo/punt_dpo.c
125   dpo/receive_dpo.c
126   dpo/replicate_dpo.c
127   ethernet/arp.c
128   ethernet/format.c
129   ethernet/init.c
130   ethernet/interface.c
131   ethernet/node.c
132   ethernet/p2p_ethernet_api.c
133   ethernet/p2p_ethernet.c
134   ethernet/p2p_ethernet_input.c
135   ethernet/pg.c
136   ethernet/sfp.c
137   feature/feature_api.c
138   feature/feature.c
139   feature/registration.c
140   fib/fib_api.c
141   fib/fib_attached_export.c
142   fib/fib_bfd.c
143   fib/fib.c
144   fib/fib_entry.c
145   fib/fib_entry_cover.c
146   fib/fib_entry_delegate.c
147   fib/fib_entry_src_adj.c
148   fib/fib_entry_src_api.c
149   fib/fib_entry_src.c
150   fib/fib_entry_src_default_route.c
151   fib/fib_entry_src_interface.c
152   fib/fib_entry_src_interpose.c
153   fib/fib_entry_src_lisp.c
154   fib/fib_entry_src_mpls.c
155   fib/fib_entry_src_rr.c
156   fib/fib_entry_src_special.c
157   fib/fib_node.c
158   fib/fib_node_list.c
159   fib/fib_path.c
160   fib/fib_path_ext.c
161   fib/fib_path_list.c
162   fib/fib_table.c
163   fib/fib_test.c
164   fib/fib_types.c
165   fib/fib_urpf_list.c
166   fib/fib_walk.c
167   fib/ip4_fib.c
168   fib/ip6_fib.c
169   fib/mpls_fib.c
170   flow/flow.c
171   flow/flow_cli.c
172   geneve/decap.c
173   geneve/encap.c
174   geneve/geneve_api.c
175   geneve/geneve.c
176   gre/gre_api.c
177   gre/gre.c
178   gre/interface.c
179   gre/node.c
180   gre/pg.c
181   handoff.c
182   hdlc/hdlc.c
183   hdlc/node.c
184   hdlc/pg.c
185   interface_api.c
186   interface.c
187   interface_cli.c
188   interface_format.c
189   interface_output.c
190   interface_stats.c
191   ipfix-export/flow_api.c
192   ipfix-export/flow_report.c
193   ipfix-export/flow_report_classify.c
194   ip/format.c
195   ip/icmp4.c
196   ip/icmp6.c
197   ip/ip46_cli.c
198   ip/ip4_format.c
199   ip/ip4_forward.c
200   ip/ip4_input.c
201   ip/ip4_mtrie.c
202   ip/ip4_options.c
203   ip/ip4_pg.c
204   ip/ip4_punt_drop.c
205   ip/ip4_reassembly.c
206   ip/ip4_source_and_port_range_check.c
207   ip/ip4_source_check.c
208   ip/ip6_format.c
209   ip/ip6_forward.c
210   ip/ip6_hop_by_hop.c
211   ip/ip6_input.c
212   ip/ip6_ll_table.c
213   ip/ip6_ll_types.c
214   ip/ip6_neighbor.c
215   ip/ip6_pg.c
216   ip/ip6_punt_drop.c
217   ip/ip6_reassembly.c
218   ip/ip_api.c
219   ip/ip.c
220   ip/ip_checksum.c
221   ip/ip_frag.c
222   ip/ip_init.c
223   ip/ip_in_out_acl.c
224   ipip/ipip_api.c
225   ipip/ipip.c
226   ipip/ipip_cli.c
227   ip/ip_neighbor.c
228   ipip/node.c
229   ipip/sixrd.c
230   ip/ip_types_api.c
231   ip/lookup.c
232   ip/ping.c
233   ip/punt_api.c
234   ip/punt.c
235   ip/rd_cp.c
236   ipsec/ah_decrypt.c
237   ipsec/ah_encrypt.c
238   ipsec/esp_decrypt.c
239   ipsec/esp_encrypt.c
240   ipsec/esp_format.c
241   ipsec-gre/interface.c
242   ipsec-gre/ipsec_gre_api.c
243   ipsec-gre/ipsec_gre.c
244   ipsec-gre/node.c
245   ipsec/ikev2.c
246   ipsec/ikev2_cli.c
247   ipsec/ikev2_crypto.c
248   ipsec/ikev2_format.c
249   ipsec/ikev2_payload.c
250   ipsec/ipsec_api.c
251   ipsec/ipsec.c
252   ipsec/ipsec_cli.c
253   ipsec/ipsec_format.c
254   ipsec/ipsec_if.c
255   ipsec/ipsec_if_in.c
256   ipsec/ipsec_input.c
257   ipsec/ipsec_output.c
258   l2/feat_bitmap.c
259   l2/l2_api.c
260   l2/l2_bd.c
261   l2/l2_bvi.c
262   l2/l2_efp_filter.c
263   l2/l2_fib.c
264   l2/l2_flood.c
265   l2/l2_fwd.c
266   l2/l2_in_out_acl.c
267   l2/l2_input.c
268   l2/l2_input_classify.c
269   l2/l2_input_vtr.c
270   l2/l2_learn.c
271   l2/l2_output.c
272   l2/l2_output_classify.c
273   l2/l2_patch.c
274   l2/l2_rw.c
275   l2/l2_vtr.c
276   l2/l2_xcrw.c
277   l2tp/decap.c
278   l2tp/encap.c
279   l2tp/l2tp_api.c
280   l2tp/l2tp.c
281   l2tp/pg.c
282   lawful-intercept/lawful_intercept.c
283   lawful-intercept/node.c
284   lisp-cp/control.c
285   lisp-cp/gid_dictionary.c
286   lisp-cp/lisp_api.c
287   lisp-cp/lisp_cli.c
288   lisp-cp/lisp_cp_dpo.c
289   lisp-cp/lisp_msg_serdes.c
290   lisp-cp/lisp_types.c
291   lisp-cp/one_api.c
292   lisp-cp/one_cli.c
293   lisp-cp/packets.c
294   lisp-gpe/decap.c
295   lisp-gpe/interface.c
296   lisp-gpe/lisp_gpe_adjacency.c
297   lisp-gpe/lisp_gpe_api.c
298   lisp-gpe/lisp_gpe.c
299   lisp-gpe/lisp_gpe_fwd_entry.c
300   lisp-gpe/lisp_gpe_sub_interface.c
301   lisp-gpe/lisp_gpe_tenant.c
302   lisp-gpe/lisp_gpe_tunnel.c
303   llc/llc.c
304   llc/node.c
305   llc/pg.c
306   lldp/lldp_api.c
307   lldp/lldp_cli.c
308   lldp/lldp_input.c
309   lldp/lldp_node.c
310   lldp/lldp_output.c
311   mfib/ip4_mfib.c
312   mfib/ip6_mfib.c
313   mfib/mfib_entry.c
314   mfib/mfib_forward.c
315   mfib/mfib_itf.c
316   mfib/mfib_signal.c
317   mfib/mfib_table.c
318   mfib/mfib_test.c
319   mfib/mfib_types.c
320   misc.c
321   mpls/interface.c
322   mpls/mpls_api.c
323   mpls/mpls.c
324   mpls/mpls_features.c
325   mpls/mpls_input.c
326   mpls/mpls_lookup.c
327   mpls/mpls_output.c
328   mpls/mpls_tunnel.c
329   mpls/pg.c
330   osi/node.c
331   osi/osi.c
332   osi/pg.c
333   pg/cli.c
334   pg/edit.c
335   pg/init.c
336   pg/input.c
337   pg/output.c
338   pg/pg_api.c
339   pg/stream.c
340   policer/node_funcs.c
341   policer/policer_api.c
342   policer/policer.c
343   policer/xlate.c
344   ppp/node.c
345   ppp/pg.c
346   ppp/ppp.c
347   qos/qos_api.c
348   qos/qos_egress_map.c
349   qos/qos_mark.c
350   qos/qos_record.c
351   qos/qos_types.c
352   replication.c
353   sctp/sctp_api.c
354   sctp/sctp.c
355   sctp/sctp_format.c
356   sctp/sctp_input.c
357   sctp/sctp_output.c
358   sctp/sctp_pg.c
359   session/application.c
360   session/application_interface.c
361   session/application_namespace.c
362   session-apps/echo_client.c
363   session-apps/echo_server.c
364   session-apps/http_server.c
365   session-apps/proxy.c
366   session/segment_manager.c
367   session/session_api.c
368   session/session.c
369   session/session_cli.c
370   session/session_lookup.c
371   session/session_node.c
372   session/session_rules_table.c
373   session/session_table.c
374   session/session_test.c
375   session/transport.c
376   snap/node.c
377   snap/pg.c
378   snap/snap.c
379   span/node.c
380   span/span_api.c
381   span/span.c
382   srmpls/sr_mpls_api.c
383   srmpls/sr_mpls_policy.c
384   srmpls/sr_mpls_steering.c
385   srp/format.c
386   srp/interface.c
387   srp/node.c
388   srp/pg.c
389   srv6/sr_api.c
390   srv6/sr.c
391   srv6/sr_localsid.c
392   srv6/sr_policy_rewrite.c
393   srv6/sr_steering.c
394   tcp/tcp_api.c
395   tcp/tcp.c
396   tcp/tcp_format.c
397   tcp/tcp_input.c
398   tcp/tcp_newreno.c
399   tcp/tcp_output.c
400   tcp/tcp_pg.c
401   tcp/tcp_syn_filter4.c
402   tls/tls.c
403   udp/udp_api.c
404   udp/udp.c
405   udp/udp_encap.c
406   udp/udp_encap_node.c
407   udp/udp_format.c
408   udp/udp_input.c
409   udp/udp_local.c
410   udp/udp_pg.c
411   unix/gdb_funcs.c
412   unix/pcap.c
413   unix/tap_api.c
414   unix/tapcli.c
415   unix/tuntap.c
416   util/radix.c
417   util/refcount.c
418   util/trajectory.c
419   vxlan/decap.c
420   vxlan/encap.c
421   vxlan-gpe/decap.c
422   vxlan-gpe/encap.c
423   vxlan-gpe/vxlan_gpe_api.c
424   vxlan-gpe/vxlan_gpe.c
425   vxlan/vxlan_api.c
426   vxlan/vxlan.c
427 )
428
429 vpp_add_api_files(vnet_api_headers
430   vxlan-gpe/vxlan_gpe.api
431   ip/ip.api
432   ip/rd_cp.api
433   ip/ip_types.api
434   ip/punt.api
435   fib/fib_types.api
436   devices/virtio/vhost_user.api
437   devices/af_packet/af_packet.api
438   devices/tap/tapv2.api
439   devices/netmap/netmap.api
440   devices/pipe/pipe.api
441   l2tp/l2tp.api
442   bier/bier.api
443   ipsec-gre/ipsec_gre.api
444   cop/cop.api
445   ipsec/ipsec.api
446   lisp-gpe/lisp_gpe.api
447   lldp/lldp.api
448   vxlan/vxlan.api
449   srmpls/sr_mpls.api
450   pg/pg.api
451   bonding/bond.api
452   dns/dns.api
453   feature/feature.api
454   dhcp/dhcp.api
455   dhcp/dhcp6_pd_client_cp.api
456   dhcp/dhcp6_ia_na_client_cp.api
457   sctp/sctp.api
458   ipip/ipip.api
459   qos/qos.api
460   interface.api
461   udp/udp.api
462   lisp-cp/one.api
463   lisp-cp/lisp.api
464   mpls/mpls.api
465   l2/l2.api
466   geneve/geneve.api
467   tcp/tcp.api
468   unix/tap.api
469   srv6/sr.api
470   gre/gre.api
471   span/span.api
472   policer/policer.api
473   session/session.api
474   ethernet/p2p_ethernet.api
475   ipfix-export/ipfix_export.api
476   classify/classify.api
477   bfd/bfd.api
478 )
479
480 vpp_add_header_files(vnet
481   l3_types.h
482   vxlan-gpe/vxlan_gpe.h
483   vxlan-gpe/vxlan_gpe_packet.h
484   vxlan-gpe/vxlan_gpe_error.def
485   ip/icmp6.h
486   ip/ip_source_and_port_range_check.h
487   ip/ports.def
488   ip/ip6_to_ip4.h
489   ip/ip4_error.h
490   ip/ip6_error.h
491   ip/ip4_packet.h
492   ip/lookup.h
493   ip/ip_neighbor.h
494   ip/ip6_hop_by_hop_packet.h
495   ip/format.h
496   ip/ip4_mtrie.h
497   ip/icmp4.h
498   ip/icmp46_packet.h
499   ip/igmp_packet.h
500   ip/protocols.def
501   ip/ip6_neighbor.h
502   ip/ip4.h
503   ip/ip6_hop_by_hop.h
504   ip/punt.h
505   ip/ip6.h
506   ip/ip6_packet.h
507   ip/punt_error.def
508   ip/ip.h
509   ip/ip_packet.h
510   ip/ip4_to_ip6.h
511   adj/adj_nbr.h
512   adj/adj_glean.h
513   adj/adj_nsh.h
514   adj/adj.h
515   adj/adj_types.h
516   adj/rewrite.h
517   fib/fib_table.h
518   fib/fib_entry.h
519   fib/fib.h
520   fib/ip4_fib.h
521   fib/fib_node.h
522   fib/ip6_fib.h
523   fib/fib_types.h
524   fib/fib_node_list.h
525   fib/fib_entry_delegate.h
526   devices/virtio/virtio.h
527   devices/virtio/vhost_user.h
528   devices/af_packet/af_packet.h
529   devices/devices.h
530   devices/tap/tap.h
531   devices/netmap/netmap.h
532   devices/netlink.h
533   devices/pipe/pipe.h
534   vnet_msg_enum.h
535   dpo/load_balance.h
536   dpo/dpo.h
537   dpo/punt_dpo.h
538   dpo/lookup_dpo.h
539   dpo/drop_dpo.h
540   dpo/classify_dpo.h
541   dpo/receive_dpo.h
542   dpo/ip_null_dpo.h
543   dpo/replicate_dpo.h
544   l2tp/packet.h
545   l2tp/l2tp.h
546   global_funcs.h
547   bier/bier_types.h
548   bier/bier_entry.h
549   bier/bier_table.h
550   bier/bier_update.h
551   ipsec-gre/ipsec_gre.h
552   ipsec-gre/error.def
553   interface_funcs.h
554   lawful-intercept/lawful_intercept.h
555   util/radix.h
556   util/refcount.h
557   cop/cop.h
558   ipsec/ikev2.h
559   ipsec/ikev2_priv.h
560   ipsec/ah.h
561   ipsec/esp.h
562   ipsec/ipsec.h
563   flow/flow.h
564   lisp-gpe/lisp_gpe_packet.h
565   lisp-gpe/lisp_gpe_error.def
566   lisp-gpe/lisp_gpe_fwd_entry.h
567   lisp-gpe/lisp_gpe_tenant.h
568   lisp-gpe/lisp_gpe.h
569   lldp/lldp.h
570   lldp/lldp_protocol.h
571   pipeline.h
572   hdlc/packet.h
573   hdlc/hdlc.h
574   hdlc/error.def
575   vxlan/vxlan_packet.h
576   vxlan/vxlan.h
577   vxlan/vxlan_error.def
578   srmpls/sr_mpls.h
579   pg/edit.h
580   pg/pg.h
581   bonding/node.h
582   dns/dns.h
583   feature/feature.h
584   dhcp/dhcp6_pd_client_dp.h
585   dhcp/client.h
586   dhcp/dhcp4_proxy_error.def
587   dhcp/dhcp4_packet.h
588   dhcp/dhcp6_proxy_error.def
589   dhcp/dhcp6_client_common_dp.h
590   dhcp/dhcp_proxy.h
591   dhcp/dhcp6_ia_na_client_dp.h
592   dhcp/dhcp6_packet.h
593   tls/tls.h
594   sctp/sctp_error.def
595   sctp/sctp_packet.h
596   sctp/sctp_timer.h
597   sctp/sctp.h
598   ipip/ipip.h
599   handoff.h
600   api_errno.h
601   osi/osi.h
602   udp/udp_error.def
603   udp/udp_packet.h
604   udp/udp.h
605   ppp/packet.h
606   ppp/ppp.h
607   ppp/error.def
608   lisp-cp/lisp_types.h
609   lisp-cp/lisp_cp_messages.h
610   lisp-cp/packets.h
611   lisp-cp/gid_dictionary.h
612   lisp-cp/lisp_msg_serdes.h
613   lisp-cp/control.h
614   vnet.h
615   mpls/packet.h
616   mpls/mpls.h
617   mpls/mpls_tunnel.h
618   mpls/mpls_types.h
619   mpls/error.def
620   mfib/mfib_types.h
621   mfib/ip4_mfib.h
622   mfib/mfib_table.h
623   interface.h
624   plugin/plugin.h
625   l2/l2_xcrw.h
626   l2/l2_output.h
627   l2/l2_rw.h
628   l2/l2_fib.h
629   l2/l2_vtr.h
630   l2/feat_bitmap.h
631   l2/l2_flood.h
632   l2/l2_classify.h
633   l2/l2_bd.h
634   l2/l2_efp_filter.h
635   l2/l2_fwd.h
636   l2/l2_input.h
637   l2/l2_input_vtr.h
638   l2/l2_bvi.h
639   geneve/geneve.h
640   geneve/geneve_error.def
641   geneve/geneve_packet.h
642   tcp/tcp_packet.h
643   tcp/tcp_debug.h
644   tcp/tcp_timer.h
645   tcp/tcp_error.def
646   tcp/tcp.h
647   session-apps/echo_client.h
648   session-apps/proxy.h
649   unix/pcap.h
650   unix/tuntap.h
651   unix/tapcli.h
652   srv6/sr.h
653   srv6/sr_packet.h
654   gre/packet.h
655   gre/gre.h
656   gre/error.def
657   span/span.h
658   policer/xlate.h
659   policer/policer.h
660   policer/police.h
661   config.h
662   buffer.h
663   llc/llc.h
664   session/session_lookup.h
665   session/mma_template.c
666   session/application.h
667   session/segment_manager.h
668   session/mma_template.h
669   session/session_rules_table.h
670   session/session.h
671   session/transport.h
672   session/session_debug.h
673   session/mma_16.h
674   session/mma_40.h
675   session/session_table.h
676   session/transport_interface.h
677   session/application_namespace.h
678   session/stream_session.h
679   session/application_interface.h
680   replication.h
681   ethernet/packet.h
682   ethernet/arp.h
683   ethernet/p2p_ethernet.h
684   ethernet/sfp.h
685   ethernet/types.def
686   ethernet/arp_packet.h
687   ethernet/ethernet.h
688   ethernet/error.def
689   ipfix-export/ipfix_info_elements.h
690   ipfix-export/flow_report.h
691   ipfix-export/flow_report_classify.h
692   ipfix-export/ipfix_packet.h
693   snap/snap.h
694   classify/flow_classify.h
695   classify/in_out_acl.h
696   classify/vnet_classify.h
697   classify/policer_classify.h
698   bfd/bfd_udp.h
699   bfd/bfd_protocol.h
700   bfd/bfd_main.h
701   srp/packet.h
702   srp/srp.h
703 )
704
705 add_library(vnet SHARED ${VNET_SRCS})
706
707 vpp_library_set_multiarch_sources(vnet
708   bonding/node.c
709   ip/ip4_forward.c
710   ip/ip4_input.c
711   l2/l2_output.c
712   devices/virtio/vhost_user_input.c
713   devices/virtio/vhost_user_output.c
714 )
715 target_link_libraries(vnet vlib ${OPENSSL_LIBRARIES})
716 add_dependencies(vnet api_headers)
717
718 #
719 # Install
720 #
721 install(TARGETS vnet DESTINATION lib)