X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_mbuf%2Frte_mbuf_ptype.h;h=ff6de9d17989bb67ff2f50a5255ab4c2c09c8b06;hb=0bc9f022a144f6522b9f7d3f191531fef392805d;hp=fbe764a6c02d0c9fa563372df51d371369784dfc;hpb=2c15c5377da23863b02a4b94ae89a3a76dfa0e4a;p=dpdk.git diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h index fbe764a6c0..ff6de9d179 100644 --- a/lib/librte_mbuf/rte_mbuf_ptype.h +++ b/lib/librte_mbuf/rte_mbuf_ptype.h @@ -227,7 +227,7 @@ extern "C" { * * Packet format: * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=6, 'MF'=0> + * | 'version'=4, 'protocol'=6, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=6> @@ -239,7 +239,7 @@ extern "C" { * * Packet format: * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=17, 'MF'=0> + * | 'version'=4, 'protocol'=17, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=17> @@ -258,6 +258,9 @@ extern "C" { * <'ether type'=0x0800 * | 'version'=4, 'MF'=1> * or, + * <'ether type'=0x0800 + * | 'version'=4, 'frag_offset'!=0> + * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=44> */ @@ -268,7 +271,7 @@ extern "C" { * * Packet format: * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=132, 'MF'=0> + * | 'version'=4, 'protocol'=132, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=132> @@ -280,7 +283,7 @@ extern "C" { * * Packet format: * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=1, 'MF'=0> + * | 'version'=4, 'protocol'=1, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=1> @@ -296,7 +299,7 @@ extern "C" { * * Packet format: * <'ether type'=0x0800 - * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0> + * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'!=[6|17|44|132|1]> @@ -473,7 +476,7 @@ extern "C" { * * Packet format (inner only): * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=6, 'MF'=0> + * | 'version'=4, 'protocol'=6, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=6> @@ -485,7 +488,7 @@ extern "C" { * * Packet format (inner only): * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=17, 'MF'=0> + * | 'version'=4, 'protocol'=17, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=17> @@ -499,6 +502,9 @@ extern "C" { * <'ether type'=0x0800 * | 'version'=4, 'MF'=1> * or, + * <'ether type'=0x0800 + * | 'version'=4, 'frag_offset'!=0> + * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=44> */ @@ -509,7 +515,7 @@ extern "C" { * * Packet format (inner only): * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=132, 'MF'=0> + * | 'version'=4, 'protocol'=132, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=132> @@ -521,7 +527,7 @@ extern "C" { * * Packet format (inner only): * <'ether type'=0x0800 - * | 'version'=4, 'protocol'=1, 'MF'=0> + * | 'version'=4, 'protocol'=1, 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'=1> @@ -534,7 +540,7 @@ extern "C" { * * Packet format (inner only): * <'ether type'=0x0800 - * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0> + * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0, 'frag_offset'=0> * or, * <'ether type'=0x86DD * | 'version'=6, 'next header'!=[6|17|44|132|1]> @@ -544,6 +550,10 @@ extern "C" { * Mask of inner layer 4 packet types. */ #define RTE_PTYPE_INNER_L4_MASK 0x0f000000 +/** + * All valid layer masks. + */ +#define RTE_PTYPE_ALL_MASK 0x0fffffff /** * Check if the (outer) L3 header is IPv4. To avoid comparing IPv4 types one by @@ -566,6 +576,91 @@ extern "C" { RTE_PTYPE_INNER_L3_MASK | \ RTE_PTYPE_INNER_L4_MASK)) +/** + * Get the name of the l2 packet type + * + * @param ptype + * The packet type value. + * @return + * A non-null string describing the packet type. + */ +const char *rte_get_ptype_l2_name(uint32_t ptype); + +/** + * Get the name of the l3 packet type + * + * @param ptype + * The packet type value. + * @return + * A non-null string describing the packet type. + */ +const char *rte_get_ptype_l3_name(uint32_t ptype); + +/** + * Get the name of the l4 packet type + * + * @param ptype + * The packet type value. + * @return + * A non-null string describing the packet type. + */ +const char *rte_get_ptype_l4_name(uint32_t ptype); + +/** + * Get the name of the tunnel packet type + * + * @param ptype + * The packet type value. + * @return + * A non-null string describing the packet type. + */ +const char *rte_get_ptype_tunnel_name(uint32_t ptype); + +/** + * Get the name of the inner_l2 packet type + * + * @param ptype + * The packet type value. + * @return + * A non-null string describing the packet type. + */ +const char *rte_get_ptype_inner_l2_name(uint32_t ptype); + +/** + * Get the name of the inner_l3 packet type + * + * @param ptype + * The packet type value. + * @return + * A non-null string describing the packet type. + */ +const char *rte_get_ptype_inner_l3_name(uint32_t ptype); + +/** + * Get the name of the inner_l4 packet type + * + * @param ptype + * The packet type value. + * @return + * A non-null string describing the packet type. + */ +const char *rte_get_ptype_inner_l4_name(uint32_t ptype); + +/** + * Write the packet type name into the buffer + * + * @param ptype + * The packet type value. + * @param buf + * The buffer where the string is written. + * @param buflen + * The length of the buffer. + * @return + * - 0 on success + * - (-1) if the buffer is too small + */ +int rte_get_ptype_name(uint32_t ptype, char *buf, size_t buflen); + #ifdef __cplusplus } #endif