Commit 053a24d1 authored by Justin Hibbits's avatar Justin Hibbits
Browse files

debugnet: Add ifnet accessor to set debugnet methods

As part of the effort to hide the internals of the ifnet struct, convert
the DEBUGNET_SET() macro to use an accessor instead of directly touching
the methods member.

Reviewed by:	glebius (older version)
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38105
parent 2c2b37ad
......@@ -263,7 +263,7 @@ extern int debugnet_arp_nretries;
#define DEBUGNET_NOTIFY_MTU(ifp) debugnet_any_ifnet_update(ifp)
#define DEBUGNET_SET(ifp, driver) \
(ifp)->if_debugnet_methods = &driver##_debugnet_methods
if_setdebugnet_methods((ifp), &driver##_debugnet_methods)
#else /* !DEBUGNET || !INET */
......
......@@ -4803,6 +4803,12 @@ if_setgetcounterfn(if_t ifp, if_get_counter_t fn)
ifp->if_get_counter = fn;
}
void
if_setdebugnet_methods(if_t ifp, struct debugnet_methods *m)
{
ifp->if_debugnet_methods = m;
}
#ifdef DDB
static void
if_show_ifnet(struct ifnet *ifp)
......
......@@ -653,6 +653,7 @@ void if_settransmitfn(if_t ifp, if_transmit_fn_t);
void if_setqflushfn(if_t ifp, if_qflush_fn_t);
void if_setgetcounterfn(if_t ifp, if_get_counter_t);
void if_setsndtagallocfn(if_t ifp, if_snd_tag_alloc_t);
void if_setdebugnet_methods(struct ifnet *, struct debugnet_methods *);
/* TSO */
void if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment