summaryrefslogtreecommitdiffstats
path: root/src/svm
AgeCommit message (Expand)AuthorFilesLines
2019-05-21svm_queue_timedwait_inline: lock after waitVratko Polak1-1/+1
2019-05-20consolidate all mutux opertionPing Yu1-17/+17
2019-05-14svm: improve fifo segment prealloc supportFlorin Coras3-196/+349
2019-05-09session: segment manager fixesFlorin Coras2-17/+3
2019-05-07svm: decouple fifo and default chunk allocationFlorin Coras4-135/+149
2019-05-03session/svm: apis for fifo shrinkingFlorin Coras3-1/+42
2019-05-03svm: basic support for fifo shrinkingFlorin Coras2-78/+263
2019-05-03svm: store normalized head/tail for fifoFlorin Coras2-51/+41
2019-05-01svm: remove dead code triggering overflowBenoƮt Ganne1-26/+0
2019-04-30svm: more fifo refactor/cleanupFlorin Coras2-600/+846
2019-04-27svm: fix fifo tail/head/ooo logic for u32 wrapFlorin Coras2-4/+4
2019-04-26svm: fifo segment support for chunk allocationFlorin Coras4-17/+217
2019-04-25session: cleanup segment manager and fifo segmentFlorin Coras6-502/+477
2019-04-24svm: fifo ooo reads/writes with multiple chunksFlorin Coras3-56/+174
2019-04-24svm: move mq test to ut pluginFlorin Coras1-177/+0
2019-04-24svm: move fifo tests to ut pluginFlorin Coras1-362/+0
2019-04-20svm: reorganize fifo march codeFlorin Coras2-239/+185
2019-04-19svm: support addition of chunks to fifosFlorin Coras3-12/+86
2019-04-18svm: allow indirect fifo data chunksFlorin Coras3-165/+167
2019-04-16svm_fifo rework to avoid contention on cursizeSirshak Das3-244/+393
2019-04-08host stack: update stale copyrightFlorin Coras12-12/+12
2019-04-03session: allow more fifos in preallocated segmentsFlorin Coras1-4/+0
2019-03-22svm/atomics: add clib_atomic_swap_rel_nFlorin Coras1-2/+2
2019-03-21session/fifo: make event unset atomicFlorin Coras1-2/+2
2019-03-12svm mq: add unit testFlorin Coras1-3/+0
2019-03-04svm: avoid heap push/pop on fifo freeFlorin Coras1-3/+0
2019-02-21svm: fix mem ordering for enqueue nocopyFlorin Coras1-1/+1
2019-01-29vls: multi-process and multi-threaded apps improvementsFlorin Coras1-1/+1
2019-01-17vcl/session: replicate events for shared sessionsFlorin Coras2-7/+43
2019-01-10session/vcl: improve fifo tx notificationsFlorin Coras1-30/+80
2019-01-02Fixes for buliding for 32bit targets:David Johnson6-13/+21
2018-12-03svm: use explicit svm fifo segment main for slavesFlorin Coras3-41/+49
2018-11-30session: segment handle in accept/connect notificationsFlorin Coras3-2/+5
2018-11-28Use acquire/release ordering when accessing svm_fifo shared variable cursizeSirshak Das2-8/+8
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach2-24/+25
2018-10-25session/tcp: improve cliFlorin Coras1-10/+15
2018-10-25pmalloc: support for 4K pagesDamjan Marion1-2/+2
2018-10-23c11 safe string handling supportDave Barach10-47/+48
2018-10-19vppinfra: add atomic macros for __sync builtinsSirshak Das4-11/+11
2018-10-16Fix coverity issue for potentially overflowing of page sizeHaiyang Tan1-1/+1
2018-10-05session: fix local session tagging and cleanupFlorin Coras3-2/+6
2018-09-25tcp: add option to cfg max rx fifo sizeFlorin Coras1-1/+1
2018-09-24svm: march svm_fifo take 2Florin Coras1-71/+17
2018-09-20session/svm: add want_tx_event flag to fifoFlorin Coras1-0/+13
2018-09-18svm: better march support for svm fifoFlorin Coras2-96/+87
2018-09-12vcl: add apis that expos fifo as bufferFlorin Coras2-2/+57
2018-09-12vcl: improve read and fifo event handlingFlorin Coras2-5/+9
2018-09-06vcl/session/svm: fix coverity warningsFlorin Coras1-1/+1
2018-08-2832/64 shmem bihash interoperabilityDave Barach1-1/+1
2018-08-26cmake: add add_vpp_library and add_vpp_executable macrosDamjan Marion1-24/+21
Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright (c) 2015 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

AUTOMAKE_OPTIONS = foreign subdir-objects

AM_CFLAGS = -Wall -Werror @DPDK@ @IPSEC@ @IPV6SR@

libvnet_la_SOURCES =
libvnetplugin_la_SOURCES =
nobase_include_HEADERS =
noinst_PROGRAMS =
TESTS =

dpdk_libs =
if WITH_DPDK
dpdk_libs += -l:libdpdk.a
endif

########################################
# Generic stuff
########################################
libvnet_la_SOURCES +=					\
  vnet/config.c						\
  vnet/handoff.c					\
  vnet/interface.c					\
  vnet/interface_cli.c					\
  vnet/interface_format.c				\
  vnet/interface_output.c				\
  vnet/misc.c						\
  vnet/replication.c                                    \
  vnet/rewrite.c				

nobase_include_HEADERS +=			\
  vnet/api_errno.h				\
  vnet/buffer.h					\
  vnet/config.h					\
  vnet/global_funcs.h				\
  vnet/handoff.h				\
  vnet/interface.h				\
  vnet/interface_funcs.h			\
  vnet/l3_types.h				\
  vnet/pipeline.h				\
  vnet/replication.h				\
  vnet/rewrite.h				\
  vnet/vnet.h

########################################
# Policer infra
########################################

libvnet_la_SOURCES +=				\
  vnet/policer/node_funcs.c			\
  vnet/policer/policer.c			\
  vnet/policer/xlate.c

nobase_include_HEADERS +=			\
  vnet/policer/police.h				\
  vnet/policer/policer.h			\
  vnet/policer/fix_types.h			\
  vnet/policer/xlate.h

########################################
# Cop - junk filter
########################################

libvnet_la_SOURCES +=				\
  vnet/cop/cop.c				\
  vnet/cop/node1.c				\
  vnet/cop/ip4_whitelist.c			\
  vnet/cop/ip6_whitelist.c	

nobase_include_HEADERS +=			\
  vnet/cop/cop.h

########################################
# Layer 2 protocols go here
########################################

########################################
# Layer 2 protocol: Ethernet
########################################
libvnet_la_SOURCES +=				\
 vnet/ethernet/arp.c				\
 vnet/ethernet/format.c				\
 vnet/ethernet/init.c				\
 vnet/ethernet/interface.c			\
 vnet/ethernet/node.c				\
 vnet/ethernet/pg.c

nobase_include_HEADERS +=			\
 vnet/ethernet/arp_packet.h			\
 vnet/ethernet/error.def			\
 vnet/ethernet/ethernet.h			\
 vnet/ethernet/packet.h				\
 vnet/ethernet/types.def

########################################
# Layer 2 protocol: Ethernet bridging
########################################
libvnet_la_SOURCES +=				\
 vnet/l2/feat_bitmap.c				\
 vnet/l2/l2_bd.c				\
 vnet/l2/l2_bvi.c				\
 vnet/l2/l2_input_classify.c			\
 vnet/l2/l2_output_classify.c			\
 vnet/l2/l2_efp_filter.c			\
 vnet/l2/l2_fib.c				\
 vnet/l2/l2_flood.c				\
 vnet/l2/l2_fwd.c				\
 vnet/l2/l2_input_acl.c				\
 vnet/l2/l2_input.c				\
 vnet/l2/l2_input_vtr.c				\
 vnet/l2/l2_learn.c				\
 vnet/l2/l2_output_acl.c			\
 vnet/l2/l2_output.c				\
 vnet/l2/l2_patch.c				\
 vnet/l2/l2_rw.c                                \
 vnet/l2/l2_vtr.c				\
 vnet/l2/l2_xcrw.c

nobase_include_HEADERS +=			\
 vnet/l2/feat_bitmap.h				\
 vnet/l2/l2_input.h				\
 vnet/l2/l2_output.h				\
 vnet/l2/l2_vtr.h				\
 vnet/l2/l2_input_vtr.h				\
 vnet/l2/l2_efp_filter.h			\
 vnet/l2/l2_fwd.h				\
 vnet/l2/l2_bd.h				\
 vnet/l2/l2_bvi.h				\
 vnet/l2/l2_flood.h				\
 vnet/l2/l2_fib.h				\
 vnet/l2/l2_rw.h                                \
 vnet/l2/l2_xcrw.h				\
 vnet/l2/l2_classify.h

########################################
# Layer 2 protocol: SRP
########################################
libvnet_la_SOURCES +=				\
 vnet/srp/format.c				\
 vnet/srp/interface.c				\
 vnet/srp/node.c				\
 vnet/srp/pg.c

nobase_include_HEADERS +=			\
 vnet/srp/packet.h				\
 vnet/srp/srp.h

########################################
# Layer 2 protocol: PPP
########################################
libvnet_la_SOURCES +=				\
  vnet/ppp/node.c				\
  vnet/ppp/pg.c					\
  vnet/ppp/ppp.c

nobase_include_HEADERS +=			\
 vnet/ppp/error.def				\
 vnet/ppp/ppp.h					\
 vnet/ppp/packet.h

########################################
# Layer 2 protocol: HDLC
########################################
libvnet_la_SOURCES +=				\
  vnet/hdlc/node.c				\
  vnet/hdlc/pg.c				\
  vnet/hdlc/hdlc.c

nobase_include_HEADERS +=			\
 vnet/hdlc/error.def				\
 vnet/hdlc/hdlc.h				\
 vnet/hdlc/packet.h

########################################
# Layer 2 protocol: LLC
########################################
libvnet_la_SOURCES +=				\
  vnet/llc/llc.c				\
  vnet/llc/node.c				\
  vnet/llc/pg.c

nobase_include_HEADERS +=			\
 vnet/llc/llc.h

########################################
# Layer 2 protocol: SNAP
########################################
libvnet_la_SOURCES +=				\
  vnet/snap/snap.c				\
  vnet/snap/node.c				\
  vnet/snap/pg.c

nobase_include_HEADERS +=			\
 vnet/snap/snap.h

########################################
# Layer 2 / vxlan
########################################
libvnet_la_SOURCES +=				\
  vnet/vxlan/vxlan.c				\
  vnet/vxlan/encap.c				\
  vnet/vxlan/decap.c	

nobase_include_HEADERS +=			\
  vnet/vxlan/vxlan.h				\
  vnet/vxlan/vxlan_packet.h         		\
  vnet/vxlan/vxlan_error.def

########################################
# Layer 2 / CDP
########################################
libvnet_la_SOURCES +=				\
  vnet/cdp/cdp_input.c				\
  vnet/cdp/cdp_node.c				\
  vnet/cdp/cdp_periodic.c	

nobase_include_HEADERS +=			\
  vnet/cdp/cdp_protocol.h

########################################
# Layer 2 / LLDP
########################################
libvnet_la_SOURCES +=				\
  vnet/lldp/lldp_input.c				\
  vnet/lldp/lldp_node.c				\
  vnet/lldp/lldp_output.c	\
  vnet/lldp/lldp_cli.c

nobase_include_HEADERS +=			\
  vnet/lldp/lldp_protocol.h

########################################
# Layer 2/3 "classify"
########################################
libvnet_la_SOURCES +=				\
  vnet/classify/vnet_classify.c			\
  vnet/classify/ip_classify.c			\
  vnet/classify/input_acl.c			\
  vnet/classify/policer_classify.c		\
  vnet/classify/flow_classify.c                 \
  vnet/classify/flow_classify_node.c            \
  vnet/classify/vnet_classify.h

nobase_include_HEADERS +=			\
  vnet/classify/vnet_classify.h	                \
  vnet/classify/input_acl.h                     \
  vnet/classify/policer_classify.h              \
  vnet/classify/flow_classify.h

########################################
# Layer 3 protocols go here
########################################

########################################
# Layer 3 protocol: IP v4/v6
########################################
libvnet_la_SOURCES +=				\
 vnet/ip/feature_registration.c			\
 vnet/ip/format.c				\
 vnet/ip/icmp4.c				\
 vnet/ip/icmp6.c				\
 vnet/ip/ip46_cli.c				\
 vnet/ip/ip4_format.c				\
 vnet/ip/ip4_forward.c				\
 vnet/ip/ip4_input.c				\
 vnet/ip/ip4_mtrie.c				\
 vnet/ip/ip4_pg.c				\
 vnet/ip/ip4_source_and_port_range_check.c	\
 vnet/ip/ip4_source_check.c			\
 vnet/ip/ip6_format.c				\
 vnet/ip/ip6_forward.c				\
 vnet/ip/ip6_hop_by_hop.c			\
 vnet/ip/ip6_input.c				\
 vnet/ip/ip6_neighbor.c				\
 vnet/ip/ip6_pg.c				\
 vnet/ip/ip_checksum.c				\
 vnet/ip/ip_frag.c				\
 vnet/ip/ip.h					\
 vnet/ip/ip_init.c				\
 vnet/ip/ip_input_acl.c				\
 vnet/ip/lookup.c				\
 vnet/ip/ping.c					\
 vnet/ip/punt.c					\
 vnet/ip/udp_format.c				\
 vnet/ip/udp_init.c				\
 vnet/ip/udp_local.c				\
 vnet/ip/udp_pg.c

nobase_include_HEADERS +=			\
 vnet/ip/feature_registration.h			\
 vnet/ip/format.h				\
 vnet/ip/icmp46_packet.h			\
 vnet/ip/icmp4.h				\
 vnet/ip/icmp6.h				\
 vnet/ip/igmp_packet.h				\
 vnet/ip/ip4_error.h				\
 vnet/ip/ip4.h					\
 vnet/ip/ip4_mtrie.h				\
 vnet/ip/ip4_packet.h				\
 vnet/ip/ip6_error.h				\
 vnet/ip/ip6.h					\
 vnet/ip/ip6_hop_by_hop.h			\
 vnet/ip/ip6_hop_by_hop_packet.h		\
 vnet/ip/ip6_packet.h				\
 vnet/ip/ip.h					\
 vnet/ip/ip_packet.h				\
 vnet/ip/ip_source_and_port_range_check.h	\
 vnet/ip/lookup.h				\
 vnet/ip/ports.def				\
 vnet/ip/protocols.def				\
 vnet/ip/punt_error.def				\
 vnet/ip/punt.h					\
 vnet/ip/tcp_packet.h				\
 vnet/ip/udp_error.def				\
 vnet/ip/udp.h					\
 vnet/ip/udp_packet.h

########################################
# Layer 3 protocol: IPSec
########################################
if WITH_IPSEC
libvnet_la_SOURCES +=       			\
 vnet/ipsec/ipsec.c				\
 vnet/ipsec/ipsec_cli.c  			\
 vnet/ipsec/ipsec_format.c			\
 vnet/ipsec/ipsec_input.c			\
 vnet/ipsec/ipsec_if.c				\
 vnet/ipsec/ipsec_if_in.c			\
 vnet/ipsec/ipsec_if_out.c			\
 vnet/ipsec/esp_encrypt.c			\
 vnet/ipsec/esp_decrypt.c			\
 vnet/ipsec/ikev2.c				\
 vnet/ipsec/ikev2_crypto.c			\
 vnet/ipsec/ikev2_cli.c				\
 vnet/ipsec/ikev2_payload.c			\
 vnet/ipsec/ikev2_format.c
endif 

libvnet_la_SOURCES +=       			\
 vnet/ipsec/ipsec_output.c

nobase_include_HEADERS +=     		        \
 vnet/ipsec/ipsec.h                             \
 vnet/ipsec/esp.h				\
 vnet/ipsec/ikev2.h                             \
 vnet/ipsec/ikev2_priv.h

########################################
# Layer 3 protocol: osi
########################################
libvnet_la_SOURCES +=				\
 vnet/osi/node.c				\
 vnet/osi/osi.c					\
 vnet/osi/pg.c

nobase_include_HEADERS +=			\
 vnet/osi/osi.h

########################################
# Layer 3 protocol: MAP
########################################
libvnet_la_SOURCES +=                           \
 vnet/map/map.c                                 \
 vnet/map/map_dpo.c                             \
 vnet/map/ip4_map.c                             \
 vnet/map/ip6_map.c                             \
 vnet/map/ip4_map_t.c                           \
 vnet/map/ip6_map_t.c

nobase_include_HEADERS +=                       \
 vnet/map/map.h                                 \
 vnet/map/map_dpo.h

if ENABLE_TESTS
TESTS += test_map
test_map_SOURCES =                             \
 vnet/map/test.c
test_map_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG

test_map_LDADD = libvnet.la -lvppinfra -lvlib	\
  -lpthread -lvlibmemory -lvlibapi -lvlib_unix	\
  -ldl -lsvm -lrt

test_map_LDFLAGS = -static
endif


########################################
# Tunnel protocol: gre
########################################
libvnet_la_SOURCES +=				\
 vnet/gre/gre.c					\
 vnet/gre/node.c				\
 vnet/gre/interface.c				\
 vnet/gre/pg.c
 
nobase_include_HEADERS +=			\
 vnet/gre/gre.h					\
 vnet/gre/packet.h				\
 vnet/gre/error.def

########################################
# Tunnel protocol: l2tpv3
########################################
libvnet_la_SOURCES +=				\
 vnet/l2tp/l2tp.c				\
 vnet/l2tp/encap.c 				\
 vnet/l2tp/decap.c  				\
 vnet/l2tp/pg.c
 
nobase_include_HEADERS +=			\
 vnet/l2tp/l2tp.h				\
 vnet/l2tp/packet.h				

########################################
# Tunnel protocol: gre+mpls
########################################
libvnet_la_SOURCES +=				\
 vnet/mpls/mpls.c				\
 vnet/mpls/mpls_lookup.c			\
 vnet/mpls/mpls_output.c			\
 vnet/mpls/mpls_features.c			\
 vnet/mpls/node.c				\
 vnet/mpls/interface.c			        \
 vnet/mpls/policy_encap.c			\
 vnet/mpls/pg.c
 
nobase_include_HEADERS +=			\
 vnet/mpls/mpls.h				\
 vnet/mpls/mpls_types.h			        \
 vnet/mpls/packet.h				\
 vnet/mpls/error.def


########################################
# Tunnel protocol: vxlan-gpe
########################################

libvnet_la_SOURCES +=				\
 vnet/vxlan-gpe/vxlan_gpe.c			\
 vnet/vxlan-gpe/encap.c	        		\
 vnet/vxlan-gpe/decap.c

nobase_include_HEADERS +=			\
 vnet/vxlan-gpe/vxlan_gpe.h			\
 vnet/vxlan-gpe/vxlan_gpe_packet.h		\
 vnet/vxlan-gpe/vxlan_gpe_error.def

########################################
# Tunnel protocol: ipsec+gre
########################################
libvnet_la_SOURCES +=				\
 vnet/ipsec-gre/ipsec_gre.c			\
 vnet/ipsec-gre/node.c				\
 vnet/ipsec-gre/interface.c

nobase_include_HEADERS +=			\
 vnet/ipsec-gre/ipsec_gre.h		        \
 vnet/ipsec-gre/error.def

########################################
# LISP control plane: lisp-cp
########################################

libvnet_la_SOURCES +=				\
 vnet/lisp-cp/lisp_types.c			\
 vnet/lisp-cp/lisp_cp_dpo.c			\
 vnet/lisp-cp/control.c				\
 vnet/lisp-cp/gid_dictionary.c			\
 vnet/lisp-cp/lisp_msg_serdes.c			\
 vnet/lisp-cp/packets.c			

nobase_include_HEADERS +=			\
 vnet/lisp-cp/lisp_types.h			\
 vnet/lisp-cp/packets.h				\
 vnet/lisp-cp/gid_dictionary.h			\
 vnet/lisp-cp/lisp_cp_messages.h		\
 vnet/lisp-cp/lisp_msg_serdes.h			\
 vnet/lisp-cp/control.h				


if ENABLE_TESTS
LDS = -lvppinfra -l:libvlib.a $(dpdk_libs) -l:libvlibmemory.a \
	-l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a

TESTS += test_cp_serdes test_lisp_types

test_cp_serdes_SOURCES =			\
 test/lisp-cp/test_cp_serdes.c		\
 vnet/lisp-cp/lisp_msg_serdes.c			\
 vnet/lisp-cp/lisp_types.c			\
 vnet/lisp-cp/packets.c				\
 vnet/ip/ip_checksum.c

test_lisp_types_SOURCES =			\
 test/lisp-cp/test_lisp_types.c		\
 vnet/lisp-cp/lisp_types.c

test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG

test_cp_serdes_LDADD = libvnet.la $(LDS)
test_lisp_types_LDADD = libvnet.la $(LDS)

test_cp_serdes_LDFLAGS = -static
test_lisp_types_LDFLAGS = -static
endif

########################################
# Tunnel protocol: lisp-gpe
########################################

libvnet_la_SOURCES +=				\
 vnet/lisp-gpe/lisp_gpe.c			\
 vnet/lisp-gpe/lisp_gpe_sub_interface.c         \
 vnet/lisp-gpe/lisp_gpe_adjacency.c             \
 vnet/lisp-gpe/lisp_gpe_tunnel.c                \
 vnet/lisp-gpe/lisp_gpe_fwd_entry.c		\
 vnet/lisp-gpe/lisp_gpe_tenant.c		\
 vnet/lisp-gpe/interface.c			\
 vnet/lisp-gpe/decap.c				

nobase_include_HEADERS +=			\
 vnet/lisp-gpe/lisp_gpe.h			\
 vnet/lisp-gpe/lisp_gpe_fwd_entry.h		\
 vnet/lisp-gpe/lisp_gpe_tenant.h		\
 vnet/lisp-gpe/lisp_gpe_packet.h		\
 vnet/lisp-gpe/lisp_gpe_error.def		

if ENABLE_TESTS
TESTS += test_test

test_test_SOURCES = test/lisp-gpe/test.c

test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG

test_test_LDADD = $(LIBOBJS)

noinst_PROGRAMS += $(TESTS)
check_PROGRAMS = $(TESTS)
endif

########################################
# DHCP client
########################################
libvnet_la_SOURCES +=				\
 vnet/dhcp/client.c				\
 vnet/dhcp/client.h	

nobase_include_HEADERS +=			\
 vnet/dhcp/client.h	

########################################
# DHCP proxy
########################################
libvnet_la_SOURCES +=				\
 vnet/dhcp/proxy_node.c				\
 vnet/dhcp/proxy.h
 
nobase_include_HEADERS +=			\
 vnet/dhcp/packet.h				\
 vnet/dhcp/proxy.h				\
 vnet/dhcp/proxy_error.def

########################################
# ipv6 segment routing
########################################

if WITH_IPV6SR
libvnet_la_SOURCES +=				\
 vnet/sr/sr.c					\
 vnet/sr/sr_replicate.c
endif
 
nobase_include_HEADERS +=			\
 vnet/sr/sr_packet.h				\
 vnet/sr/sr_error.def				\
 vnet/sr/sr.h

########################################
# DHCPv6 proxy
########################################
libvnet_la_SOURCES +=				\
 vnet/dhcpv6/proxy_node.c
 
nobase_include_HEADERS +=			\
 vnet/dhcpv6/packet.h				\
 vnet/dhcpv6/proxy.h				\
 vnet/dhcpv6/proxy_error.def

########################################
# IPFIX / netflow v10 
########################################
libvnet_la_SOURCES +=				\
 vnet/flow/flow_report.c

nobase_include_HEADERS +=			\
 vnet/flow/flow_report.h			\
 vnet/flow/ipfix_info_elements.h		\
 vnet/flow/ipfix_packet.h

########################################
# IPFIX classify code
########################################

libvnet_la_SOURCES +=				\
  vnet/flow/flow_report_classify.c

nobase_include_HEADERS +=			\
  vnet/flow/flow_report_classify.h

########################################
# lawful intercept
########################################

libvnet_la_SOURCES +=				\
  vnet/lawful-intercept/lawful_intercept.c	\
  vnet/lawful-intercept/node.c

nobase_include_HEADERS += 			\
  vnet/dpdk_replication.h			\
  vnet/lawful-intercept/lawful_intercept.h

########################################
# Packet generator
########################################

libvnet_la_SOURCES +=				\
  vnet/pg/cli.c					\
  vnet/pg/edit.c				\
  vnet/pg/init.c				\
  vnet/pg/input.c				\
  vnet/pg/output.c				\
  vnet/pg/stream.c

nobase_include_HEADERS +=			\
  vnet/pg/pg.h					\
  vnet/pg/edit.h

########################################
# Intel DPDK
########################################
if WITH_DPDK
libvnet_la_SOURCES +=				\
  vnet/devices/dpdk/dpdk_priv.h		\
  vnet/devices/dpdk/device.c		\
  vnet/devices/dpdk/format.c		\
  vnet/devices/dpdk/init.c			\
  vnet/devices/dpdk/node.c			\
  vnet/devices/dpdk/hqos.c			\
  vnet/devices/dpdk/vhost_user.c    \
  vnet/devices/dpdk/cli.c

nobase_include_HEADERS +=			\
  vnet/devices/dpdk/dpdk.h
else
libvnet_la_SOURCES +=				\
  vnet/devices/nic/ixge.c                       \
  vnet/devices/nic/ixge.h                       \
  vnet/devices/nic/sfp.c                        \
  vnet/devices/nic/sfp.h
endif

########################################
# virtio
########################################

libvnet_la_SOURCES +=       \
  vnet/devices/virtio/vhost-user.c

nobase_include_HEADERS +=     \
  vnet/devices/virtio/vhost-user.h

########################################
# ssvm ethernet
########################################
libvnet_la_SOURCES +=				\
  vnet/devices/ssvm/ssvm_eth.c			\
  vnet/devices/ssvm/node.c

nobase_include_HEADERS +=			\
  vnet/devices/ssvm/ssvm_eth.h

########################################
# Linux packet interface
########################################

libvnet_la_SOURCES +=				\
  vnet/devices/af_packet/af_packet.c		\
  vnet/devices/af_packet/device.c		\
  vnet/devices/af_packet/node.c			\
  vnet/devices/af_packet/cli.c

nobase_include_HEADERS +=			\
  vnet/devices/af_packet/af_packet.h

########################################
# NETMAP interface
########################################

libvnet_la_SOURCES +=				\
  vnet/devices/netmap/netmap.c			\
  vnet/devices/netmap/device.c			\
  vnet/devices/netmap/node.c			\
  vnet/devices/netmap/cli.c

nobase_include_HEADERS +=			\
  vnet/devices/netmap/netmap.h


########################################
# Unix kernel related
########################################

# FIXME: vnet/unix/hgshm.c 

libvnet_la_SOURCES +=				\
  vnet/unix/gdb_funcs.c				\
  vnet/unix/pcap.c				\
  vnet/unix/tapcli.c				\
  vnet/unix/tuntap.c

nobase_include_HEADERS +=			\
  vnet/unix/pcap.h				\
  vnet/unix/tuntap.h				\
  vnet/unix/tapcli.h

########################################
# FIB
########################################

libvnet_la_SOURCES +=				\
  vnet/fib/fib.c                                \
  vnet/fib/fib_test.c                           \
  vnet/fib/ip4_fib.c                            \
  vnet/fib/ip6_fib.c                            \
  vnet/fib/mpls_fib.c                           \
  vnet/fib/fib_table.c                          \
  vnet/fib/fib_walk.c                           \
  vnet/fib/fib_types.c                          \
  vnet/fib/fib_node.c                           \
  vnet/fib/fib_node_list.c                      \
  vnet/fib/fib_entry.c                          \
  vnet/fib/fib_entry_src.c                      \
  vnet/fib/fib_entry_src_rr.c                   \
  vnet/fib/fib_entry_src_interface.c            \
  vnet/fib/fib_entry_src_default_route.c        \
  vnet/fib/fib_entry_src_special.c              \
  vnet/fib/fib_entry_src_api.c                  \
  vnet/fib/fib_entry_src_adj.c                  \
  vnet/fib/fib_entry_src_mpls.c                 \
  vnet/fib/fib_entry_src_lisp.c                 \
  vnet/fib/fib_entry_cover.c                    \
  vnet/fib/fib_path_list.c                      \
  vnet/fib/fib_path.c				\
  vnet/fib/fib_path_ext.c			\
  vnet/fib/fib_urpf_list.c			\
  vnet/fib/fib_attached_export.c

nobase_include_HEADERS +=			\
  vnet/fib/fib.h				\
  vnet/fib/ip4_fib.h				\
  vnet/fib/ip6_fib.h				\
  vnet/fib/fib_types.h				\
  vnet/fib/fib_table.h				\
  vnet/fib/fib_node.h				\
  vnet/fib/fib_node_list.h			\
  vnet/fib/fib_entry.h				

########################################
# ADJ
########################################

libvnet_la_SOURCES +=				\
  vnet/adj/adj_nbr.c				\
  vnet/adj/adj_rewrite.c			\
  vnet/adj/adj_glean.c   			\
  vnet/adj/adj_midchain.c   			\
  vnet/adj/adj_l2.c      			\
  vnet/adj/adj.c                            

nobase_include_HEADERS +=			\
  vnet/adj/adj.h				\
  vnet/adj/adj_types.h				\
  vnet/adj/adj_rewrite.h			\
  vnet/adj/adj_glean.h  			\
  vnet/adj/adj_nbr.h				

########################################
# Data-Plane Objects
########################################

libvnet_la_SOURCES +=				\
  vnet/dpo/dpo.c                                \
  vnet/dpo/drop_dpo.c                           \
  vnet/dpo/punt_dpo.c                           \
  vnet/dpo/receive_dpo.c                        \
  vnet/dpo/load_balance.c			\
  vnet/dpo/load_balance_map.c			\
  vnet/dpo/lookup_dpo.c   			\
  vnet/dpo/classify_dpo.c   			\
  vnet/dpo/mpls_label_dpo.c

nobase_include_HEADERS +=			\
  vnet/dpo/load_balance.h                       \
  vnet/dpo/drop_dpo.h                           \
  vnet/dpo/lookup_dpo.h                         \
  vnet/dpo/punt_dpo.h                           \
  vnet/dpo/classify_dpo.h                       \
  vnet/dpo/receive_dpo.h                        \
  vnet/dpo/dpo.h

########################################
# Plugin client library
########################################

libvnetplugin_la_SOURCES +=                    \
  vnet/plugin/p1.c

nobase_include_HEADERS +=                      \
  vnet/plugin/plugin.h

lib_LTLIBRARIES = libvnet.la libvnetplugin.la

pcap2pg_SOURCES = 				\
  vnet/unix/pcap2pg.c				\
  vnet/unix/pcap.h

pcap2pg_LDFLAGS = -static
pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl

noinst_PROGRAMS += pcap2pg