summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/ipxe')
-rw-r--r--src/include/ipxe/if_arp.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/ipxe/if_arp.h b/src/include/ipxe/if_arp.h
index 4eb1f80b7..9d7b03fe8 100644
--- a/src/include/ipxe/if_arp.h
+++ b/src/include/ipxe/if_arp.h
@@ -99,4 +99,14 @@ static inline void * arp_target_pa ( struct arphdr *arphdr ) {
return ( arp_target_ha ( arphdr ) + arphdr->ar_hln );
}
+/** ARP packet length
+ *
+ * @v arphdr ARP header
+ * @ret len Length (including header)
+ */
+static inline size_t arp_len ( struct arphdr *arphdr ) {
+ return ( sizeof ( *arphdr ) +
+ ( 2 * ( arphdr->ar_hln + arphdr->ar_pln ) ) );
+}
+
#endif /* _IPXE_IF_ARP_H */