summaryrefslogtreecommitdiffstats
path: root/test/test_acl_plugin_macip.py
AgeCommit message (Expand)AuthorFilesLines
2019-03-29tests: test/vpp_l2.py fix missing name.Paul Vinciguerra1-3/+3
2019-03-11vpp_papi_provider: Remove more wrapper functions.Ole Troan1-5/+5
2019-03-11VPP-1508: Use scapy.compat to manage packet level library differences.Paul Vinciguerra1-19/+29
2019-03-07VPP-1508: Python3 tests. Explicitly specify string formatting.Paul Vinciguerra1-1/+2
2019-03-01Tests: Remove all wildcard imports.Paul Vinciguerra1-2/+2
2018-12-05VPP-1508: Python3 compatible printPaul Vinciguerra1-17/+18
2018-11-27VPP-1508 python3 tests: .encode('hex')Paul Vinciguerra1-4/+5
2018-09-27Test typo fixesjuraj.linkes1-1/+1
2018-09-25L2 BD: introduce a BD interface on which to send UU packetsNeale Ranns1-1/+3
2018-06-25make test: fix broken interfaces #2Klement Sekera1-4/+4
2018-06-24Revert "Revert "make test: fix broken interfaces""Klement Sekera1-1/+1
2018-06-22Revert "make test: fix broken interfaces"Ole Troan1-1/+1
2018-06-22make test: fix broken interfacesKlement Sekera1-1/+1
2018-03-23acl-plugin: improvements in 'show acl-plugin macip acl' CLIAndrew Yourtchenko1-0/+6
2018-03-23acl-plugin: make test: do not use a debug CLI where API can be usedAndrew Yourtchenko1-6/+3
2017-12-11acl-plugin: unapply/reapply the classifier-based inacls when performing macip...Andrew Yourtchenko1-19/+15
2017-11-08ACL plugin support tagged subinterfacesPavel Kotucek1-230/+492
2017-09-19ACL plugin enable macip for ip4/ip6 trafficPavel Kotucek1-81/+200
2017-09-12ACL-plugin add "replace" semantics for adding a new MacIP aclPavel Kotucek1-18/+100
2017-09-08ACL-plugin MACIP ACLs testsPavel Kotucek1-0/+760
ound-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) 2017 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 included_vppcom_h
#define included_vppcom_h

#include <netdb.h>
#include <errno.h>
#include <sys/epoll.h>

/*
 * VPPCOM Public API Definitions, Enums, and Data Structures
 */
#define INVALID_SESSION_ID                   (~0)
#define VPPCOM_VRF_DEFAULT                   0
#define VPPCOM_CONF_DEFAULT                  "/etc/vpp/vcl.conf"
#define VPPCOM_ENV_CONF                      "VCL_CONFIG"
#define VPPCOM_ENV_DEBUG                     "VCL_DEBUG"
#define VPPCOM_ENV_APP_PROXY_TRANSPORT_TCP   "VCL_APP_PROXY_TRANSPORT_TCP"
#define VPPCOM_ENV_APP_PROXY_TRANSPORT_UDP   "VCL_APP_PROXY_TRANSPORT_UDP"
#define VPPCOM_ENV_APP_NAMESPACE_ID          "VCL_APP_NAMESPACE_ID"
#define VPPCOM_ENV_APP_NAMESPACE_SECRET      "VCL_APP_NAMESPACE_SECRET"
#define VPPCOM_ENV_APP_SCOPE_LOCAL           "VCL_APP_SCOPE_LOCAL"
#define VPPCOM_ENV_APP_SCOPE_GLOBAL          "VCL_APP_SCOPE_GLOBAL"

typedef enum
{
  VPPCOM_PROTO_TCP = 0,
  VPPCOM_PROTO_UDP,
} vppcom_proto_t;

typedef enum
{
  VPPCOM_IS_IP6 = 0,
  VPPCOM_IS_IP4,
} vppcom_is_ip4_t;

typedef struct vppcom_endpt_t_
{
  uint32_t vrf;
  uint8_t is_cut_thru;
  uint8_t is_ip4;
  uint8_t *ip;
  uint16_t port;
} vppcom_endpt_t;

typedef enum
{
  VPPCOM_OK = 0,
  VPPCOM_EAGAIN = -EAGAIN,
  VPPCOM_EINVAL = -EINVAL,
  VPPCOM_EBADFD = -EBADFD,
  VPPCOM_EAFNOSUPPORT = -EAFNOSUPPORT,
  VPPCOM_ECONNRESET = -ECONNRESET,
  VPPCOM_ECONNREFUSED = -ECONNREFUSED,
  VPPCOM_ETIMEDOUT = -ETIMEDOUT,
} vppcom_error_t;

typedef enum
{
  VPPCOM_ATTR_GET_NREAD,
  VPPCOM_ATTR_PEEK_NREAD,
  VPPCOM_ATTR_GET_FLAGS,
  VPPCOM_ATTR_SET_FLAGS,
  VPPCOM_ATTR_GET_LCL_ADDR,
  VPPCOM_ATTR_GET_PEER_ADDR,
  VPPCOM_ATTR_SET_REUSEADDR,
  VPPCOM_ATTR_SET_BROADCAST,
  VPPCOM_ATTR_SET_V6ONLY,
  VPPCOM_ATTR_SET_KEEPALIVE,
  VPPCOM_ATTR_SET_TCP_KEEPIDLE,
  VPPCOM_ATTR_SET_TCP_KEEPINTVL,
} vppcom_attr_op_t;

/*
 * VPPCOM Public API Functions
 */
static inline const char *
vppcom_retval_str (int retval)
{
  char *st;

  switch (retval)
    {
    case VPPCOM_OK:
      st = "VPPCOM_OK";
      break;

    case VPPCOM_EAGAIN:
      st = "VPPCOM_EAGAIN";
      break;

    case VPPCOM_EINVAL:
      st = "VPPCOM_EINVAL";
      break;

    case VPPCOM_EBADFD:
      st = "VPPCOM_EBADFD";
      break;

    case VPPCOM_EAFNOSUPPORT:
      st = "VPPCOM_EAFNOSUPPORT";
      break;

    case VPPCOM_ECONNRESET:
      st = "VPPCOM_ECONNRESET";
      break;

    case VPPCOM_ECONNREFUSED:
      st = "VPPCOM_ECONNREFUSED";
      break;

    case VPPCOM_ETIMEDOUT:
      st = "VPPCOM_ETIMEDOUT";
      break;

    default:
      st = "UNKNOWN_STATE";
      break;
    }

  return st;
}

/* TBD: make these constructor/destructor function */
extern int vppcom_app_create (char *app_name);
extern void vppcom_app_destroy (void);

extern int vppcom_session_create (uint32_t vrf, uint8_t proto,
				  uint8_t is_nonblocking);
extern int vppcom_session_close (uint32_t session_index);

extern int vppcom_session_bind (uint32_t session_index, vppcom_endpt_t * ep);
extern int vppcom_session_listen (uint32_t session_index, uint32_t q_len);
extern int vppcom_session_accept (uint32_t session_index,
				  vppcom_endpt_t * client_ep,
				  double wait_for_time);

extern int vppcom_session_connect (uint32_t session_index,
				   vppcom_endpt_t * server_ep);
extern int vppcom_session_read (uint32_t session_index, void *buf, int n);
extern int vppcom_session_write (uint32_t session_index, void *buf, int n);

extern int vppcom_select (unsigned long n_bits,
			  unsigned long *read_map,
			  unsigned long *write_map,
			  unsigned long *except_map, double wait_for_time);

extern int vppcom_epoll_create (void);
extern int vppcom_epoll_ctl (uint32_t vep_idx, int op,
			     uint32_t session_index,
			     struct epoll_event *event);
extern int vppcom_epoll_wait (uint32_t vep_idx, struct epoll_event *events,
			      int maxevents, double wait_for_time);
extern int vppcom_session_attr (uint32_t session_index, uint32_t op,
				void *buffer, uint32_t * buflen);
extern int vppcom_session_recvfrom (uint32_t session_index, void *buffer,
				    uint32_t buflen, int flags,
				    vppcom_endpt_t * ep);
extern int vppcom_session_sendto (uint32_t session_index, void *buffer,
				  uint32_t buflen, int flags,
				  vppcom_endpt_t * ep);

#endif /* included_vppcom_h */

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