Added ARP protocol to network stack and fixed bug in grub_netbuff_alloc function.

* include/grub/net/arp.h: added arp header, arp cache entry and related constants and functions
* net/arp.c: added functions arp_init_table, arp_find_entry, arp_resolve and arp_receive
* net/ethernet.c (send_ethernet_packet): replaced hardcoded hardware address by parameter target_addr
* net/ethernet.c (recv_ethernet_packet): added call to arp_receive when packet is of type 0x803 (ARP) and only return when packet is of type determined by parameter ethertype
* net/ip.c (send_ip_packet): added call to arp_resolve to determine hardware address of destination
* net/netbuff.c (grub_netbuff_alloc): fixed swapped parameters in call to grub_memalign
This commit is contained in:
Paulo de Rezende Pinatti committed 2010-08-13 14:42:16 -03:00
1 parent 7c978f0690
commit 10830203a0
12 files changed
+335 -56

No files matched your search

+2 -2
View File
@@ -113,7 +113,7 @@ tftp_open (struct grub_net_network_layer_interface *inf __attribute((unused)),
app_interface->trans_prot->send (inf,protstack->interface,nb);
/*Receive OACK*/
grub_netbuff_clear (nb);
grub_netbuff_reserve (nb,80*1024);
grub_netbuff_reserve (nb,2048);
return app_interface->app_prot->recv(inf,protstack,nb);
}
@@ -215,7 +215,7 @@ static int tftp_file_size (struct grub_net_network_layer_interface* inf ,
tftp_open (inf, protocol_stack,nb, filename);
grub_netbuff_clear (nb);
grub_netbuff_reserve (nb,80*1024);
grub_netbuff_reserve (nb,2048);
tftp_send_err (inf, protocol_stack,nb,"Abort transference.",0);
return tftp_file.size;