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