diff options
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a01b6f84e3bc..acf17af45af9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -493,6 +493,19 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list, | |||
493 | } | 493 | } |
494 | 494 | ||
495 | /** | 495 | /** |
496 | * skb_queue_is_first - check if skb is the first entry in the queue | ||
497 | * @list: queue head | ||
498 | * @skb: buffer | ||
499 | * | ||
500 | * Returns true if @skb is the first buffer on the list. | ||
501 | */ | ||
502 | static inline bool skb_queue_is_first(const struct sk_buff_head *list, | ||
503 | const struct sk_buff *skb) | ||
504 | { | ||
505 | return (skb->prev == (struct sk_buff *) list); | ||
506 | } | ||
507 | |||
508 | /** | ||
496 | * skb_queue_next - return the next packet in the queue | 509 | * skb_queue_next - return the next packet in the queue |
497 | * @list: queue head | 510 | * @list: queue head |
498 | * @skb: current buffer | 511 | * @skb: current buffer |
@@ -511,6 +524,24 @@ static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list, | |||
511 | } | 524 | } |
512 | 525 | ||
513 | /** | 526 | /** |
527 | * skb_queue_prev - return the prev packet in the queue | ||
528 | * @list: queue head | ||
529 | * @skb: current buffer | ||
530 | * | ||
531 | * Return the prev packet in @list before @skb. It is only valid to | ||
532 | * call this if skb_queue_is_first() evaluates to false. | ||
533 | */ | ||
534 | static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list, | ||
535 | const struct sk_buff *skb) | ||
536 | { | ||
537 | /* This BUG_ON may seem severe, but if we just return then we | ||
538 | * are going to dereference garbage. | ||
539 | */ | ||
540 | BUG_ON(skb_queue_is_first(list, skb)); | ||
541 | return skb->prev; | ||
542 | } | ||
543 | |||
544 | /** | ||
514 | * skb_get - reference buffer | 545 | * skb_get - reference buffer |
515 | * @skb: buffer to reference | 546 | * @skb: buffer to reference |
516 | * | 547 | * |
@@ -1652,6 +1683,8 @@ extern int skb_splice_bits(struct sk_buff *skb, | |||
1652 | extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | 1683 | extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); |
1653 | extern void skb_split(struct sk_buff *skb, | 1684 | extern void skb_split(struct sk_buff *skb, |
1654 | struct sk_buff *skb1, const u32 len); | 1685 | struct sk_buff *skb1, const u32 len); |
1686 | extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, | ||
1687 | int shiftlen); | ||
1655 | 1688 | ||
1656 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); | 1689 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); |
1657 | 1690 | ||