skb_clone
the kernel can clone the original, which consists
of making a copy of the sk_buff structure only and playing with the
reference counts to avoid releasing the shared data block prematurely. Buffer
cloning is done with the skb_clone function.
skb_copy
When he knows he needs to modify only the contents of the data in the area
between skb->start and skb->end, he can use
pskb_copy to clone just that area. When he thinks he may need to modify
the content of the fragment data blocks too, he must use skb_copy.
skb_copy_expand
Make a copy of both an &sk_buff and its data and while doing so allocate additional space.
This is used when the caller wishes to modify the data and needs a private copy of the data to alter as well as more space for new fields. Returns NULL on failure or the pointer to the buffer on success. The returned buffer has a reference count of 1.
阅读(963) | 评论(0) | 转发(0) |