summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2006-07-19 20:16:48 +0200
committerMichael Brown2006-07-19 20:16:48 +0200
commit6858b14a34abea2bf5862bb4c1ddda161df5ebf7 (patch)
tree9a35bc9f315ae51bc3df81387d3783cb07042fcf /src
parentEliminate confusion between functions that return pointers and (diff)
downloadipxe-6858b14a34abea2bf5862bb4c1ddda161df5ebf7.tar.gz
ipxe-6858b14a34abea2bf5862bb4c1ddda161df5ebf7.tar.xz
ipxe-6858b14a34abea2bf5862bb4c1ddda161df5ebf7.zip
Add pkb_available()
Diffstat (limited to 'src')
-rw-r--r--src/include/gpxe/pkbuff.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/gpxe/pkbuff.h b/src/include/gpxe/pkbuff.h
index c363a50dc..21a771678 100644
--- a/src/include/gpxe/pkbuff.h
+++ b/src/include/gpxe/pkbuff.h
@@ -136,6 +136,16 @@ static inline size_t pkb_len ( struct pk_buff *pkb ) {
return ( pkb->tail - pkb->data );
}
+/**
+ * Calculate available space in a packet buffer
+ *
+ * @v pkb Packet buffer
+ * @ret len Length of data available in buffer
+ */
+static inline size_t pkb_available ( struct pk_buff *pkb ) {
+ return ( pkb->end - pkb->tail );
+}
+
extern struct pk_buff * alloc_pkb ( size_t len );
extern void free_pkb ( struct pk_buff *pkb );