summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vapi
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-08-27 13:17:09 +0200
committerMohsin Kazmi <sykazmi@cisco.com>2018-08-27 16:28:04 +0200
commitb3abec7c1f936ee4950d14cc8a9c34c729551f9f (patch)
tree69963fbbad50cf4a06fa1943b2f6f8e4c9dd1207 /src/vpp-api/vapi
parent2ba9dcf408d5f861738356dfb43c28a803fcd7fc (diff)
cmake: Fix VAPI .hpp generation
Change-Id: I2bec3b2511f00d017f9b3a727809631695222c1a Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vapi')
-rw-r--r--src/vpp-api/vapi/CMakeLists.txt2
-rwxr-xr-xsrc/vpp-api/vapi/vapi_cpp_gen.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/vpp-api/vapi/CMakeLists.txt b/src/vpp-api/vapi/CMakeLists.txt
index 103e7c50d16..0aff8827017 100644
--- a/src/vpp-api/vapi/CMakeLists.txt
+++ b/src/vpp-api/vapi/CMakeLists.txt
@@ -42,7 +42,7 @@ foreach(f ${VPP_API_FILES})
OUTPUT ${output}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/vapi_cpp_gen.py
- ARGS --remove-path ${input}
+ ARGS --gen-h-prefix=vapi --remove-path ${input}
DEPENDS ${input} vapi_cpp_gen.py vapi_json_parser.py
COMMENT "Generating VAPI C++ header ${output}"
)
diff --git a/src/vpp-api/vapi/vapi_cpp_gen.py b/src/vpp-api/vapi/vapi_cpp_gen.py
index adf85c753d8..326026837fd 100755
--- a/src/vpp-api/vapi/vapi_cpp_gen.py
+++ b/src/vpp-api/vapi/vapi_cpp_gen.py
@@ -136,7 +136,7 @@ def gen_json_header(parser, logger, j, io, gen_h_prefix, add_debug_comments):
print("#define %s" % include_guard)
print("")
print("#include <vapi/vapi.hpp>")
- print("#include <%s%s>" % (gen_h_prefix, json_to_c_header_name(j)))
+ print("#include <%s%s>" % (gen_h_prefix, json_to_c_header_name(f)))
print("")
print("namespace vapi {")
print("")
#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) 2016 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.
 */

#ifndef __MFIB_ITF_H__
#define __MFIB_ITF_H__

#include <vlib/vlib.h>
#include <vnet/mfib/mfib_types.h>

/**
 * @brief An interface associated with a particular MFIB entry
 */
typedef struct mfib_itf_t_
{
    /**
     * Required for pool_get_aligned
     */
    CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);

    /**
     * @brief Forwarding Flags on the entry - checked in the data-path
     */
    mfib_itf_flags_t mfi_flags;

    /**
     * The SW IF index that this MFIB interface represents
     */
    u32 mfi_sw_if_index;

    /**
     * The index of the signal in the pending list
     */
    u32 mfi_si;

    /**
     * A hash table of path-inidices that are contributing flags to this interface.
     * Since paths with next-hops can be on the same interface and each of those
     * paths can contribute different flags, we need to maintain the flag
     * contribution from each path, and use a combination for forwarding.
     */
    uword *mfi_hash;
} mfib_itf_t;

/**
 * update an interface from a path.
 * returns 1 if the entry is removed, i.e. has no flags left, as a result
 * of the update.
 */
extern int mfib_itf_update(mfib_itf_t *itf,
                           fib_node_index_t path_index,
                           mfib_itf_flags_t mfi_flags);

extern index_t mfib_itf_create(fib_node_index_t path_index,
                               mfib_itf_flags_t mfi_flags);

extern void mfib_itf_delete(mfib_itf_t *itf);

extern u8 *format_mfib_itf(u8 * s, va_list * args);

extern mfib_itf_t *mfib_itf_pool;

/**
 * Get the MFIB interface representation
 */
static inline mfib_itf_t *
mfib_itf_get (index_t mi)
{
    return (pool_elt_at_index(mfib_itf_pool, mi));
}

static inline index_t
mfib_itf_get_index (const mfib_itf_t *mfi)
{
    return (mfi - mfib_itf_pool);
}

#endif