函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\cgroup.c Create Date:2022-07-27 14:46:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__cgroup_bpf_run_filter_skb() - Run a program for packet filtering*@sk: The socket sending or receiving traffic*@skb: The skb that is being sent or received*@type: The type of program to be exectuted* If no socket is passed, or the socket is not of type

函数原型:int __cgroup_bpf_run_filter_skb(struct sock *sk, struct sk_buff *skb, enum bpf_attach_type type)

返回类型:int

参数:

类型参数名称
struct sock *sk
struct sk_buff *skb
enum bpf_attach_typetype
627  offset等于dataskb_network_header(skb)
633  如果非sk或非This helper checks if a socket is a full socket,* ie _not_ a timewait or request socket.则返回:0
636  如果sk_family不等于Internet IP Protocol sk_family不等于IP version 6 则返回:0
639  cgrp等于sock_cgroup_ptr( & sk_cgrp_data)
640  save_sk等于sk
641  sk等于sk
642  __skb_push(skb, offset)
645  Similar to bpf_compute_data_pointers(), except that save orginal* data in cb->data and cb->meta_data for restore.
647  如果type恒等于BPF_CGROUP_INET_EGRESS
648  ret等于To be used by __cgroup_bpf_run_filter_skb for EGRESS BPF progs* so BPF programs can request cwr for TCP packets( array of effective progs in this cgroup [type], skb, __bpf_prog_run_save_cb)
650  否则
651  ret等于BPF_PROG_RUN_ARRAY( array of effective progs in this cgroup [type], skb, __bpf_prog_run_save_cb)
653  ret等于如果ret恒等于1则0否则负EPERM
655  Restore data saved by bpf_compute_data_pointers().
656  __skb_pull(skb, offset)
657  sk等于save_sk
659  返回:ret