Lines Matching refs:bat_priv
45 static void _batadv_update_route(struct batadv_priv *bat_priv, in _batadv_update_route() argument
65 batadv_dbg(BATADV_DBG_ROUTES, bat_priv, in _batadv_update_route()
67 batadv_tt_global_del_orig(bat_priv, orig_node, -1, in _batadv_update_route()
72 batadv_dbg(BATADV_DBG_ROUTES, bat_priv, in _batadv_update_route()
77 batadv_dbg(BATADV_DBG_ROUTES, bat_priv, in _batadv_update_route()
116 void batadv_update_route(struct batadv_priv *bat_priv, in batadv_update_route() argument
129 _batadv_update_route(bat_priv, orig_node, recv_if, neigh_node); in batadv_update_route()
141 int batadv_window_protected(struct batadv_priv *bat_priv, int32_t seq_num_diff, in batadv_window_protected() argument
151 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, in batadv_window_protected()
197 static int batadv_recv_my_icmp_packet(struct batadv_priv *bat_priv, in batadv_recv_my_icmp_packet() argument
219 primary_if = batadv_primary_if_get_selected(bat_priv); in batadv_recv_my_icmp_packet()
224 orig_node = batadv_orig_hash_find(bat_priv, icmph->orig); in batadv_recv_my_icmp_packet()
256 static int batadv_recv_icmp_ttl_exceeded(struct batadv_priv *bat_priv, in batadv_recv_icmp_ttl_exceeded() argument
273 primary_if = batadv_primary_if_get_selected(bat_priv); in batadv_recv_icmp_ttl_exceeded()
278 orig_node = batadv_orig_hash_find(bat_priv, icmp_packet->orig); in batadv_recv_icmp_ttl_exceeded()
308 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_icmp_packet() local
331 if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest)) in batadv_recv_icmp_packet()
358 if (batadv_is_my_mac(bat_priv, icmph->dst)) in batadv_recv_icmp_packet()
359 return batadv_recv_my_icmp_packet(bat_priv, skb); in batadv_recv_icmp_packet()
363 return batadv_recv_icmp_ttl_exceeded(bat_priv, skb); in batadv_recv_icmp_packet()
366 orig_node = batadv_orig_hash_find(bat_priv, icmph->dst); in batadv_recv_icmp_packet()
400 static int batadv_check_unicast_packet(struct batadv_priv *bat_priv, in batadv_check_unicast_packet() argument
420 if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest)) in batadv_check_unicast_packet()
436 batadv_find_router(struct batadv_priv *bat_priv, in batadv_find_router() argument
440 struct batadv_algo_ops *bao = bat_priv->bat_algo_ops; in batadv_find_router()
458 if (recv_if == BATADV_IF_DEFAULT || !atomic_read(&bat_priv->bonding) || in batadv_find_router()
566 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_route_unicast_packet() local
582 orig_node = batadv_orig_hash_find(bat_priv, unicast_packet->dest); in batadv_route_unicast_packet()
616 batadv_inc_counter(bat_priv, BATADV_CNT_FORWARD); in batadv_route_unicast_packet()
617 batadv_add_counter(bat_priv, BATADV_CNT_FORWARD_BYTES, in batadv_route_unicast_packet()
646 batadv_reroute_unicast_packet(struct batadv_priv *bat_priv, in batadv_reroute_unicast_packet() argument
655 if (batadv_is_my_client(bat_priv, dst_addr, vid)) { in batadv_reroute_unicast_packet()
656 primary_if = batadv_primary_if_get_selected(bat_priv); in batadv_reroute_unicast_packet()
660 orig_ttvn = (uint8_t)atomic_read(&bat_priv->tt.vn); in batadv_reroute_unicast_packet()
662 orig_node = batadv_transtable_search(bat_priv, NULL, dst_addr, in batadv_reroute_unicast_packet()
688 static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv, in batadv_check_unicast_ttvn() argument
715 if (batadv_tt_local_client_is_roaming(bat_priv, ethhdr->h_dest, vid)) { in batadv_check_unicast_ttvn()
716 if (batadv_reroute_unicast_packet(bat_priv, unicast_packet, in batadv_check_unicast_ttvn()
719 bat_priv, in batadv_check_unicast_ttvn()
735 curr_ttvn = (uint8_t)atomic_read(&bat_priv->tt.vn); in batadv_check_unicast_ttvn()
736 if (!batadv_is_my_mac(bat_priv, unicast_packet->dest)) { in batadv_check_unicast_ttvn()
737 orig_node = batadv_orig_hash_find(bat_priv, in batadv_check_unicast_ttvn()
762 if (batadv_reroute_unicast_packet(bat_priv, unicast_packet, in batadv_check_unicast_ttvn()
764 batadv_dbg_ratelimited(BATADV_DBG_TT, bat_priv, in batadv_check_unicast_ttvn()
775 if (!batadv_is_my_client(bat_priv, ethhdr->h_dest, vid)) in batadv_check_unicast_ttvn()
781 primary_if = batadv_primary_if_get_selected(bat_priv); in batadv_check_unicast_ttvn()
807 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_unhandled_unicast_packet() local
810 check = batadv_check_unicast_packet(bat_priv, skb, hdr_size); in batadv_recv_unhandled_unicast_packet()
816 if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) in batadv_recv_unhandled_unicast_packet()
825 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_unicast_packet() local
842 check = batadv_check_unicast_packet(bat_priv, skb, hdr_size); in batadv_recv_unicast_packet()
848 batadv_nc_skb_store_sniffed_unicast(bat_priv, skb); in batadv_recv_unicast_packet()
852 if (!batadv_check_unicast_ttvn(bat_priv, skb, hdr_size)) in batadv_recv_unicast_packet()
856 if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) { in batadv_recv_unicast_packet()
858 batadv_dat_inc_counter(bat_priv, in batadv_recv_unicast_packet()
861 orig_node = batadv_orig_hash_find(bat_priv, orig_addr); in batadv_recv_unicast_packet()
864 if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb, in batadv_recv_unicast_packet()
867 if (batadv_dat_snoop_incoming_arp_reply(bat_priv, skb, in batadv_recv_unicast_packet()
896 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_unicast_tvlv() local
903 if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0) in batadv_recv_unicast_tvlv()
922 ret = batadv_tvlv_containers_process(bat_priv, false, NULL, in batadv_recv_unicast_tvlv()
949 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_frag_packet() local
954 if (batadv_check_unicast_packet(bat_priv, skb, in batadv_recv_frag_packet()
959 orig_node_src = batadv_orig_hash_find(bat_priv, frag_packet->orig); in batadv_recv_frag_packet()
964 if (!batadv_is_my_mac(bat_priv, frag_packet->dest) && in batadv_recv_frag_packet()
970 batadv_inc_counter(bat_priv, BATADV_CNT_FRAG_RX); in batadv_recv_frag_packet()
971 batadv_add_counter(bat_priv, BATADV_CNT_FRAG_RX_BYTES, skb->len); in batadv_recv_frag_packet()
996 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); in batadv_recv_bcast_packet() local
1020 if (batadv_is_my_mac(bat_priv, ethhdr->h_source)) in batadv_recv_bcast_packet()
1026 if (batadv_is_my_mac(bat_priv, bcast_packet->orig)) in batadv_recv_bcast_packet()
1032 orig_node = batadv_orig_hash_find(bat_priv, bcast_packet->orig); in batadv_recv_bcast_packet()
1048 if (batadv_window_protected(bat_priv, seq_diff, in batadv_recv_bcast_packet()
1055 if (batadv_bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1)) in batadv_recv_bcast_packet()
1061 if (batadv_bla_check_bcast_duplist(bat_priv, skb)) in batadv_recv_bcast_packet()
1067 batadv_add_bcast_packet_to_list(bat_priv, skb, 1); in batadv_recv_bcast_packet()
1075 if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb, hdr_size)) in batadv_recv_bcast_packet()
1077 if (batadv_dat_snoop_incoming_arp_reply(bat_priv, skb, hdr_size)) in batadv_recv_bcast_packet()