tcp_prot结构体可在linux-5.0.1/net/ipv4/tcp_ipv4.c中寻得,tcp_prot指定了TCP协议栈的访问接口函数,socket接口层里sock->opt->connect和sock->opt->accept对应的接口函数即是在这里制定的,sock->opt->connect实际调用的是tcp_v4_connect函数,sock->opt->accept实际调用的是inet_csk_accept函数。tcp_init函数...
set for this state */ break; //未连接 case SS_UNCONNECTED: err = -EISCONN; //socket内部状态不是TCP_CLOSE,说明socket并未完全关闭 if (sk->sk_state != TCP_CLOSE) goto out; //是否开启BPF连接的钩子 if (BPF_CGROUP_PRE_CONNECT_ENABLED(sk)) { //调用connect err = sk->sk_prot->pre_c...
17 .sendmsg = tcp_sendmsg, 18 .sendpage = tcp_sendpage, 19 .backlog_rcv = tcp_v4_do_rcv, 20 .release_cb = tcp_release_cb, 21 .hash = inet_hash, 22 .unhash = inet_unhash, 23 .get_port = inet_csk_get_port, 24 .enter_memory_pressure = tcp_enter_memory_pressure, 25 .leav...
{structtcp_sock *tp =tcp_sk(sk);structsk_buff *buff;interr; tcp_call_bpf(sk, BPF_SOCK_OPS_TCP_CONNECT_CB,0, NULL);if(inet_csk(sk)->icsk_af_ops->rebuild_header(sk))return-EHOSTUNREACH;/*Routing failure or similar.*/tcp_connect_init(sk);if(unlikely(tp->repair)) { tcp_finish_...
bpf_trace_printk("tcp_push mss_now %u nonagle:%u size_goal:%u\\n",mss_now , nonagle, size_goal ); } return 0; }; int kprobe__tcp_sendmsg_locked(struct pt_regs *ctx, struct sock *sk, struct msghdr *msg, size_t size)
.bpf_bypass_getsockopt = tcp_bpf_bypass_getsockopt, .keepalive = tcp_set_keepalive, .recvmsg = tcp_recvmsg, .sendmsg = tcp_sendmsg, .sendpage = tcp_sendpage, .backlog_rcv = tcp_v4_do_rcv, .release_cb = tcp_release_cb, .hash = inet_hash, .unhash = inet_unhash, .get_port =...
31.6 BPF Output / BPF输出1046 31.7 Summary / 小结 1047 Chapter 32. 原始IP 1049 32.1 Introduction / 概述1049 32.2 Code Introduction / 代码介绍1050 32.3 Raw IP protosw Structure / 原始IP的protosw结构1051 32.4 rip_init Function / rip_init函数 1053 32.5 rip_input Function / rip_input函数 1053...
16.4 write,writev,sendto和sendmsg系统调用 16.5 sendmsg系统调用 16.6 sendit函数 16.6.1 uiomove函数 16.6.2 举例 16.6.3 sendit代码 16.7 sosend函数 16.7.1 可靠的协议缓存 16.7.2 不可靠的协议缓存 16.7.3 sosend函数小结 16.7.4 性能问题
The Socket tracer and TCP stats connector can't be enabled together. Since Vizier v0.14.12 (from #1989), the socket tracer adds a BPF probe to tcp_sendmsg which conflicts with the TCP stats connector's probe. Reproducing the issue Runnin...
BPF的输出 837 31.7 小结 838 第32章 原始IP 839 32.1 引言 839 32.2 代码介绍 839 32.2.1 全局变量 839 32.2.2 统计量 840 32.3 原始 IP的protosw结构 840 32.4 rip_init函数 842 32.5 rip_input函数 842 32.6 rip_output函数 844 32.7 rip_usrreq函数 846 32.8 rip_ctloutput函数 850 32.9 小结 852...