diff options
author | glebius <glebius@FreeBSD.org> | 2012-10-16 13:37:54 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2012-10-16 13:37:54 +0000 |
commit | 05f24a6b77a43334f14f31cd33a4f3e34a418ea2 (patch) | |
tree | 0f54a9446bfe2083d3c0a3f744318b2be8a0db05 /sys/net/if_faith.c | |
parent | 745884b065065ffc8847d3ea463bf751ffcaf863 (diff) | |
download | FreeBSD-src-05f24a6b77a43334f14f31cd33a4f3e34a418ea2.zip FreeBSD-src-05f24a6b77a43334f14f31cd33a4f3e34a418ea2.tar.gz |
Make the "struct if_clone" opaque to users of the cloning API. Users
now use function calls:
if_clone_simple()
if_clone_advanced()
to initialize a cloner, instead of macros that initialize if_clone
structure.
Discussed with: brooks, bz, 1 year ago
Diffstat (limited to 'sys/net/if_faith.c')
-rw-r--r-- | sys/net/if_faith.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c index db4c1d9..907dcce 100644 --- a/sys/net/if_faith.c +++ b/sys/net/if_faith.c @@ -79,8 +79,6 @@ #include <netinet6/ip6_var.h> #endif -#define FAITHNAME "faith" - struct faith_softc { struct ifnet *sc_ifp; }; @@ -95,12 +93,12 @@ static int faithprefix(struct in6_addr *); static int faithmodevent(module_t, int, void *); -static MALLOC_DEFINE(M_FAITH, FAITHNAME, "Firewall Assisted Tunnel Interface"); +static const char faithname[] = "faith"; +static MALLOC_DEFINE(M_FAITH, faithname, "Firewall Assisted Tunnel Interface"); static int faith_clone_create(struct if_clone *, int, caddr_t); static void faith_clone_destroy(struct ifnet *); - -IFC_SIMPLE_DECLARE(faith, 0); +static struct if_clone *faith_cloner; #define FAITHMTU 1500 @@ -113,8 +111,8 @@ faithmodevent(mod, type, data) switch (type) { case MOD_LOAD: - if_clone_attach(&faith_cloner); - + faith_cloner = if_clone_simple(faithname, faith_clone_create, + faith_clone_destroy, 0); #ifdef INET6 faithprefix_p = faithprefix; #endif @@ -125,7 +123,7 @@ faithmodevent(mod, type, data) faithprefix_p = NULL; #endif - if_clone_detach(&faith_cloner); + if_clone_detach(faith_cloner); break; default: return EOPNOTSUPP; @@ -159,7 +157,7 @@ faith_clone_create(ifc, unit, params) } ifp->if_softc = sc; - if_initname(sc->sc_ifp, ifc->ifc_name, unit); + if_initname(sc->sc_ifp, faithname, unit); ifp->if_mtu = FAITHMTU; /* Change to BROADCAST experimentaly to announce its prefix. */ |