Lines Matching +full:sec +full:- +full:v4
1 // SPDX-License-Identifier: GPL-2.0
48 } v6_addr_map SEC(".maps");
55 } v4_addr_map SEC(".maps");
63 } v4_lpm_val_map SEC(".maps");
70 } tcp_port_map SEC(".maps");
77 } udp_port_map SEC(".maps");
79 enum ip_type { V4 = 1, V6 = 2 }; enumerator
144 return lpm_val ? lpm_val->val : 0; in filter_ipv4_lpm()
151 if (info->type == V6) { in filter_src_dst_ip()
152 match_info->v6_src_ip_match = in filter_src_dst_ip()
153 filter_ipv6_addr(&info->ip.ipv6->saddr); in filter_src_dst_ip()
154 } else if (info->type == V4) { in filter_src_dst_ip()
155 match_info->v4_src_ip_match = in filter_src_dst_ip()
156 filter_ipv4_addr(info->ip.ipv4->saddr); in filter_src_dst_ip()
157 match_info->v4_src_prefix_match = in filter_src_dst_ip()
158 filter_ipv4_lpm(info->ip.ipv4->saddr); in filter_src_dst_ip()
159 match_info->v4_dst_prefix_match = in filter_src_dst_ip()
160 filter_ipv4_lpm(info->ip.ipv4->daddr); in filter_src_dst_ip()
183 info->flags |= TCP_SYN; in set_tcp_flags()
185 info->flags |= TCP_ACK; in set_tcp_flags()
187 info->flags |= TCP_RST; in set_tcp_flags()
198 info->sport = bpf_ntohs(tcp->source); in parse_tcp()
199 info->dport = bpf_ntohs(tcp->dest); in parse_tcp()
213 info->sport = bpf_ntohs(udp->source); in parse_udp()
214 info->dport = bpf_ntohs(udp->dest); in parse_udp()
237 if (info->proto == IPPROTO_TCP) { in filter_transport_hdr()
241 match_info->is_tcp = true; in filter_transport_hdr()
242 match_info->is_tcp_syn = (info->flags & TCP_SYN) > 0; in filter_transport_hdr()
244 match_info->tcp_dp_match = filter_tcp_port(info->dport); in filter_transport_hdr()
245 } else if (info->proto == IPPROTO_UDP) { in filter_transport_hdr()
249 match_info->udp_dp_match = filter_udp_port(info->dport); in filter_transport_hdr()
250 match_info->udp_sp_match = filter_udp_port(info->sport); in filter_transport_hdr()
265 if (udp->dest != bpf_htons(6666)) in parse_gue_v6()
268 info->flags |= TUNNEL; in parse_gue_v6()
279 info->type = V6; in parse_gue_v6()
280 info->proto = inner_ip6h->nexthdr; in parse_gue_v6()
281 info->ip.ipv6 = inner_ip6h; in parse_gue_v6()
282 info->trans_hdr_offset += sizeof(struct ipv6hdr) + sizeof(struct udphdr); in parse_gue_v6()
289 info->type = V4; in parse_gue_v6()
290 info->proto = inner_ip4h->protocol; in parse_gue_v6()
291 info->ip.ipv4 = inner_ip4h; in parse_gue_v6()
292 info->trans_hdr_offset += sizeof(struct iphdr) + sizeof(struct udphdr); in parse_gue_v6()
306 info->proto = ip6h->nexthdr; in parse_ipv6_gue()
307 info->ip.ipv6 = ip6h; in parse_ipv6_gue()
308 info->type = V6; in parse_ipv6_gue()
309 info->trans_hdr_offset = sizeof(struct ethhdr) + sizeof(struct ipv6hdr); in parse_ipv6_gue()
311 if (info->proto == IPPROTO_UDP) in parse_ipv6_gue()
317 SEC("xdp")
320 void *data_end = (void *)(long)(ctx->data_end); in edgewall()
321 void *data = (void *)(long)(ctx->data); in edgewall()
333 proto = eth->h_proto; in edgewall()
364 char LICENSE[] SEC("license") = "GPL";