A deep understanding of the key data structure of Linux kernel network technology-skbuff

Source: Internet
Author: User

Deep understanding of the key data structures of Linux kernel network technology-skbuff 1, skb-> users and skb-> dataref difference skb-> users: when the number of references increases, this value and skb-> dataref both add skb-> dataref: When skb is cloned, only skb-> dataref is added, the cloned skb's skb-> users = 12, pskb-> copy and skb-> copy pskb-> copy: only copies the skb data structure, do not copy the buffer content skb-> copy: copy the skb data structure will also copy the buffer content 3, skb operation functions: reverse, put, push, pull, actually only modified the pointer, put: Move skb-> tail, skb-> tail + n without adding or deleting data. The general function is to add data reverse: this function moves the skb-> data and skb-> tail pointers. The main function is to force alignment. It is often called immediately after the skb is allocated: move skb-> data Pointer, skb-> data-n. The general function is to add the protocol header pull: Move skb-> data Pointer, skb-> data + n, the general function is to delete protocol header 4, skb's linked list operation function skb_queue_head_init: Initialize the two-way linked list skb_queue_head, skb_queue_tail: add the buffer to the queue header and tail skb_dequeue, skb_dequeue_tail respectively: delete an element from the header or tail of the queue skb_queue_purge: Change the queue to an empty queue skb_queue_walk: cyclically run each element in the queue in turn

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.