if_clone
t4_cloner_match(struct if_clone *ifc, const char *name)
t4_cloner_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
t4_cloner_destroy(struct if_clone *ifc, if_t ifp)
static struct if_clone *t4_cloner;
VNET_DEFINE_STATIC(struct if_clone *, wg_cloner);
wg_clone_create(struct if_clone *ifc, char *name, size_t len,
wg_clone_destroy(struct if_clone *ifc, if_t ifp, uint32_t flags)
struct if_clone *clone = VNET_VNET(vnet_iter, wg_cloner);
static int wg_clone_create(struct if_clone *ifc, char *name, size_t len,
static int wg_clone_destroy(struct if_clone *ifc, if_t ifp,
static int bridge_clone_create(struct if_clone *, char *, size_t,
static int bridge_clone_destroy(struct if_clone *, struct ifnet *, uint32_t);
VNET_DEFINE_STATIC(struct if_clone *, bridge_cloner);
bridge_clone_create(struct if_clone *ifc, char *name, size_t len,
bridge_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
LIST_ENTRY(if_clone) ifc_list; /* (e) On list of cloners */
static void if_clone_free(struct if_clone *ifc);
static int if_clone_createif_nl(struct if_clone *ifc, const char *name,
static int ifc_simple_match(struct if_clone *ifc, const char *name);
static int ifc_handle_unit(struct if_clone *ifc, char *name, size_t len, int *punit);
static struct if_clone *ifc_find_cloner(const char *name);
static struct if_clone *ifc_find_cloner_match(const char *name);
static int ifc_simple_create_wrapper(struct if_clone *ifc, char *name, size_t maxlen,
static int ifc_advanced_create_wrapper(struct if_clone *ifc, char *name, size_t maxlen,
VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners) = LIST_HEAD_INITIALIZER();
struct if_clone *ifc = ifc_find_cloner_match(name);
struct if_clone *ifc = ifc_find_cloner_match(name);
struct if_clone *ifc = ifc_find_cloner(ifp->if_dname);
struct if_clone *ifc = ifc_find_cloner(ifp->if_dname);
ifc_create_ifp_nl_default(struct if_clone *ifc, char *name, size_t len,
ifc_link_ifp(struct if_clone *ifc, struct ifnet *ifp)
if_clone_addif(struct if_clone *ifc, struct ifnet *ifp)
ifc_unlink_ifp(struct if_clone *ifc, struct ifnet *ifp)
static struct if_clone *
struct if_clone *ifc;
static struct if_clone *
struct if_clone *ifc;
static struct if_clone *
struct if_clone *ifc = ifc_find_cloner(name);
if_clone_createif_nl(struct if_clone *ifc, const char *ifname, struct ifc_data_nl *ifd)
struct if_clone *ifc;
if_clone_destroyif_flags(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
if_clone_destroyif(struct if_clone *ifc, struct ifnet *ifp)
static struct if_clone *
struct if_clone *ifc;
ifc = malloc(sizeof(struct if_clone), M_CLONE, M_WAITOK | M_ZERO);
if_clone_attach(struct if_clone *ifc)
struct if_clone *ifc1;
struct if_clone *
struct if_clone *ifc;
ifc_detach_cloner(struct if_clone *ifc)
ifc_advanced_create_wrapper(struct if_clone *ifc, char *name, size_t maxlen,
ifc_advanced_destroy_wrapper(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
struct if_clone *
struct if_clone *ifc;
ifc_simple_create_wrapper(struct if_clone *ifc, char *name, size_t maxlen,
ifc_simple_destroy_wrapper(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
struct if_clone *
struct if_clone *ifc;
if_clone_detach(struct if_clone *ifc)
if_clone_free(struct if_clone *ifc)
struct if_clone *ifc;
struct if_clone *ifc;
ifc_alloc_unit_specific(struct if_clone *ifc, int *unit)
ifc_alloc_unit_next(struct if_clone *ifc, int *unit)
ifc_alloc_unit(struct if_clone *ifc, int *unit)
ifc_free_unit(struct if_clone *ifc, int unit)
ifc_simple_match(struct if_clone *ifc, const char *name)
ifc_handle_unit(struct if_clone *ifc, char *name, size_t len, int *punit)
struct if_clone *ifc_attach_cloner(const char *name, struct if_clone_addreq *req);
void ifc_detach_cloner(struct if_clone *ifc);
void ifc_link_ifp(struct if_clone *ifc, struct ifnet *ifp);
bool ifc_unlink_ifp(struct if_clone *ifc, struct ifnet *ifp);
typedef int ifc_match_t(struct if_clone *, const char *);
typedef int ifc_create_t(struct if_clone *, char *, size_t, caddr_t);
typedef int ifc_destroy_t(struct if_clone *, struct ifnet *);
typedef int ifcs_create_t(struct if_clone *, int, caddr_t);
struct if_clone *
struct if_clone *
void if_clone_detach(struct if_clone *);
int ifc_alloc_unit(struct if_clone *, int *);
void ifc_free_unit(struct if_clone *, int);
typedef void (*if_clone_event_handler_t)(void *, struct if_clone *);
void if_clone_addif(struct if_clone *, struct ifnet *);
int if_clone_destroyif(struct if_clone *, struct ifnet *);
struct if_clone;
typedef int ifc_match_f(struct if_clone *ifc, const char *name);
typedef int ifc_create_f(struct if_clone *ifc, char *name, size_t maxlen,
typedef int ifc_destroy_f(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags);
typedef int ifc_create_nl_f(struct if_clone *ifc, char *name, size_t maxlen,
static int disc_clone_create(struct if_clone *, int, caddr_t);
VNET_DEFINE_STATIC(struct if_clone *, disc_cloner);
disc_clone_create(struct if_clone *ifc, int unit, caddr_t params)
VNET_DEFINE_STATIC(struct if_clone *, edsc_cloner);
static int edsc_clone_create(struct if_clone *, int, caddr_t);
edsc_clone_create(struct if_clone *ifc, int unit, caddr_t params)
enc_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
enc_clone_create(struct if_clone *ifc, char *name, size_t len,
VNET_DEFINE_STATIC(struct if_clone *, enc_cloner);
static int enc_clone_create(struct if_clone *, char *, size_t,
static int enc_clone_destroy(struct if_clone *, struct ifnet *, uint32_t);
epair_clone_match(struct if_clone *ifc, const char *name)
epair_clone_add(struct if_clone *ifc, struct epair_softc *scb)
epair_alloc_sc(struct if_clone *ifc)
epair_handle_unit(struct if_clone *ifc, char *name, size_t len, int *punit)
epair_clone_create(struct if_clone *ifc, char *name, size_t len,
epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
VNET_DEFINE_STATIC(struct if_clone *, epair_cloner);
static int gif_clone_create(struct if_clone *, int, caddr_t);
VNET_DEFINE_STATIC(struct if_clone *, gif_cloner);
gif_clone_create(struct if_clone *ifc, int unit, caddr_t params)
static int gre_clone_create(struct if_clone *, char *, size_t,
static int gre_clone_destroy(struct if_clone *, struct ifnet *,
static int gre_clone_create_nl(struct if_clone *, char *, size_t,
VNET_DEFINE_STATIC(struct if_clone *, gre_cloner);
gre_clone_create_nl(struct if_clone *ifc, char *name, size_t len,
gre_clone_create(struct if_clone *ifc, char *name, size_t len,
gre_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
static int ipsec_clone_create(struct if_clone *, int, caddr_t);
VNET_DEFINE_STATIC(struct if_clone *, ipsec_cloner);
ipsec_clone_create(struct if_clone *ifc, int unit, caddr_t params)
static int lagg_clone_create(struct if_clone *, char *, size_t,
static int lagg_clone_destroy(struct if_clone *, struct ifnet *, uint32_t);
VNET_DEFINE_STATIC(struct if_clone *, lagg_cloner);
lagg_clone_create(struct if_clone *ifc, char *name, size_t len,
lagg_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
lo_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
lo_clone_create(struct if_clone *ifc, char *name, size_t len,
VNET_DEFINE_STATIC(struct if_clone *, lo_cloner);
static int me_clone_create(struct if_clone *, int, caddr_t);
VNET_DEFINE_STATIC(struct if_clone *, me_cloner);
me_clone_create(struct if_clone *ifc, int unit, caddr_t params)
VNET_DEFINE_STATIC(struct if_clone *, ovpn_cloner);
ovpn_clone_match(struct if_clone *ifc, const char *name)
ovpn_clone_create(struct if_clone *ifc, char *name, size_t len,
ovpn_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
VNET_DEFINE_STATIC(struct if_clone *, stf_cloner);
stf_clone_match(struct if_clone *ifc, const char *name)
stf_clone_create(struct if_clone *ifc, char *name, size_t len,
stf_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
struct if_clone *cloner;
static int tun_clone_match(struct if_clone *ifc, const char *name);
static int tap_clone_match(struct if_clone *ifc, const char *name);
static int vmnet_clone_match(struct if_clone *ifc, const char *name);
static int tun_clone_create(struct if_clone *, char *, size_t,
static int tun_clone_destroy(struct if_clone *, struct ifnet *, uint32_t);
VNET_DEFINE_STATIC(struct if_clone *, tuntap_driver_cloners[NDRV]);
static struct if_clone *
tun_clone_match(struct if_clone *ifc, const char *name)
tap_clone_match(struct if_clone *ifc, const char *name)
vmnet_clone_match(struct if_clone *ifc, const char *name)
tun_clone_create(struct if_clone *ifc, char *name, size_t len,
tun_clone_destroy(struct if_clone *ifc __unused, struct ifnet *ifp, uint32_t flags)
vlan_clone_match(struct if_clone *ifc, const char *name)
vlan_clone_create(struct if_clone *ifc, char *name, size_t len,
vlan_clone_create_nl(struct if_clone *ifc, char *name, size_t len,
vlan_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
static int vlan_clone_match(struct if_clone *, const char *);
static int vlan_clone_create(struct if_clone *, char *, size_t,
static int vlan_clone_destroy(struct if_clone *, struct ifnet *, uint32_t);
static int vlan_clone_create_nl(struct if_clone *ifc, char *name, size_t len,
static struct if_clone *vlan_cloner;
VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner);
vxlan_clone_create(struct if_clone *ifc, char *name, size_t len,
vxlan_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
static int vxlan_clone_create(struct if_clone *, char *, size_t,
static int vxlan_clone_destroy(struct if_clone *, struct ifnet *, uint32_t);
static struct if_clone *vxlan_cloner;
wlan_clone_create(struct if_clone *ifc, char *name, size_t len,
wlan_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
static struct if_clone *wlan_cloner;
VNET_DEFINE_STATIC(struct if_clone *, pflog_cloner);
pflog_clone_create(struct if_clone *ifc, char *name, size_t maxlen,
pflog_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
static int pflog_clone_create(struct if_clone *, char *, size_t,
static int pflog_clone_destroy(struct if_clone *, struct ifnet *, uint32_t);
static int pfsync_clone_create(struct if_clone *, int, caddr_t);
VNET_DEFINE(struct if_clone *, pfsync_cloner);
pfsync_clone_create(struct if_clone *ifc, int unit, caddr_t param)