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