MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_ipv6_get_next_ext

Function rte_ipv6_get_next_ext

dpdk/lib/net/rte_ip.h:812–840  ·  view source on GitHub ↗

* Parse next IPv6 header extension * * This function checks if proto number is an IPv6 extensions and parses its * data if so, providing information on next header and extension length. * * @param p * Pointer to an extension raw data. * @param proto * Protocol number extracted from the "next header" field from * the IPv6 header or the previous extension. * @param ext_len * Exten

Source from the content-addressed store, hash-verified

810 * next protocol number if proto is an IPv6 extension, -EINVAL otherwise
811 */
812static inline int
813rte_ipv6_get_next_ext(const uint8_t *p, int proto, size_t *ext_len)
814{
815 int next_proto;
816
817 switch (proto) {
818 case IPPROTO_AH:
819 next_proto = *p++;
820 *ext_len = (*p + 2) * sizeof(uint32_t);
821 break;
822
823 case IPPROTO_HOPOPTS:
824 case IPPROTO_ROUTING:
825 case IPPROTO_DSTOPTS:
826 next_proto = *p++;
827 *ext_len = (*p + 1) * sizeof(uint64_t);
828 break;
829
830 case IPPROTO_FRAGMENT:
831 next_proto = *p;
832 *ext_len = RTE_IPV6_FRAG_HDR_SIZE;
833 break;
834
835 default:
836 return -EINVAL;
837 }
838
839 return next_proto;
840}
841
842#ifdef __cplusplus
843}

Callers 7

update_trs_l3hdrFunction · 0.85
ipsec_po_out_rlen_getFunction · 0.85
parse_ptypeFunction · 0.85
prepare_one_packetFunction · 0.85
ipv6_pkt_l3_len_setFunction · 0.85

Calls

no outgoing calls

Tested by 1