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