Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154610134
D27155.id79362.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D27155.id79362.diff
View Options
Index: tools/tools/ifinfo/Makefile
===================================================================
--- tools/tools/ifinfo/Makefile
+++ tools/tools/ifinfo/Makefile
@@ -3,5 +3,6 @@
PROG= ifinfo
SRCS= ifinfo.c rfc1650.c
MAN=
+BINDIR?= /usr/bin
.include <bsd.prog.mk>
Index: tools/tools/ifinfo/ifinfo.c
===================================================================
--- tools/tools/ifinfo/ifinfo.c
+++ tools/tools/ifinfo/ifinfo.c
@@ -12,7 +12,7 @@
* no representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
* ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
@@ -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);
@@ -83,7 +82,7 @@
usage(argv[0]);
}
}
-
+
retval = 1;
name[0] = CTL_NET;
@@ -132,15 +131,15 @@
if (dolink && (pf = findlink(ifmd.ifmd_data.ifi_type))) {
name[5] = IFDATA_LINKSPECIFIC;
if (sysctl(name, 6, 0, &linkmiblen, 0, 0) < 0)
- err(EX_OSERR,
+ err(EX_OSERR,
"sysctl(net.link.ifdata.%d.linkspec) size",
i);
linkmib = malloc(linkmiblen);
if (!linkmib)
- err(EX_OSERR, "malloc(%lu)",
+ err(EX_OSERR, "malloc(%lu)",
(u_long)linkmiblen);
if (sysctl(name, 6, linkmib, &linkmiblen, 0, 0) < 0)
- err(EX_OSERR,
+ err(EX_OSERR,
"sysctl(net.link.ifdata.%d.linkspec)",
i);
pf(linkmib, linkmiblen);
@@ -165,15 +164,13 @@
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);
@@ -185,7 +182,7 @@
printf("\tmulticasts received: %lu\n", ifmd->ifmd_data.ifi_imcasts);
printf("\tmulticasts transmitted: %lu\n", ifmd->ifmd_data.ifi_omcasts);
printf("\tinput queue drops: %lu\n", ifmd->ifmd_data.ifi_iqdrops);
- printf("\tpackets for unknown protocol: %lu\n",
+ printf("\tpackets for unknown protocol: %lu\n",
ifmd->ifmd_data.ifi_noproto);
printf("\tHW offload capabilities: 0x%lx\n",
ifmd->ifmd_data.ifi_hwassist);
@@ -193,7 +190,7 @@
ifmd->ifmd_data.ifi_epoch);
#ifdef notdef
printf("\treceive timing: %lu usec\n", ifmd->ifmd_data.ifi_recvtiming);
- printf("\ttransmit timing: %lu usec\n",
+ printf("\ttransmit timing: %lu usec\n",
ifmd->ifmd_data.ifi_xmittiming);
#endif
}
@@ -258,7 +255,7 @@
"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 @@
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)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 30, 1:11 AM (2 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32424890
Default Alt Text
D27155.id79362.diff (3 KB)
Attached To
Mode
D27155: Fixing build on -head and removing useless function
Attached
Detach File
Event Timeline
Log In to Comment