File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 3030 "sk_fullsock" ,
3131 "sk_nulls_for_each" ,
3232 "skb_shinfo" ,
33+ "skb_headlen" ,
34+ "skb_headroom" ,
35+ "skb_is_nonlinear" ,
36+ "skb_tailroom" ,
37+ "skb_availroom" ,
3338)
3439
3540
@@ -260,3 +265,28 @@ def skb_shinfo(skb: Object) -> Object:
260265 return cast ("struct skb_shared_info *" , skb .head + skb .end )
261266 else :
262267 return cast ("struct skb_shared_info *" , skb .end )
268+
269+ def skb_headlen (skb : Object ) -> Object :
270+ prog = skb .prog_
271+ return skb .len - skb .data_len
272+
273+ def skb_headroom (skb : Object ) -> Object :
274+ prog = skb .prog_
275+ return skb .data - skb .head
276+
277+ def skb_is_nonlinear (skb : Object ) -> Object :
278+ prog = skb .prog_
279+ return skb .data_len
280+
281+ def skb_tailroom (skb : Object ) -> Object :
282+ prog = skb .prog_
283+ if skb_is_nonlinear (skb ):
284+ return 0
285+ return skb .end - skb .tail
286+
287+ def skb_availroom (skb : Object ) -> Object :
288+ prog = skb .prog_
289+ if skb_is_nonlinear (skb ):
290+ return 0
291+
292+ return skb .end - skb .tail - skb .reserved_tailroom
You can’t perform that action at this time.
0 commit comments