mirror of
https://github.com/xcat2/xNBA.git
synced 2025-02-09 15:23:30 +00:00
Added pkb_unput() and pkb_len().
This commit is contained in:
parent
744b895077
commit
ab139ceda9
@ -68,6 +68,17 @@ static inline void * pkb_put ( struct pk_buff *pkb, size_t len ) {
|
||||
return old_tail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove data from end of packet buffer
|
||||
*
|
||||
* @v pkb Packet buffer
|
||||
* @v len Length to remove
|
||||
*/
|
||||
static inline void pkb_unput ( struct pk_buff *pkb, size_t len ) {
|
||||
pkb->tail -= len;
|
||||
assert ( pkb->tail >= pkb->data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty a packet buffer
|
||||
*
|
||||
@ -77,4 +88,14 @@ static inline void pkb_empty ( struct pk_buff *pkb ) {
|
||||
pkb->tail = pkb->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate length of data in a packet buffer
|
||||
*
|
||||
* @v pkb Packet buffer
|
||||
* @ret len Length of data in buffer
|
||||
*/
|
||||
static inline size_t pkb_len ( struct pk_buff *pkb ) {
|
||||
return ( pkb->tail - pkb->data );
|
||||
}
|
||||
|
||||
#endif /* _PKBUFF_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user