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