summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/pkbuff.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/include/gpxe/pkbuff.h b/src/include/gpxe/pkbuff.h
index 21a771678..dc3d24c4b 100644
--- a/src/include/gpxe/pkbuff.h
+++ b/src/include/gpxe/pkbuff.h
@@ -137,12 +137,22 @@ static inline size_t pkb_len ( struct pk_buff *pkb ) {
}
/**
- * Calculate available space in a packet buffer
+ * Calculate available space at start of a packet buffer
*
* @v pkb Packet buffer
- * @ret len Length of data available in buffer
+ * @ret len Length of data available at start of buffer
*/
-static inline size_t pkb_available ( struct pk_buff *pkb ) {
+static inline size_t pkb_headroom ( struct pk_buff *pkb ) {
+ return ( pkb->data - pkb->head );
+}
+
+/**
+ * Calculate available space at end of a packet buffer
+ *
+ * @v pkb Packet buffer
+ * @ret len Length of data available at end of buffer
+ */
+static inline size_t pkb_tailroom ( struct pk_buff *pkb ) {
return ( pkb->end - pkb->tail );
}