diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2016-01-21 11:39:29 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-03-04 11:15:24 +0300 |
commit | 4f4cd556370d6798722057dedec53bfbacb9ff71 (patch) | |
tree | cf7da4fb4af1deb65d93a23f609f2f759e32ddfd /include/odp | |
parent | 0f38eb8469ebd085f8a040f5a36b0445c136fe4a (diff) |
api: packet: added multicast flags
Added packet flags for Ethernet and IP broad- and multicast.
For application, it's more effective to check a flag than all
destionation address bits.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp')
-rw-r--r-- | include/odp/api/spec/packet_flags.h | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/include/odp/api/spec/packet_flags.h b/include/odp/api/spec/packet_flags.h index 960a5249a..0148521ad 100644 --- a/include/odp/api/spec/packet_flags.h +++ b/include/odp/api/spec/packet_flags.h @@ -102,11 +102,29 @@ int odp_packet_has_l4(odp_packet_t pkt); * * @param pkt Packet handle * @retval non-zero if packet contains a valid eth header - * @retval 0 if packet does not contain a valid & known eth header + * @retval 0 if packet does not contain a valid eth header */ int odp_packet_has_eth(odp_packet_t pkt); /** + * Check for Ethernet broadcast address + * + * @param pkt Packet handle + * @retval non-zero if Ethernet destination address is the broadcast address + * @retval 0 if Ethernet destination address is not the broadcast address + */ +int odp_packet_has_eth_bcast(odp_packet_t pkt); + +/** + * Check for Ethernet multicast address + * + * @param pkt Packet handle + * @retval non-zero if Ethernet destination address is a multicast address + * @retval 0 if Ethernet destination address is not a multicast address + */ +int odp_packet_has_eth_mcast(odp_packet_t pkt); + +/** * Check for jumbo frame * * @param pkt Packet handle @@ -161,6 +179,24 @@ int odp_packet_has_ipv4(odp_packet_t pkt); int odp_packet_has_ipv6(odp_packet_t pkt); /** + * Check for IP broadcast address + * + * @param pkt Packet handle + * @retval non-zero if IP destination address is a broadcast address + * @retval 0 if IP destination address is not a broadcast address + */ +int odp_packet_has_ip_bcast(odp_packet_t pkt); + +/** + * Check for IP multicast address + * + * @param pkt Packet handle + * @retval non-zero if IP destination address is a multicast address + * @retval 0 if IP destination address is not a multicast address + */ +int odp_packet_has_ip_mcast(odp_packet_t pkt); + +/** * Check for IP fragment * * @param pkt Packet handle @@ -265,6 +301,22 @@ void odp_packet_has_l4_set(odp_packet_t pkt, int val); void odp_packet_has_eth_set(odp_packet_t pkt, int val); /** + * Set flag for Ethernet broadcast address + * + * @param pkt Packet handle + * @param val Value + */ +void odp_packet_has_eth_bcast_set(odp_packet_t pkt, int val); + +/** + * Set flag for Ethernet multicast address + * + * @param pkt Packet handle + * @param val Value + */ +void odp_packet_has_eth_mcast_set(odp_packet_t pkt, int val); + +/** * Set flag for jumbo frame * * @param pkt Packet handle @@ -313,6 +365,22 @@ void odp_packet_has_ipv4_set(odp_packet_t pkt, int val); void odp_packet_has_ipv6_set(odp_packet_t pkt, int val); /** + * Set flag for IP broadcast address + * + * @param pkt Packet handle + * @param val Value + */ +void odp_packet_has_ip_bcast_set(odp_packet_t pkt, int val); + +/** + * Set flag for IP multicast address + * + * @param pkt Packet handle + * @param val Value + */ +void odp_packet_has_ip_mcast_set(odp_packet_t pkt, int val); + +/** * Set flag for IP fragment * * @param pkt Packet handle |