/* // Copyright (c) 2017 Intel Corporation // // 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. */ /** * @file * L3fwd lpm4 header file is for IPv4 specific declarations */ #ifndef L3FWD_LPM_H #define L3FWD_LPM_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "l3fwd_common.h" #include "l3fwd_lpm6.h" #include "interface.h" /** * Define all RTE MBUF offset size */ #define MBUF_HDR_ROOM 256 /**< MBUF HEADER ROOM OFFSET */ /* IPv4 */ #define ETH_HDR_SIZE 14 /**< ETHER HEADER OFFSET */ #define IP_HDR_SIZE 20 /**< IP HEADER OFFSET */ #define IP_HDR_DST_ADR_OFST 16 /**< IP HEADER DST IP ADDRESS OFFSET */ #define IP_HDR_SRC_ADR_OFST 12 /**< IP HEADER SRC IP ADDRESS OFFSET */ /* Rules and Tables8s */ #define IPV4_L3FWD_LPM_MAX_RULES 256 /**< Number of LPM RULES */ #define IPV4_L3FWD_LPM_NUMBER_TBL8S (1 << 8) /**< Number of TABLE 8s for LPM */ #define MAX_FIB_PATHS 8 /**< MAX FIB PATH, If ECMP feature is enabled */ #define IP_LOCAL 0 /**< for ICMP Packet destined to Local */ #define IP_REMOTE 1 /**< for ICMP Packet destined to Local */ /* ECMP MACROS */ #define MAX_SUPPORTED_FIB_PATHS 8 /**< for ECMP max supported FIB Paths */ #define HASH_BUCKET_SIZE 64 /**< size of HASH bucket for ECMP */ /* L2 Adjacency Macro */ #define L2_ADJ_RESOLVED 0x00 /**