.. | .. |
---|
793 | 793 | #ifdef CONFIG_SKB_EXTENSIONS |
---|
794 | 794 | __u8 active_extensions; |
---|
795 | 795 | #endif |
---|
| 796 | +#ifdef CONFIG_NET_OOB |
---|
| 797 | + __u8 oob:1; |
---|
| 798 | + __u8 oob_clone:1; |
---|
| 799 | + __u8 oob_cloned:1; |
---|
| 800 | +#endif |
---|
| 801 | + |
---|
796 | 802 | /* fields enclosed in headers_start/headers_end are copied |
---|
797 | 803 | * using a single memcpy() in __copy_skb_header() |
---|
798 | 804 | */ |
---|
.. | .. |
---|
1102 | 1108 | struct sk_buff *build_skb(void *data, unsigned int frag_size); |
---|
1103 | 1109 | struct sk_buff *build_skb_around(struct sk_buff *skb, |
---|
1104 | 1110 | void *data, unsigned int frag_size); |
---|
| 1111 | +#ifdef CONFIG_NET_OOB |
---|
| 1112 | + |
---|
| 1113 | +static inline void __skb_oob_copy(struct sk_buff *new, |
---|
| 1114 | + const struct sk_buff *old) |
---|
| 1115 | +{ |
---|
| 1116 | + new->oob = old->oob; |
---|
| 1117 | + new->oob_clone = old->oob_clone; |
---|
| 1118 | + new->oob_cloned = old->oob_cloned; |
---|
| 1119 | +} |
---|
| 1120 | + |
---|
| 1121 | +static inline bool skb_is_oob(const struct sk_buff *skb) |
---|
| 1122 | +{ |
---|
| 1123 | + return skb->oob; |
---|
| 1124 | +} |
---|
| 1125 | + |
---|
| 1126 | +static inline bool skb_is_oob_clone(const struct sk_buff *skb) |
---|
| 1127 | +{ |
---|
| 1128 | + return skb->oob_clone; |
---|
| 1129 | +} |
---|
| 1130 | + |
---|
| 1131 | +static inline bool skb_has_oob_clone(const struct sk_buff *skb) |
---|
| 1132 | +{ |
---|
| 1133 | + return skb->oob_cloned; |
---|
| 1134 | +} |
---|
| 1135 | + |
---|
| 1136 | +struct sk_buff *__netdev_alloc_oob_skb(struct net_device *dev, |
---|
| 1137 | + size_t len, size_t headroom, |
---|
| 1138 | + gfp_t gfp_mask); |
---|
| 1139 | +void __netdev_free_oob_skb(struct net_device *dev, struct sk_buff *skb); |
---|
| 1140 | +void netdev_reset_oob_skb(struct net_device *dev, struct sk_buff *skb, |
---|
| 1141 | + size_t headroom); |
---|
| 1142 | +struct sk_buff *skb_alloc_oob_head(gfp_t gfp_mask); |
---|
| 1143 | +void skb_morph_oob_skb(struct sk_buff *n, struct sk_buff *skb); |
---|
| 1144 | +bool skb_release_oob_skb(struct sk_buff *skb, int *dref); |
---|
| 1145 | + |
---|
| 1146 | +static inline bool recycle_oob_skb(struct sk_buff *skb) |
---|
| 1147 | +{ |
---|
| 1148 | + bool skb_oob_recycle(struct sk_buff *skb); |
---|
| 1149 | + |
---|
| 1150 | + if (!skb->oob) |
---|
| 1151 | + return false; |
---|
| 1152 | + |
---|
| 1153 | + return skb_oob_recycle(skb); |
---|
| 1154 | +} |
---|
| 1155 | + |
---|
| 1156 | +#else /* !CONFIG_NET_OOB */ |
---|
| 1157 | + |
---|
| 1158 | +static inline void __skb_oob_copy(struct sk_buff *new, |
---|
| 1159 | + const struct sk_buff *old) |
---|
| 1160 | +{ |
---|
| 1161 | +} |
---|
| 1162 | + |
---|
| 1163 | +static inline bool skb_is_oob(const struct sk_buff *skb) |
---|
| 1164 | +{ |
---|
| 1165 | + return false; |
---|
| 1166 | +} |
---|
| 1167 | + |
---|
| 1168 | +static inline bool recycle_oob_skb(struct sk_buff *skb) |
---|
| 1169 | +{ |
---|
| 1170 | + return false; |
---|
| 1171 | +} |
---|
| 1172 | + |
---|
| 1173 | +#endif /* !CONFIG_NET_OOB */ |
---|
1105 | 1174 | |
---|
1106 | 1175 | /** |
---|
1107 | 1176 | * alloc_skb - allocate a network buffer |
---|