more than 10 interfaces (!!) it'd print them wrong (e.g. as ';', etc.).
From: "Chris G. Demetriou" <cgd@vangogh.CS.Berkeley.EDU>
SCCS-vsn: usr.bin/netstat/if.c 8.2
-static char sccsid[] = "@(#)if.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)if.c 8.2 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#include <sys/protosw.h>
#include <sys/socket.h>
#endif /* not lint */
#include <sys/types.h>
#include <sys/protosw.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <netinet/in.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <netinet/in.h>
#include <netns/ns_if.h>
#include <netiso/iso.h>
#include <netiso/iso_var.h>
#include <netns/ns_if.h>
#include <netiso/iso.h>
#include <netiso/iso_var.h>
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
#include "netstat.h"
#define YES 1
#define NO 0
#include "netstat.h"
#define YES 1
#define NO 0
-static void sidewaysintpr __P((unsigned, u_long));
-static void catchalarm __P(());
+static void sidewaysintpr __P((u_int, u_long));
+static void catchalarm __P((int));
/*
* Print a description of the network interfaces.
/*
* Print a description of the network interfaces.
kread((u_long)ifnet.if_name, name, 16))
return;
name[15] = '\0';
kread((u_long)ifnet.if_name, name, 16))
return;
name[15] = '\0';
- ifnetaddr = (u_long) ifnet.if_next;
- if (interface != 0 &&
- (strcmp(name, interface) != 0 || unit != ifnet.if_unit))
+ ifnetaddr = (u_long)ifnet.if_next;
+ if (interface != 0 && (strcmp(name, interface) != 0 ||
+ unit != ifnet.if_unit))
continue;
cp = index(name, '\0');
continue;
cp = index(name, '\0');
- *cp++ = ifnet.if_unit + '0';
+ cp += sprintf(cp, "%d", ifnet.if_unit);
if ((ifnet.if_flags&IFF_UP) == 0)
*cp++ = '*';
*cp = '\0';
if ((ifnet.if_flags&IFF_UP) == 0)
*cp++ = '*';
*cp = '\0';
* Sets a flag to not wait for the alarm.
*/
static void
* Sets a flag to not wait for the alarm.
*/
static void
+catchalarm(signo)
+ int signo;