Added pkb_reserve().
authorMichael Brown <mcb30@etherboot.org>
Mon, 24 Apr 2006 19:34:51 +0000 (19:34 +0000)
committerMichael Brown <mcb30@etherboot.org>
Mon, 24 Apr 2006 19:34:51 +0000 (19:34 +0000)
src/include/gpxe/pkbuff.h

index 2e3980a..895367a 100644 (file)
@@ -40,6 +40,20 @@ struct pk_buff {
        struct ll_protocol *ll_protocol;
 };
 
+/**
+ * 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
  *