aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_l2.py
AgeCommit message (Expand)AuthorFilesLines
2022-10-11l2: Add bridge_domain_add_del_v2 to l2 apiLaszlo Kiraly1-2/+2
2022-05-10tests: replace pycodestyle with blackKlement Sekera1-53/+53
2021-11-03tests: Apply the 'return self' pattern for the L2 objectsNeale Ranns1-0/+5
2019-11-15tests: Remove the unrequired VPP IP address/prefix class wrappersNeale Ranns1-1/+0
2019-06-19l2: BD ARP termination entry API updateNeale Ranns1-21/+21
2019-04-24l2: Add support for arp unicast forwardingMohsin Kazmi1-2/+6
2019-03-29tests: test/vpp_l2.py fix missing name.Paul Vinciguerra1-0/+1
2019-03-29tests: refactor vpp_object.pyPaul Vinciguerra1-15/+0
2019-03-12GBP: L3 out fixesNeale Ranns1-0/+29
2019-03-11vpp_papi_provider: Remove more wrapper functions.Ole Troan1-17/+11
2019-03-06test framework: vpp_papi_provider.py - further cleanupOle Troan1-11/+7
2019-03-01Tests: Remove all wildcard imports.Paul Vinciguerra1-1/+1
2018-12-18PAPI: Add MACAddress object wrapper for vl_api_mac_address_tOle Troan1-13/+13
2018-12-10Test framework: StringIO fixes for Python3Ole Troan1-2/+1
2018-11-07GBP Endpoint LearningNeale Ranns1-0/+221
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) 2015 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 __AH_H__
#define __AH_H__

#include <vnet/ip/ip.h>
#include <vnet/ipsec/ipsec.h>

typedef struct
{
  unsigned char nexthdr;
  unsigned char hdrlen;
  unsigned short reserved;
  unsigned int spi;
  unsigned int seq_no;
  unsigned char auth_data[0];
} ah_header_t;


/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
  ip4_header_t ip4;
  ah_header_t ah;
}) ip4_and_ah_header_t;
/* *INDENT-ON* */

/* *INDENT-OFF* */
typedef CLIB_PACKED (struct {
  ip6_header_t ip6;
  ah_header_t ah;
}) ip6_and_ah_header_t;
/* *INDENT-ON* */

always_inline u8
ah_calc_icv_padding_len (u8 icv_size, int is_ipv6)
{
  ASSERT (0 == is_ipv6 || 1 == is_ipv6);
  const u8 req_multiple = 4 + 4 * is_ipv6;	// 4 for ipv4, 8 for ipv6
  const u8 total_size = sizeof (ah_header_t) + icv_size;
  return (req_multiple - total_size % req_multiple) % req_multiple;
}

#endif /* __AH_H__ */

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