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