mirror of
https://git.proxmox.com/git/grub2
synced 2025-05-21 14:20:49 +00:00

* 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
71 lines
2.1 KiB
C
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
|