The new api will be used in a subsequent patch. Signed-off-by: Darrell Ball <dlu...@gmail.com> --- lib/dp-packet.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/lib/dp-packet.h b/lib/dp-packet.h index 7b85dd9..087f36a 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -353,9 +353,18 @@ dp_packet_set_l4(struct dp_packet *b, void *l4) } static inline size_t +dp_packet_l3_size(const struct dp_packet *b) +{ + return OVS_LIKELY(b->l3_ofs != UINT16_MAX) + ? (const char *)dp_packet_tail(b) - (const char *)dp_packet_l3(b) + - dp_packet_l2_pad_size(b) + : 0; +} + +static inline size_t dp_packet_l4_size(const struct dp_packet *b) { - return b->l4_ofs != UINT16_MAX + return OVS_LIKELY(b->l4_ofs != UINT16_MAX) ? (const char *)dp_packet_tail(b) - (const char *)dp_packet_l4(b) - dp_packet_l2_pad_size(b) : 0; -- 1.9.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev