summaryrefslogtreecommitdiffstats
path: root/test/test_acl_plugin.py
AgeCommit message (Expand)AuthorFilesLines
2018-06-25make test: fix broken interfaces #2Klement Sekera1-1/+1
2018-04-10test: Fix issues with new version of pycodestyle (VPP-1232)Chris Luke1-1/+2
2018-03-23acl-plugin: make test: add a test which deletes an interface with applied ACLAndrew Yourtchenko1-0/+39
2018-02-08acl-plugin: add whitelisted ethertype mode (VPP-1163)Andrew Yourtchenko1-7/+93
2017-11-11ACLs: Use better error return codes than "-1" everywhere.Jon Loeliger1-5/+5
2017-11-10make test: automatically seed random generatorKlement Sekera1-2/+0
2017-10-25VPP-1033: Python API support arbitrary sized input parameters.Ole Troan1-2/+2
2017-09-27acl-plugin: take 2 at VPP-991 fix, this time with a test case which verifies it.Andrew Yourtchenko1-1/+30
2017-09-26acl-plugin: test: move the API calls to vpp_papi_provider.pyAndrew Yourtchenko1-49/+15
2017-09-07acl-plugin: match index set to first portrange element if non-first portrange...Andrew Yourtchenko1-0/+191
2017-06-19acl-plugin: bihash-based ACL lookupAndrew Yourtchenko1-0/+3
2017-04-18ACL-plugin does not match UDP next-header, VPP-687Pavel Kotucek1-7/+79
2017-04-06acl-plugin: make the IPv4/IPv6 non-first fragment handling in line with ACL (...Andrew Yourtchenko1-6/+43
2017-03-13ACL plugin rejects ICMP messages (VPP-624)Pavel Kotucek1-0/+1015
/ .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 */ }
/*
 * http_static.c - skeleton vpp-api-test plug-in
 *
 * Copyright (c) <current-year> <your-organization>
 * 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.
 */
#include <vat/vat.h>
#include <vlibapi/api.h>
#include <vlibmemory/api.h>
#include <vppinfra/error.h>

uword unformat_sw_if_index (unformat_input_t * input, va_list * args);

/* Declare message IDs */
#include <http_static/http_static.api_enum.h>
#include <http_static/http_static.api_types.h>

typedef struct
{
  /* API message ID base */
  u16 msg_id_base;
  vat_main_t *vat_main;
} http_static_test_main_t;

http_static_test_main_t http_static_test_main;

#define __plugin_msg_base http_static_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>

static int
api_http_static_enable (vat_main_t * vam)
{
  unformat_input_t *line_input = vam->input;
  vl_api_http_static_enable_t *mp;
  u64 tmp;
  u8 *www_root = 0;
  u8 *uri = 0;
  u32 prealloc_fifos = 0;
  u32 private_segment_size = 0;
  u32 fifo_size = 8 << 10;
  u32 cache_size_limit = 1 << 20;
  int ret;

  /* Parse args required to build the message */
  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
    {
      if (unformat (line_input, "www-root %s", &www_root))
	;
      else if (unformat (line_input, "prealloc-fifos %d", &prealloc_fifos))
	;
      else if (unformat (line_input, "private-segment-size %U",
			 unformat_memory_size, &tmp))
	{
	  if (tmp >= 0x100000000ULL)
	    {
	      errmsg ("private segment size %llu, too large", tmp);
	      return -99;
	    }
	  private_segment_size = (u32) tmp;
	}
      else if (unformat (line_input, "fifo-size %U", unformat_memory_size,
			 &tmp))
	{
	  if (tmp >= 0x100000000ULL)
	    {
	      errmsg ("fifo-size %llu, too large", tmp);
	      return -99;
	    }
	  fifo_size = (u32) tmp;
	}
      else if (unformat (line_input, "cache-size %U", unformat_memory_size,
			 &tmp))
	{
	  if (tmp < (128ULL << 10))
	    {
	      errmsg ("cache-size must be at least 128kb");
	      return -99;
	    }
	  cache_size_limit = (u32) tmp;
	}

      else if (unformat (line_input, "uri %s", &uri))
	;
      else
	{
	  errmsg ("unknown input `%U'", format_unformat_error, line_input);
	  return -99;
	}
    }

  if (www_root == 0)
    {
      errmsg ("Must specify www-root");
      return -99;
    }

  if (uri == 0)
    uri = format (0, "tcp://0.0.0.0/80%c", 0);



  /* Construct the API message */
  M (HTTP_STATIC_ENABLE, mp);
  strncpy_s ((char *) mp->www_root, 256, (const char *) www_root, 256);
  strncpy_s ((char *) mp->uri, 256, (const char *) uri, 256);
  mp->fifo_size = ntohl (fifo_size);
  mp->cache_size_limit = ntohl (cache_size_limit);
  mp->prealloc_fifos = ntohl (prealloc_fifos);
  mp->private_segment_size = ntohl (private_segment_size);

  /* send it... */
  S (mp);

  /* Wait for a reply... */
  W (ret);
  return ret;
}

#include <http_static/http_static.api_test.c>

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */