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