BPF_FUNC_skb_change_proto() BPF_FUNC_skb_change_type() BPF_FUNC_skb_adjust_room() BPF_FUNC_skb_change_tail() BPF_FUNC_skb_get_tunnel_key() BPF_FUNC_skb_set_tunnel_key() BPF_FUNC_skb_get_tunnel_opt() BPF_FUNC_skb_set_tunnel_opt() BPF_FUNC_redirect() BPF_FUNC_get_route_realm(...
int bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags) Description Resize (trim or grow) the packet associated to skb to the new len. The flags are reserved for future usage, and must be left at zero. The basic idea is that the helper performs the needed work to change...
int bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags) Description Resize (trim or grow) the packet associated to skb to the new len. The flags are reserved for future usage, and must be left at zero. The basic idea is that the helper performs the needed work to change...
static int __init register_sk_filter_ops(void){bpf_register_prog_type(&sk_filter_type);bpf_register_prog_type(&sched_cls_type);bpf_register_prog_type(&sched_act_type);bpf_register_prog_type(&xdp_type);bpf_register_prog_type(&cg_skb_type); return 0;} BPF的好处在哪里?是因为它提供了...
type:当前bpf程序的类型(kprobe/tracepoint/perf_event/sk_filter/sched_cls/sched_act/xdp/cg_skb); aux:主要用来辅助verifier校验和转换的数据; orig_prog: bpf_func:运行时BPF程序的入口。如果JIT转换成功,这里指向的就是BPF程序JIT转换后的映像;否则这里指向内核解析器(interpreter)的通用入口__bpf_prog_run(...
skb->head = data; skb->data = data; skb->end = skb->tail + size; ... } 第二就是什么时候会使用no-linear,frag_list在处理IP分片时被使用,可以查看内核中的ip_fragment->ip_do_fragment函数,[1][2][3]中对这个部分的描述并不够详细,或者说对frags对描述还不够详细。
_skb_change_tail, bpf_skb_pull_data, bpf_csum_update, bpf_set_hash_invalid, bpf_get_numa_node_id, bpf_skb_change_head, bpf_get_socket_cookie, bpf_get_socket_uid, bpf_set_hash, bpf_skb_adjust_room, bpf_skb_get_xfrm_state, bpf_skb_load_bytes_relative, bpf_fib_lookup, bp...
{bpf_register_prog_type(&sk_filter_type);bpf_register_prog_type(&sched_cls_type);bpf_register_prog_type(&sched_act_type);bpf_register_prog_type(&xdp_type);bpf_register_prog_type(&cg_skb_type); return0; } BPF的好处在哪里?是因为它提供了一种在不修改内核代码的情况下,可以灵活修改内核处理...
static int __init register_sk_filter_ops(void){bpf_register_prog_type(&sk_filter_type);bpf_register_prog_type(&sched_cls_type);bpf_register_prog_type(&sched_act_type);bpf_register_prog_type(&xdp_type);bpf_register_prog_type(&cg_skb_type); ...
void*data = (void*)(long)skb->data; void*data_end = (void*)(long)skb->data_end; char*payload = data +sizeof(*eth) +sizeof(*ip) +sizeof(*tcp) 这样的方法在ingress中是成功的,但是在egress宏实际获取数据是失败的,我尝试使用如下代码打印在改变payload大小: ...