Lines Matching refs:sock_ops
476 struct bpf_sock_ops_kern sock_ops; in bpf_skops_hdr_opt_len() local
487 memset(&sock_ops, 0, offsetof(struct bpf_sock_ops_kern, temp)); in bpf_skops_hdr_opt_len()
489 sock_ops.op = BPF_SOCK_OPS_HDR_OPT_LEN_CB; in bpf_skops_hdr_opt_len()
505 sock_ops.sk = (struct sock *)req; in bpf_skops_hdr_opt_len()
506 sock_ops.syn_skb = syn_skb; in bpf_skops_hdr_opt_len()
510 sock_ops.is_fullsock = 1; in bpf_skops_hdr_opt_len()
511 sock_ops.sk = sk; in bpf_skops_hdr_opt_len()
514 sock_ops.args[0] = bpf_skops_write_hdr_opt_arg0(skb, synack_type); in bpf_skops_hdr_opt_len()
515 sock_ops.remaining_opt_len = *remaining; in bpf_skops_hdr_opt_len()
518 bpf_skops_init_skb(&sock_ops, skb, 0); in bpf_skops_hdr_opt_len()
520 err = BPF_CGROUP_RUN_PROG_SOCK_OPS_SK(&sock_ops, sk); in bpf_skops_hdr_opt_len()
522 if (err || sock_ops.remaining_opt_len == *remaining) in bpf_skops_hdr_opt_len()
525 opts->bpf_opt_len = *remaining - sock_ops.remaining_opt_len; in bpf_skops_hdr_opt_len()
539 struct bpf_sock_ops_kern sock_ops; in bpf_skops_write_hdr_opt() local
545 memset(&sock_ops, 0, offsetof(struct bpf_sock_ops_kern, temp)); in bpf_skops_write_hdr_opt()
547 sock_ops.op = BPF_SOCK_OPS_WRITE_HDR_OPT_CB; in bpf_skops_write_hdr_opt()
550 sock_ops.sk = (struct sock *)req; in bpf_skops_write_hdr_opt()
551 sock_ops.syn_skb = syn_skb; in bpf_skops_write_hdr_opt()
555 sock_ops.is_fullsock = 1; in bpf_skops_write_hdr_opt()
556 sock_ops.sk = sk; in bpf_skops_write_hdr_opt()
559 sock_ops.args[0] = bpf_skops_write_hdr_opt_arg0(skb, synack_type); in bpf_skops_write_hdr_opt()
560 sock_ops.remaining_opt_len = max_opt_len; in bpf_skops_write_hdr_opt()
562 bpf_skops_init_skb(&sock_ops, skb, first_opt_off); in bpf_skops_write_hdr_opt()
564 err = BPF_CGROUP_RUN_PROG_SOCK_OPS_SK(&sock_ops, sk); in bpf_skops_write_hdr_opt()
569 nr_written = max_opt_len - sock_ops.remaining_opt_len; in bpf_skops_write_hdr_opt()