ifconfig: fix warnings #2

Fix all -Wparameter-unused and cast alignment

Differential Revision: https://reviews.freebsd.org/D40303
MFC after:	2 weeks
This commit is contained in:
Alexander V. Chernikov 2023-06-01 11:54:02 +00:00
parent a77facd273
commit 0c2beef72d
17 changed files with 125 additions and 118 deletions

View File

@ -263,7 +263,7 @@ static struct in_px *sintab_nl[] = {
};
static void
in_copyaddr(if_ctx *ctx, int to, int from)
in_copyaddr(if_ctx *ctx __unused, int to, int from)
{
sintab_nl[to]->addr = sintab_nl[from]->addr;
sintab_nl[to]->addrset = sintab_nl[from]->addrset;

View File

@ -99,7 +99,7 @@ extern void nd6_status(if_ctx *);
static char addr_buf[NI_MAXHOST]; /*for getnameinfo()*/
static void
setifprefixlen(if_ctx *ctx, const char *addr, int dummy __unused)
setifprefixlen(if_ctx *ctx __netlink_unused, const char *addr, int dummy __unused)
{
#ifdef WITHOUT_NETLINK
const struct afswtch *afp = ctx->afp;
@ -385,7 +385,7 @@ show_lifetime(struct ifa_cacheinfo *ci)
}
static void
in6_status_nl(if_ctx *ctx __unused, if_link_t *link, if_addr_t *ifa)
in6_status_nl(if_ctx *ctx __unused, if_link_t *link __unused, if_addr_t *ifa)
{
int plen = ifa->ifa_prefixlen;
uint32_t scopeid;
@ -422,7 +422,7 @@ static struct in6_px *sin6tab_nl[] = {
};
static void
in6_copyaddr(if_ctx *ctx, int to, int from)
in6_copyaddr(if_ctx *ctx __unused, int to, int from)
{
sin6tab_nl[to]->addr = sin6tab_nl[from]->addr;
sin6tab_nl[to]->set = sin6tab_nl[from]->set;
@ -771,7 +771,7 @@ static struct afswtch af_inet6 = {
};
static void
in6_Lopt_cb(const char *optarg __unused)
in6_Lopt_cb(const char *arg __unused)
{
ip6lifetime++; /* print IPv6 address lifetime */
}

View File

@ -114,7 +114,7 @@ setcarp_vhid(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
setcarp_callback(int s, void *arg __unused)
setcarp_callback(int s __unused, void *arg __unused)
{
struct ifconfig_carp carpr = { };
@ -214,8 +214,7 @@ setcarp_peer6(if_ctx *ctx __unused, const char *val, int dummy __unused)
if (getaddrinfo(val, NULL, &hints, &res) != 0)
errx(1, "Invalid IPv6 address %s", val);
memcpy(&carp_addr6, &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr,
sizeof(carp_addr6));
memcpy(&carp_addr6, &(satosin6(res->ai_addr))->sin6_addr, sizeof(carp_addr6));
freeaddrinfo(res);
}

View File

@ -373,7 +373,7 @@ unsetbridge_autoptp(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
setbridge_flush(if_ctx *ctx, const char *val, int dummy __unused)
setbridge_flush(if_ctx *ctx, const char *val __unused, int dummy __unused)
{
struct ifbreq req;
@ -384,7 +384,7 @@ setbridge_flush(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
setbridge_flushall(if_ctx *ctx, const char *val, int dummy __unused)
setbridge_flushall(if_ctx *ctx, const char *val __unused, int dummy __unused)
{
struct ifbreq req;
@ -434,7 +434,7 @@ setbridge_deladdr(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
setbridge_addr(if_ctx *ctx, const char *val, int dummy __unused)
setbridge_addr(if_ctx *ctx, const char *val __unused, int dummy __unused)
{
bridge_addresses(ctx->io_s, "");

View File

@ -118,7 +118,7 @@ clone_setdefcallback_filter(clone_match_func *filter, clone_callback_func *p)
* no parameters.
*/
static void
ifclonecreate(int s, void *arg)
ifclonecreate(int s, void *arg __unused)
{
struct ifreq ifr;
struct clone_defcb *dcp;
@ -182,7 +182,7 @@ static struct cmd clone_cmds[] = {
};
static void
clone_Copt_cb(const char *optarg __unused)
clone_Copt_cb(const char *arg __unused)
{
list_cloners();
exit(exit_code);

View File

@ -1776,7 +1776,7 @@ status(struct ifconfig_args *args, const struct sockaddr_dl *sdl,
print_ifstatus(s);
if (args->verbose > 0)
sfp_status(s, &ifr, args->verbose);
sfp_status(ctx);
close(s);
return;

View File

@ -43,6 +43,14 @@
#define __constructor __attribute__((constructor))
#ifdef WITHOUT_NETLINK
#define __netlink_used __unused
#define __netlink_unused
#else
#define __netlink_used
#define __netlink_unused __unused
#endif
struct afswtch;
struct cmd;
struct ifconfig_context;
@ -267,7 +275,7 @@ typedef void clone_callback_func(int, struct ifreq *);
void clone_setdefcallback_prefix(const char *, clone_callback_func *);
void clone_setdefcallback_filter(clone_match_func *, clone_callback_func *);
void sfp_status(int s, struct ifreq *ifr, int verbose);
void sfp_status(if_ctx *ctx);
struct sockaddr_dl;
bool match_ether(const struct sockaddr_dl *sdl);

View File

@ -398,7 +398,7 @@ status_nl(if_ctx *ctx, struct iface *iface)
print_ifstatus(ctx->io_s);
if (args->verbose > 0)
sfp_status(ctx->io_s, &ifr, args->verbose);
sfp_status(ctx);
}
static int

View File

@ -70,7 +70,7 @@ gif_status(if_ctx *ctx)
}
static void
setgifopts(if_ctx *ctx, const char *val, int d)
setgifopts(if_ctx *ctx, const char *val __unused, int d)
{
int opts;

View File

@ -91,7 +91,7 @@ setifgreport(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
setifgreopts(if_ctx *ctx, const char *val, int d)
setifgreopts(if_ctx *ctx, const char *val __unused, int d)
{
uint32_t opts;

View File

@ -899,7 +899,7 @@ set80211powersavemode(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211powersave(if_ctx *ctx, const char *val, int d)
set80211powersave(if_ctx *ctx, const char *val __unused, int d)
{
int s = ctx->io_s;
@ -936,7 +936,7 @@ set80211wepmode(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211wep(if_ctx *ctx, const char *val, int d)
set80211wep(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_WEP, d, 0, NULL);
}
@ -1097,31 +1097,31 @@ set80211roaming(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211wme(if_ctx *ctx, const char *val, int d)
set80211wme(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_WME, d, 0, NULL);
}
static void
set80211hidessid(if_ctx *ctx, const char *val, int d)
set80211hidessid(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_HIDESSID, d, 0, NULL);
}
static void
set80211apbridge(if_ctx *ctx, const char *val, int d)
set80211apbridge(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_APBRIDGE, d, 0, NULL);
}
static void
set80211fastframes(if_ctx *ctx, const char *val, int d)
set80211fastframes(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_FF, d, 0, NULL);
}
static void
set80211dturbo(if_ctx *ctx, const char *val, int d)
set80211dturbo(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_TURBOP, d, 0, NULL);
}
@ -1366,7 +1366,7 @@ set80211kickmac(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211maccmd(if_ctx *ctx, const char *val, int d)
set80211maccmd(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_MACCMD, d, 0, NULL);
}
@ -1404,7 +1404,7 @@ set80211delmeshrt(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211meshrtcmd(if_ctx *ctx, const char *val, int d)
set80211meshrtcmd(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_MESH_RTCMD, d, 0, NULL);
}
@ -1432,13 +1432,13 @@ set80211hwmpmaxhops(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211pureg(if_ctx *ctx, const char *val, int d)
set80211pureg(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_PUREG, d, 0, NULL);
}
static void
set80211quiet(if_ctx *ctx, const char *val, int d)
set80211quiet(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_QUIET, d, 0, NULL);
}
@ -1468,7 +1468,7 @@ set80211quietoffset(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211bgscan(if_ctx *ctx, const char *val, int d)
set80211bgscan(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_BGSCAN, d, 0, NULL);
}
@ -1770,25 +1770,25 @@ set80211bmissthreshold(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211burst(if_ctx *ctx, const char *val, int d)
set80211burst(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_BURST, d, 0, NULL);
}
static void
set80211doth(if_ctx *ctx, const char *val, int d)
set80211doth(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_DOTH, d, 0, NULL);
}
static void
set80211dfs(if_ctx *ctx, const char *val, int d)
set80211dfs(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_DFS, d, 0, NULL);
}
static void
set80211shortgi(if_ctx *ctx, const char *val, int d)
set80211shortgi(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_SHORTGI,
d ? (IEEE80211_HTCAP_SHORTGI20 | IEEE80211_HTCAP_SHORTGI40) : 0,
@ -1797,7 +1797,7 @@ set80211shortgi(if_ctx *ctx, const char *val, int d)
/* XXX 11ac density/size is different */
static void
set80211ampdu(if_ctx *ctx, const char *val, int d)
set80211ampdu(if_ctx *ctx, const char *val __unused, int d)
{
int ampdu;
int s = ctx->io_s;
@ -1813,7 +1813,7 @@ set80211ampdu(if_ctx *ctx, const char *val, int d)
}
static void
set80211stbc(if_ctx *ctx, const char *val, int d)
set80211stbc(if_ctx *ctx, const char *val __unused, int d)
{
int stbc;
int s = ctx->io_s;
@ -1829,7 +1829,7 @@ set80211stbc(if_ctx *ctx, const char *val, int d)
}
static void
set80211ldpc(if_ctx *ctx, const char *val, int d)
set80211ldpc(if_ctx *ctx, const char *val __unused, int d)
{
int s = ctx->io_s;
int ldpc;
@ -1845,7 +1845,7 @@ set80211ldpc(if_ctx *ctx, const char *val, int d)
}
static void
set80211uapsd(if_ctx *ctx, const char *val, int d)
set80211uapsd(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_UAPSD, d, 0, NULL);
}
@ -1918,7 +1918,7 @@ set80211ampdudensity(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211amsdu(if_ctx *ctx, const char *val, int d)
set80211amsdu(if_ctx *ctx, const char *val __unused, int d)
{
int amsdu;
@ -1939,62 +1939,62 @@ set80211amsdulimit(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211puren(if_ctx *ctx, const char *val, int d)
set80211puren(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_PUREN, d, 0, NULL);
}
static void
set80211htcompat(if_ctx *ctx, const char *val, int d)
set80211htcompat(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_HTCOMPAT, d, 0, NULL);
}
static void
set80211htconf(if_ctx *ctx, const char *val, int d)
set80211htconf(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_HTCONF, d, 0, NULL);
htconf = d;
}
static void
set80211dwds(if_ctx *ctx, const char *val, int d)
set80211dwds(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_DWDS, d, 0, NULL);
}
static void
set80211inact(if_ctx *ctx, const char *val, int d)
set80211inact(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_INACTIVITY, d, 0, NULL);
}
static void
set80211tsn(if_ctx *ctx, const char *val, int d)
set80211tsn(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_TSN, d, 0, NULL);
}
static void
set80211dotd(if_ctx *ctx, const char *val, int d)
set80211dotd(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_DOTD, d, 0, NULL);
}
static void
set80211smps(if_ctx *ctx, const char *val, int d)
set80211smps(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_SMPS, d, 0, NULL);
}
static void
set80211rifs(if_ctx *ctx, const char *val, int d)
set80211rifs(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_RIFS, d, 0, NULL);
}
static void
set80211vhtconf(if_ctx *ctx, const char *val, int d)
set80211vhtconf(if_ctx *ctx, const char *val __unused, int d)
{
int s = ctx->io_s;
@ -2041,19 +2041,19 @@ set80211meshttl(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211meshforward(if_ctx *ctx, const char *val, int d)
set80211meshforward(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_MESH_FWRD, d, 0, NULL);
}
static void
set80211meshgate(if_ctx *ctx, const char *val, int d)
set80211meshgate(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_MESH_GATE, d, 0, NULL);
}
static void
set80211meshpeering(if_ctx *ctx, const char *val, int d)
set80211meshpeering(if_ctx *ctx, const char *val __unused, int d)
{
set80211(ctx->io_s, IEEE80211_IOC_MESH_AP, d, 0, NULL);
}
@ -2565,7 +2565,7 @@ set80211country(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
set80211location(if_ctx *ctx, const char *val, int d)
set80211location(if_ctx *ctx, const char *val __unused, int d)
{
getregdomain(ctx->io_s);
regdomain.location = d;
@ -2573,7 +2573,7 @@ set80211location(if_ctx *ctx, const char *val, int d)
}
static void
set80211ecm(if_ctx *ctx, const char *val, int d)
set80211ecm(if_ctx *ctx, const char *val __unused, int d)
{
getregdomain(ctx->io_s);
regdomain.ecm = d;
@ -2757,7 +2757,7 @@ printie(const char* tag, const uint8_t *ie, size_t ielen, unsigned int maxlen)
*/
static void
printwmeparam(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printwmeparam(const char *tag, const u_int8_t *ie)
{
static const char *acnames[] = { "BE", "BK", "VO", "VI" };
const struct ieee80211_wme_param *wme =
@ -2787,7 +2787,7 @@ printwmeparam(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
printwmeinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printwmeinfo(const char *tag, const u_int8_t *ie)
{
printf("%s", tag);
if (verbose) {
@ -2799,7 +2799,7 @@ printwmeinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
printvhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printvhtcap(const char *tag, const u_int8_t *ie)
{
printf("%s", tag);
if (verbose) {
@ -2822,7 +2822,7 @@ printvhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
printvhtinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printvhtinfo(const char *tag, const u_int8_t *ie)
{
printf("%s", tag);
if (verbose) {
@ -2838,7 +2838,7 @@ printvhtinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
printvhtpwrenv(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printvhtpwrenv(const char *tag, const u_int8_t *ie, size_t ielen)
{
printf("%s", tag);
static const char *txpwrmap[] = {
@ -2871,7 +2871,7 @@ printvhtpwrenv(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printhtcap(const char *tag, const u_int8_t *ie)
{
printf("%s", tag);
if (verbose) {
@ -2905,7 +2905,7 @@ printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
printhtinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printhtinfo(const char *tag, const u_int8_t *ie)
{
printf("%s", tag);
if (verbose) {
@ -2937,7 +2937,7 @@ printhtinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
printathie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printathie(const char *tag, const u_int8_t *ie)
{
printf("%s", tag);
@ -2968,7 +2968,7 @@ printathie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
static void
printmeshconf(const char *tag, const uint8_t *ie, size_t ielen, int maxlen)
printmeshconf(const char *tag, const uint8_t *ie)
{
printf("%s", tag);
@ -3006,7 +3006,7 @@ printmeshconf(const char *tag, const uint8_t *ie, size_t ielen, int maxlen)
}
static void
printbssload(const char *tag, const uint8_t *ie, size_t ielen, int maxlen)
printbssload(const char *tag, const uint8_t *ie)
{
printf("%s", tag);
if (verbose) {
@ -3020,7 +3020,7 @@ printbssload(const char *tag, const uint8_t *ie, size_t ielen, int maxlen)
}
static void
printapchanrep(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printapchanrep(const char *tag, const u_int8_t *ie, size_t ielen)
{
printf("%s", tag);
if (verbose) {
@ -3079,7 +3079,7 @@ wpa_keymgmt(const u_int8_t *sel)
}
static void
printwpaie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printwpaie(const char *tag, const u_int8_t *ie)
{
u_int8_t len = ie[1];
@ -3165,7 +3165,7 @@ rsn_keymgmt(const u_int8_t *sel)
}
static void
printrsnie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printrsnie(const char *tag, const u_int8_t *ie, size_t ielen)
{
printf("%s", tag);
if (verbose) {
@ -3213,7 +3213,7 @@ printrsnie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
(((const u_int8_t *)(p))[0] << 8)))
static void
printwpsie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printwpsie(const char *tag, const u_int8_t *ie)
{
u_int8_t len = ie[1];
@ -3443,7 +3443,7 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
printtdmaie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printtdmaie(const char *tag, const u_int8_t *ie, size_t ielen)
{
printf("%s", tag);
if (verbose && ielen >= sizeof(struct ieee80211_tdma_param)) {
@ -3501,7 +3501,7 @@ copy_essid(char buf[], size_t bufsize, const u_int8_t *essid, size_t essid_len)
}
static void
printssid(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printssid(const char *tag, const u_int8_t *ie, int maxlen)
{
char ssid[2*IEEE80211_NWID_LEN+1];
@ -3509,7 +3509,7 @@ printssid(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
printrates(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printrates(const char *tag, const u_int8_t *ie, size_t ielen)
{
const char *sep;
@ -3525,7 +3525,7 @@ printrates(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
printcountry(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printcountry(const char *tag, const u_int8_t *ie)
{
const struct ieee80211_country_ie *cie =
(const struct ieee80211_country_ie *) ie;
@ -3628,13 +3628,13 @@ printies(const u_int8_t *vp, int ielen, unsigned int maxcols)
switch (vp[0]) {
case IEEE80211_ELEMID_SSID:
if (verbose)
printssid(" SSID", vp, 2+vp[1], maxcols);
printssid(" SSID", vp, maxcols);
break;
case IEEE80211_ELEMID_RATES:
case IEEE80211_ELEMID_XRATES:
if (verbose)
printrates(vp[0] == IEEE80211_ELEMID_RATES ?
" RATES" : " XRATES", vp, 2+vp[1], maxcols);
" RATES" : " XRATES", vp, 2+vp[1]);
break;
case IEEE80211_ELEMID_DSPARMS:
if (verbose)
@ -3642,7 +3642,7 @@ printies(const u_int8_t *vp, int ielen, unsigned int maxcols)
break;
case IEEE80211_ELEMID_COUNTRY:
if (verbose)
printcountry(" COUNTRY", vp, 2+vp[1], maxcols);
printcountry(" COUNTRY", vp);
break;
case IEEE80211_ELEMID_ERP:
if (verbose)
@ -3650,51 +3650,51 @@ printies(const u_int8_t *vp, int ielen, unsigned int maxcols)
break;
case IEEE80211_ELEMID_VENDOR:
if (iswpaoui(vp))
printwpaie(" WPA", vp, 2+vp[1], maxcols);
printwpaie(" WPA", vp);
else if (iswmeinfo(vp))
printwmeinfo(" WME", vp, 2+vp[1], maxcols);
printwmeinfo(" WME", vp);
else if (iswmeparam(vp))
printwmeparam(" WME", vp, 2+vp[1], maxcols);
printwmeparam(" WME", vp);
else if (isatherosoui(vp))
printathie(" ATH", vp, 2+vp[1], maxcols);
printathie(" ATH", vp);
else if (iswpsoui(vp))
printwpsie(" WPS", vp, 2+vp[1], maxcols);
printwpsie(" WPS", vp);
else if (istdmaoui(vp))
printtdmaie(" TDMA", vp, 2+vp[1], maxcols);
printtdmaie(" TDMA", vp, 2+vp[1]);
else if (verbose)
printie(" VEN", vp, 2+vp[1], maxcols);
break;
case IEEE80211_ELEMID_RSN:
printrsnie(" RSN", vp, 2+vp[1], maxcols);
printrsnie(" RSN", vp, 2+vp[1]);
break;
case IEEE80211_ELEMID_HTCAP:
printhtcap(" HTCAP", vp, 2+vp[1], maxcols);
printhtcap(" HTCAP", vp);
break;
case IEEE80211_ELEMID_HTINFO:
if (verbose)
printhtinfo(" HTINFO", vp, 2+vp[1], maxcols);
printhtinfo(" HTINFO", vp);
break;
case IEEE80211_ELEMID_MESHID:
if (verbose)
printssid(" MESHID", vp, 2+vp[1], maxcols);
printssid(" MESHID", vp, maxcols);
break;
case IEEE80211_ELEMID_MESHCONF:
printmeshconf(" MESHCONF", vp, 2+vp[1], maxcols);
printmeshconf(" MESHCONF", vp);
break;
case IEEE80211_ELEMID_VHT_CAP:
printvhtcap(" VHTCAP", vp, 2+vp[1], maxcols);
printvhtcap(" VHTCAP", vp);
break;
case IEEE80211_ELEMID_VHT_OPMODE:
printvhtinfo(" VHTOPMODE", vp, 2+vp[1], maxcols);
printvhtinfo(" VHTOPMODE", vp);
break;
case IEEE80211_ELEMID_VHT_PWR_ENV:
printvhtpwrenv(" VHTPWRENV", vp, 2+vp[1], maxcols);
printvhtpwrenv(" VHTPWRENV", vp, 2+vp[1]);
break;
case IEEE80211_ELEMID_BSSLOAD:
printbssload(" BSSLOAD", vp, 2+vp[1], maxcols);
printbssload(" BSSLOAD", vp);
break;
case IEEE80211_ELEMID_APCHANREP:
printapchanrep(" APCHANREP", vp, 2+vp[1], maxcols);
printapchanrep(" APCHANREP", vp, 2+vp[1]);
break;
default:
if (verbose)
@ -3855,7 +3855,7 @@ scan_and_wait(int s)
}
static void
set80211scan(if_ctx *ctx, const char *val, int dummy __unused)
set80211scan(if_ctx *ctx, const char *val __unused, int dummy __unused)
{
scan_and_wait(ctx->io_s);
list_scan(ctx->io_s);
@ -3950,7 +3950,7 @@ list_stations(int s)
do {
const struct ieee80211req_sta_info *si;
si = (const struct ieee80211req_sta_info *) cp;
si = (const struct ieee80211req_sta_info *)(const void *)cp;
if (si->isi_len < sizeof(*si))
break;
if (opmode == IEEE80211_M_MBSS)
@ -4268,7 +4268,7 @@ list_txpow(int s)
}
static void
list_keys(int s)
list_keys(int s __unused)
{
}
@ -5808,13 +5808,13 @@ wlan_create(int s, struct ifreq *ifr)
}
static void
set80211clone_wlandev(if_ctx *ctx, const char *arg, int dummy __unused)
set80211clone_wlandev(if_ctx *ctx __unused, const char *arg, int dummy __unused)
{
strlcpy(params.icp_parent, arg, IFNAMSIZ);
}
static void
set80211clone_wlanbssid(if_ctx *ctx, const char *arg, int dummy __unused)
set80211clone_wlanbssid(if_ctx *ctx __unused, const char *arg, int dummy __unused)
{
const struct ether_addr *ea;
@ -5825,7 +5825,7 @@ set80211clone_wlanbssid(if_ctx *ctx, const char *arg, int dummy __unused)
}
static void
set80211clone_wlanaddr(if_ctx *ctx, const char *arg, int dummy __unused)
set80211clone_wlanaddr(if_ctx *ctx __unused, const char *arg, int dummy __unused)
{
const struct ether_addr *ea;
@ -5837,7 +5837,7 @@ set80211clone_wlanaddr(if_ctx *ctx, const char *arg, int dummy __unused)
}
static void
set80211clone_wlanmode(if_ctx *ctx, const char *arg, int dummy __unused)
set80211clone_wlanmode(if_ctx *ctx __unused, const char *arg, int dummy __unused)
{
#define iseq(a,b) (strncasecmp(a,b,sizeof(b)-1) == 0)
if (iseq(arg, "sta"))
@ -5863,7 +5863,7 @@ set80211clone_wlanmode(if_ctx *ctx, const char *arg, int dummy __unused)
}
static void
set80211clone_beacons(if_ctx *ctx, const char *val, int d)
set80211clone_beacons(if_ctx *ctx __unused, const char *val __unused, int d)
{
/* NB: inverted sense */
if (d)
@ -5873,7 +5873,7 @@ set80211clone_beacons(if_ctx *ctx, const char *val, int d)
}
static void
set80211clone_bssid(if_ctx *ctx, const char *val, int d)
set80211clone_bssid(if_ctx *ctx __unused, const char *val __unused, int d)
{
if (d)
params.icp_flags |= IEEE80211_CLONE_BSSID;
@ -5882,7 +5882,7 @@ set80211clone_bssid(if_ctx *ctx, const char *val, int d)
}
static void
set80211clone_wdslegacy(if_ctx *ctx, const char *val, int d)
set80211clone_wdslegacy(if_ctx *ctx __unused, const char *val __unused, int d)
{
if (d)
params.icp_flags |= IEEE80211_CLONE_WDSLEGACY;

View File

@ -294,7 +294,7 @@ lagg_status(if_ctx *ctx __unused)
}
static void
setlaggtype(if_ctx *ctx, const char *arg, int dummy __unused)
setlaggtype(if_ctx *ctx __unused, const char *arg, int dummy __unused)
{
static const struct lagg_types lt[] = LAGG_TYPES;

View File

@ -90,7 +90,7 @@
#include "ifconfig.h"
static void domediaopt(const char *, bool, int);
static void domediaopt(const char *, bool);
static ifmedia_t get_media_subtype(ifmedia_t, const char *);
static ifmedia_t get_media_mode(ifmedia_t, const char *);
static ifmedia_t get_media_options(ifmedia_t, const char *);
@ -217,21 +217,21 @@ setmedia(if_ctx *ctx __unused, const char *val, int d __unused)
}
static void
setmediaopt(if_ctx *ctx, const char *val, int d __unused)
setmediaopt(if_ctx *ctx __unused, const char *val, int d __unused)
{
domediaopt(val, false, ctx->io_s);
domediaopt(val, false);
}
static void
unsetmediaopt(if_ctx *ctx, const char *val, int d __unused)
unsetmediaopt(if_ctx *ctx __unused, const char *val, int d __unused)
{
domediaopt(val, true, ctx->io_s);
domediaopt(val, true);
}
static void
domediaopt(const char *val, bool clear, int s)
domediaopt(const char *val, bool clear)
{
struct ifmediareq *ifmr;
ifmedia_t options;

View File

@ -185,7 +185,7 @@ setpfsync_syncdev(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
unsetpfsync_syncdev(if_ctx *ctx, const char *val, int dummy __unused)
unsetpfsync_syncdev(if_ctx *ctx, const char *val __unused, int dummy __unused)
{
nvlist_t *nvl = nvlist_create(0);
@ -220,8 +220,7 @@ setpfsync_syncpeer(if_ctx *ctx, const char *val, int dummy __unused)
switch (peerres->ai_family) {
#ifdef INET
case AF_INET: {
struct sockaddr_in *sin = (struct sockaddr_in *)
peerres->ai_addr;
struct sockaddr_in *sin = satosin(peerres->ai_addr);
if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr)))
errx(1, "syncpeer address cannot be multicast");
@ -248,7 +247,7 @@ setpfsync_syncpeer(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
unsetpfsync_syncpeer(if_ctx *ctx, const char *val, int dummy __unused)
unsetpfsync_syncpeer(if_ctx *ctx, const char *val __unused, int dummy __unused)
{
struct sockaddr_storage addr;
memset(&addr, 0, sizeof(addr));
@ -293,7 +292,7 @@ setpfsync_maxupd(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
setpfsync_defer(if_ctx *ctx, const char *val, int d)
setpfsync_defer(if_ctx *ctx, const char *val __unused, int d)
{
nvlist_t *nvl = nvlist_create(0);

View File

@ -176,7 +176,7 @@ vlan_create(int s, struct ifreq *ifr)
}
static void
vlan_cb(int s, void *arg)
vlan_cb(int s __unused, void *arg __unused)
{
if ((params.vlr_tag != NOTAG) ^ (params.vlr_parent[0] != '\0'))
errx(1, "both vlan and vlandev must be specified");
@ -263,7 +263,7 @@ setvlanpcp(if_ctx *ctx, const char *val, int dummy __unused)
}
static void
unsetvlandev(if_ctx *ctx, const char *val, int dummy __unused)
unsetvlandev(if_ctx *ctx, const char *val __unused, int dummy __unused)
{
struct vlanreq vreq;

View File

@ -179,7 +179,7 @@ vxlan_check_params(void)
#undef _REMOTE_ADDR46
static void
vxlan_cb(int s, void *arg)
vxlan_cb(int s __unused, void *arg __unused)
{
}
@ -554,7 +554,7 @@ setvxlan_ttl(if_ctx *ctx, const char *arg, int dummy __unused)
}
static void
setvxlan_learn(if_ctx *ctx, const char *arg, int d)
setvxlan_learn(if_ctx *ctx, const char *arg __unused, int d)
{
struct ifvxlancmd cmd;

View File

@ -55,13 +55,14 @@ static const char rcsid[] =
#include "ifconfig.h"
void
sfp_status(int s, struct ifreq *ifr, int verbose)
sfp_status(if_ctx *ctx)
{
struct ifconfig_sfp_info info;
struct ifconfig_sfp_info_strings strings;
struct ifconfig_sfp_vendor_info vendor_info;
struct ifconfig_sfp_status status;
size_t channel_count;
int verbose = ctx->args->verbose;
if (ifconfig_sfp_get_sfp_info(lifh, name, &info) == -1)
return;