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