aboutsummaryrefslogtreecommitdiffstats
path: root/resources/2021-06-10FIX: Pylint reducepmikus1-1/+1 2020-10-19FIX: disable sending IPv6 RA messages from VMsJuraj Linkeš1-9/+10 2019-11-28Python3: resources and librariesJan Gelety1-12/+15 2019-07-17Use PapiSocketProvider for most PAPI callsVratko Polak1-3/+3 2019-07-12PapiExecutor always verifiesVratko Polak1-4/+2 2019-06-18CSIT-1459: Migrate IP libraries from VAT to PAPIJan Gelety1-102/+50 2018-04-25Fix warnings reported by gen_doc.shVratko Polak1-4/+4 2017-03-01Remove unused VRF paramter from IP neighbour Add/delNeale Ranns1-7/+2 2016-10-04Fix pylint warnings in python librariesselias1-4/+4 2016-07-21CSIT-183: Vpn baseline routed forwarding (VRF)Zdeno Olsovsky1-2/+7 2016-06-28Use interface key instead of interface name.Miroslav Miklus1-3/+4 2016-05-11Add iACL IPv4/IPv6 tests.Patrik Hrnciar1-0/+26 2016-04-22Reformat python libraries.Matej Klotton1-31/+38 2016-02-08New version of RF tests.Stefan Kobza1-0/+101
om the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef included_ip6_input_h #define included_ip6_input_h #include <vnet/ip/ip.h> #include <vnet/ip/icmp6.h> extern char *ip6_error_strings[]; typedef enum { IP6_INPUT_NEXT_DROP, IP6_INPUT_NEXT_LOOKUP, IP6_INPUT_NEXT_LOOKUP_MULTICAST, IP6_INPUT_NEXT_ICMP_ERROR, IP6_INPUT_N_NEXT, } ip6_input_next_t; always_inline void ip6_input_check_x2 (vlib_main_t * vm, vlib_node_runtime_t * error_node, vlib_buffer_t * p0, vlib_buffer_t * p1, ip6_header_t * ip0, ip6_header_t * ip1, u32 * next0, u32 * next1) { u8 error0, error1; error0 = error1 = IP6_ERROR_NONE; /* Version != 6? Drop it. */ error0 = (clib_net_to_host_u32 (ip0->ip_version_traffic_class_and_flow_label) >> 28) != 6 ? IP6_ERROR_VERSION : error0; error1 = (clib_net_to_host_u32 (ip1->ip_version_traffic_class_and_flow_label) >> 28) != 6 ? IP6_ERROR_VERSION : error1; /* hop limit < 1? Drop it. for link-local broadcast packets, * like dhcpv6 packets from client has hop-limit 1, which should not * be dropped. */ error0 = ip0->hop_limit < 1 ? IP6_ERROR_TIME_EXPIRED : error0; error1 = ip1->hop_limit < 1 ? IP6_ERROR_TIME_EXPIRED : error1; /* L2 length must be at least minimal IP header. */ error0 = p0->current_length < sizeof (ip0[0]) ? IP6_ERROR_TOO_SHORT : error0; error1 = p1->current_length < sizeof (ip1[0]) ? IP6_ERROR_TOO_SHORT : error1; if (PREDICT_FALSE (error0 != IP6_ERROR_NONE)) { if (error0 == IP6_ERROR_TIME_EXPIRED) { icmp6_error_set_vnet_buffer (p0, ICMP6_time_exceeded, ICMP6_time_exceeded_ttl_exceeded_in_transit, 0); *next0 = IP6_INPUT_NEXT_ICMP_ERROR; } else { *next0 = IP6_INPUT_NEXT_DROP; } } if (PREDICT_FALSE (error1 != IP6_ERROR_NONE)) { if (error1 == IP6_ERROR_TIME_EXPIRED) { icmp6_error_set_vnet_buffer (p1, ICMP6_time_exceeded, ICMP6_time_exceeded_ttl_exceeded_in_transit, 0); *next1 = IP6_INPUT_NEXT_ICMP_ERROR; } else { *next1 = IP6_INPUT_NEXT_DROP; } } } always_inline void ip6_input_check_x1 (vlib_main_t * vm, vlib_node_runtime_t * error_node, vlib_buffer_t * p0, ip6_header_t * ip0, u32 * next0) { u8 error0; error0 = IP6_ERROR_NONE; /* Version != 6? Drop it. */ error0 = (clib_net_to_host_u32 (ip0->ip_version_traffic_class_and_flow_label) >> 28) != 6 ? IP6_ERROR_VERSION : error0; /* hop limit < 1? Drop it. for link-local broadcast packets, * like dhcpv6 packets from client has hop-limit 1, which should not * be dropped. */ error0 = ip0->hop_limit < 1 ? IP6_ERROR_TIME_EXPIRED : error0; /* L2 length must be at least minimal IP header. */ error0 = p0->current_length < sizeof (ip0[0]) ? IP6_ERROR_TOO_SHORT : error0; if (PREDICT_FALSE (error0 != IP6_ERROR_NONE)) { if (error0 == IP6_ERROR_TIME_EXPIRED) { icmp6_error_set_vnet_buffer (p0, ICMP6_time_exceeded, ICMP6_time_exceeded_ttl_exceeded_in_transit, 0); *next0 = IP6_INPUT_NEXT_ICMP_ERROR; } else { *next0 = IP6_INPUT_NEXT_DROP; } } } #endif /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */