IfAPI: More accessors
Summary: Add the following accessors needed by infiniband drivers: * if_getaddrlen() * if_setbroadcastaddr() * if_resolvemulti() With these accessors, and additional changes on the drivers' side, an amd64 kernel can be compiled with `struct ifnet` completely hidden. Reviewed by: melifaro Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38488
This commit is contained in:
parent
8d5feede40
commit
189c3729d8
21
sys/net/if.c
21
sys/net/if.c
@ -4681,6 +4681,15 @@ if_transmit(if_t ifp, struct mbuf *m)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
if_resolvemulti(if_t ifp, struct sockaddr **srcs, struct sockaddr *dst)
|
||||
{
|
||||
if (ifp->if_resolvemulti == NULL)
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
return (ifp->if_resolvemulti(ifp, srcs, dst));
|
||||
}
|
||||
|
||||
struct mbuf *
|
||||
if_dequeue(if_t ifp)
|
||||
{
|
||||
@ -4928,6 +4937,12 @@ if_getbroadcastaddr(if_t ifp)
|
||||
return (ifp->if_broadcastaddr);
|
||||
}
|
||||
|
||||
void
|
||||
if_setbroadcastaddr(if_t ifp, const uint8_t *addr)
|
||||
{
|
||||
ifp->if_broadcastaddr = addr;
|
||||
}
|
||||
|
||||
int
|
||||
if_getnumadomain(if_t ifp)
|
||||
{
|
||||
@ -4964,6 +4979,12 @@ if_getfib(if_t ifp)
|
||||
return (ifp->if_fib);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
if_getaddrlen(if_t ifp)
|
||||
{
|
||||
return (ifp->if_addrlen);
|
||||
}
|
||||
|
||||
struct bpf_if *
|
||||
if_getbpf(if_t ifp)
|
||||
{
|
||||
|
@ -604,8 +604,10 @@ int if_setflags(if_t ifp, int flags);
|
||||
void if_setllsoftc(if_t ifp, void *softc);
|
||||
void *if_getllsoftc(if_t ifp);
|
||||
u_int if_getfib(if_t ifp);
|
||||
uint8_t if_getaddrlen(if_t ifp);
|
||||
int if_gethwaddr(const if_t ifp, struct ifreq *);
|
||||
const uint8_t *if_getbroadcastaddr(const if_t ifp);
|
||||
void if_setbroadcastaddr(if_t ifp, const uint8_t *);
|
||||
int if_setmtu(if_t ifp, int mtu);
|
||||
int if_getmtu(const if_t ifp);
|
||||
int if_getmtu_family(const if_t ifp, int family);
|
||||
@ -640,6 +642,7 @@ void if_etherbpfmtap(if_t ifp, struct mbuf *m);
|
||||
void if_vlancap(if_t ifp);
|
||||
int if_transmit(if_t ifp, struct mbuf *m);
|
||||
int if_init(if_t ifp, void *ctx);
|
||||
int if_resolvemulti(if_t ifp, struct sockaddr **, struct sockaddr *);
|
||||
uint64_t if_getcounter(if_t ifp, ift_counter counter);
|
||||
struct label *if_getmaclabel(if_t ifp);
|
||||
void if_setmaclabel(if_t ifp, struct label *label);
|
||||
|
Loading…
Reference in New Issue
Block a user