summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2006-04-24 21:34:51 +0200
committerMichael Brown2006-04-24 21:34:51 +0200
commit455b76980f99c746346a241dc69af6f973722867 (patch)
tree5b59d66b241afa90369ce67a743b67052693fbcb /src/include
parentWe have our own ARP layer now. (diff)
downloadipxe-455b76980f99c746346a241dc69af6f973722867.tar.gz
ipxe-455b76980f99c746346a241dc69af6f973722867.tar.xz
ipxe-455b76980f99c746346a241dc69af6f973722867.zip
Added pkb_reserve().
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/pkbuff.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/include/gpxe/pkbuff.h b/src/include/gpxe/pkbuff.h
index 2e3980a8..895367ae 100644
--- a/src/include/gpxe/pkbuff.h
+++ b/src/include/gpxe/pkbuff.h
@@ -41,6 +41,20 @@ struct pk_buff {
};
/**
+ * Reserve space at start of packet buffer
+ *
+ * @v pkb Packet buffer
+ * @v len Length to reserve
+ * @ret data Pointer to new start of buffer
+ */
+static inline void * pkb_reserve ( struct pk_buff *pkb, size_t len ) {
+ pkb->data += len;
+ pkb->tail += len;
+ assert ( pkb->tail <= pkb->end );
+ return pkb->data;
+}
+
+/**
* Add data to start of packet buffer
*
* @v pkb Packet buffer