Lines Matching defs:nb

104 grub_net_recv_icmp6_packet (struct grub_net_buff *nb,
116 icmph = (struct icmp_header *) nb->data;
118 if (nb->tail - nb->data < (grub_ssize_t) sizeof (*icmph))
120 grub_netbuff_free (nb);
126 if (checksum != grub_net_ip_transport_checksum (nb,
133 grub_net_ip_transport_checksum (nb,
138 grub_netbuff_free (nb);
143 err = grub_netbuff_pull (nb, sizeof (*icmph));
146 grub_netbuff_free (nb);
163 nb_reply = grub_netbuff_alloc (nb->tail - nb->data + 512);
166 grub_netbuff_free (nb);
169 err = grub_netbuff_reserve (nb_reply, nb->tail - nb->data + 512);
172 err = grub_netbuff_push (nb_reply, nb->tail - nb->data);
175 grub_memcpy (nb_reply->data, nb->data, nb->tail - nb->data);
191 grub_netbuff_free (nb);
208 nbh = (struct neighbour_solicit *) nb->data;
209 err = grub_netbuff_pull (nb, sizeof (struct router_adv));
212 grub_netbuff_free (nb);
215 for (ptr = (grub_uint8_t *) nb->data; ptr < nb->tail;
219 if (ohdr->len == 0 || ptr + 8 * ohdr->len > nb->tail)
221 grub_netbuff_free (nb);
251 grub_netbuff_free (nb);
297 grub_netbuff_free (nb);
311 nbh = (struct neighbour_advertise *) nb->data;
312 err = grub_netbuff_pull (nb, sizeof (*nbh));
315 grub_netbuff_free (nb);
319 for (ptr = (grub_uint8_t *) nb->data; ptr < nb->tail;
323 if (ohdr->len == 0 || ptr + 8 * ohdr->len > nb->tail)
325 grub_netbuff_free (nb);
345 err = grub_netbuff_pull (nb, sizeof (struct router_adv));
348 grub_netbuff_free (nb);
351 for (ptr = (grub_uint8_t *) nb->data; ptr < nb->tail;
355 if (ohdr->len == 0 || ptr + 8 * ohdr->len > nb->tail)
357 grub_netbuff_free (nb);
429 if (ptr != nb->tail)
434 grub_netbuff_free (nb);
442 struct grub_net_buff *nb;
461 nb = grub_netbuff_alloc (sizeof (struct neighbour_solicit)
467 if (!nb)
469 err = grub_netbuff_reserve (nb,
476 err = grub_netbuff_push (nb, 6);
480 grub_memcpy (nb->data, inf->hwaddress.mac, 6);
481 err = grub_netbuff_push (nb, sizeof (*ohdr));
485 ohdr = (struct option_header *) nb->data;
488 err = grub_netbuff_push (nb, sizeof (*sol));
492 sol = (struct neighbour_solicit *) nb->data;
496 err = grub_netbuff_push (nb, sizeof (*icmphr));
500 icmphr = (struct icmp_header *) nb->data;
504 icmphr->checksum = grub_net_ip_transport_checksum (nb,
508 nbd = nb->data;
509 err = grub_net_send_ip_packet (inf, &multicast, &ll_multicast, nb,
521 nb->data = nbd;
522 err = grub_net_send_ip_packet (inf, &multicast, &ll_multicast, nb,
529 grub_netbuff_free (nb);