#include <sys/lock.h>
/* End Temporary lock stuff. */
-int
-linker_api_available(void)
-{
- /* linker_* API won't work without a process context */
- if (curproc == NULL)
- return 0;
- /*
- * nlookup_init() relies on namei_oc to be initialized,
- * but it's not when the netgraph module is loaded during boot.
- */
- if (namei_oc == NULL)
- return 0;
- return 1;
-}
-
/* Locking stuff. */
#define va_start(ap,last) __va_start(ap,last)
#define va_end(ap) __va_end(ap)
-int linker_api_available(void);
-
/* Temporary lock stuff */
int lock_sleep(void *, int, const char *, int, struct lock *);
int lockstatus_owned(struct lock *, struct thread *);
*/
#include <sys/sysctl.h>
#include <sys/thread2.h>
-#ifdef NOTYET
#include <sys/vnode.h>
-#endif
+
#include <netgraph7/ng_message.h>
#include <netgraph7/netgraph.h>
#include "ng_socketvar.h"
static int ngs_mod_event(module_t mod, int event, void *data);
static void ng_socket_item_applied(void *context, int error);
+static int linker_api_available(void);
/* Netgraph type descriptor */
static struct ng_type typestruct = {
return (error);
}
+static int
+linker_api_available(void)
+{
+ /* linker_* API won't work without a process context */
+ if (curproc == NULL)
+ return 0;
+ /*
+ * nlookup_init() relies on namei_oc to be initialized,
+ * but it's not when the netgraph module is loaded during boot.
+ */
+ if (namei_oc == NULL)
+ return 0;
+ return 1;
+}
+
SYSCTL_INT(_net_graph, OID_AUTO, family, CTLFLAG_RD, 0, AF_NETGRAPH, "");
SYSCTL_NODE(_net_graph, OID_AUTO, data, CTLFLAG_RW, 0, "DATA");
SYSCTL_INT(_net_graph_data, OID_AUTO, proto, CTLFLAG_RD, 0, NG_DATA, "");