Browse Source

Added pkb_reserve().

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
455b76980f
1 changed files with 14 additions and 0 deletions
  1. 14
    0
      src/include/gpxe/pkbuff.h

+ 14
- 0
src/include/gpxe/pkbuff.h View File

@@ -40,6 +40,20 @@ struct pk_buff {
40 40
 	struct ll_protocol *ll_protocol;
41 41
 };
42 42
 
43
+/**
44
+ * Reserve space at start of packet buffer
45
+ *
46
+ * @v pkb	Packet buffer
47
+ * @v len	Length to reserve
48
+ * @ret data	Pointer to new start of buffer
49
+ */
50
+static inline void * pkb_reserve ( struct pk_buff *pkb, size_t len ) {
51
+	pkb->data += len;
52
+	pkb->tail += len;
53
+	assert ( pkb->tail <= pkb->end );
54
+	return pkb->data;
55
+}
56
+
43 57
 /**
44 58
  * Add data to start of packet buffer
45 59
  *

Loading…
Cancel
Save