Lines Matching refs:hdr_size
227 * @hdr_size: size of the possible header before the ARP packet
231 static u8 *batadv_arp_hw_src(struct sk_buff *skb, int hdr_size)
235 addr = (u8 *)(skb->data + hdr_size);
244 * @hdr_size: size of the possible header before the ARP packet
248 static __be32 batadv_arp_ip_src(struct sk_buff *skb, int hdr_size)
250 return *(__force __be32 *)(batadv_arp_hw_src(skb, hdr_size) + ETH_ALEN);
256 * @hdr_size: size of the possible header before the ARP packet
260 static u8 *batadv_arp_hw_dst(struct sk_buff *skb, int hdr_size)
262 return batadv_arp_hw_src(skb, hdr_size) + ETH_ALEN + 4;
268 * @hdr_size: size of the possible header before the ARP packet
272 static __be32 batadv_arp_ip_dst(struct sk_buff *skb, int hdr_size)
274 u8 *dst = batadv_arp_hw_src(skb, hdr_size) + ETH_ALEN * 2 + 4;
420 * @hdr_size: size of the possible header before the ARP packet
424 int hdr_size, char *msg)
434 ip_src = batadv_arp_ip_src(skb, hdr_size);
435 ip_dst = batadv_arp_ip_dst(skb, hdr_size);
438 batadv_arp_hw_src(skb, hdr_size), &ip_src,
439 batadv_arp_hw_dst(skb, hdr_size), &ip_dst);
441 if (hdr_size < sizeof(struct batadv_unicast_packet))
491 int hdr_size, char *msg)
996 * @hdr_size: size of the possible header before the ARP packet in the skb
1001 struct sk_buff *skb, int hdr_size)
1010 if (unlikely(!pskb_may_pull(skb, hdr_size + ETH_HLEN)))
1013 ethhdr = (struct ethhdr *)(skb->data + hdr_size);
1019 if (unlikely(!pskb_may_pull(skb, hdr_size + ETH_HLEN +
1023 arphdr = (struct arphdr *)(skb->data + hdr_size + ETH_HLEN);
1041 ip_src = batadv_arp_ip_src(skb, hdr_size);
1042 ip_dst = batadv_arp_ip_dst(skb, hdr_size);
1049 hw_src = batadv_arp_hw_src(skb, hdr_size);
1055 hw_dst = batadv_arp_hw_dst(skb, hdr_size);
1069 * @hdr_size: the size of the batman-adv header encapsulating the packet
1075 static unsigned short batadv_dat_get_vid(struct sk_buff *skb, int *hdr_size)
1079 vid = batadv_get_vid(skb, *hdr_size);
1081 /* ARP parsing functions jump forward of hdr_size + ETH_HLEN.
1083 * hdr_size is updated so that the functions will still skip the
1087 *hdr_size += VLAN_HLEN;
1147 int hdr_size = 0;
1153 vid = batadv_dat_get_vid(skb, &hdr_size);
1155 type = batadv_arp_get_type(bat_priv, skb, hdr_size);
1162 batadv_dbg_arp(bat_priv, skb, hdr_size, "Parsing outgoing ARP REQUEST");
1164 ip_src = batadv_arp_ip_src(skb, hdr_size);
1165 hw_src = batadv_arp_hw_src(skb, hdr_size);
1166 ip_dst = batadv_arp_ip_dst(skb, hdr_size);
1209 skb->len + ETH_HLEN + hdr_size);
1229 * @hdr_size: size of the encapsulation header
1234 struct sk_buff *skb, int hdr_size)
1248 vid = batadv_dat_get_vid(skb, &hdr_size);
1250 type = batadv_arp_get_type(bat_priv, skb, hdr_size);
1254 hw_src = batadv_arp_hw_src(skb, hdr_size);
1255 ip_src = batadv_arp_ip_src(skb, hdr_size);
1256 ip_dst = batadv_arp_ip_dst(skb, hdr_size);
1258 batadv_dbg_arp(bat_priv, skb, hdr_size, "Parsing incoming ARP REQUEST");
1275 if (hdr_size == sizeof(struct batadv_unicast_4addr_packet))
1304 int hdr_size = 0;
1310 vid = batadv_dat_get_vid(skb, &hdr_size);
1312 type = batadv_arp_get_type(bat_priv, skb, hdr_size);
1316 batadv_dbg_arp(bat_priv, skb, hdr_size, "Parsing outgoing ARP REPLY");
1318 hw_src = batadv_arp_hw_src(skb, hdr_size);
1319 ip_src = batadv_arp_ip_src(skb, hdr_size);
1320 hw_dst = batadv_arp_hw_dst(skb, hdr_size);
1321 ip_dst = batadv_arp_ip_dst(skb, hdr_size);
1340 * @hdr_size: size of the encapsulation header
1346 struct sk_buff *skb, int hdr_size)
1358 vid = batadv_dat_get_vid(skb, &hdr_size);
1360 type = batadv_arp_get_type(bat_priv, skb, hdr_size);
1364 batadv_dbg_arp(bat_priv, skb, hdr_size, "Parsing incoming ARP REPLY");
1366 hw_src = batadv_arp_hw_src(skb, hdr_size);
1367 ip_src = batadv_arp_ip_src(skb, hdr_size);
1368 hw_dst = batadv_arp_hw_dst(skb, hdr_size);
1369 ip_dst = batadv_arp_ip_dst(skb, hdr_size);
1739 * @hdr_size: header size, up to the tail of the batman-adv header
1746 struct sk_buff *skb, int hdr_size)
1758 if (unlikely(!pskb_may_pull(skb, hdr_size + ETH_HLEN)))
1761 ethhdr = (struct ethhdr *)(skb->data + hdr_size);
1762 skb_set_network_header(skb, hdr_size + ETH_HLEN);
1769 vid = batadv_dat_get_vid(skb, &hdr_size);
1797 int hdr_size = sizeof(struct batadv_bcast_packet);
1809 vid = batadv_dat_get_vid(forw_packet->skb, &hdr_size);
1811 type = batadv_arp_get_type(bat_priv, forw_packet->skb, hdr_size);
1815 ip_dst = batadv_arp_ip_dst(forw_packet->skb, hdr_size);