Remove some dead code
This commit is contained in:
parent
760a7e5aed
commit
ce3a2ec025
13 changed files with 3 additions and 164 deletions
|
@ -1438,7 +1438,6 @@ module = {
|
|||
common = net/udp.c;
|
||||
common = net/ethernet.c;
|
||||
common = net/arp.c;
|
||||
common = net/interface.c;
|
||||
common = net/netbuff.c;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include <grub/net/arp.h>
|
||||
#include <grub/net/netbuff.h>
|
||||
#include <grub/net/interface.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/net.h>
|
||||
#include <grub/net/ethernet.h>
|
||||
|
@ -92,7 +91,7 @@ grub_net_arp_resolve(struct grub_net_network_level_interface *inf,
|
|||
return GRUB_ERR_NONE;
|
||||
}
|
||||
current_time = grub_get_time_ms();
|
||||
if (current_time - start_time > TIMEOUT_TIME_MS)
|
||||
if (current_time - start_time > 3000)
|
||||
break;
|
||||
} while (! entry);
|
||||
grub_netbuff_clear(nb);
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <grub/net/ip.h>
|
||||
#include <grub/net/arp.h>
|
||||
#include <grub/net/netbuff.h>
|
||||
#include <grub/net/interface.h>
|
||||
#include <grub/net.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/net/arp.h>
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
/*#include <grub/net/interface.h>
|
||||
|
||||
#define INTERFACE_REGISTER_FUNCTIONS(layerprevious,layernext) \
|
||||
struct grub_net_##layername_layer_protocol *grub_net_##layername_layer_protocols;\
|
||||
\
|
||||
void grub_net_##layerprevious_##layernext_interface_register (struct grub_net_##layername_layer_protocol *prot)\
|
||||
{\
|
||||
grub_list_push (GRUB_AS_LIST_P (&grub_net_##layername_layer_protocols),\
|
||||
GRUB_AS_LIST (prot));\
|
||||
}\
|
||||
\
|
||||
void grub_net_##layerprevious_##layernext_interface_unregister (struct grub_net_##layername_layer_protocol *prot);\
|
||||
{\
|
||||
grub_list_remove (GRUB_AS_LIST_P (&grub_net_##layername_layer_protocols),\
|
||||
GRUB_AS_LIST (prot));\
|
||||
}\
|
||||
|
||||
INTERFACE_REGISTER_FUNCTIONS("application","transport");
|
||||
INTERFACE_REGISTER_FUNCTIONS("transport","network");
|
||||
INTERFACE_REGISTER_FUNCTIONS("network","link");
|
||||
INTERFACE_REGISTER_FUNCTIONS("link");*/
|
||||
|
||||
#include <grub/mm.h>
|
||||
#include <grub/net/interface.h>
|
||||
struct grub_net_protocol_stack
|
||||
*grub_net_protocol_stack_get (char *name)
|
||||
{
|
||||
struct grub_net_protocol_stack *p;
|
||||
|
||||
for (p = grub_net_protocol_stacks; p; p = p->next)
|
||||
{
|
||||
if (!grub_strcmp(p->name,name))
|
||||
return p;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
|
@ -2,8 +2,6 @@
|
|||
#include <grub/misc.h>
|
||||
#include <grub/net/arp.h>
|
||||
#include <grub/net/ethernet.h>
|
||||
#include <grub/net/interface.h>
|
||||
#include <grub/net/type_net.h>
|
||||
#include <grub/net.h>
|
||||
#include <grub/net/netbuff.h>
|
||||
#include <grub/mm.h>
|
||||
|
|
|
@ -73,7 +73,7 @@ struct grub_net_buff *grub_netbuff_alloc ( grub_size_t len )
|
|||
|
||||
len = ALIGN_UP (len,NETBUFF_ALIGN);
|
||||
data = grub_memalign (NETBUFF_ALIGN, len + sizeof (*nb));
|
||||
nb = (struct grub_net_buff *) ((int)data + len);
|
||||
nb = (struct grub_net_buff *) ((grub_uint8_t *) data + len);
|
||||
nb->head = nb->data = nb->tail = data;
|
||||
nb->end = (char *) nb;
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
#include <grub/net/ip.h>
|
||||
#include <grub/net/ethernet.h>
|
||||
#include <grub/net/netbuff.h>
|
||||
#include <grub/net/interface.h>
|
||||
#include <grub/net/type_net.h>
|
||||
#include <grub/net.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/dl.h>
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
#include <grub/net.h>
|
||||
#include <grub/net/udp.h>
|
||||
#include <grub/net/ip.h>
|
||||
#include <grub/net/type_net.h>
|
||||
#include <grub/net/netbuff.h>
|
||||
#include <grub/net/protocol.h>
|
||||
#include <grub/net/interface.h>
|
||||
#include <grub/time.h>
|
||||
|
||||
grub_err_t
|
||||
|
|
|
@ -23,9 +23,8 @@
|
|||
#include <grub/err.h>
|
||||
#include <grub/list.h>
|
||||
#include <grub/fs.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/net/netbuff.h>
|
||||
#include <grub/net/type_net.h>
|
||||
#include <grub/net/protocol.h>
|
||||
|
||||
typedef struct grub_fs *grub_net_app_level_t;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define GRUB_NET_ARP_HEADER 1
|
||||
#include <grub/misc.h>
|
||||
#include <grub/net.h>
|
||||
#include <grub/net/protocol.h>
|
||||
|
||||
/* IANA ARP constant to define hardware type as ethernet */
|
||||
#define ARPHRD_ETHERNET 1
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
#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
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef GRUB_PROTOCOL_HEADER
|
||||
#define GRUB_PROTOCOL_HEADER
|
||||
#include <grub/err.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/net/interface.h>
|
||||
#include <grub/net/netbuff.h>
|
||||
#include <grub/net/type_net.h>
|
||||
|
||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||
#ifndef GRUB_TYPES_NET_HEADER
|
||||
#define GRUB_TYPES_NET_HEADER 1
|
||||
#include <grub/misc.h>
|
||||
|
||||
|
||||
#define UDP_PCKT 0x11
|
||||
#define IP_PCKT 0x0800
|
||||
#define TIMEOUT_TIME_MS 3*1000
|
||||
typedef enum
|
||||
{
|
||||
GRUB_NET_TFTP_ID,
|
||||
GRUB_NET_UDP_ID,
|
||||
GRUB_NET_IPV4_ID,
|
||||
GRUB_NET_IPV6_ID,
|
||||
GRUB_NET_ETHERNET_ID,
|
||||
GRUB_NET_ARP_ID,
|
||||
GRUB_NET_DHCP_ID
|
||||
}grub_net_protocol_id_t;
|
||||
|
||||
|
||||
typedef union grub_net_network_layer_netaddress
|
||||
{
|
||||
grub_uint32_t ipv4;
|
||||
} grub_net_network_layer_address_t;
|
||||
|
||||
typedef union grub_net_network_layer_address
|
||||
{
|
||||
struct {
|
||||
grub_uint32_t base;
|
||||
int masksize;
|
||||
} ipv4;
|
||||
} grub_net_network_layer_netaddress_t;
|
||||
#endif
|
Loading…
Reference in a new issue