summaryrefslogtreecommitdiffstats
path: root/src/plugins/nsh
AgeCommit message (Expand)AuthorFilesLines
2019-04-10API: Fix shared memory only action handlers.Ole Troan1-20/+16
2019-03-07Remove local REPLY_MACRO so that socket transport works.Ole Troan1-38/+2
2019-03-01nsh: fix load failureFilip Tehlar5-69/+69
2019-02-26nsh: migrate old MUTIARCH macros to VLIB_NODE_FNFilip Tehlar8-2289/+2438
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach5-30/+31
2018-10-23c11 safe string handling supportDave Barach5-22/+22
2018-10-08Fix coverity issue for NSH pluginHongjun Ni1-69/+70
2018-09-16fix nsh map index error, it will cause vpp appear Segmentation fault when vpp...zhanglimao1-1/+1
2018-09-11VAT: plugin load errorsOle Troan1-2/+3
2018-08-29Add NSH Plugin MaintainersHongjun Ni1-2/+2
2018-08-28Port NSH plugin to VPPHongjun Ni18-0/+6268
.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 */ }
#!/usr/bin/env bash
set -o pipefail -o errtrace -o nounset -o errexit

# Experimental script, please consult with dmarion@me.com before
# submitting any changes

# defaults
build_dir=.
install_dir=/usr/local
build_type=release
src_dir="$(dirname "$(readlink -f "$0")")"
host_arch=$(uname -m)
arch=${host_arch}
native_only=no
wipe=no
args=()

help()
{
  cat << __EOF__
VPP Build Configuration Script

USAGE: ${0} [options]

OPTIONS:
  --help, -h              This help
  --arch, -a              Cross-compile for specified target architecture (aarch64, riscv64, i386, ...)
  --build-dir, -b         Build directory
  --install-dir, -i       Install directory
  --build-type, -t        Build type (release, debug, ...)
  --native-only, -n       Only compile for Native CPU (no multiarch)
  --wipe, -w              Wipe whole repo (except startup.* files)
__EOF__
}

while (( "$#" )); do
  case "$1" in
    -h|--help)
      help
      exit 1
      ;;
    -b|--build-dir)
      if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
        build_dir=$2
        shift 2
      else
        echo "Error: Argument for $1 is missing" >&2
        exit 1
      fi
      ;;
    -a|--arch)
      if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
	arch=$2
        shift 2
      else
        echo "Error: Argument for $1 is missing" >&2
        exit 1
      fi
      ;;
    -i|--install-dir)
      if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
        install_dir=$2
        shift 2
      else
        echo "Error: Argument for $1 is missing" >&2
        exit 1
      fi
      ;;
    -t|--build-type)
      if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
        build_type=$2
        shift 2
      else
        echo "Error: Argument for $1 is missing" >&2
        exit 1
      fi
      ;;
    -n|--native-only)
      native_only=yes
      shift 1
      ;;
    -w|--wipe)
      wipe=yes
      shift 1
      ;;
    -*|--*=) # unsupported flags
      echo "Error: Unsupported flag $1" >&2
      exit 1
      ;;
    *) # preserve positional arguments
      PARAMS="$PARAMS $1"
      shift
      ;;
  esac
done

if [ "${arch}" != "${host_arch}" ] ; then
  args+=("-DCMAKE_SYSTEM_NAME=Linux")
  args+=("-DCMAKE_SYSTEM_PROCESSOR=${arch}")
  args+=("-DCMAKE_C_COMPILER=clang")
  args+=("-DCMAKE_C_COMPILER_TARGET=${arch}-linux-gnu")
  args+=("-DCMAKE_ASM_COMPILER_TARGET=${arch}-linux-gnu")
  args+=("-DCMAKE_FIND_ROOT_PATH=/usr/${arch}-linux-gnu")
  args+=("-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER")
  args+=("-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH")
  args+=("-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH")
  args+=("-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY")
fi

args+=("-DCMAKE_PREFIX_PATH=/opt/vpp/external/${arch}")
args+=("-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON")
args+=("-DCMAKE_INSTALL_PREFIX=${install_dir}")
args+=("-DCMAKE_BUILD_TYPE:STRING=${build_type}")
[ "${native_only}" == "yes" ] && args+=("-DVPP_BUILD_NATIVE_ONLY:BOOL=ON")

[ "${wipe}" == "yes" ] && git clean -fdx --exclude=startup.\*

cmake ${args[@]} -G Ninja -S ${src_dir}/src -B ${build_dir}

cat << __EOF__

  Useful build commands:

  ninja                   Build VPP
  ninja set-build-type-*  Change build type to <debug|release|gcov|...>
  ninja config            Start build configuration TUI
  ninja run               Runs VPP using startup.conf in the build directory
  ninja debug             Runs VPP inside GDB using startup.conf in the build directory
  ninja pkg-deb           Create .deb packages
  ninja install           Install VPP to $install_dir

__EOF__