virtio: remove kernel virtio header dependencies
[vpp.git] / src / vnet / CMakeLists.txt
1 # Copyright (c) 2018-2020 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 unset(VNET_SOURCES)
18 unset(VNET_HEADERS)
19 unset(VNET_API_FILES)
20 unset(VNET_MULTIARCH_SOURCES)
21
22 ##############################################################################
23 # Generic stuff
24 ##############################################################################
25 list(APPEND VNET_SOURCES
26   buffer.c
27   config.c
28   devices/devices.c
29   devices/netlink.c
30   flow/flow.c
31   flow/flow_cli.c
32   flow/flow_api.c
33   handoff.c
34   interface.c
35   interface_api.c
36   interface_cli.c
37   interface_format.c
38   interface_output.c
39   interface_stats.c
40   misc.c
41 )
42
43 list(APPEND VNET_MULTIARCH_SOURCES
44   interface_output.c
45   interface_stats.c
46   handoff.c
47 )
48
49 list(APPEND VNET_HEADERS
50   api_errno.h
51   buffer.h
52   config.h
53   devices/devices.h
54   devices/netlink.h
55   flow/flow.h
56   global_funcs.h
57   handoff.h
58   interface.h
59   interface_funcs.h
60   interface_output.h
61   ip/ip4_to_ip6.h
62   ip/ip6_to_ip4.h
63   ip/ip_types_api.h
64   l3_types.h
65   plugin/plugin.h
66   pipeline.h
67   vnet.h
68   vnet_all_api_h.h
69   vnet_msg_enum.h
70   util/radix.h
71   util/refcount.h
72   format_fns.h
73   ip/ip_format_fns.h
74   ethernet/ethernet_format_fns.h
75 )
76
77 list(APPEND VNET_API_FILES
78   interface.api
79   interface_types.api
80   ip/ip_types.api
81   flow/flow_types.api
82   flow/flow.api
83 )
84
85 ##############################################################################
86 # Policer infra
87 ##############################################################################
88 list(APPEND VNET_SOURCES
89   policer/node_funcs.c
90   policer/policer.c
91   policer/xlate.c
92   policer/policer_api.c
93 )
94
95 list(APPEND VNET_MULTIARCH_SOURCES
96   policer/node_funcs.c
97 )
98
99 list(APPEND VNET_HEADERS
100   policer/police.h
101   policer/policer.h
102   policer/xlate.h
103 )
104
105 list(APPEND VNET_API_FILES
106   policer/policer.api
107   policer/policer_types.api
108 )
109
110 ##############################################################################
111 # Binary API compatibility until vpp 20.12, see the ADL plugin...
112 ##############################################################################
113
114 list(APPEND VNET_SOURCES
115   cop/cop_api.c
116 )
117
118 list(APPEND VNET_API_FILES cop/cop.api)
119
120 ##############################################################################
121 # Layer 2 protocols go here
122 ##############################################################################
123
124 ##############################################################################
125 # Layer 2 protocol: Ethernet
126 ##############################################################################
127 list(APPEND VNET_SOURCES
128   ethernet/arp_packet.c
129   ethernet/ethernet_types_api.c
130   ethernet/format.c
131   ethernet/init.c
132   ethernet/interface.c
133   ethernet/mac_address.c
134   ethernet/node.c
135   ethernet/pg.c
136   ethernet/sfp.c
137   ethernet/p2p_ethernet.c
138   ethernet/p2p_ethernet_input.c
139   ethernet/p2p_ethernet_api.c
140 )
141
142 list(APPEND VNET_MULTIARCH_SOURCES
143   ethernet/node.c
144   ethernet/p2p_ethernet_input.c
145 )
146
147 list(APPEND VNET_HEADERS
148   ethernet/error.def
149   ethernet/ethernet.h
150   ethernet/mac_address.h
151   ethernet/packet.h
152   ethernet/types.def
153   ethernet/sfp.h
154   ethernet/p2p_ethernet.h
155   ethernet/arp_packet.h
156 )
157
158 list(APPEND VNET_API_FILES
159   ethernet/p2p_ethernet.api
160   ethernet/ethernet_types.api)
161
162 ##############################################################################
163 # Layer 2 protocol: Ethernet bridging
164 ##############################################################################
165 list(APPEND VNET_SOURCES
166   l2/feat_bitmap.c
167   l2/l2_api.c
168   l2/l2_arp_term.c
169   l2/l2_bd.c
170   l2/l2_bvi.c
171   l2/l2_bvi_node.c
172   l2/l2_input_classify.c
173   l2/l2_output_classify.c
174   l2/l2_efp_filter.c
175   l2/l2_fib.c
176   l2/l2_flood.c
177   l2/l2_fwd.c
178   l2/l2_input.c
179   l2/l2_input_vtr.c
180   l2/l2_learn.c
181   l2/l2_output.c
182   l2/l2_in_out_acl.c
183   l2/l2_in_out_feat_arc.c
184   l2/l2_patch.c
185   l2/l2_rw.c
186   l2/l2_uu_fwd.c
187   l2/l2_vtr.c
188   l2/l2_xcrw.c
189 )
190
191 list(APPEND VNET_MULTIARCH_SOURCES
192   l2/l2_bvi_node.c
193   l2/l2_fwd.c
194   l2/l2_learn.c
195   l2/l2_output.c
196   l2/l2_patch.c
197   l2/l2_in_out_feat_arc.c
198   l2/l2_input_classify.c
199   l2/l2_input.c
200   l2/l2_output_classify.c
201   l2/l2_flood.c
202   l2/l2_uu_fwd.c
203   l2/l2_efp_filter.c
204   l2/l2_rw.c
205   l2/l2_xcrw.c
206   l2/l2_in_out_acl.c
207   l2/l2_input_vtr.c
208 )
209
210 list(APPEND VNET_HEADERS
211   l2/feat_bitmap.h
212   l2/l2_input.h
213   l2/l2_output.h
214   l2/l2_vtr.h
215   l2/l2_input_vtr.h
216   l2/l2_efp_filter.h
217   l2/l2_fwd.h
218   l2/l2_bd.h
219   l2/l2_bvi.h
220   l2/l2_flood.h
221   l2/l2_fib.h
222   l2/l2_rw.h
223   l2/l2_xcrw.h
224   l2/l2_classify.h
225 )
226
227 list(APPEND VNET_API_FILES l2/l2.api)
228
229 ##############################################################################
230 # Layer 2 protocol: SRP
231 ##############################################################################
232 list(APPEND VNET_SOURCES
233   srp/format.c
234   srp/interface.c
235   srp/node.c
236   srp/pg.c
237 )
238
239 list(APPEND VNET_HEADERS
240   srp/packet.h
241   srp/srp.h
242 )
243
244 ##############################################################################
245 # Layer 2 protocol: PPP
246 ##############################################################################
247 list(APPEND VNET_SOURCES
248   ppp/node.c
249   ppp/pg.c
250   ppp/ppp.c
251 )
252
253 list(APPEND VNET_HEADERS
254   ppp/error.def
255   ppp/ppp.h
256   ppp/packet.h
257 )
258
259 ##############################################################################
260 # Layer 2 protocol: HDLC
261 ##############################################################################
262 list(APPEND VNET_SOURCES
263   hdlc/node.c
264   hdlc/pg.c
265   hdlc/hdlc.c
266 )
267
268 list(APPEND VNET_HEADERS
269   hdlc/error.def
270   hdlc/hdlc.h
271   hdlc/packet.h
272 )
273
274 ##############################################################################
275 # Layer 2 protocol: LLC
276 ##############################################################################
277 list(APPEND VNET_SOURCES
278   llc/llc.c
279   llc/node.c
280   llc/pg.c
281 )
282
283 list(APPEND VNET_HEADERS
284   llc/llc.h
285 )
286
287 ##############################################################################
288 # Layer 2 protocol: SNAP
289 ##############################################################################
290 list(APPEND VNET_SOURCES
291   snap/snap.c
292   snap/node.c
293   snap/pg.c
294 )
295
296 list(APPEND VNET_HEADERS
297   snap/snap.h
298 )
299
300 ##############################################################################
301 # Layer 2 / vxlan
302 ##############################################################################
303 list(APPEND VNET_SOURCES
304   vxlan/vxlan.c
305   vxlan/encap.c
306   vxlan/decap.c
307   vxlan/vxlan_api.c
308 )
309
310 list(APPEND VNET_MULTIARCH_SOURCES
311   vxlan/encap.c
312 )
313
314 list(APPEND VNET_HEADERS
315   vxlan/vxlan.h
316   vxlan/vxlan_packet.h
317   vxlan/vxlan_error.def
318 )
319
320 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
321
322 list(APPEND VNET_API_FILES vxlan/vxlan.api)
323
324 ##############################################################################
325 # Layer 2 / Geneve
326 ##############################################################################
327 list(APPEND VNET_SOURCES
328   geneve/geneve.c
329   geneve/encap.c
330   geneve/decap.c
331   geneve/geneve_api.c
332 )
333
334 list(APPEND VNET_MULTIARCH_SOURCES
335   geneve/encap.c
336   geneve/decap.c
337 )
338
339 list(APPEND VNET_HEADERS
340   geneve/geneve.h
341   geneve/geneve_packet.h
342   geneve/geneve_error.def
343 )
344
345 list(APPEND VNET_API_FILES geneve/geneve.api)
346
347 ##############################################################################
348 # Layer 2 / Bonding
349 ##############################################################################
350 list(APPEND VNET_SOURCES
351   bonding/cli.c
352   bonding/node.c
353   bonding/device.c
354   bonding/bond_api.c
355 )
356
357 list(APPEND VNET_HEADERS
358   bonding/node.h
359 )
360
361 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
362 list(APPEND VNET_API_FILES bonding/bond.api)
363
364 ##############################################################################
365 # Layer 2 / LLDP
366 ##############################################################################
367 list(APPEND VNET_SOURCES
368   lldp/lldp_input.c
369   lldp/lldp_node.c
370   lldp/lldp_output.c
371   lldp/lldp_cli.c
372   lldp/lldp_api.c
373 )
374
375 list(APPEND VNET_HEADERS
376   lldp/lldp_protocol.h
377   lldp/lldp.h
378 )
379
380 list(APPEND VNET_API_FILES lldp/lldp.api)
381
382 ##############################################################################
383 # Layer 2/3 "classify"
384 ##############################################################################
385 list(APPEND VNET_SOURCES
386   classify/vnet_classify.c
387   classify/trace_classify.h
388   classify/ip_classify.c
389   classify/in_out_acl.c
390   classify/policer_classify.c
391   classify/flow_classify.c
392   classify/flow_classify_node.c
393   classify/vnet_classify.h
394   classify/classify_api.c
395 )
396
397 list(APPEND VNET_MULTIARCH_SOURCES
398   classify/ip_classify.c
399   classify/flow_classify_node.c
400 )
401
402 list(APPEND VNET_HEADERS
403   classify/vnet_classify.h
404   classify/trace_classify.h
405   classify/in_out_acl.h
406   classify/policer_classify.h
407   classify/flow_classify.h
408 )
409
410 list(APPEND VNET_API_FILES classify/classify.api)
411
412 ##############################################################################
413 # Layer 3 protocols go here
414 ##############################################################################
415
416 ##############################################################################
417 # Layer 3 protocol: IP v4/v6
418 ##############################################################################
419 list(APPEND VNET_SOURCES
420   ip/format.c
421   ip/icmp4.c
422   ip/icmp6.c
423   ip/ip46_cli.c
424   ip/ip_types_api.c
425   ip/ip46_address.c
426   ip/ip4_format.c
427   ip/ip4_forward.c
428   ip/ip4_punt_drop.c
429   ip/ip4_input.c
430   ip/ip4_options.c
431   ip/ip4_mtrie.c
432   ip/ip4_pg.c
433   ip/ip4_source_and_port_range_check.c
434   ip/reass/ip4_full_reass.c
435   ip/reass/ip4_sv_reass.c
436   ip/ip6_format.c
437   ip/ip6_forward.c
438   ip/ip6_ll_table.c
439   ip/ip6_ll_types.c
440   ip/ip6_punt_drop.c
441   ip/ip6_hop_by_hop.c
442   ip/ip6_input.c
443   ip/ip6_link.c
444   ip/ip6_pg.c
445   ip/reass/ip6_full_reass.c
446   ip/reass/ip6_sv_reass.c
447   ip/ip_api.c
448   ip/ip_checksum.c
449   ip/ip_frag.c
450   ip/ip.c
451   ip/ip_interface.c
452   ip/ip_init.c
453   ip/ip_in_out_acl.c
454   ip/ip_punt_drop.c
455   ip/ip_types.c
456   ip/lookup.c
457   ip/punt_api.c
458   ip/punt.c
459   ip/punt_node.c
460   ip/vtep.c
461 )
462
463 list(APPEND VNET_MULTIARCH_SOURCES
464   ip/ip4_punt_drop.c
465   ip/reass/ip4_full_reass.c
466   ip/ip6_hop_by_hop.c
467   ip/reass/ip6_full_reass.c
468   ip/reass/ip4_sv_reass.c
469   ip/ip6_hop_by_hop.c
470   ip/reass/ip6_full_reass.c
471   ip/reass/ip6_sv_reass.c
472   ip/ip6_input.c
473   ip/ip6_punt_drop.c
474   ip/punt_node.c
475   ip/ip_in_out_acl.c
476 )
477
478 list(APPEND VNET_HEADERS
479   ip/format.h
480   ip/icmp46_packet.h
481   ip/icmp4.h
482   ip/icmp6.h
483   ip/igmp_packet.h
484   ip/ip4_error.h
485   ip/ip4.h
486   ip/ip4_mtrie.h
487   ip/ip4_packet.h
488   ip/ip46_address.h
489   ip/ip6_error.h
490   ip/ip6.h
491   ip/ip6_hop_by_hop.h
492   ip/ip6_hop_by_hop_packet.h
493   ip/ip6_packet.h
494   ip/ip.h
495   ip/ip_table.h
496   ip/ip_interface.h
497   ip/ip_packet.h
498   ip/ip_source_and_port_range_check.h
499   ip/ip_types.h
500   ip/lookup.h
501   ip/ports.def
502   ip/protocols.def
503   ip/punt_error.def
504   ip/punt.h
505 )
506
507 list(APPEND VNET_API_FILES
508   ip/ip.api
509   ip/punt.api
510 )
511
512 list(APPEND VNET_MULTIARCH_SOURCES
513   ip/ip4_forward.c
514   ip/ip6_forward.c
515   ip/ip4_input.c
516 )
517
518 ##############################################################################
519 # Layer 3 neighbours
520 ##############################################################################
521 list(APPEND VNET_SOURCES
522   ip-neighbor/ip_neighbor.c
523   ip-neighbor/ip_neighbor_api.c
524   ip-neighbor/ip_neighbor_dp.c
525   ip-neighbor/ip_neighbor_types.c
526   ip-neighbor/ip_neighbor_watch.c
527   ip-neighbor/ip4_neighbor.c
528   ip-neighbor/ip6_neighbor.c
529 )
530
531 list(APPEND VNET_HEADERS
532   ip-neighbor/ip_neighbor.h
533   ip-neighbor/ip_neighbor_types.h
534 )
535
536 list(APPEND VNET_API_FILES
537   ip-neighbor/ip_neighbor.api
538 )
539
540 ##############################################################################
541 # Bidirectional Forwarding Detection
542 ##############################################################################
543
544 list(APPEND VNET_HEADERS
545   bfd/bfd_protocol.h
546   bfd/bfd_main.h
547   bfd/bfd_api.h
548   bfd/bfd_udp.h
549 )
550
551 list(APPEND VNET_SOURCES
552   bfd/bfd_api.h
553   bfd/bfd_udp.c
554   bfd/bfd_main.c
555   bfd/bfd_protocol.c
556   bfd/bfd_cli.c
557   bfd/bfd_api.c
558 )
559
560 list(APPEND VNET_API_FILES bfd/bfd.api)
561
562 ##############################################################################
563 # Crypto
564 ##############################################################################
565
566 list(APPEND VNET_SOURCES
567   crypto/cli.c
568   crypto/crypto.c
569   crypto/format.c
570   crypto/node.c
571   crypto/crypto_api.c
572 )
573
574 list(APPEND VNET_HEADERS
575   crypto/crypto.h
576 )
577
578 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
579
580 list(APPEND VNET_API_FILES crypto/crypto.api)
581
582 ##############################################################################
583 # Layer 3 protocol: IPSec
584 ##############################################################################
585 list(APPEND VNET_SOURCES
586   ipsec/ipsec.c
587   ipsec/ipsec_cli.c
588   ipsec/ipsec_format.c
589   ipsec/ipsec_handoff.c
590   ipsec/ipsec_input.c
591   ipsec/ipsec_itf.c
592   ipsec/ipsec_punt.c
593   ipsec/ipsec_sa.c
594   ipsec/ipsec_spd.c
595   ipsec/ipsec_spd_policy.c
596   ipsec/ipsec_tun.c
597   ipsec/ipsec_tun_in.c
598   ipsec/esp_format.c
599   ipsec/esp_encrypt.c
600   ipsec/esp_decrypt.c
601   ipsec/ah_decrypt.c
602   ipsec/ah_encrypt.c
603   ipsec/ipsec_api.c
604   ipsec/ipsec_types_api.c
605 )
606
607 list(APPEND VNET_MULTIARCH_SOURCES
608   ipsec/esp_encrypt.c
609   ipsec/esp_decrypt.c
610   ipsec/ah_decrypt.c
611   ipsec/ah_encrypt.c
612   ipsec/ipsec_handoff.c
613   ipsec/ipsec_output.c
614   ipsec/ipsec_input.c
615   ipsec/ipsec_tun_in.c
616 )
617
618 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
619 list(APPEND VNET_API_FILES ipsec/ipsec.api)
620
621 list(APPEND VNET_SOURCES
622   ipsec/ipsec_output.c
623 )
624
625 list(APPEND VNET_HEADERS
626   ipsec/ipsec.h
627   ipsec/ipsec_spd.h
628   ipsec/ipsec_spd_policy.h
629   ipsec/ipsec_sa.h
630   ipsec/ipsec_tun.h
631   ipsec/ipsec_types_api.h
632   ipsec/ipsec_punt.h
633   ipsec/esp.h
634   ipsec/ah.h
635 )
636
637 ##############################################################################
638 # Layer 3 protocol: osi
639 ##############################################################################
640 list(APPEND VNET_SOURCES
641   osi/node.c
642   osi/osi.c
643   osi/pg.c
644 )
645
646 list(APPEND VNET_HEADERS
647   osi/osi.h
648 )
649
650 ##############################################################################
651 # Layer 4 protocol: tcp
652 ##############################################################################
653 list(APPEND VNET_SOURCES
654   tcp/tcp_api.c
655   tcp/tcp_format.c
656   tcp/tcp_pg.c
657   tcp/tcp_syn_filter4.c
658   tcp/tcp_output.c
659   tcp/tcp_input.c
660   tcp/tcp_newreno.c
661   tcp/tcp_bt.c
662   tcp/tcp_cli.c
663   tcp/tcp_cubic.c
664   tcp/tcp_debug.c
665   tcp/tcp_sack.c
666   tcp/tcp.c
667 )
668
669 list(APPEND VNET_MULTIARCH_SOURCES
670   tcp/tcp_input.c
671   tcp/tcp_output.c
672   tcp/tcp_syn_filter4.c
673 )
674
675 list(APPEND VNET_HEADERS
676   tcp/tcp_packet.h
677   tcp/tcp_timer.h
678   tcp/tcp_bt.h
679   tcp/tcp_cc.h
680   tcp/tcp_debug.h
681   tcp/tcp_inlines.h
682   tcp/tcp_sack.h
683   tcp/tcp_types.h
684   tcp/tcp.h
685   tcp/tcp_error.def
686 )
687
688 list(APPEND VNET_API_FILES tcp/tcp.api)
689
690 ##############################################################################
691 # Layer 4 protocol: udp
692 ##############################################################################
693 list(APPEND VNET_SOURCES
694   udp/udp.c
695   udp/udp_cli.c
696   udp/udp_input.c
697   udp/udp_format.c
698   udp/udp_local.c
699   udp/udp_pg.c
700   udp/udp_encap_node.c
701   udp/udp_encap.c
702   udp/udp_api.c
703 )
704
705 list(APPEND VNET_MULTIARCH_SOURCES
706   udp/udp_local.c
707   udp/udp_encap_node.c
708 )
709
710 list(APPEND VNET_HEADERS
711   udp/udp_error.def
712   udp/udp.h
713   udp/udp_packet.h
714 )
715
716 list(APPEND VNET_API_FILES udp/udp.api)
717
718 ##############################################################################
719 # Tunnel protocol: gre
720 ##############################################################################
721 list(APPEND VNET_SOURCES
722   gre/gre.c
723   gre/node.c
724   gre/interface.c
725   gre/pg.c
726   gre/gre_api.c
727 )
728
729 list(APPEND VNET_MULTIARCH_SOURCES
730   gre/node.c
731   gre/gre.c
732 )
733
734 list(APPEND VNET_HEADERS
735   gre/gre.h
736   gre/packet.h
737   gre/error.def
738 )
739
740 list(APPEND VNET_API_FILES gre/gre.api)
741
742 ##############################################################################
743 # Tunnel protocol: ipip
744 ##############################################################################
745 list(APPEND VNET_SOURCES
746   ipip/ipip.c
747   ipip/node.c
748   ipip/sixrd.c
749   ipip/ipip_api.c
750   ipip/ipip_cli.c
751 )
752
753 list(APPEND VNET_MULTIARCH_SOURCES
754   ipip/node.c
755 )
756
757 list(APPEND VNET_HEADERS
758   ipip/ipip.h
759 )
760
761 list(APPEND VNET_API_FILES
762   ipip/ipip.api
763 )
764
765 ##############################################################################
766 # Tunnel infra
767 ##############################################################################
768 list(APPEND VNET_SOURCES
769   tunnel/tunnel.c
770   tunnel/tunnel_types_api.c
771 )
772
773 list(APPEND VNET_API_FILES
774   tunnel/tunnel_types.api
775 )
776
777 list(APPEND VNET_HEADERS
778   tunnel/tunnel.h
779   tunnel/tunnel_dp.h
780 )
781
782 ##############################################################################
783 # Tunnel protocol: l2tpv3
784 ##############################################################################
785 list(APPEND VNET_SOURCES
786   l2tp/l2tp.c
787   l2tp/encap.c
788   l2tp/decap.c
789   l2tp/pg.c
790   l2tp/l2tp_api.c
791 )
792
793 list(APPEND VNET_MULTIARCH_SOURCES
794   l2tp/encap.c
795   l2tp/decap.c
796 )
797
798 list(APPEND VNET_HEADERS
799   l2tp/l2tp.h
800   l2tp/packet.h
801 )
802
803 list(APPEND VNET_API_FILES l2tp/l2tp.api)
804
805 ##############################################################################
806 # Tunnel protocol: gre+mpls
807 ##############################################################################
808 list(APPEND VNET_SOURCES
809   mpls/mpls.c
810   mpls/mpls_lookup.c
811   mpls/mpls_output.c
812   mpls/mpls_features.c
813   mpls/mpls_input.c
814   mpls/interface.c
815   mpls/mpls_tunnel.c
816   mpls/pg.c
817   mpls/mpls_api.c
818 )
819
820 list(APPEND VNET_MULTIARCH_SOURCES
821   mpls/mpls_output.c
822   mpls/mpls_input.c
823   mpls/mpls_lookup.c
824   mpls/mpls_features.c
825 )
826
827 list(APPEND VNET_HEADERS
828   mpls/mpls.h
829   mpls/mpls_types.h
830   mpls/mpls_tunnel.h
831   mpls/packet.h
832   mpls/error.def
833 )
834
835 list(APPEND VNET_API_FILES mpls/mpls.api)
836
837 ##############################################################################
838 # Tunnel protocol: vxlan-gbp
839 ##############################################################################
840 list(APPEND VNET_SOURCES
841   vxlan-gbp/decap.c
842   vxlan-gbp/encap.c
843   vxlan-gbp/vxlan_gbp_api.c
844   vxlan-gbp/vxlan_gbp.c
845   vxlan-gbp/vxlan_gbp_packet.c
846 )
847
848 list (APPEND VNET_MULTIARCH_SOURCES
849   vxlan-gbp/decap.c
850   vxlan-gbp/encap.c
851 )
852
853 list(APPEND VNET_HEADERS
854   vxlan-gbp/vxlan_gbp.h
855   vxlan-gbp/vxlan_gbp_packet.h
856   vxlan-gbp/vxlan_gbp_error.def
857 )
858
859 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
860
861 ##############################################################################
862 # Tunnel protocol: vxlan-gpe
863 ##############################################################################
864
865 list(APPEND VNET_SOURCES
866   vxlan-gpe/vxlan_gpe.c
867   vxlan-gpe/encap.c
868   vxlan-gpe/decap.c
869   vxlan-gpe/vxlan_gpe_api.c
870 )
871
872 list (APPEND VNET_MULTIARCH_SOURCES
873   vxlan-gpe/decap.c
874 )
875
876 list(APPEND VNET_HEADERS
877   vxlan-gpe/vxlan_gpe.h
878   vxlan-gpe/vxlan_gpe_packet.h
879   vxlan-gpe/vxlan_gpe_error.def
880 )
881
882 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
883
884 ##############################################################################
885 # LISP control plane: lisp-cp
886 ##############################################################################
887
888 list(APPEND VNET_SOURCES
889   lisp-cp/lisp_types.c
890   lisp-cp/lisp_cp_dpo.c
891   lisp-cp/control.c
892   lisp-cp/gid_dictionary.c
893   lisp-cp/lisp_msg_serdes.c
894   lisp-cp/packets.c
895   lisp-cp/one_cli.c
896   lisp-cp/lisp_cli.c
897   lisp-cp/one_api.c
898   lisp-cp/lisp_api.c
899   lisp-cp/lisp_types_api.c
900 )
901
902 list(APPEND VNET_HEADERS
903   lisp-cp/lisp_types.h
904   lisp-cp/packets.h
905   lisp-cp/gid_dictionary.h
906   lisp-cp/lisp_cp_messages.h
907   lisp-cp/lisp_msg_serdes.h
908   lisp-cp/control.h
909   lisp-cp/lisp_types_api.h
910 )
911
912 list(APPEND VNET_API_FILES lisp-cp/lisp_types.api)
913 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
914 list(APPEND VNET_API_FILES lisp-cp/one.api)
915
916 ##############################################################################
917 # Tunnel protocol: lisp-gpe
918 ##############################################################################
919
920 list(APPEND VNET_SOURCES
921   lisp-gpe/lisp_gpe.c
922   lisp-gpe/lisp_gpe_sub_interface.c
923   lisp-gpe/lisp_gpe_adjacency.c
924   lisp-gpe/lisp_gpe_tunnel.c
925   lisp-gpe/lisp_gpe_fwd_entry.c
926   lisp-gpe/lisp_gpe_tenant.c
927   lisp-gpe/interface.c
928   lisp-gpe/decap.c
929   lisp-gpe/lisp_gpe_api.c
930 )
931
932 list(APPEND VNET_HEADERS
933   lisp-gpe/lisp_gpe.h
934   lisp-gpe/lisp_gpe_fwd_entry.h
935   lisp-gpe/lisp_gpe_tenant.h
936   lisp-gpe/lisp_gpe_packet.h
937   lisp-gpe/lisp_gpe_error.def
938 )
939
940 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
941
942 ##############################################################################
943 # ipv6 segment routing
944 ##############################################################################
945
946 list(APPEND VNET_SOURCES
947   srv6/sr.c
948   srv6/sr_localsid.c
949   srv6/sr_policy_rewrite.c
950   srv6/sr_steering.c
951   srv6/sr_api.c
952 )
953
954 list(APPEND VNET_HEADERS
955   srv6/sr_packet.h
956   srv6/sr.h
957 )
958
959 list(APPEND VNET_API_FILES
960   srv6/sr.api
961   srv6/sr_types.api
962 )
963
964 ##############################################################################
965 # mpls segment routing
966 ##############################################################################
967
968 list(APPEND VNET_SOURCES
969   srmpls/sr_mpls_policy.c
970   srmpls/sr_mpls_steering.c
971   srmpls/sr_mpls_api.c
972 )
973
974 list(APPEND VNET_HEADERS
975   srmpls/sr_mpls.h
976 )
977
978 list(APPEND VNET_API_FILES
979   srmpls/sr_mpls.api
980   srv6/sr_types.api
981 )
982
983 ##############################################################################
984 # IPFIX / netflow v10
985 ##############################################################################
986 list(APPEND VNET_SOURCES
987   ipfix-export/flow_report.c
988   ipfix-export/flow_api.c
989 )
990
991 list(APPEND VNET_HEADERS
992   ipfix-export/flow_report.h
993   ipfix-export/ipfix_info_elements.h
994   ipfix-export/ipfix_packet.h
995 )
996
997 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
998
999 ##############################################################################
1000 # GSO
1001 ##############################################################################
1002 list(APPEND VNET_SOURCES
1003   gso/cli.c
1004   gso/gso.c
1005   gso/gso_api.c
1006   gso/node.c
1007 )
1008
1009 list(APPEND VNET_HEADERS
1010   gso/gro.h
1011   gso/gro_func.h
1012   gso/hdr_offset_parser.h
1013   gso/gso.h
1014 )
1015
1016 list(APPEND VNET_API_FILES
1017   gso/gso.api
1018 )
1019
1020 ##############################################################################
1021 # IPFIX classify code
1022 ##############################################################################
1023
1024 list(APPEND VNET_SOURCES
1025   ipfix-export/flow_report_classify.c
1026 )
1027
1028 list(APPEND VNET_HEADERS
1029   ipfix-export/flow_report_classify.h
1030 )
1031
1032 ##############################################################################
1033 # lawful intercept
1034 ##############################################################################
1035
1036 list(APPEND VNET_SOURCES
1037   lawful-intercept/lawful_intercept.c
1038   lawful-intercept/node.c
1039 )
1040
1041 list(APPEND VNET_MULTIARCH_SOURCES
1042   lawful-intercept/node.c
1043 )
1044
1045 list(APPEND VNET_HEADERS
1046   lawful-intercept/lawful_intercept.h
1047 )
1048
1049 ##############################################################################
1050 # SPAN (port mirroring)
1051 ##############################################################################
1052
1053 list(APPEND VNET_SOURCES
1054   span/span_api.c
1055   span/span.c
1056   span/node.c
1057 )
1058
1059 list(APPEND VNET_MULTIARCH_SOURCES
1060   span/node.c
1061 )
1062
1063 list(APPEND VNET_HEADERS
1064   span/span.h
1065 )
1066
1067 list(APPEND VNET_API_FILES span/span.api)
1068
1069 ##############################################################################
1070 # Packet generator
1071 ##############################################################################
1072
1073 list(APPEND VNET_SOURCES
1074   pg/cli.c
1075   pg/edit.c
1076   pg/init.c
1077   pg/input.c
1078   pg/output.c
1079   pg/stream.c
1080   pg/pg_api.c
1081 )
1082
1083 list(APPEND VNET_HEADERS
1084   pg/pg.h
1085   pg/edit.h
1086 )
1087
1088 list(APPEND VNET_API_FILES pg/pg.api)
1089
1090 ##############################################################################
1091 # virtio
1092 ##############################################################################
1093
1094 list(APPEND VNET_SOURCES
1095   devices/virtio/cli.c
1096   devices/virtio/device.c
1097   devices/virtio/format.c
1098   devices/virtio/node.c
1099   devices/virtio/pci.c
1100   devices/virtio/vhost_user.c
1101   devices/virtio/vhost_user_input.c
1102   devices/virtio/vhost_user_output.c
1103   devices/virtio/vhost_user_api.c
1104   devices/virtio/virtio.c
1105   devices/virtio/virtio_api.c
1106   devices/virtio/virtio_pci_legacy.c
1107   devices/virtio/virtio_pci_modern.c
1108   devices/virtio/virtio_types_api.c
1109 )
1110
1111 list(APPEND VNET_HEADERS
1112   devices/virtio/pci.h
1113   devices/virtio/virtio.h
1114   devices/virtio/virtio_std.h
1115   devices/virtio/virtio_pci_legacy.h
1116   devices/virtio/virtio_pci_modern.h
1117   devices/virtio/vhost_std.h
1118   devices/virtio/vhost_user.h
1119   devices/virtio/virtio_types_api.h
1120 )
1121
1122 list(APPEND VNET_MULTIARCH_SOURCES
1123   devices/virtio/vhost_user_input.c
1124   devices/virtio/vhost_user_output.c
1125   devices/virtio/node.c
1126   devices/af_packet/node.c
1127   devices/virtio/device.c
1128 )
1129
1130 list(APPEND VNET_API_FILES
1131   devices/virtio/vhost_user.api
1132   devices/virtio/virtio.api
1133   devices/virtio/virtio_types.api
1134 )
1135
1136 ##############################################################################
1137 # tap interface (with virtio backend)
1138 ##############################################################################
1139
1140 list(APPEND VNET_SOURCES
1141   devices/tap/cli.c
1142   devices/tap/tap.c
1143   devices/tap/tapv2_api.c
1144 )
1145
1146 list(APPEND VNET_HEADERS
1147   devices/tap/tap.h
1148 )
1149
1150 list(APPEND VNET_API_FILES
1151   devices/tap/tapv2.api
1152 )
1153
1154 ##############################################################################
1155 # tap interface (with virtio backend)
1156 ##############################################################################
1157
1158 list(APPEND VNET_SOURCES
1159   devices/pipe/pipe_api.c
1160   devices/pipe/pipe.c
1161 )
1162
1163 list(APPEND VNET_HEADERS
1164   devices/pipe/pipe.h
1165 )
1166
1167 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1168
1169 ##############################################################################
1170 # session managmeent
1171 ##############################################################################
1172
1173 list(APPEND VNET_SOURCES
1174   session/session.c
1175   session/session_debug.c
1176   session/session_table.c
1177   session/session_rules_table.c
1178   session/session_lookup.c
1179   session/session_node.c
1180   session/transport.c
1181   session/application.c
1182   session/application_worker.c
1183   session/session_cli.c
1184   session/application_interface.c
1185   session/application_local.c
1186   session/application_namespace.c
1187   session/segment_manager.c
1188   session/session_api.c
1189 )
1190
1191 list(APPEND VNET_HEADERS
1192   session/session.h
1193   session/session_table.h
1194   session/session_rules_table.h
1195   session/session_types.h
1196   session/session_lookup.h
1197   session/application.h
1198   session/transport.h
1199   session/transport_types.h
1200   session/application_interface.h
1201   session/application_local.h
1202   session/application_namespace.h
1203   session/session_debug.h
1204   session/segment_manager.h
1205   session/mma_template.h
1206   session/mma_template.c
1207   session/mma_16.h
1208   session/mma_40.h
1209 )
1210
1211 list(APPEND VNET_API_FILES session/session.api)
1212
1213 ##############################################################################
1214 # TLS protocol
1215 ##############################################################################
1216
1217 list(APPEND VNET_SOURCES
1218   tls/tls.c
1219 )
1220
1221 list(APPEND VNET_HEADERS
1222   tls/tls.h
1223   tls/tls_test.h
1224 )
1225
1226 ##############################################################################
1227 # Linux packet interface
1228 ##############################################################################
1229
1230 list(APPEND VNET_SOURCES
1231   devices/af_packet/af_packet.c
1232   devices/af_packet/device.c
1233   devices/af_packet/node.c
1234   devices/af_packet/cli.c
1235   devices/af_packet/af_packet_api.c
1236 )
1237
1238 list(APPEND VNET_MULTIARCH_SOURCES
1239   devices/af_packet/device.c
1240 )
1241
1242 list(APPEND VNET_HEADERS
1243   devices/af_packet/af_packet.h
1244 )
1245
1246 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1247
1248 ##############################################################################
1249 # Driver feature graph arc support
1250 ##############################################################################
1251
1252 list(APPEND VNET_SOURCES
1253   feature/feature.c
1254   feature/feature_api.c
1255   feature/registration.c
1256 )
1257
1258 list(APPEND VNET_HEADERS
1259   feature/feature.h
1260 )
1261
1262 list(APPEND VNET_API_FILES feature/feature.api)
1263
1264 ##############################################################################
1265 # Unix kernel related
1266 ##############################################################################
1267
1268 # FIXME: unix/hgshm.c
1269
1270 list(APPEND VNET_SOURCES
1271   unix/gdb_funcs.c
1272   unix/tuntap.c
1273 )
1274
1275 list(APPEND VNET_HEADERS
1276   unix/tuntap.h
1277 )
1278
1279 ##############################################################################
1280 # FIB
1281 ##############################################################################
1282
1283 list(APPEND VNET_SOURCES
1284   fib/fib.c
1285   fib/ip4_fib.c
1286   fib/ip6_fib.c
1287   fib/mpls_fib.c
1288   fib/fib_table.c
1289   fib/fib_walk.c
1290   fib/fib_types.c
1291   fib/fib_node.c
1292   fib/fib_node_list.c
1293   fib/fib_entry.c
1294   fib/fib_entry_src.c
1295   fib/fib_entry_src_adj.c
1296   fib/fib_entry_src_api.c
1297   fib/fib_entry_src_drop.c
1298   fib/fib_entry_src_interface.c
1299   fib/fib_entry_src_interpose.c
1300   fib/fib_entry_src_lisp.c
1301   fib/fib_entry_src_mpls.c
1302   fib/fib_entry_src_simple.c
1303   fib/fib_entry_src_rr.c
1304   fib/fib_entry_cover.c
1305   fib/fib_entry_delegate.c
1306   fib/fib_entry_track.c
1307   fib/fib_path_list.c
1308   fib/fib_path.c
1309   fib/fib_path_ext.c
1310   fib/fib_source.c
1311   fib/fib_urpf_list.c
1312   fib/fib_attached_export.c
1313   fib/fib_api.c
1314   fib/fib_bfd.c
1315 )
1316
1317 list(APPEND VNET_HEADERS
1318   fib/fib.h
1319   fib/fib_api.h
1320   fib/ip4_fib.h
1321   fib/ip6_fib.h
1322   fib/fib_types.h
1323   fib/fib_table.h
1324   fib/fib_node.h
1325   fib/fib_node_list.h
1326   fib/fib_entry.h
1327   fib/fib_entry_delegate.h
1328   fib/fib_source.h
1329 )
1330
1331 list(APPEND VNET_API_FILES fib/fib_types.api)
1332
1333 ##############################################################################
1334 # ADJ
1335 ##############################################################################
1336
1337 list(APPEND VNET_SOURCES
1338   adj/adj_nbr.c
1339   adj/adj_glean.c
1340   adj/adj_midchain.c
1341   adj/adj_midchain_delegate.c
1342   adj/adj_mcast.c
1343   adj/adj_l2.c
1344   adj/adj_nsh.c
1345   adj/adj.c
1346   adj/rewrite.c
1347   adj/adj_bfd.c
1348   adj/adj_delegate.c
1349 )
1350
1351 list(APPEND VNET_MULTIARCH_SOURCES
1352   adj/adj_nsh.c
1353   adj/adj_l2.c
1354   adj/adj_midchain.c
1355 )
1356
1357 list(APPEND VNET_HEADERS
1358   adj/adj.h
1359   adj/adj_types.h
1360   adj/adj_glean.h
1361   adj/adj_nsh.h
1362   adj/adj_nbr.h
1363   adj/adj_midchain.h
1364   adj/rewrite.h
1365 )
1366
1367 ##############################################################################
1368 # Data-Plane Objects
1369 ##############################################################################
1370
1371 list(APPEND VNET_SOURCES
1372   dpo/dpo.c
1373   dpo/drop_dpo.c
1374   dpo/ip_null_dpo.c
1375   dpo/ip6_ll_dpo.c
1376   dpo/punt_dpo.c
1377   dpo/receive_dpo.c
1378   dpo/load_balance.c
1379   dpo/load_balance_map.c
1380   dpo/lookup_dpo.c
1381   dpo/classify_dpo.c
1382   dpo/replicate_dpo.c
1383   dpo/interface_rx_dpo.c
1384   dpo/interface_tx_dpo.c
1385   dpo/mpls_disposition.c
1386   dpo/mpls_label_dpo.c
1387   dpo/l3_proxy_dpo.c
1388   dpo/dvr_dpo.c
1389   dpo/pw_cw.c
1390 )
1391
1392 list(APPEND VNET_MULTIARCH_SOURCES
1393   dpo/lookup_dpo.h
1394   dpo/mpls_disposition.c
1395   dpo/dvr_dpo.c
1396   dpo/mpls_label_dpo.c
1397   dpo/interface_rx_dpo.c
1398 )
1399
1400 list(APPEND VNET_HEADERS
1401   dpo/load_balance.h
1402   dpo/drop_dpo.h
1403   dpo/lookup_dpo.h
1404   dpo/punt_dpo.h
1405   dpo/classify_dpo.h
1406   dpo/receive_dpo.h
1407   dpo/ip_null_dpo.h
1408   dpo/replicate_dpo.h
1409   dpo/dpo.h
1410 )
1411
1412 ##############################################################################
1413 # Multicast FIB
1414 ##############################################################################
1415
1416 list(APPEND VNET_SOURCES
1417   mfib/mfib_forward.c
1418   mfib/ip4_mfib.c
1419   mfib/ip6_mfib.c
1420   mfib/mfib_api.c
1421   mfib/mfib_types.c
1422   mfib/mfib_signal.c
1423   mfib/mfib_itf.c
1424   mfib/mfib_entry.c
1425   mfib/mfib_entry.c
1426   mfib/mfib_entry_cover.c
1427   mfib/mfib_entry_delegate.c
1428   mfib/mfib_entry_src.c
1429   mfib/mfib_entry_src_rr.c
1430   mfib/mfib_table.c
1431 )
1432
1433 list(APPEND VNET_MULTIARCH_SOURCES
1434   mfib/mfib_forward.c
1435 )
1436
1437 list(APPEND VNET_HEADERS
1438   mfib/ip4_mfib.h
1439   mfib/mfib_types.h
1440   mfib/mfib_table.h
1441 )
1442
1443 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1444
1445 ##############################################################################
1446 # Utilities
1447 ##############################################################################
1448
1449 list(APPEND VNET_SOURCES
1450   util/radix.c
1451   util/refcount.c
1452   util/throttle.c
1453   util/trajectory.c
1454 )
1455
1456 list(APPEND VNET_HEADERS
1457   util/throttle.h
1458 )
1459
1460 ##############################################################################
1461 # QoS
1462 ##############################################################################
1463
1464 list(APPEND VNET_SOURCES
1465   qos/qos_types.c
1466   qos/qos_api.c
1467   qos/qos_egress_map.c
1468   qos/qos_record.c
1469   qos/qos_record_node.c
1470   qos/qos_store.c
1471   qos/qos_store_node.c
1472   qos/qos_mark.c
1473   qos/qos_mark_node.c
1474 )
1475
1476 list(APPEND VNET_MULTIARCH_SOURCES
1477   qos/qos_record_node.c
1478   qos/qos_mark_node.c
1479 )
1480
1481 list(APPEND VNET_API_FILES qos/qos.api)
1482
1483 ##############################################################################
1484 # BIER
1485 ##############################################################################
1486
1487 list(APPEND VNET_SOURCES
1488   bier/bier_bit_string.c
1489   bier/bier_entry.c
1490   bier/bier_fmask.c
1491   bier/bier_fmask_db.c
1492   bier/bier_input.c
1493   bier/bier_lookup.c
1494   bier/bier_output.c
1495   bier/bier_table.c
1496   bier/bier_types.c
1497   bier/bier_api.c
1498   bier/bier_drop.c
1499   bier/bier_update.c
1500   bier/bier_imp_node.c
1501   bier/bier_imp.c
1502   bier/bier_disp_entry.c
1503   bier/bier_disp_lookup_node.c
1504   bier/bier_disp_dispatch_node.c
1505   bier/bier_disp_table.c
1506   bier/bier_bift_table.c
1507 )
1508
1509 list(APPEND VNET_MULTIARCH_SOURCES
1510   bier/bier_disp_dispatch_node.c
1511   bier/bier_disp_lookup_node.c
1512   bier/bier_imp_node.c
1513 )
1514
1515 list(APPEND VNET_HEADERS
1516   bier/bier_types.h
1517   bier/bier_entry.h
1518   bier/bier_update.h
1519   bier/bier_table.h
1520 )
1521
1522 list(APPEND VNET_API_FILES bier/bier.api)
1523
1524 ##############################################################################
1525 # SYSLOG
1526 ##############################################################################
1527
1528 list (APPEND VNET_SOURCES
1529   syslog/syslog_api.c
1530   syslog/syslog_udp.c
1531   syslog/syslog.c
1532 )
1533
1534 list(APPEND VNET_HEADERS
1535   syslog/syslog_udp.h
1536   syslog/syslog.h
1537 )
1538
1539 list(APPEND VNET_API_FILES syslog/syslog.api)
1540
1541 ##############################################################################
1542 # Tunnel Endpoint Information Base
1543 ##############################################################################
1544
1545 list (APPEND VNET_SOURCES
1546   teib/teib_api.c
1547   teib/teib_cli.c
1548   teib/teib.c
1549 )
1550
1551 list(APPEND VNET_HEADERS
1552   teib/teib.h
1553 )
1554
1555 list(APPEND VNET_API_FILES teib/teib.api)
1556
1557 ##############################################################################
1558 # ARP/ND
1559 ##############################################################################
1560
1561 list (APPEND VNET_SOURCES
1562   arp/arp_api.c
1563   arp/arp.c
1564   arp/arp_proxy.c
1565 )
1566
1567 list(APPEND VNET_HEADERS
1568   arp/arp.h
1569 )
1570
1571 list(APPEND VNET_API_FILES arp/arp.api)
1572
1573 list (APPEND VNET_SOURCES
1574   ip6-nd/ip6_mld.c
1575   ip6-nd/ip6_nd.c
1576   ip6-nd/ip6_nd_api.c
1577   ip6-nd/ip6_nd_proxy.c
1578   ip6-nd/ip6_ra.c
1579   ip6-nd/rd_cp.c
1580   ip6-nd/rd_cp_api.c
1581 )
1582
1583 list(APPEND VNET_HEADERS
1584   ip6-nd/ip6_nd.h
1585 )
1586
1587 list(APPEND VNET_API_FILES
1588   ip6-nd/ip6_nd.api
1589   ip6-nd/rd_cp.api
1590 )
1591
1592 ##############################################################################
1593 # VNET Library
1594 ##############################################################################
1595
1596 add_vpp_library(vnet
1597   SOURCES ${VNET_SOURCES}
1598   MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1599   INSTALL_HEADERS ${VNET_HEADERS}
1600   API_FILES ${VNET_API_FILES}
1601   LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1602   DEPENDS vpp_version_h api_headers
1603 )
1604
1605 ##############################################################################
1606 # vpp api test client library
1607 ##############################################################################
1608
1609 add_vpp_library (vatclient
1610   SOURCES ip/ip_types_api.c
1611   DEPENDS api_headers
1612 )
1613
1614 ##############################################################################