{"id":4181,"date":"2022-12-20T17:39:38","date_gmt":"2022-12-20T20:39:38","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/skb_insert-man9\/"},"modified":"2022-12-20T17:39:38","modified_gmt":"2022-12-20T20:39:38","slug":"skb_insert-man9","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/skb_insert-man9\/","title":{"rendered":"SKB_INSERT (man9)"},"content":{"rendered":"<h1 align=\"center\">SKB_INSERT<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#RETURN VALUE\">RETURN VALUE<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#AVAILABILITY\">AVAILABILITY<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">__skb_insert, skb_insert, skb_append \u2212 insert an sk_buff into a list<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <linux\/skbuff.h><\/b><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"89%\">\n<p style=\"margin-top: 1em\"><b>void __skb_insert(struct sk_buff<\/b> <i>*newsk<\/i><b>, struct sk_buff<\/b> <i>*prev<\/i><b>, struct sk_buff<\/b> <i>*next<\/i><b>, struct sk_buff_head<\/b> <i>*list<\/i><b>)<\/b><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p><b>void skb_insert(struct sk_buff<\/b> <i>*old<\/i><b>, struct sk_buff<\/b> <i>*newsk<\/i><b>)<\/b><\/p>\n<\/table>\n<p style=\"margin-left:11%;\"><b>void skb_append(struct sk_buff<\/b> <i>*old<\/i><b>, struct sk_buff<\/b> <i>*newsk<\/i><b>)<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>skb_insert<\/b> and <b>skb_append<\/b> are essentially wrapper functions for <b>__skb_insert<\/b> (see <b>NOTES<\/b>, below.) <b>__skb_insert<\/b> inserts <i>newsk<\/i> into <i>list<\/i>, and resets the appropriate next and prev pointers. <i>prev<\/i> and <i>next<\/i> are used to frame <i>newsk<\/i> in <i>list<\/i>. After setting the next and prev pointers in <i>newsk<\/i>, <b>__skb_insert<\/b> sets the prev pointer in <i>next<\/i> and the next pointer in <i>prev<\/i>, sets the list pointer in <i>newsk<\/i>, and increments the qlen counter in <i>list<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>skb_insert<\/b> and <b>skb_append<\/b> should be used to add sk_buffs to a list rather than performing this task manually; in addition to performing this task in a standardized way, these functions also provide for interrupt diasabling and prevent list mangling. Both of these functions use the list pointer in <i>old<\/i> to determine to which list <i>newsk<\/i> should be attached.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>skb_insert<\/b> function adds <i>newsk<\/i> to the list before <i>old<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>skb_append<\/b> function adds <i>newsk<\/i> to the list after <i>old<\/i>.<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">It is important to note the difference between not only <b>skb_insert<\/b>, <b>skb_append<\/b> and <b>__skb_insert<\/b>, but all the <b>__skb_<\/b> functions and their <b>skb_<\/b> counterparts. Essentially, the <b>__skb_<\/b> functions are non-atomic, and should only be used with interrupts disabled. As a convenience, the <b>skb_<\/b> functions are provided, which perform interrupt disable \/ enable wrapper functionality in addition to performing their specific tasks.<\/p>\n<h2>AVAILABILITY <a name=\"AVAILABILITY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Linux 1.0+<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>intro<\/b>(9), <b>skb_queue_head<\/b>(9), <b>skb_queue_tail<\/b>(9)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/usr\/src\/linux\/net\/ax25\/af_ax25.c \/usr\/src\/linux\/net\/core\/skbuff.c \/usr\/src\/linux\/net\/ipv4\/tcp_input.c \/usr\/src\/linux\/net\/netrom\/nr_in.c<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Cyrus Durgin <cider@speakeasy.org><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  __skb_insert, skb_insert, skb_append \u2212 insert an sk_buff into a list <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1222],"tags":[1226,1223,1225,1261],"class_list":["post-4181","post","type-post","status-publish","format-standard","hentry","category-9-rutinas-del-nucleo","tag-1226","tag-kernel","tag-man9","tag-skb_insert"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4181"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4181\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}