aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api-test
AgeCommit message (Expand)AuthorFilesLines
2016-11-30Enabling AES-GCM-128 with 16B ICV supportRadu Nicolau3-3/+42
2016-11-30VXLAN multicast dst (remote) address supportEyal Bari1-26/+86
2016-11-30Start spliting vpe.api into logically related piecesDave Barach1-3/+25
2016-11-24ipsec: remove dependency on DPDK > 0Damjan Marion1-81/+0
2016-11-23dpdk: remove rte_mbuf modifications at many places in the codeDamjan Marion1-0/+1
2016-11-22add vpp banner graphic when vpp-cli startsPadraig Connolly1-3/+14
2016-11-22VAT: don't pass u8 to unformat - it expects an 4 byte integerNeale Ranns1-2/+2
2016-11-21Add client-side msg_name_and_crc -> msg_index tableDave Barach1-0/+63
2016-11-17feature: API/CLI to enable/disable feature per interfacePavel Kotucek1-3/+73
2016-11-17remove reference to Intel with dpdk docsPadraig Connolly1-1/+1
2016-11-17Fix coverity warnings, VPP-486Dave Barach1-0/+10
2016-11-17Put address in top bytes for the nexthop in vl_api_fib_path_t (VPP-532)Steven1-18/+42
2016-11-16VPP-521: Classify API enhancement to redirect traffic to pre-defined VRFSteve Shin1-3/+25
2016-11-15span: add feature (rx only) (VPP-185)Pavel Kotucek1-0/+94
2016-11-15VPP-393: Subinterface is still used after deletionPavel Kotucek1-1/+3
2016-11-15Dump routes (VPP-500)Steven1-2/+236
2016-11-10VXLAN tunnel encap forwarding optimization with FIB 2.0John Lo1-7/+1
2016-11-09Fix a batch of coverity warnings, VPP-486Dave Barach1-3/+0
2016-11-04vppctl: Do not use sudo if already rootPierre Pfister1-1/+5
2016-11-03Adding Sequence Number - Per Packet Counter(PPC) support for iOAM6.AkshayaNadahalli1-12/+12
2016-10-25Support IETF routing Yang models (VPP-503).Neale Ranns1-2/+15
2016-10-25Add API call of sw_interface_set_mpls_enable to vpp_api_testJohn Lo1-0/+48
2016-10-18Deprecate MPLSoGRE tunnels (VPP-502)Neale Ranns1-287/+328
2016-10-12VPP-362 Implement dumping of LISP adjacenciesFilip Tehlar1-0/+122
2016-10-10ipfix: add l4 unformat support for mask and match (VPP-204)Juraj Sloboda1-7/+201
2016-10-10ipfix: add classification nodes for flow statistics (VPP-204)Juraj Sloboda1-3/+145
2016-10-10Add signal handlingDave Barach3-1/+78
2016-10-10platform: rewrote vppctl script to include historyPadraig1-30/+96
2016-10-10FIB2.0: memory leaks during load-balance update (VPP-475)Neale Ranns1-1/+1
2016-10-07VPP-395 Add udp-punt node(s) and APIAlexander Popovsky (apopovsk)1-5/+49
2016-10-04VPP-355: add PBB (802.1ah) tag rewritePavel Kotucek1-3/+96
2016-09-30vat: add pg interfaces to sw_interface_dump (VPP-451)Damjan Marion1-0/+5
2016-09-30VPP-450 Fix adding LISP adjacencies via CLIFilip Tehlar1-44/+43
2016-09-28DPDK HQoS: Enable Hierarchical Scheduler in VPPJasvinder Singh1-0/+236
2016-09-27VPP-448 Fix LISP APIs using binary dataFilip Tehlar1-6/+10
2016-09-27LISP Source/Dest control plane support, VPP-197Florin Coras1-0/+114
2016-09-22VPP-189: fix coverity issue in api_format.cFlorin Coras1-2/+3
2016-09-22VPP-426: Rename parameter in LISP remote mapping VAT commandFilip Tehlar1-1/+1
2016-09-21A Protocol Independent Hierarchical FIB (VPP-352)Neale Ranns1-3/+9
2016-09-20VPP-189: fix coverity issue in api_format.cFilip Tehlar1-1/+7
2016-09-19Add support for transparent ethernet bridging to GREDavid Hotham1-5/+12
2016-09-13VPP-376: Refactor LISP dump API + VATFilip Tehlar2-932/+230
2016-09-07Fix bugs in IPFIX code discovered by coverityJuraj Sloboda1-1/+1
2016-09-07VPP-382: Add ipsec tunnel interface to sw_interface_dumpMatus Fabian1-0/+6
2016-09-07VPP-204 Rework and finish IPFIX implementationJuraj Sloboda1-20/+232
2016-09-06Move iOAM Trace as a pluginVengada Govindan1-94/+16
2016-09-06VPP-381 Add LISP interfaces to sw_interface_dumpFlorin Coras1-0/+7
2016-09-03VPP-358: Add IPv6 ND Event Notification and TerminationJohn Lo1-2/+4
2016-09-02Add in-message cli_request/cli_reply APIOle Troan2-0/+70
2016-08-31VPP-369 Add an L2 output classification featureDave Barach1-2/+5
e ipsec_policy_t * ipsec_input_protect_policy_match (ipsec_spd_t * spd, u32 sa, u32 da, u32 spi) { ipsec_main_t *im = &ipsec_main; ipsec_policy_t *p; ipsec_sa_t *s; u32 *i; vec_foreach (i, spd->ipv4_inbound_protect_policy_indices) { p = pool_elt_at_index (spd->policies, *i); s = pool_elt_at_index (im->sad, p->sa_index); if (spi != s->spi) continue; if (s->is_tunnel) { if (da != clib_net_to_host_u32 (s->tunnel_dst_addr.ip4.as_u32)) continue; if (sa != clib_net_to_host_u32 (s->tunnel_src_addr.ip4.as_u32)) continue; return p; } if (da < clib_net_to_host_u32 (p->laddr.start.ip4.as_u32)) continue; if (da > clib_net_to_host_u32 (p->laddr.stop.ip4.as_u32)) continue; if (sa < clib_net_to_host_u32 (p->raddr.start.ip4.as_u32)) continue; if (sa > clib_net_to_host_u32 (p->raddr.stop.ip4.as_u32)) continue; return p; } return 0; } always_inline uword ip6_addr_match_range (ip6_address_t * a, ip6_address_t * la, ip6_address_t * ua) { if ((memcmp (a->as_u64, la->as_u64, 2 * sizeof (u64)) >= 0) && (memcmp (a->as_u64, ua->as_u64, 2 * sizeof (u64)) <= 0)) return 1; return 0; } always_inline ipsec_policy_t * ipsec_input_ip6_protect_policy_match (ipsec_spd_t * spd, ip6_address_t * sa, ip6_address_t * da, u32 spi) { ipsec_main_t *im = &ipsec_main; ipsec_policy_t *p; ipsec_sa_t *s; u32 *i; vec_foreach (i, spd->ipv6_inbound_protect_policy_indices) { p = pool_elt_at_index (spd->policies, *i); s = pool_elt_at_index (im->sad, p->sa_index); if (spi != s->spi) continue; if (s->is_tunnel) { if (!ip6_address_is_equal (sa, &s->tunnel_src_addr.ip6)) continue; if (!ip6_address_is_equal (da, &s->tunnel_dst_addr.ip6)) continue; return p; } if (!ip6_addr_match_range (sa, &p->raddr.start.ip6, &p->raddr.stop.ip6)) continue; if (!ip6_addr_match_range (da, &p->laddr.start.ip6, &p->laddr.stop.ip6)) continue; return p; } return 0; } static vlib_node_registration_t ipsec_input_ip4_node; static uword ipsec_input_ip4_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * from_frame) { u32 n_left_from, *from, next_index, *to_next; ipsec_main_t *im = &ipsec_main; from = vlib_frame_vector_args (from_frame); n_left_from = from_frame->n_vectors; next_index = node->cached_next_index; while (n_left_from > 0) { u32 n_left_to_next; vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); while (n_left_from > 0 && n_left_to_next > 0) { u32 bi0, next0; vlib_buffer_t *b0; ip4_header_t *ip0; esp_header_t *esp0; ah_header_t *ah0; ip4_ipsec_config_t *c0; ipsec_spd_t *spd0; ipsec_policy_t *p0 = 0; bi0 = to_next[0] = from[0]; from += 1; n_left_from -= 1; to_next += 1; n_left_to_next -= 1; b0 = vlib_get_buffer (vm, bi0); b0->flags |= VNET_BUFFER_F_IS_IP4; b0->flags &= ~VNET_BUFFER_F_IS_IP6; c0 = vnet_feature_next_with_data (&next0, b0, sizeof (c0[0])); spd0 = pool_elt_at_index (im->spds, c0->spd_index); ip0 = vlib_buffer_get_current (b0); if (PREDICT_TRUE (ip0->protocol == IP_PROTOCOL_IPSEC_ESP || ip0->protocol == IP_PROTOCOL_UDP)) { #if 0 clib_warning ("packet received from %U to %U spi %u size %u spd_id %u", format_ip4_address, ip0->src_address.as_u8, format_ip4_address, ip0->dst_address.as_u8, clib_net_to_host_u32 (esp0->spi), clib_net_to_host_u16 (ip0->length), spd0->id); #endif esp0 = (esp_header_t *) ((u8 *) ip0 + ip4_header_bytes (ip0)); if (PREDICT_FALSE (ip0->protocol == IP_PROTOCOL_UDP)) { esp0 = (esp_header_t *) ((u8 *) esp0 + sizeof (udp_header_t)); } /* FIXME TODO missing check whether there is enough data inside * IP/UDP to contain ESP header & stuff ? */ p0 = ipsec_input_protect_policy_match (spd0, clib_net_to_host_u32 (ip0->src_address. as_u32), clib_net_to_host_u32 (ip0->dst_address. as_u32), clib_net_to_host_u32 (esp0->spi)); if (PREDICT_TRUE (p0 != 0)) { p0->counter.packets++; p0->counter.bytes += clib_net_to_host_u16 (ip0->length); vnet_buffer (b0)->ipsec.sad_index = p0->sa_index; vnet_buffer (b0)->ipsec.flags = 0; next0 = im->esp_decrypt_next_index; vlib_buffer_advance (b0, ((u8 *) esp0 - (u8 *) ip0)); goto trace0; } /* FIXME bypass and discard */ trace0: if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED)) { ipsec_input_trace_t *tr = vlib_add_trace (vm, node, b0, sizeof (*tr)); if (ip0->protocol == IP_PROTOCOL_IPSEC_ESP || ip0->protocol == IP_PROTOCOL_UDP) { if (p0) tr->sa_id = p0->sa_id; tr->spi = clib_host_to_net_u32 (esp0->spi); tr->seq = clib_host_to_net_u32 (esp0->seq); } } } if (PREDICT_TRUE (ip0->protocol == IP_PROTOCOL_IPSEC_AH)) { ah0 = (ah_header_t *) ((u8 *) ip0 + ip4_header_bytes (ip0)); p0 = ipsec_input_protect_policy_match (spd0, clib_net_to_host_u32 (ip0->src_address. as_u32), clib_net_to_host_u32 (ip0->dst_address. as_u32), clib_net_to_host_u32 (ah0->spi)); if (PREDICT_TRUE (p0 != 0)) { p0->counter.packets++; p0->counter.bytes += clib_net_to_host_u16 (ip0->length); vnet_buffer (b0)->ipsec.sad_index = p0->sa_index; vnet_buffer (b0)->ipsec.flags = 0; next0 = im->ah_decrypt_next_index; goto trace1; } /* FIXME bypass and discard */ trace1: if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED)) { ipsec_input_trace_t *tr = vlib_add_trace (vm, node, b0, sizeof (*tr)); if (ip0->protocol == IP_PROTOCOL_IPSEC_ESP) { if (p0) tr->sa_id = p0->sa_id; tr->spi = clib_host_to_net_u32 (ah0->spi); tr->seq = clib_host_to_net_u32 (ah0->seq_no); } } } vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi0, next0); } vlib_put_next_frame (vm, node, next_index, n_left_to_next); } vlib_node_increment_counter (vm, ipsec_input_ip4_node.index, IPSEC_INPUT_ERROR_RX_PKTS, from_frame->n_vectors); return from_frame->n_vectors; } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (ipsec_input_ip4_node,static) = { .function = ipsec_input_ip4_node_fn, .name = "ipsec-input-ip4", .vector_size = sizeof (u32), .format_trace = format_ipsec_input_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_errors = ARRAY_LEN(ipsec_input_error_strings), .error_strings = ipsec_input_error_strings, .n_next_nodes = IPSEC_INPUT_N_NEXT, .next_nodes = { #define _(s,n) [IPSEC_INPUT_NEXT_##s] = n, foreach_ipsec_input_next #undef _ }, }; /* *INDENT-ON* */ VLIB_NODE_FUNCTION_MULTIARCH (ipsec_input_ip4_node, ipsec_input_ip4_node_fn) static vlib_node_registration_t ipsec_input_ip6_node; static uword ipsec_input_ip6_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * from_frame) { u32 n_left_from, *from, next_index, *to_next; ipsec_main_t *im = &ipsec_main; from = vlib_frame_vector_args (from_frame); n_left_from = from_frame->n_vectors; next_index = node->cached_next_index; while (n_left_from > 0) { u32 n_left_to_next; vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); while (n_left_from > 0 && n_left_to_next > 0) { u32 bi0, next0; vlib_buffer_t *b0; ip6_header_t *ip0; esp_header_t *esp0; ip4_ipsec_config_t *c0; ipsec_spd_t *spd0; ipsec_policy_t *p0 = 0; u32 header_size = sizeof (ip0[0]); bi0 = to_next[0] = from[0]; from += 1; n_left_from -= 1; to_next += 1; n_left_to_next -= 1; b0 = vlib_get_buffer (vm, bi0); b0->flags |= VNET_BUFFER_F_IS_IP6; b0->flags &= ~VNET_BUFFER_F_IS_IP4; c0 = vnet_feature_next_with_data (&next0, b0, sizeof (c0[0])); spd0 = pool_elt_at_index (im->spds, c0->spd_index); ip0 = vlib_buffer_get_current (b0); esp0 = (esp_header_t *) ((u8 *) ip0 + header_size); if (PREDICT_TRUE (ip0->protocol == IP_PROTOCOL_IPSEC_ESP)) { #if 0 clib_warning ("packet received from %U to %U spi %u size %u spd_id %u", format_ip6_address, &ip0->src_address, format_ip6_address, &ip0->dst_address, clib_net_to_host_u32 (esp0->spi), clib_net_to_host_u16 (ip0->payload_length) + header_size, spd0->id); #endif p0 = ipsec_input_ip6_protect_policy_match (spd0, &ip0->src_address, &ip0->dst_address, clib_net_to_host_u32 (esp0->spi)); if (PREDICT_TRUE (p0 != 0)) { p0->counter.packets++; p0->counter.bytes += clib_net_to_host_u16 (ip0->payload_length); p0->counter.bytes += header_size; vnet_buffer (b0)->ipsec.sad_index = p0->sa_index; vnet_buffer (b0)->ipsec.flags = 0; next0 = im->esp_decrypt_next_index; vlib_buffer_advance (b0, header_size); goto trace0; } } trace0: if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED)) { ipsec_input_trace_t *tr = vlib_add_trace (vm, node, b0, sizeof (*tr)); if (ip0->protocol == IP_PROTOCOL_IPSEC_ESP) { if (p0) tr->sa_id = p0->sa_id; tr->spi = clib_host_to_net_u32 (esp0->spi); tr->seq = clib_host_to_net_u32 (esp0->seq); } } vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi0, next0); } vlib_put_next_frame (vm, node, next_index, n_left_to_next); } vlib_node_increment_counter (vm, ipsec_input_ip6_node.index, IPSEC_INPUT_ERROR_RX_PKTS, from_frame->n_vectors); return from_frame->n_vectors; } /* *INDENT-OFF* */ VLIB_REGISTER_NODE (ipsec_input_ip6_node,static) = { .function = ipsec_input_ip6_node_fn, .name = "ipsec-input-ip6", .vector_size = sizeof (u32), .format_trace = format_ipsec_input_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_errors = ARRAY_LEN(ipsec_input_error_strings), .error_strings = ipsec_input_error_strings, .sibling_of = "ipsec-input-ip4", }; /* *INDENT-ON* */ VLIB_NODE_FUNCTION_MULTIARCH (ipsec_input_ip6_node, ipsec_input_ip6_node_fn) /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */