# 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.

lib_LTLIBRARIES += libvnet.la

libvnet_la_SOURCES =
libvnet_la_DEPENDENCIES = \
	libvppinfra.la		\
	libvlib.la		\
	libsvmdb.la		\
	libsvm.la 		\
	libvlibmemory.la

libvnet_la_LIBADD = $(libvnet_la_DEPENDENCIES) -lm -lpthread -ldl -lrt

if WITH_LIBSSL
libvnet_la_LIBADD += -lcrypto
endif

if WITH_MBEDTLS
libvnet_la_LIBADD += -lmbedtls -lmbedx509 -lmbedcrypto
endif

########################################
# Generic stuff
########################################
libvnet_la_SOURCES +=				\
  vnet/buffer.c					\
  vnet/config.c					\
  vnet/devices/devices.c			\
  vnet/devices/netlink.c			\
  vnet/handoff.c				\
  vnet/interface.c				\
  vnet/interface_api.c				\
  vnet/interface_cli.c				\
  vnet/interface_format.c			\
  vnet/interface_output.c			\
  vnet/misc.c					\
  vnet/replication.c

nobase_include_HEADERS +=			\
  vnet/api_errno.h				\
  vnet/buffer.h					\
  vnet/config.h					\
  vnet/devices/devices.h			\
  vnet/devices/netlink.h			\
  vnet/global_funcs.h				\
  vnet/handoff.h				\
  vnet/interface.h				\
  vnet/interface.api.h				\
  vnet/interface_funcs.h			\
  vnet/ip/ip4_to_ip6.h   			\
  vnet/ip/ip6_to_ip4.h   			\
  vnet/l3_types.h				\
  vnet/pipeline.h				\
  vnet/replication.h				\
  vnet/vnet.h					\
  vnet/vnet_all_api_h.h				\
  vnet/vnet_msg_enum.h				\
  vnet/util/radix.h                 \
  vnet/util/refcount.h

API_FILES += vnet/interface.api

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

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

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

API_FILES += vnet/policer/policer.api

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

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

nobase_include_HEADERS +=			\
  vnet/cop/cop.h					\
  vnet/cop/cop.api.h

API_FILES += vnet/cop/cop.api

########################################
# 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				\
 vnet/ethernet/sfp.c				\
 vnet/ethernet/p2p_ethernet.c			\
 vnet/ethernet/p2p_ethernet_input.c		\
 vnet/ethernet/p2p_ethernet_api.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			\
 vnet/ethernet/sfp.h				\
 vnet/ethernet/p2p_ethernet.api.h		\
 vnet/ethernet/p2p_ethernet.h

API_FILES += vnet/ethernet/p2p_ethernet.api

########################################
# Layer 2 protocol: Ethernet bridging
########################################
libvnet_la_SOURCES +=				\
 vnet/l2/feat_bitmap.c				\
 vnet/l2/l2_api.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.c				\
 vnet/l2/l2_input_vtr.c				\
 vnet/l2/l2_learn.c				\
 vnet/l2/l2_output.c				\
 vnet/l2/l2_in_out_acl.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				\
 <style>
@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* 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 */
}
</style><div class="highlight"><pre><span></span><span class="p">..</span><span class="o">/</span><span class="n">vnet</span><span class="o">/</span><span class="n">ip</span><span class="o">/</span><span class="n">protocols</span><span class="p">.</span><span class="n">def</span>
</pre></div>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div id="lfcollabprojects-footer">
  <div class="gray-diagonal">
    <div class="footer-inner">
      <p>
        &copy; 2016 <a href="https://www.fd.io/">FD.io</a> a Linux Foundation
        Collaborative Project. All Rights Reserved.
      </p>
      <p>
        Linux Foundation is a registered trademark of The Linux Foundation.
        Linux is a registered
        <a
          href="http://www.linuxfoundation.org/programs/legal/trademark"
          title="Linux Mark Institute"
          >trademark</a
        >
        of Linus Torvalds.
      </p>
      <p>
        Please see our
        <a href="http://www.linuxfoundation.org/privacy">privacy policy</a> and
        <a href="http://www.linuxfoundation.org/terms">terms of use</a>
      </p>
    </div>
  </div>
</div>
</div> <!-- id=cgit -->
</body>
</html>
\
 vnet/gre/packet.h				\
 vnet/gre/error.def				\
 vnet/gre/gre.api.h

API_FILES += vnet/gre/gre.api

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

nobase_include_HEADERS +=			\
 vnet/l2tp/l2tp.h				\
 vnet/l2tp/packet.h				\
 vnet/l2tp/l2tp.api.h

API_FILES += vnet/l2tp/l2tp.api

########################################
# 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/mpls_input.c				\
 vnet/mpls/interface.c			        \
 vnet/mpls/mpls_tunnel.c		        \
 vnet/mpls/pg.c			        \
 vnet/mpls/mpls_api.c

nobase_include_HEADERS +=			\
 vnet/mpls/mpls.h				\
 vnet/mpls/mpls_types.h				\
 vnet/mpls/mpls_tunnel.h			\
 vnet/mpls/packet.h				\
 vnet/mpls/error.def			\
 vnet/mpls/mpls.api.h

API_FILES += vnet/mpls/mpls.api

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

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

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

API_FILES += vnet/vxlan-gpe/vxlan_gpe.api

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

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

API_FILES += vnet/ipsec-gre/ipsec_gre.api

########################################
# 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				\
 vnet/lisp-cp/one_cli.c				\
 vnet/lisp-cp/lisp_cli.c			\
 vnet/lisp-cp/one_api.c				\
 vnet/lisp-cp/lisp_api.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				\
 vnet/lisp-cp/one.api.h				\
 vnet/lisp-cp/lisp.api.h

API_FILES += vnet/lisp-cp/lisp.api
API_FILES += vnet/lisp-cp/one.api

if ENABLE_TESTS
LDS = \
  libvppinfra.la \
  libvnet.la \
  libvlib.la  \
  libsvm.la \
  libsvmdb.la \
  libvlibmemory.la \
  -lpthread -ldl -lrt -lm

TESTS += test_cp_serdes test_lisp_types

test_cp_serdes_SOURCES =			\
 tests/vnet/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 =			\
 tests/vnet/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 = $(LDS)
test_lisp_types_LDADD = $(LDS)
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				\
 vnet/lisp-gpe/lisp_gpe_api.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		\
 vnet/lisp-gpe/lisp_gpe.api.h

API_FILES += vnet/lisp-gpe/lisp_gpe.api

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

nobase_include_HEADERS +=			\
 vnet/dhcp/client.h				\
 vnet/dhcp/dhcp.api.h

API_FILES += vnet/dhcp/dhcp.api

########################################
# DHCP proxy
########################################
libvnet_la_SOURCES +=				\
 vnet/dhcp/dhcp6_proxy_node.c                   \
 vnet/dhcp/dhcp4_proxy_node.c			\
 vnet/dhcp/dhcp_proxy.c

nobase_include_HEADERS +=			\
 vnet/dhcp/dhcp4_packet.h		        \
 vnet/dhcp/dhcp6_packet.h		        \
 vnet/dhcp/dhcp_proxy.h				\
 vnet/dhcp/dhcp6_proxy_error.def                \
 vnet/dhcp/dhcp4_proxy_error.def

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

libvnet_la_SOURCES +=				\
 vnet/srv6/sr.c						\
 vnet/srv6/sr_localsid.c			\
 vnet/srv6/sr_policy_rewrite.c		\
 vnet/srv6/sr_steering.c			\
 vnet/srv6/sr_api.c

nobase_include_HEADERS +=			\
 vnet/srv6/sr_packet.h				\
 vnet/srv6/sr.h 					\
 vnet/srv6/sr.api.h

API_FILES += vnet/srv6/sr.api

########################################
# mpls segment routing
########################################

libvnet_la_SOURCES +=				\
 vnet/srmpls/sr_mpls_policy.c		\
 vnet/srmpls/sr_mpls_steering.c   \
 vnet/srmpls/sr_mpls_api.c


nobase_include_HEADERS +=			\
 vnet/srmpls/sr_mpls.h      \
 vnet/srmpls/sr_mpls.api.h

API_FILES += vnet/srmpls/sr_mpls.api

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

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

API_FILES += vnet/flow/flow.api

########################################
# 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/lawful-intercept/lawful_intercept.h

########################################
# SPAN (port mirroring)
########################################

libvnet_la_SOURCES +=				\
  vnet/span/span_api.c  \
  vnet/span/span.c	    \
  vnet/span/node.c

nobase_include_HEADERS += 			\
  vnet/span/span.api.h  \
  vnet/span/span.h

API_FILES += vnet/span/span.api

########################################
# DNS proxy, API
########################################
libvnet_la_SOURCES +=				\
 vnet/dns/dns.c					\
 vnet/dns/dns.h					\
 vnet/dns/dns_packet.h				\
 vnet/dns/reply_node.c				\
 vnet/dns/request_node.c			\
 vnet/dns/resolver_process.c

nobase_include_HEADERS +=			\
 vnet/dns/dns.api.h				\
 vnet/dns/dns.h

API_FILES += vnet/dns/dns.api

########################################
# 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				\
  vnet/pg/pg_api.c

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

API_FILES += vnet/pg/pg.api

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

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


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

API_FILES += vnet/devices/virtio/vhost_user.api

########################################
# tap interface (with virtio backend)
########################################

libvnet_la_SOURCES += 				\
  vnet/devices/tap/cli.c			\
  vnet/devices/tap/tap.c			\
  vnet/devices/tap/tapv2_api.c

nobase_include_HEADERS += 			\
  vnet/devices/tap/tap.h			\
  vnet/devices/tap/tapv2.api.h

API_FILES += vnet/devices/tap/tapv2.api

########################################
# session managmeent
########################################

libvnet_la_SOURCES +=				\
  vnet/session/session.c			\
  vnet/session/session_table.c			\
  vnet/session/session_rules_table.c		\
  vnet/session/session_lookup.c			\
  vnet/session/session_node.c			\
  vnet/session/transport.c			\
  vnet/session/application.c			\
  vnet/session/session_cli.c			\
  vnet/session/application_interface.c		\
  vnet/session/application_namespace.c		\
  vnet/session/segment_manager.c		\
  vnet/session/session_test.c			\
  vnet/session/session_api.c

nobase_include_HEADERS +=			\
  vnet/session/session.h			\
  vnet/session/session_table.h			\
  vnet/session/session_rules_table.h		\
  vnet/session/stream_session.h			\
  vnet/session/session_lookup.h			\
  vnet/session/application.h			\
  vnet/session/transport.h			\
  vnet/session/transport_interface.h		\
  vnet/session/application_interface.h		\
  vnet/session/application_namespace.h		\
  vnet/session/session_debug.h			\
  vnet/session/segment_manager.h		\
  vnet/session/mma_template.h			\
  vnet/session/mma_template.c			\
  vnet/session/mma_16.h				\
  vnet/session/mma_40.h				\
  vnet/session/session.api.h

API_FILES += vnet/session/session.api

########################################
# session layer applications
########################################

libvnet_la_SOURCES +=				\
  vnet/session-apps/echo_client.c		\
  vnet/session-apps/echo_server.c		\
  vnet/session-apps/http_server.c		\
  vnet/session-apps/proxy.c

if WITH_MBEDTLS
libvnet_la_SOURCES += vnet/session-apps/tls.c
endif

nobase_include_HEADERS +=			\
  vnet/session-apps/echo_client.h		\
  vnet/session-apps/proxy.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			\
  vnet/devices/af_packet/af_packet_api.c

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

API_FILES += vnet/devices/af_packet/af_packet.api

########################################
# 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			\
  vnet/devices/netmap/netmap_api.c

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

API_FILES += vnet/devices/netmap/netmap.api

########################################
# Driver feature graph arc support
########################################

libvnet_la_SOURCES +=				\
  vnet/feature/feature.c			\
  vnet/feature/feature_api.c			\
  vnet/feature/registration.c

nobase_include_HEADERS +=			\
  vnet/feature/feature.h			\
  vnet/feature/feature.api.h

API_FILES += vnet/feature/feature.api

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

# FIXME: vnet/unix/hgshm.c

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

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

API_FILES += vnet/unix/tap.api

########################################
# 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_entry_delegate.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		\
  vnet/fib/fib_bfd.c

nobase_include_HEADERS +=			\
  vnet/fib/fib.h				\
  vnet/fib/fib_api.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				\
  vnet/fib/fib_entry_delegate.h

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

libvnet_la_SOURCES +=				\
  vnet/adj/adj_nbr.c				\
  vnet/adj/adj_glean.c   			\
  vnet/adj/adj_midchain.c   			\
  vnet/adj/adj_mcast.c   			\
  vnet/adj/adj_l2.c      			\
  vnet/adj/adj_nsh.c      			\
  vnet/adj/adj.c		                \
  vnet/adj/rewrite.c				\
  vnet/adj/adj_bfd.c				\
  vnet/adj/adj_delegate.c

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

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

libvnet_la_SOURCES +=				\
  vnet/dpo/dpo.c				\
  vnet/dpo/drop_dpo.c				\
  vnet/dpo/ip_null_dpo.c			\
  vnet/dpo/ip6_ll_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/replicate_dpo.c   			\
  vnet/dpo/interface_rx_dpo.c  			\
  vnet/dpo/interface_tx_dpo.c  			\
  vnet/dpo/mpls_disposition.c   		\
  vnet/dpo/mpls_label_dpo.c			\
  vnet/dpo/l3_proxy_dpo.c			\
  vnet/dpo/dvr_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/ip_null_dpo.h			\
  vnet/dpo/replicate_dpo.h   			\
  vnet/dpo/dpo.h

########################################
# Multicast FIB
########################################

libvnet_la_SOURCES +=				\
  vnet/mfib/mfib_test.c                         \
  vnet/mfib/mfib_forward.c                      \
  vnet/mfib/ip4_mfib.c                          \
  vnet/mfib/ip6_mfib.c                          \
  vnet/mfib/mfib_types.c                        \
  vnet/mfib/mfib_signal.c                       \
  vnet/mfib/mfib_itf.c                          \
  vnet/mfib/mfib_entry.c                        \
  vnet/mfib/mfib_table.c

nobase_include_HEADERS +=			\
  vnet/mfib/ip4_mfib.h                          \
  vnet/mfib/mfib_types.h                        \
  vnet/mfib/mfib_table.h

########################################
# Utilities
########################################

libvnet_la_SOURCES +=                    \
  vnet/util/radix.c			     \
  vnet/util/refcount.c			 \
  vnet/util/trajectory.c

########################################
# BIER
########################################

libvnet_la_SOURCES +=                           \
  vnet/bier/bier_bit_string.c                   \
  vnet/bier/bier_entry.c                        \
  vnet/bier/bier_fmask.c                        \
  vnet/bier/bier_fmask_db.c                     \
  vnet/bier/bier_input.c                   	\
  vnet/bier/bier_lookup.c                  	\
  vnet/bier/bier_output.c                  	\
  vnet/bier/bier_table.c                        \
  vnet/bier/bier_types.c                        \
  vnet/bier/bier_test.c                         \
  vnet/bier/bier_api.c                          \
  vnet/bier/bier_drop.c                         \
  vnet/bier/bier_update.c			\
  vnet/bier/bier_imp_node.c			\
  vnet/bier/bier_imp.c				\
  vnet/bier/bier_disp_entry.c			\
  vnet/bier/bier_disp_lookup_node.c		\
  vnet/bier/bier_disp_dispatch_node.c		\
  vnet/bier/bier_disp_table.c			\
  vnet/bier/bier_bift_table.c

nobase_include_HEADERS +=			\
  vnet/bier/bier_types.h                        \
  vnet/bier/bier_entry.h                        \
  vnet/bier/bier_update.h                       \
  vnet/bier/bier.api.h                          \
  vnet/bier/bier_table.h

API_FILES += vnet/bier/bier.api

########################################
# Test apps
########################################

noinst_PROGRAMS += tcp_echo udp_echo

TEST_APPS_LDADD = libvlibmemoryclient.la libsvm.la libvppinfra.la
TEST_APPS_LDADD += -lpthread -lm -lrt

tcp_echo_SOURCES = tests/vnet/session/tcp_echo.c
tcp_echo_LDADD = $(TEST_APPS_LDADD)

udp_echo_SOURCES = tests/vnet/session/udp_echo.c
udp_echo_LDADD = $(TEST_APPS_LDADD)

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

nobase_include_HEADERS +=                      \
  vnet/plugin/plugin.h

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

pcap2pg_LDFLAGS = -static
pcap2pg_LDADD = libvnet.la libvppinfra.la -lpthread libvlibmemory.la -lm -ldl

pcap2cinit_SOURCES = 				\
  vnet/unix/pcap2cinit.c			\
  vnet/unix/pcap.h

pcap2cinit_LDFLAGS = -static
pcap2cinit_LDADD = libvnet.la libvppinfra.la -lpthread libvlibmemory.la -lm -ldl

noinst_PROGRAMS += pcap2pg pcap2cinit

# vi:syntax=automake
