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-skbuff1, skb-& gt; users and skb-& gt; dataref differences skb-& gt; users: when the number of references increases, this value and skb-& gt; dataref both increase skb-& gt; dataref: when skb is cloned, only sk... 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
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.