Lines Matching refs:skb

87 static inline __u32 get_data_len(struct __sk_buff *skb)
89 __u32 length = skb->len;
90 if (skb->vlan_present == 1) {
93 if (skb->family == AF_INET) {
96 if (skb->family == AF_INET6) {
103 int socket_iface_stats(struct __sk_buff *skb)
105 if (skb == NULL) {
109 if (skb->pkt_type == PACKET_LOOPBACK) {
113 uint64_t ifindex = skb->ifindex;
121 if (skb->pkt_type == PACKET_OUTGOING) {
124 __sync_fetch_and_add(&value_if->txBytes, skb->len);
129 __sync_fetch_and_add(&value_if->rxBytes, skb->len);
255 int bpf_cgroup_skb_uid_ingress(struct __sk_buff *skb)
258 if (skb == NULL) {
261 if (netfirewall_policy_ingress(skb) != SK_PASS) {
264 if (skb->pkt_type == PACKET_LOOPBACK) {
268 if (skb == NULL || skb->pkt_type == PACKET_LOOPBACK) {
273 uint64_t sock_uid = bpf_get_socket_uid(skb);
286 net_bear_type_map_value net_bear_mark_type = check_socket_fwmark(skb->mark);
299 __sync_fetch_and_add(&value->rxBytes, skb->len);
301 socket_cookie_stats_key sock_cookie = bpf_get_socket_cookie(skb);
310 __sync_fetch_and_add(&value_cookie->rxBytes, skb->len);
314 app_uid_if_stats_key key = {.uId = sock_uid, .ifIndex = skb->ifindex};
323 __sync_fetch_and_add(&value_uid_if->rxBytes, get_data_len(skb));
326 if (filter_sim_stats(skb->local_ip4) == 1) {
327 app_uid_sim_stats_key key_sim = {.uId = sock_uid, .ifIndex = skb->ifindex,
328 .ifType = get_iface_type(skb->local_ip4)};
337 __sync_fetch_and_add(&value_uid_sim->rxBytes, get_data_len(skb));
345 int bpf_cgroup_skb_uid_egress(struct __sk_buff *skb)
348 if (skb == NULL) {
351 if (netfirewall_policy_egress(skb) != SK_PASS) {
354 if (skb->pkt_type == PACKET_LOOPBACK) {
358 if (skb == NULL || skb->pkt_type == PACKET_LOOPBACK) {
363 uint64_t sock_uid = bpf_get_socket_uid(skb);
375 net_bear_type_map_value net_bear_mark_type = check_socket_fwmark(skb->mark);
389 __sync_fetch_and_add(&value->txBytes, skb->len);
391 socket_cookie_stats_key sock_cookie = bpf_get_socket_cookie(skb);
400 __sync_fetch_and_add(&value_cookie->txBytes, skb->len);
404 app_uid_if_stats_key key = {.uId = sock_uid, .ifIndex = skb->ifindex};
413 __sync_fetch_and_add(&value_uid_if->txBytes, get_data_len(skb));
416 if (filter_sim_stats(skb->local_ip4) == 1) {
417 app_uid_sim_stats_key key_sim = {.uId = sock_uid, .ifIndex = skb->ifindex,
418 .ifType = get_iface_type(skb->local_ip4)};
427 __sync_fetch_and_add(&value_uid_sim->txBytes, get_data_len(skb));