Fix compilation on head and while here:
- remove unwanted whitespaces - remove useless function ifphys() - fix the Makefile to install it into /usr/bin PR: 250133 Reviewed by: glebius, maxim Approved by: glebius Differential Revision: https://reviews.freebsd.org/D27155
This commit is contained in:
parent
b2e9e573a3
commit
6b97a6e365
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=368188
@ -3,5 +3,6 @@
|
||||
PROG= ifinfo
|
||||
SRCS= ifinfo.c rfc1650.c
|
||||
MAN=
|
||||
BINDIR?= /usr/bin
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -49,7 +49,6 @@
|
||||
|
||||
static void printit(const struct ifmibdata *, const char *);
|
||||
static const char *iftype(int);
|
||||
static const char *ifphys(int, int);
|
||||
static int isit(int, char **, const char *);
|
||||
static printfcn findlink(int);
|
||||
|
||||
@ -165,15 +164,13 @@ printit(const struct ifmibdata *ifmd, const char *dname)
|
||||
printf("\tsend queue max length: %d\n", ifmd->ifmd_snd_maxlen);
|
||||
printf("\tsend queue drops: %d\n", ifmd->ifmd_snd_drops);
|
||||
printf("\ttype: %s\n", iftype(ifmd->ifmd_data.ifi_type));
|
||||
printf("\tphysical: %s\n", ifphys(ifmd->ifmd_data.ifi_type,
|
||||
ifmd->ifmd_data.ifi_physical));
|
||||
printf("\taddress length: %d\n", ifmd->ifmd_data.ifi_addrlen);
|
||||
printf("\theader length: %d\n", ifmd->ifmd_data.ifi_hdrlen);
|
||||
printf("\tlink state: %u\n", ifmd->ifmd_data.ifi_link_state);
|
||||
printf("\tvhid: %u\n", ifmd->ifmd_data.ifi_vhid);
|
||||
printf("\tdatalen: %u\n", ifmd->ifmd_data.ifi_datalen);
|
||||
printf("\tmtu: %lu\n", ifmd->ifmd_data.ifi_mtu);
|
||||
printf("\tmetric: %lu\n", ifmd->ifmd_data.ifi_metric);
|
||||
printf("\tmtu: %u\n", ifmd->ifmd_data.ifi_mtu);
|
||||
printf("\tmetric: %u\n", ifmd->ifmd_data.ifi_metric);
|
||||
printf("\tline rate: %lu bit/s\n", ifmd->ifmd_data.ifi_baudrate);
|
||||
printf("\tpackets received: %lu\n", ifmd->ifmd_data.ifi_ipackets);
|
||||
printf("\tinput errors: %lu\n", ifmd->ifmd_data.ifi_ierrors);
|
||||
@ -258,7 +255,7 @@ static const char *const if_types[] = {
|
||||
"IPv6-to-IPv4 TCP relay capturing interface",
|
||||
"6to4 tunnel interface"
|
||||
};
|
||||
#define NIFTYPES ((sizeof if_types)/(sizeof if_types[0]))
|
||||
#define NIFTYPES (int)((sizeof if_types)/(sizeof if_types[0]))
|
||||
|
||||
static const char *
|
||||
iftype(int type)
|
||||
@ -273,15 +270,6 @@ iftype(int type)
|
||||
return if_types[type];
|
||||
}
|
||||
|
||||
static const char *
|
||||
ifphys(int type, int phys)
|
||||
{
|
||||
static char buf[256];
|
||||
|
||||
sprintf(buf, "unknown physical %d", phys);
|
||||
return buf;
|
||||
}
|
||||
|
||||
static int
|
||||
isit(int argc, char **argv, const char *name)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user