Function report | 
Source Code:kernel\bpf\syscall.c | 
Create Date:2022-07-28 12:53:28 | 
| Last Modify:2022-05-19 18:06:12 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:bpf_prog_load_check_attach
Proto:static int bpf_prog_load_check_attach(enum bpf_prog_type prog_type, enum bpf_attach_type expected_attach_type, u32 btf_id, u32 prog_fd)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| enum bpf_prog_type | prog_type | |
| enum bpf_attach_type | expected_attach_type | |
| u32 | btf_id | |
| u32 | prog_fd | 
| 1644 | Case prog_type == BPF_PROG_TYPE_TRACING | 
| 1645 | If btf_id > Max # of type identifier Then Return -EINVAL | 
| 1647 | Break | 
| 1648 | Default | 
| 1651 | Break | 
| 1655 | Case prog_type == BPF_PROG_TYPE_CGROUP_SOCK | 
| 1657 | Case expected_attach_type == BPF_CGROUP_INET_SOCK_CREATE | 
| 1658 | Case expected_attach_type == BPF_CGROUP_INET4_POST_BIND | 
| 1659 | Case expected_attach_type == BPF_CGROUP_INET6_POST_BIND | 
| 1660 | Return 0 | 
| 1661 | Default | 
| 1662 | Return -EINVAL | 
| 1664 | Case prog_type == BPF_PROG_TYPE_CGROUP_SOCK_ADDR | 
| 1666 | Case expected_attach_type == BPF_CGROUP_INET4_BIND | 
| 1667 | Case expected_attach_type == BPF_CGROUP_INET6_BIND | 
| 1668 | Case expected_attach_type == BPF_CGROUP_INET4_CONNECT | 
| 1669 | Case expected_attach_type == BPF_CGROUP_INET6_CONNECT | 
| 1670 | Case expected_attach_type == BPF_CGROUP_UDP4_SENDMSG | 
| 1671 | Case expected_attach_type == BPF_CGROUP_UDP6_SENDMSG | 
| 1672 | Case expected_attach_type == BPF_CGROUP_UDP4_RECVMSG | 
| 1673 | Case expected_attach_type == BPF_CGROUP_UDP6_RECVMSG | 
| 1674 | Return 0 | 
| 1675 | Default | 
| 1676 | Return -EINVAL | 
| 1678 | Case prog_type == BPF_PROG_TYPE_CGROUP_SKB | 
| 1680 | Case expected_attach_type == BPF_CGROUP_INET_INGRESS | 
| 1681 | Case expected_attach_type == BPF_CGROUP_INET_EGRESS | 
| 1682 | Return 0 | 
| 1683 | Default | 
| 1684 | Return -EINVAL | 
| 1686 | Case prog_type == BPF_PROG_TYPE_CGROUP_SOCKOPT | 
| 1688 | Case expected_attach_type == BPF_CGROUP_SETSOCKOPT | 
| 1689 | Case expected_attach_type == BPF_CGROUP_GETSOCKOPT | 
| 1690 | Return 0 | 
| 1691 | Default | 
| 1692 | Return -EINVAL | 
| 1694 | Default | 
| 1695 | Return 0 | 
| Name | Describe | 
|---|---|
| bpf_prog_load | 
| Source code conversion tool public plug-in interface  | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion  |