Home
last modified time | relevance | path

Searched refs:skb (Results 1 – 3 of 3) sorted by relevance

/system/netd/bpf_progs/
Dbpf_net_helpers.h26 static uint64_t (*bpf_get_socket_cookie)(struct __sk_buff* skb) = (void*)BPF_FUNC_get_socket_cookie;
28 static uint32_t (*bpf_get_socket_uid)(struct __sk_buff* skb) = (void*)BPF_FUNC_get_socket_uid;
30 static int (*bpf_skb_pull_data)(struct __sk_buff* skb, __u32 len) = (void*)BPF_FUNC_skb_pull_data;
32 static int (*bpf_skb_load_bytes)(struct __sk_buff* skb, int off, void* to,
35 static int (*bpf_skb_store_bytes)(struct __sk_buff* skb, __u32 offset, const void* from, __u32 len,
41 static int64_t (*bpf_csum_update)(struct __sk_buff* skb, __wsum csum) = (void*)BPF_FUNC_csum_update;
43 static int (*bpf_skb_change_proto)(struct __sk_buff* skb, __be16 proto,
45 static int (*bpf_l3_csum_replace)(struct __sk_buff* skb, __u32 offset, __u64 from, __u64 to,
47 static int (*bpf_l4_csum_replace)(struct __sk_buff* skb, __u32 offset, __u64 from, __u64 to,
53 static int (*bpf_skb_change_head)(struct __sk_buff* skb, __u32 head_room,
[all …]
Dnetd.c100 static __always_inline inline void update_##the_stats_map(struct __sk_buff* skb, \
111 uint64_t bytes = skb->len; \
113 bool is_ipv6 = (skb->protocol == htons(ETH_P_IPV6)); \
136 static inline bool skip_owner_match(struct __sk_buff* skb) { in DEFINE_UPDATE_STATS()
139 if (skb->protocol == htons(ETH_P_IP)) { in DEFINE_UPDATE_STATS()
143 ret = bpf_skb_load_bytes(skb, offset, &proto, 1); in DEFINE_UPDATE_STATS()
148 ret = bpf_skb_load_bytes(skb, IPPROTO_IHL_OFF, &ihl, 1); in DEFINE_UPDATE_STATS()
150 ret = bpf_skb_load_bytes(skb, ihl * 4 + TCP_FLAG_OFF, &flag, 1); in DEFINE_UPDATE_STATS()
156 } else if (skb->protocol == htons(ETH_P_IPV6)) { in DEFINE_UPDATE_STATS()
159 ret = bpf_skb_load_bytes(skb, offset, &proto, 1); in DEFINE_UPDATE_STATS()
[all …]
Dclatd.c42 static inline __always_inline int nat64(struct __sk_buff* skb, bool is_ethernet) { in nat64() argument
44 void* data = (void*)(long)skb->data; in nat64()
45 const void* data_end = (void*)(long)skb->data_end; in nat64()
50 if (is_ethernet && (skb->pkt_type != PACKET_HOST)) return TC_ACT_OK; in nat64()
53 if (skb->protocol != htons(ETH_P_IPV6)) return TC_ACT_OK; in nat64()
79 .iif = skb->ifindex, in nat64()
135 if (bpf_skb_change_proto(skb, htons(ETH_P_IP), 0)) return TC_ACT_OK; in nat64()
152 bpf_csum_update(skb, sum6); in nat64()
155 data = (void*)(long)skb->data; in nat64()
156 data_end = (void*)(long)skb->data_end; in nat64()
[all …]