Skip to content
Snippets Groups Projects
Commit 4d34da9e authored by Guy Zana's avatar Guy Zana
Browse files

net: cleaned up if_llatbl.h and add to net_init()

parent 9738a944
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ extern "C" { ...@@ -10,6 +10,7 @@ extern "C" {
#include <bsd/sys/sys/domain.h> #include <bsd/sys/sys/domain.h>
#include <bsd/sys/net/netisr.h> #include <bsd/sys/net/netisr.h>
#include <bsd/sys/net/if.h> #include <bsd/sys/net/if.h>
#include <bsd/sys/net/if_llatbl.h>
#include <bsd/sys/net/pfil.h> #include <bsd/sys/net/pfil.h>
#include <bsd/sys/netinet/igmp.h> #include <bsd/sys/netinet/igmp.h>
#include <bsd/sys/netinet/if_ether.h> #include <bsd/sys/netinet/if_ether.h>
...@@ -37,6 +38,7 @@ void net_init(void) ...@@ -37,6 +38,7 @@ void net_init(void)
eventhandler_init(NULL); eventhandler_init(NULL);
mbuf_init(NULL); mbuf_init(NULL);
netisr_init(NULL); netisr_init(NULL);
vnet_lltable_init();
arp_init(); arp_init();
ether_init(NULL); ether_init(NULL);
if_init(NULL); if_init(NULL);
......
...@@ -63,6 +63,7 @@ int tvtohz(struct timeval *tv); ...@@ -63,6 +63,7 @@ int tvtohz(struct timeval *tv);
#define hz (1000000000L) #define hz (1000000000L)
#define MALLOC_DEFINE(...) #define MALLOC_DEFINE(...)
#define MALLOC_DECLARE(...)
#define SYSINIT(...) #define SYSINIT(...)
#define SYSUNINIT(...) #define SYSUNINIT(...)
......
...@@ -40,8 +40,12 @@ ...@@ -40,8 +40,12 @@
#include <bsd/sys/net/route.h> #include <bsd/sys/net/route.h>
#include <bsd/sys/net/vnet.h> #include <bsd/sys/net/vnet.h>
#include <bsd/sys/netinet/if_ether.h> #include <bsd/sys/netinet/if_ether.h>
// #include <netinet6/in6_var.h> #if 0
// #include <netinet6/nd6.h> #include <netinet6/in6_var.h>
#include <netinet6/nd6.h>
#endif
MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables");
static VNET_DEFINE(SLIST_HEAD(, lltable), lltables); static VNET_DEFINE(SLIST_HEAD(, lltable), lltables);
#define V_lltables VNET(lltables) #define V_lltables VNET(lltables)
...@@ -384,11 +388,8 @@ void vnet_lltable_init() ...@@ -384,11 +388,8 @@ void vnet_lltable_init()
rw_init(&lltable_rwlock, "lltable_rwlock"); rw_init(&lltable_rwlock, "lltable_rwlock");
SLIST_INIT(&V_lltables); SLIST_INIT(&V_lltables);
} }
#if 0
VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST, VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST,
vnet_lltable_init, NULL); vnet_lltable_init, NULL);
#endif
#ifdef DDB #ifdef DDB
struct llentry_sa { struct llentry_sa {
......
...@@ -24,19 +24,18 @@ ...@@ -24,19 +24,18 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <bsd/porting/netport.h>
#include <bsd/porting/callout.h>
#include <bsd/porting/rwlock.h>
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef _NET_IF_LLATBL_H_ #ifndef _NET_IF_LLATBL_H_
#define _NET_IF_LLATBL_H_ #define _NET_IF_LLATBL_H_
#include <bsd/porting/netport.h>
#include <bsd/porting/callout.h>
#include <bsd/porting/rwlock.h>
#include <bsd/sys/netinet/in.h> #include <bsd/sys/netinet/in.h>
void vnet_lltable_init(); void vnet_lltable_init(void);
struct ifnet; struct ifnet;
struct sysctl_req; struct sysctl_req;
...@@ -166,6 +165,7 @@ struct lltable { ...@@ -166,6 +165,7 @@ struct lltable {
int (*llt_dump)(struct lltable *, int (*llt_dump)(struct lltable *,
struct sysctl_req *); struct sysctl_req *);
}; };
MALLOC_DECLARE(M_LLTABLE);
/* /*
* flags to be passed to arplookup. * flags to be passed to arplookup.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment