diff --git a/src/sys/include/net/netif.h b/src/sys/include/net/netif.h index 866a7d8..545ec7e 100644 --- a/src/sys/include/net/netif.h +++ b/src/sys/include/net/netif.h @@ -44,30 +44,6 @@ #include "net/pbuf.h" -/* Start of RouteNG Pseudocode */ -/* Route Cache Linked List - Not the fastest or leanest method, but its a start. - Dupliates almost 100% the layout of the netif table - allow complete reuse of existing routines for the - netif table to manipulate the route_cache table. */ -typedef struct __route_cache { - struct __route_cache *next; - uInt8 num; - struct ip_addr ip_addr; - struct ip_addr netmask; - struct ip_addr gw; - char hwaddr[6]; - char name[2]; - void *state; -} route_cache_t; - -extern route_cache_t *route_cache_list; - -void route_cache_init(); - -route_cache_t *route_cache_add(struct ip_addr *ipaddr, - struct ip_addr *netmask, - struct ip_addr *gw); struct netif { struct netif *next; diff --git a/src/sys/net/core/ip.c b/src/sys/net/core/ip.c index fad3eea..96deb94 100644 --- a/src/sys/net/core/ip.c +++ b/src/sys/net/core/ip.c @@ -63,8 +63,6 @@ #include "lwip/dhcp.h" #endif /* LWIP_DHCP */ -#include - /*-----------------------------------------------------------------------------------*/ /* ip_init: * @@ -139,8 +137,7 @@ struct netif * ip_route(struct ip_addr *dest) { - struct netif *netif = 0x0; - route_cache_t *route_cache = 0x0; + struct netif *netif; for(netif = netif_list; netif != NULL; netif = netif->next) { if(ip_addr_maskcmp(dest, &(netif->ip_addr), &(netif->netmask))) { @@ -148,20 +145,6 @@ } } - for(route_cache = route_cache_list; route_cache != NULL; route_cache = route_cache->next) { - if(ip_addr_maskcmp(dest, &(route_cache->ip_addr), &(route_cache->netmask))) { - kprintf ("RouteNG: Cache Hit\n"); - return route_cache; - } - } - - /* Garbage injection: No real RouteNG intelligence, just building entries - to test the cache system. */ - - kprintf ("RouteNG: Adding Cache Entry\n"); - IP4_ADDR(&(route_cache->netmask), 255,255,255,0); - route_cache_add(dest, &(route_cache->netmask), &(netif_default->gw)); - return netif_default; } #if IP_FORWARD diff --git a/src/sys/net/core/netif.c b/src/sys/net/core/netif.c index 49b25c0..1c61ea1 100644 --- a/src/sys/net/core/netif.c +++ b/src/sys/net/core/netif.c @@ -45,8 +45,6 @@ struct netif *netif_list = NULL; struct netif *netif_default = NULL; -route_cache_t *route_cache_list = NULL; - /*-----------------------------------------------------------------------------------*/ struct netif * netif_add(struct ip_addr *ipaddr, struct ip_addr *netmask, @@ -145,38 +143,3 @@ netif_list = netif_default = NULL; } /*-----------------------------------------------------------------------------------*/ - -/* Add to the Route Cache */ -route_cache_t * -route_cache_add(struct ip_addr *ipaddr, struct ip_addr *netmask, - struct ip_addr *gw) -{ - route_cache_t *route_cache; - static int route_cache_num = 0; - - route_cache = mem_malloc(sizeof(route_cache_t)); - - if(route_cache == NULL) { - return NULL; - } - - route_cache->num = route_cache_num++; - ip_addr_set(&(route_cache->ip_addr), ipaddr); - ip_addr_set(&(route_cache->netmask), netmask); - ip_addr_set(&(route_cache->gw), gw); - - /* TODO: WTF? Learn how to compile stuff before you check it in. */ - /** init(route_cache); **/ - - route_cache->next = route_cache_list; - route_cache_list = route_cache; - return route_cache; -} - -/* initialize the Route Cache */ -void -route_cache_init(void) -{ - route_cache_list = NULL; -} - diff --git a/src/sys/net/net/init.c b/src/sys/net/net/init.c index 6bdd200..0a502f0 100644 --- a/src/sys/net/net/init.c +++ b/src/sys/net/net/init.c @@ -70,11 +70,6 @@ sys_sem_t sem; netif_init(); - kprintf("LWIP netif initialized.\n"); - - route_cache_init(); - kprintf("RouteNG Route Cache initialized.\n"); - sem = sys_sem_new(0); tcpip_init(tcpip_init_done, &sem); sys_sem_wait(sem);