grub2/include/grub/net/interface.h
Paulo de Rezende Pinatti 10830203a0 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
2010-08-13 14:42:16 -03:00

71 lines
2.1 KiB
C

#ifndef GRUB_INTERFACE_HEADER
#define GRUB_INTERFACE_HEADER
//#include <grub/net.h>
#include <grub/net/type_net.h>
#include <grub/list.h>
#include <grub/misc.h>
struct grub_net_protocol_stack
{
struct grub_net_protocol_stack *next;
char *name;
grub_net_protocol_id_t id;
void *interface;
};
struct grub_net_application_transport_interface
{
struct grub_net_transport_network_interface *inner_layer;
void *data;
struct grub_net_application_layer_protocol *app_prot;
struct grub_net_transport_layer_protocol *trans_prot;
};
struct grub_net_transport_network_interface
{
struct grub_net_network_link_interface *inner_layer;
void *data;
struct grub_net_transport_layer_protocol *trans_prot;
struct grub_net_network_layer_protocol *net_prot;
};
struct grub_net_network_link_interface
{
void *data;
struct grub_net_network_layer_protocol *net_prot;
struct grub_net_link_layer_protocol *link_prot;
};
struct grub_net_protocol_stack *grub_net_protocol_stacks;
static inline void
grub_net_stack_register (struct grub_net_protocol_stack *stack)
{
grub_list_push (GRUB_AS_LIST_P (&grub_net_protocol_stacks),
GRUB_AS_LIST (stack));
}
/*
void grub_net_stack_unregister (struct grub_net_protocol_stack *stack)
{
grub_list_remove (GRUB_AS_LIST_P (&grub_net_protocol_stacks),
GRUB_AS_LIST (stack));
}*/
struct grub_net_protocol_stack *grub_net_protocol_stack_get (char *name);
/*
static inline void
grub_net_interface_application_transport_register (struct grub_net_application_transport_interface);
static inline void
grub_net_interface_application_transport_unregister (struct grub_net_application_transport_interface);
static inline void
grub_net_interface_transport_network_register (struct grub_net_transport_network_interface);
static inline void
grub_net_interface_transport_network_unregister (struct grub_net_transport_network_interface);
static inline void
grub_net_interface_network_link_register (struct grub_net_network_link_interface);
static inline void
grub_net_interface_network_link_unregister (struct grub_net_network_link_interface);*/
#endif