diff options
-rw-r--r-- | sys/net/if.c | 49 | ||||
-rw-r--r-- | sys/net/if_var.h | 7 |
2 files changed, 56 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index d17738fda0b7..da684dedec73 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4242,6 +4242,42 @@ if_setcapenablebit(if_t ifp, int setcap, int clearcap) return (0); } +int +if_setcapabilities2(if_t ifp, int capabilities) +{ + ifp->if_capabilities2 = capabilities; + return (0); +} + +int +if_setcapabilities2bit(if_t ifp, int setbit, int clearbit) +{ + ifp->if_capabilities2 &= ~clearbit; + ifp->if_capabilities2 |= setbit; + return (0); +} + +int +if_getcapabilities2(const if_t ifp) +{ + return (ifp->if_capabilities2); +} + +int +if_setcapenable2(if_t ifp, int capabilities2) +{ + ifp->if_capenable2 = capabilities2; + return (0); +} + +int +if_setcapenable2bit(if_t ifp, int setcap, int clearcap) +{ + ifp->if_capenable2 &= ~clearcap; + ifp->if_capenable2 |= setcap; + return (0); +} + const char * if_getdname(const if_t ifp) { @@ -4284,6 +4320,19 @@ if_getcapenable(const if_t ifp) } int +if_togglecapenable2(if_t ifp, int togglecap) +{ + ifp->if_capenable2 ^= togglecap; + return (0); +} + +int +if_getcapenable2(const if_t ifp) +{ + return (ifp->if_capenable2); +} + +int if_getdunit(const if_t ifp) { return ((struct ifnet *)ifp)->if_dunit; diff --git a/sys/net/if_var.h b/sys/net/if_var.h index f6bb77908d40..ef3e3d71a262 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -576,6 +576,13 @@ int if_togglecapenable(if_t ifp, int togglecap); int if_setcapenable(if_t ifp, int capenable); int if_setcapenablebit(if_t ifp, int setcap, int clearcap); int if_getcapenable(const if_t ifp); +int if_setcapabilities2(if_t ifp, int capabilities); +int if_setcapabilities2bit(if_t ifp, int setbit, int clearbit); +int if_getcapabilities2(const if_t ifp); +int if_togglecapenable2(if_t ifp, int togglecap); +int if_setcapenable2(if_t ifp, int capenable); +int if_setcapenable2bit(if_t ifp, int setcap, int clearcap); +int if_getcapenable2(const if_t ifp); int if_getdunit(const if_t ifp); int if_getindex(const if_t ifp); int if_getidxgen(const if_t ifp); |