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