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