+ struct
+ {
+ u8 ttl;
+ u8 tos;
+ };
+ };
+ i16 current_data;
+ u8 skip;
+ u32 sa_index;
+} ah_encrypt_packet_data_t;
+
+always_inline uword
+ah_encrypt_inline (vlib_main_t * vm,
+ vlib_node_runtime_t * node, vlib_frame_t * frame,
+ int is_ip6)
+{
+ u32 n_left, *from, thread_index;
+ int icv_size = 0;
+ from = vlib_frame_vector_args (frame);
+ n_left = frame->n_vectors;
+ ipsec_main_t *im = &ipsec_main;
+ ah_encrypt_packet_data_t pkt_data[VLIB_FRAME_SIZE], *pd = pkt_data;
+ thread_index = vm->thread_index;
+ vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b = bufs;
+ u16 nexts[VLIB_FRAME_SIZE], *next = nexts;
+ ipsec_per_thread_data_t *ptd = vec_elt_at_index (im->ptd, thread_index);
+ ipsec_sa_t *sa0 = 0;
+ ip4_and_ah_header_t *ih0, *oh0 = 0;
+ ip6_and_ah_header_t *ih6_0, *oh6_0 = 0;
+ u32 current_sa_index = ~0, current_sa_bytes = 0, current_sa_pkts = 0;
+ const static ip4_header_t ip4_hdr_template = {
+ .ip_version_and_header_length = 0x45,
+ .protocol = IP_PROTOCOL_IPSEC_AH,
+ };
+ const static ip6_header_t ip6_hdr_template = {
+ .ip_version_traffic_class_and_flow_label = 0x60,
+ .protocol = IP_PROTOCOL_IPSEC_AH,
+ };
+
+ clib_memset (pkt_data, 0, VLIB_FRAME_SIZE * sizeof (pkt_data[0]));
+ vlib_get_buffers (vm, from, b, n_left);
+ vec_reset_length (ptd->crypto_ops);
+ vec_reset_length (ptd->integ_ops);
+
+ while (n_left > 0)
+ {
+ u8 ip_hdr_size;
+ u8 next_hdr_type;