aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nsh/nsh.c
AgeCommit message (Collapse)AuthorFilesLines
2019-05-03plugins: clean up plugin descriptionsDave Wallace1-1/+1
- Make plugin descriptions more consistent so the output of "show plugin" can be used in the wiki. Change-Id: I4c6feb11e7dcc5a4cf0848eed37f1d3b035c7dda Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2019-03-01nsh: fix load failureFilip Tehlar1-55/+0
Change-Id: I687ddba41bc80e2fbb39ebc30449ced7254e45f8 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-02-26nsh: migrate old MUTIARCH macros to VLIB_NODE_FNFilip Tehlar1-2252/+47
Change-Id: Iafe8b3a38f2a7d7571e60db91608d8130bb07cb3 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach1-24/+24
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1 Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-23c11 safe string handling supportDave Barach1-13/+13
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-08Fix coverity issue for NSH pluginHongjun Ni1-69/+70
Change-Id: Ie99ff9aebe3c896e3e104a5a7bebd84f7766e713 Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2018-09-16fix nsh map index error, it will cause vpp appear Segmentation fault when ↵zhanglimao1-1/+1
vpp process double packages Change-Id: Ib32bb351356b84aaf696c57398610b52a5a1f4dd Signed-off-by: zhanglimao <zhanglimao0017@gmail.com>
2018-08-28Port NSH plugin to VPPHongjun Ni1-0/+2545
Please refer to https://wiki.fd.io/view/NSH_SFC Change-Id: Iba7e33e4dbb064c1527aaddbe8dce4b6b63a627a Signed-off-by: Hongjun Ni <hongjun.ni@intel.com> Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com>
/* 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 */ }
/* Hey Emacs use -*- mode: C -*- */
/*
 * Linux Control Plane API
 *
 * Copyright 2020 Rubicon Communications, LLC.
 *
 * 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.
 */

option version = "1.0.0";

import "vnet/interface_types.api";

/** \brief Set the default Linux Control Plane netns
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param netns - the new default netns; netns[0] == 0 if none
*/
autoreply define lcp_default_ns_set
{
  u32 client_index;
  u32 context;
  string netns[32];		/* LCP_NS_LEN */
  option in_progress;
};

/** \brief get the default Linux Control Plane netns
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define lcp_default_ns_get
{
  u32 client_index;
  u32 context;
};

/** \brief get the default Linux Control Plane netns
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param netns - the default netns; netns[0] == 0 if none
*/
define lcp_default_ns_get_reply
{
  u32 context;
  string netns[32];		/* LCP_NS_LEN */
  option in_progress;
};

enum lcp_itf_host_type : u8
{
  LCP_API_ITF_HOST_TAP = 0,
  LCP_API_ITF_HOST_TUN = 1,
};

/** \brief Add or delete a Linux Conrol Plane interface pair
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - 0 if deleting, != 0 if adding
    @param sw_if_index - index of VPP PHY SW interface
    @param host_if_name - host tap interface name
    @param host_if_type - the type of host interface to create (tun, tap)
    @param netns - optional tap netns; netns[0] == 0 if none
*/
autoreply autoendian define lcp_itf_pair_add_del
{
  option deprecated;

  u32 client_index;
  u32 context;
  bool is_add;
  vl_api_interface_index_t sw_if_index;
  string host_if_name[16];		/* IFNAMSIZ */
  vl_api_lcp_itf_host_type_t host_if_type;
  string netns[32];			/* LCP_NS_LEN */
};
autoendian define lcp_itf_pair_add_del_v2
{
  option in_progress;

  u32 client_index;
  u32 context;
  bool is_add;
  vl_api_interface_index_t sw_if_index;
  string host_if_name[16];		/* IFNAMSIZ */
  vl_api_lcp_itf_host_type_t host_if_type;
  string netns[32];			/* LCP_NS_LEN */
};
define lcp_itf_pair_add_del_v2_reply
{
  option in_progress;

  u32 context;
  i32 retval;
  vl_api_interface_index_t host_sw_if_index;
};

/** \brief Dump Linux Control Plane interface pair data
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface to use as filter (~0 == "all")
*/
autoendian define lcp_itf_pair_get
{
  u32 client_index;
  u32 context;
  u32 cursor;
};
autoendian define lcp_itf_pair_get_reply
{
  u32 context;
  i32 retval;
  u32 cursor;
};

/** \brief Linux Control Plane interface pair dump response
    @param context - sender context which was passed in the request
    @param phy_sw_if_index - VPP's sw_if_index for the PHY
    @param host_sw_if_index - VPP's sw_if_index for the host tap
    @param vif_index - tap linux index
    @param host_if_name - host interface name
    @param host_if_type - host interface type (tun, tap)
    @param netns - host interface netns
*/
autoendian define lcp_itf_pair_details
{
  u32 context;
  vl_api_interface_index_t phy_sw_if_index;
  vl_api_interface_index_t host_sw_if_index;
  u32 vif_index;
  string host_if_name[16];	/* IFNAMSIZ */
  vl_api_lcp_itf_host_type_t host_if_type;
  string netns[32];		/* LCP_NS_LEN */
  option in_progress;
};

service {
  rpc lcp_itf_pair_get returns lcp_itf_pair_get_reply
    stream lcp_itf_pair_details;
};

/** \brief Replace end/begin
 */
autoreply define lcp_itf_pair_replace_begin
{
  u32 client_index;
  u32 context;
};
autoreply define lcp_itf_pair_replace_end
{
  u32 client_index;
  u32 context;
};

/*
 * Linux-CP Error counters/messages
 */
counters linuxcp {
  packets {
    severity info;
    type counter64;
    units "packets";
    description "ARP packets processed";
  };
  copies {
    severity info;
    type counter64;
    units "packets";
    description "ARP replies copied to host";
  };
};

paths {
  "/err/linux-cp-arp-phy" "linuxcp";
  "/err/linux-cp-arp-host" "linuxcp";
};

/*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */