/linux-master/tools/testing/selftests/bpf/progs/ |
H A D | test_sk_lookup_kern.c | 20 /* Fill 'tuple' with L3 info, and attempt to find L4. On fail, return NULL. */ 61 struct bpf_sock_tuple *tuple; local 69 tuple = get_tuple(data, sizeof(*eth), data_end, eth->h_proto, &ipv4); 70 if (!tuple || tuple + sizeof *tuple > data_end) 73 tuple_len = ipv4 ? sizeof(tuple->ipv4) : sizeof(tuple->ipv6); 74 sk = bpf_sk_lookup_tcp(skb, tuple, tuple_len, BPF_F_CURRENT_NETNS, 0); 84 struct bpf_sock_tuple tuple local 96 struct bpf_sock_tuple tuple = {}; local 111 struct bpf_sock_tuple tuple = {}; local 125 struct bpf_sock_tuple tuple = {}; local 138 struct bpf_sock_tuple tuple = {}; local 147 struct bpf_sock_tuple tuple = {}; local 159 struct bpf_sock_tuple tuple = {}; local 169 struct bpf_sock_tuple tuple = {}; local [all...] |
H A D | connect6_prog.c | 30 struct bpf_sock_tuple tuple = {}; local 35 memset(&tuple.ipv6.saddr, 0, sizeof(tuple.ipv6.saddr)); 36 memset(&tuple.ipv6.sport, 0, sizeof(tuple.ipv6.sport)); 38 tuple.ipv6.daddr[0] = bpf_htonl(DST_REWRITE_IP6_0); 39 tuple.ipv6.daddr[1] = bpf_htonl(DST_REWRITE_IP6_1); 40 tuple.ipv6.daddr[2] = bpf_htonl(DST_REWRITE_IP6_2); 41 tuple.ipv6.daddr[3] = bpf_htonl(DST_REWRITE_IP6_3); 43 tuple [all...] |
H A D | test_sk_assign.c | 53 /* Fill 'tuple' with L3 info, and attempt to find L4. On fail, return NULL. */ 102 handle_udp(struct __sk_buff *skb, struct bpf_sock_tuple *tuple, bool ipv4) argument 110 tuple_len = ipv4 ? sizeof(tuple->ipv4) : sizeof(tuple->ipv6); 111 if ((void *)tuple + tuple_len > (void *)(long)skb->data_end) 114 sk = bpf_sk_lookup_udp(skb, tuple, tuple_len, BPF_F_CURRENT_NETNS, 0); 118 dport = ipv4 ? tuple->ipv4.dport : tuple->ipv6.dport; 133 handle_tcp(struct __sk_buff *skb, struct bpf_sock_tuple *tuple, bool ipv4) argument 141 tuple_len = ipv4 ? sizeof(tuple 174 struct bpf_sock_tuple *tuple; local [all...] |
H A D | cgroup_skb_sk_lookup_kern.c | 29 static inline void set_tuple(struct bpf_sock_tuple *tuple, argument 33 set_ip(tuple->ipv6.saddr, &ip6h->daddr); 34 set_ip(tuple->ipv6.daddr, &ip6h->saddr); 35 tuple->ipv6.sport = tcph->dest; 36 tuple->ipv6.dport = tcph->source; 44 struct bpf_sock_tuple tuple; local 45 size_t tuple_len = sizeof(tuple.ipv6); 48 set_tuple(&tuple, ip6h, tcph); 50 peer_sk = bpf_sk_lookup_tcp(skb, &tuple, tuple_len,
|
H A D | connect4_prog.c | 149 struct bpf_sock_tuple tuple = {}; local 153 memset(&tuple.ipv4.saddr, 0, sizeof(tuple.ipv4.saddr)); 154 memset(&tuple.ipv4.sport, 0, sizeof(tuple.ipv4.sport)); 156 tuple.ipv4.daddr = bpf_htonl(DST_REWRITE_IP4); 157 tuple.ipv4.dport = bpf_htons(DST_REWRITE_PORT4); 172 sk = bpf_sk_lookup_tcp(ctx, &tuple, sizeof(tuple.ipv4), 175 sk = bpf_sk_lookup_udp(ctx, &tuple, sizeo [all...] |
/linux-master/drivers/pcmcia/ |
H A D | pcmcia_cis.c | 27 * pccard_read_tuple() - internal CIS tuple access 31 * @parse: buffer where the tuple shall be parsed (or NULL, if no parse) 33 * pccard_read_tuple() reads out one tuple and attempts to parse it 38 tuple_t tuple; local 44 dev_warn(&s->dev, "no memory to read tuple\n"); 47 tuple.DesiredTuple = code; 48 tuple.Attributes = 0; 50 tuple.Attributes = TUPLE_RETURN_COMMON; 51 ret = pccard_get_first_tuple(s, function, &tuple); 54 tuple 82 pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function, cisdata_t code, cisparse_t *parse, void *priv_data, int (*loop_tuple) (tuple_t *tuple, cisparse_t *parse, void *priv_data)) argument 88 tuple_t tuple; local 154 pcmcia_do_loop_config(tuple_t *tuple, cisparse_t *parse, void *priv) argument 300 pcmcia_do_loop_tuple(tuple_t *tuple, cisparse_t *parse, void *priv) argument 319 pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code, int (*loop_tuple) (struct pcmcia_device *p_dev, tuple_t *tuple, void *priv_data), void *priv_data) argument 350 pcmcia_do_get_tuple(struct pcmcia_device *p_dev, tuple_t *tuple, void *priv) argument 398 pcmcia_do_get_mac(struct pcmcia_device *p_dev, tuple_t *tuple, void *priv) argument [all...] |
H A D | cistpl.c | 432 /* The high-level CIS tuple services */ 447 tuple_t *tuple) 454 tuple->TupleLink = tuple->Flags = 0; 457 tuple->CISOffset = tuple->LinkOffset = 0; 458 SPACE(tuple->Flags) = HAS_LINK(tuple->Flags) = 1; 460 if ((s->functions > 1) && !(tuple->Attributes & TUPLE_RETURN_COMMON)) { 461 cisdata_t req = tuple 446 pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple) argument 474 follow_link(struct pcmcia_socket *s, tuple_t *tuple) argument 521 pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_t *tuple) argument 633 pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple) argument 659 parse_device(tuple_t *tuple, cistpl_device_t *device) argument 720 parse_checksum(tuple_t *tuple, cistpl_checksum_t *csum) argument 733 parse_longlink(tuple_t *tuple, cistpl_longlink_t *link) argument 742 parse_longlink_mfc(tuple_t *tuple, cistpl_longlink_mfc_t *link) argument 793 parse_vers_1(tuple_t *tuple, cistpl_vers_1_t *vers_1) argument 810 parse_altstr(tuple_t *tuple, cistpl_altstr_t *altstr) argument 822 parse_jedec(tuple_t *tuple, cistpl_jedec_t *jedec) argument 842 parse_manfid(tuple_t *tuple, cistpl_manfid_t *m) argument 852 parse_funcid(tuple_t *tuple, cistpl_funcid_t *f) argument 864 parse_funce(tuple_t *tuple, cistpl_funce_t *f) argument 878 parse_config(tuple_t *tuple, cistpl_config_t *config) argument 1078 parse_cftable_entry(tuple_t *tuple, cistpl_cftable_entry_t *entry) argument 1202 parse_device_geo(tuple_t *tuple, cistpl_device_geo_t *geo) argument 1226 parse_vers_2(tuple_t *tuple, cistpl_vers_2_t *v2) argument 1247 parse_org(tuple_t *tuple, cistpl_org_t *org) argument 1270 parse_format(tuple_t *tuple, cistpl_format_t *fmt) argument 1288 pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse) argument 1378 tuple_t *tuple; local 1476 tuple_t tuple; local [all...] |
/linux-master/net/ipv4/netfilter/ |
H A D | nf_nat_h323.c | 105 if (addr.ip == ct->tuplehash[dir].tuple.src.u3.ip && 118 &ct->tuplehash[!dir].tuple.dst.u3.ip, 123 tuple.dst.u3, 125 } else if (addr.ip == ct->tuplehash[dir].tuple.dst.u3.ip && 130 &ct->tuplehash[!dir].tuple.src.u3.ip, 135 tuple.src.u3, 157 addr.ip == ct->tuplehash[dir].tuple.src.u3.ip && 158 port == ct->tuplehash[dir].tuple.src.u.udp.port) { 161 &ct->tuplehash[!dir].tuple.dst.u3.ip, 162 ntohs(ct->tuplehash[!dir].tuple [all...] |
/linux-master/kernel/bpf/ |
H A D | mprog.c | 7 static int bpf_mprog_link(struct bpf_tuple *tuple, argument 25 tuple->link = link; 26 tuple->prog = link->prog; 30 static int bpf_mprog_prog(struct bpf_tuple *tuple, argument 48 tuple->link = NULL; 49 tuple->prog = prog; 53 static int bpf_mprog_tuple_relative(struct bpf_tuple *tuple, argument 60 memset(tuple, 0, sizeof(*tuple)); 62 return bpf_mprog_link(tuple, id_or_f 72 bpf_mprog_tuple_put(struct bpf_tuple *tuple) argument 178 bpf_mprog_pos_exact(struct bpf_mprog_entry *entry, struct bpf_tuple *tuple) argument 193 bpf_mprog_pos_before(struct bpf_mprog_entry *entry, struct bpf_tuple *tuple) argument 209 bpf_mprog_pos_after(struct bpf_mprog_entry *entry, struct bpf_tuple *tuple) argument 297 bpf_mprog_fetch(struct bpf_mprog_entry *entry, struct bpf_tuple *tuple, int idx) argument [all...] |
/linux-master/drivers/ssb/ |
H A D | sdio.c | 477 struct sdio_func_tuple *tuple; local 484 tuple = bus->host_sdio->tuples; 485 while (tuple) { 486 switch (tuple->code) { 488 switch (tuple->data[0]) { 490 GOTO_ERROR_ON((tuple->size != 7) && 491 (tuple->data[1] != 6), 494 mac = tuple->data + 2; 502 case 0x80: /* vendor specific tuple */ 503 switch (tuple [all...] |
/linux-master/drivers/net/wireless/broadcom/b43/ |
H A D | sdio.c | 96 struct sdio_func_tuple *tuple; local 101 tuple = func->tuples; 102 while (tuple) { 103 switch (tuple->code) { 105 switch (tuple->data[0]) { 107 if (tuple->size != 5) 109 vendor = tuple->data[1] | (tuple->data[2]<<8); 110 device = tuple->data[3] | (tuple [all...] |
/linux-master/include/linux/netfilter/ |
H A D | nf_conntrack_proto_gre.h | 20 struct nf_conntrack_tuple tuple; member in struct:nf_ct_gre_keymap 24 /* add new tuple->key_reply pair to keymap */ 32 struct net *net, struct nf_conntrack_tuple *tuple);
|
/linux-master/net/netfilter/ |
H A D | nf_flow_table_ip.c | 85 new_addr = flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].tuple.dst_v4.s_addr; 90 new_addr = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.src_v4.s_addr; 108 new_addr = flow->tuplehash[FLOW_OFFLOAD_DIR_REPLY].tuple.src_v4.s_addr; 113 new_addr = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.dst_v4.s_addr; 142 struct flow_offload_tuple *tuple) 149 tuple->encap[i].id = skb_vlan_tag_get(skb); 150 tuple->encap[i].proto = skb->vlan_proto; 156 tuple->encap[i].id = ntohs(veth->h_vlan_TCI); 157 tuple->encap[i].proto = skb->protocol; 161 tuple 141 nf_flow_tuple_encap(struct sk_buff *skb, struct flow_offload_tuple *tuple) argument 173 nf_flow_tuple_ip(struct nf_flowtable_ctx *ctx, struct sk_buff *skb, struct flow_offload_tuple *tuple) argument 257 nf_flow_dst_check(struct flow_offload_tuple *tuple) argument 351 struct flow_offload_tuple tuple = {}; local 576 nf_flow_tuple_ipv6(struct nf_flowtable_ctx *ctx, struct sk_buff *skb, struct flow_offload_tuple *tuple) argument 693 struct flow_offload_tuple tuple = {}; local [all...] |
H A D | xt_conntrack.c | 44 return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3, 53 return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3, 62 return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_REPLY].tuple.src.u3, 71 return conntrack_addrcmp(&ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3, 79 const struct nf_conntrack_tuple *tuple; local 81 tuple = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple; 89 (tuple->src.u.all == info->origsrc_port) ^ 94 (tuple->dst.u.all == info->origdst_port) ^ 98 tuple 123 const struct nf_conntrack_tuple *tuple; local [all...] |
H A D | nf_conntrack_proto_icmp.c | 28 struct net *net, struct nf_conntrack_tuple *tuple) 37 tuple->dst.u.icmp.type = hp->type; 38 tuple->src.u.icmp.id = hp->un.echo.id; 39 tuple->dst.u.icmp.code = hp->code; 56 bool nf_conntrack_invert_icmp_tuple(struct nf_conntrack_tuple *tuple, argument 63 tuple->src.u.icmp.id = orig->src.u.icmp.id; 64 tuple->dst.u.icmp.type = invmap[orig->dst.u.icmp.type] - 1; 65 tuple->dst.u.icmp.code = orig->dst.u.icmp.code; 89 if (ct->tuplehash[0].tuple.dst.u.icmp.type >= sizeof(valid_new) || 90 !valid_new[ct->tuplehash[0].tuple 27 icmp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff, struct net *net, struct nf_conntrack_tuple *tuple) argument 274 icmp_nlattr_to_tuple(struct nlattr *tb[], struct nf_conntrack_tuple *tuple, u_int32_t flags) argument [all...] |
H A D | nf_nat_sip.c | 107 if (nf_inet_addr_cmp(&ct->tuplehash[dir].tuple.src.u3, addr) && 108 ct->tuplehash[dir].tuple.src.u.udp.port == port) { 109 newaddr = ct->tuplehash[!dir].tuple.dst.u3; 110 newport = ct->tuplehash[!dir].tuple.dst.u.udp.port; 111 } else if (nf_inet_addr_cmp(&ct->tuplehash[dir].tuple.dst.u3, addr) && 112 ct->tuplehash[dir].tuple.dst.u.udp.port == port) { 113 newaddr = ct->tuplehash[!dir].tuple.src.u3; 115 ct->tuplehash[!dir].tuple.src.u.udp.port; 189 &ct->tuplehash[dir].tuple.src.u3) || 190 port != ct->tuplehash[dir].tuple [all...] |
H A D | nf_conntrack_tftp.c | 48 struct nf_conntrack_tuple *tuple; local 61 nf_ct_dump_tuple(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); 62 nf_ct_dump_tuple(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); 69 tuple = &ct->tuplehash[IP_CT_DIR_REPLY].tuple; 72 &tuple->src.u3, &tuple->dst.u3, 73 IPPROTO_UDP, NULL, &tuple->dst.u.udp.port); 76 nf_ct_dump_tuple(&exp->tuple);
|
H A D | nf_flow_table_core.c | 24 struct flow_offload_tuple *ft = &flow->tuplehash[dir].tuple; 25 struct nf_conntrack_tuple *ctt = &flow->ct->tuplehash[dir].tuple; 93 struct dst_entry *dst = route->tuple[dir].dst; 95 route->tuple[dir].dst = NULL; 104 struct flow_offload_tuple *flow_tuple = &flow->tuplehash[dir].tuple; 117 flow_tuple->iifidx = route->tuple[dir].in.ifindex; 118 for (i = route->tuple[dir].in.num_encaps - 1; i >= 0; i--) { 119 flow_tuple->encap[j].id = route->tuple[dir].in.encap[i].id; 120 flow_tuple->encap[j].proto = route->tuple[dir].in.encap[i].proto; 121 if (route->tuple[di 228 const struct flow_offload_tuple *tuple = data; local 243 const struct flow_offload_tuple *tuple = arg->key; local 356 flow_offload_lookup(struct nf_flowtable *flow_table, struct flow_offload_tuple *tuple) argument [all...] |
H A D | nf_conntrack_proto_icmpv6.c | 34 struct nf_conntrack_tuple *tuple) 42 tuple->dst.u.icmp.type = hp->icmp6_type; 43 tuple->src.u.icmp.id = hp->icmp6_identifier; 44 tuple->dst.u.icmp.code = hp->icmp6_code; 68 bool nf_conntrack_invert_icmpv6_tuple(struct nf_conntrack_tuple *tuple, argument 75 tuple->src.u.icmp.id = orig->src.u.icmp.id; 76 tuple->dst.u.icmp.type = invmap[type] - 1; 77 tuple->dst.u.icmp.code = orig->dst.u.icmp.code; 102 int type = ct->tuplehash[0].tuple.dst.u.icmp.type - 128; 108 nf_ct_dump_tuple_ipv6(&ct->tuplehash[0].tuple); 31 icmpv6_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff, struct net *net, struct nf_conntrack_tuple *tuple) argument 249 icmpv6_nlattr_to_tuple(struct nlattr *tb[], struct nf_conntrack_tuple *tuple, u_int32_t flags) argument [all...] |
H A D | nf_nat_proto.c | 41 const struct nf_conntrack_tuple *tuple, 48 newport = tuple->src.u.udp.port; 52 newport = tuple->dst.u.udp.port; 56 nf_csum_update(skb, iphdroff, &hdr->check, tuple, maniptype); 67 const struct nf_conntrack_tuple *tuple, 76 __udp_manip_pkt(skb, iphdroff, hdr, tuple, maniptype, !!hdr->check); 83 const struct nf_conntrack_tuple *tuple, 93 __udp_manip_pkt(skb, iphdroff, hdr, tuple, maniptype, true); 101 const struct nf_conntrack_tuple *tuple, 122 hdr->source = tuple 39 __udp_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, struct udphdr *hdr, const struct nf_conntrack_tuple *tuple, enum nf_nat_manip_type maniptype, bool do_csum) argument 65 udp_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, unsigned int hdroff, const struct nf_conntrack_tuple *tuple, enum nf_nat_manip_type maniptype) argument 81 udplite_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, unsigned int hdroff, const struct nf_conntrack_tuple *tuple, enum nf_nat_manip_type maniptype) argument 99 sctp_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, unsigned int hdroff, const struct nf_conntrack_tuple *tuple, enum nf_nat_manip_type maniptype) argument 141 tcp_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, unsigned int hdroff, const struct nf_conntrack_tuple *tuple, enum nf_nat_manip_type maniptype) argument 183 dccp_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, unsigned int hdroff, const struct nf_conntrack_tuple *tuple, enum nf_nat_manip_type maniptype) argument 223 icmp_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, unsigned int hdroff, const struct nf_conntrack_tuple *tuple, enum nf_nat_manip_type maniptype) argument 254 icmpv6_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, unsigned int hdroff, const struct nf_conntrack_tuple *tuple, enum nf_nat_manip_type maniptype) argument 278 gre_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, unsigned int hdroff, const struct nf_conntrack_tuple *tuple, enum nf_nat_manip_type maniptype) argument 317 l4proto_manip_pkt(struct sk_buff *skb, unsigned int iphdroff, unsigned int hdroff, const struct nf_conntrack_tuple *tuple, enum nf_nat_manip_type maniptype) argument [all...] |
H A D | nf_flow_table_offload.c | 91 const struct flow_offload_tuple *tuple, 112 if (tuple->xmit_type == FLOW_OFFLOAD_XMIT_TC) 113 key->meta.ingress_ifindex = tuple->tc.iifidx; 115 key->meta.ingress_ifindex = tuple->iifidx; 119 if (tuple->encap_num > 0 && !(tuple->in_vlan_ingress & BIT(0)) && 120 tuple->encap[0].proto == htons(ETH_P_8021Q)) { 123 tuple->encap[0].id, 124 tuple->encap[0].proto); 128 if (tuple 90 nf_flow_rule_match(struct nf_flow_match *match, const struct flow_offload_tuple *tuple, struct dst_entry *other_dst) argument 632 const struct flow_offload_tuple *tuple; local 737 const struct flow_offload_tuple *tuple, *other_tuple; local 822 nf_flow_offload_init(struct flow_cls_offload *cls_flow, __be16 proto, int priority, enum flow_cls_command cmd, const struct flow_offload_tuple *tuple, struct netlink_ext_ack *extack) argument [all...] |
/linux-master/net/netfilter/ipvs/ |
H A D | ip_vs_nfct.c | 100 * CIP->VIP will remain the same, so leave the tuple in 104 new_tuple = ct->tuplehash[IP_CT_DIR_REPLY].tuple; 122 ARG_TUPLE(&ct->tuplehash[IP_CT_DIR_REPLY].tuple)); 157 orig = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple; 158 ip_vs_conn_fill_param(net_ipvs(net), exp->tuple.src.l3num, orig->dst.protonum, 167 new_reply = ct->tuplehash[IP_CT_DIR_REPLY].tuple; 168 IP_VS_DBG_BUF(7, "%s: ct=%p before alter: reply tuple=" 183 new_reply = ct->tuplehash[IP_CT_DIR_REPLY].tuple; 184 IP_VS_DBG_BUF(7, "%s: ct=%p before alter: reply tuple=" 192 IP_VS_DBG_BUF(7, "%s: ct=%p, status=0x%lX, tuple 246 struct nf_conntrack_tuple tuple; local [all...] |
/linux-master/include/net/netfilter/ |
H A D | nf_conntrack_count.h | 26 const struct nf_conntrack_tuple *tuple, 30 const struct nf_conntrack_tuple *tuple,
|
H A D | nf_conntrack_expect.h | 25 /* We expect this tuple, with the following mask */ 26 struct nf_conntrack_tuple tuple; member in struct:nf_conntrack_expect 93 const struct nf_conntrack_tuple *tuple); 98 const struct nf_conntrack_tuple *tuple); 103 const struct nf_conntrack_tuple *tuple, bool unlink);
|
/linux-master/tools/testing/selftests/bpf/prog_tests/ |
H A D | cls_redirect.c | 32 struct tuple { struct 95 int *server, int *conn, struct tuple *tuple) 119 if (CHECK_FAIL(!fill_addr_port(sa, &tuple->dst))) 126 if (CHECK_FAIL(!fill_addr_port(sa, &tuple->src))) 129 tuple->family = ss.ss_family; 277 const struct tuple *tuple) 279 in_port_t sport = tuple->src.port; 290 if (tuple 94 set_up_conn(const struct sockaddr *addr, socklen_t len, int type, int *server, int *conn, struct tuple *tuple) argument 276 build_input(const struct test_cfg *test, void *const buf, const struct tuple *tuple) argument 403 struct tuple *tuple = &tuples[test->type][j]; local [all...] |