mirror of
https://github.com/PDP-10/klh10.git
synced 2026-01-11 23:52:54 +00:00
Eliminate essentially unused fields
ife_pinet, ife_plink and ife_pother.
This commit is contained in:
parent
0f3d110a2d
commit
639a0cbe4e
20
src/osdnet.c
20
src/osdnet.c
@ -364,7 +364,7 @@ osn_iftab_pass(int opts, int npass, int s, struct ifconf *ifc)
|
||||
/* Pass 2 and dealing with an existing entry. Flesh it out! */
|
||||
switch (ifp->ifr_addr.sa_family) {
|
||||
case AF_INET:
|
||||
ife->ife_pinet = ifp; /* Remember pointer */
|
||||
ife->ife_gotip4 = TRUE;
|
||||
ife->ife_ipint = ((struct sockaddr_in *)
|
||||
&ifp->ifr_addr)->sin_addr.s_addr;
|
||||
break;
|
||||
@ -376,13 +376,11 @@ osn_iftab_pass(int opts, int npass, int s, struct ifconf *ifc)
|
||||
struct sockaddr_dl *dla = (struct sockaddr_dl *)&ifp->ifr_addr;
|
||||
memcpy(ife->ife_ea, LLADDR(dla), dla->sdl_alen);
|
||||
ife->ife_gotea = TRUE;
|
||||
ife->ife_plink = ifp;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
/* Else drop through to "other" case */
|
||||
default:
|
||||
ife->ife_pother = ifp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -510,21 +508,17 @@ osn_iftab_show(FILE *f, struct ifent *ifents, int nents)
|
||||
|
||||
for (i = 0, ife = ifents; i < nents; ++i, ++ife) {
|
||||
fprintf(f, "%2d: \"%s\"", i, ife->ife_name);
|
||||
if (ife->ife_pinet) {
|
||||
if (ife->ife_gotip4) {
|
||||
unsigned char *ucp = ife->ife_ipchr;
|
||||
fprintf(f, " (IP %d.%d.%d.%d)",
|
||||
ucp[0], ucp[1], ucp[2], ucp[3]);
|
||||
}
|
||||
if (ife->ife_plink || ife->ife_gotea) {
|
||||
if (ife->ife_gotea) {
|
||||
unsigned char *ucp = ife->ife_ea;
|
||||
fprintf(f, " (%sEther %x:%x:%x:%x:%x:%x)",
|
||||
(ife->ife_plink ? "" : "Extracted "),
|
||||
"Extracted ",
|
||||
ucp[0], ucp[1], ucp[2], ucp[3], ucp[4], ucp[5]);
|
||||
}
|
||||
if (ife->ife_pother) {
|
||||
fprintf(f, " (Other: fam %d)",
|
||||
ife->ife_pother->ifr_addr.sa_family);
|
||||
}
|
||||
fprintf(f, "\r\n");
|
||||
}
|
||||
}
|
||||
@ -598,7 +592,7 @@ osn_ifealookup(char *ifnam, /* Interface name */
|
||||
register struct ifent *ife;
|
||||
|
||||
if ((ife = osn_iflookup(ifnam))
|
||||
&& (ife->ife_plink || ife->ife_gotea)) {
|
||||
&& ife->ife_gotea) {
|
||||
ea_set(eap, ife->ife_ea);
|
||||
return TRUE;
|
||||
}
|
||||
@ -1265,7 +1259,7 @@ osn_ifmcset(int s,
|
||||
int delf,
|
||||
unsigned char *pa)
|
||||
{
|
||||
#if CENV_SYS_DECOSF || CENV_SYS_LINUX || CENV_SYS_FREEBSD
|
||||
#if CENV_SYS_DECOSF || CENV_SYS_LINUX || CENV_SYS_FREEBSD || CENV_SYS_NETBSD
|
||||
|
||||
/* Common preamble code */
|
||||
int ownsock = FALSE;
|
||||
@ -1284,7 +1278,7 @@ osn_ifmcset(int s,
|
||||
ifr.ifr_addr.sa_family = AF_DECnet; /* Known to work; AF_UNSPEC may not */
|
||||
# elif CENV_SYS_LINUX
|
||||
ifr.ifr_addr.sa_family = AF_UNSPEC; /* MUST be this for Linux! */
|
||||
# elif CENV_SYS_FREEBSD
|
||||
# elif CENV_SYS_FREEBSD || CENV_SYS_NETBSD
|
||||
ifr.ifr_addr.sa_family = AF_LINK; /* MUST be this for FreeBSD! */
|
||||
# else
|
||||
# error "Unimplemented OS routine osn_ifmcset()"
|
||||
|
||||
@ -257,16 +257,13 @@ struct ifent {
|
||||
char ife_name[IFNAMSIZ+1]; /* +1 so always null-terminated */
|
||||
int ife_flags; /* IFF_ flags */
|
||||
int ife_mtu; /* MTU (not really used) */
|
||||
int ife_gotip4; /* TRUE if IPv4 addr set */
|
||||
union {
|
||||
struct in_addr ifeu_ia;
|
||||
unsigned char ifeu_chr[4];
|
||||
} ife_uip;
|
||||
int ife_gotea; /* TRUE if E/N addr set */
|
||||
unsigned char ife_ea[6]; /* E/N address */
|
||||
|
||||
struct ifreq *ife_pinet; /* Reference pointer to inet ifreq */
|
||||
struct ifreq *ife_plink; /* Reference pointer to link ifreq */
|
||||
struct ifreq *ife_pother; /* Reference pointer to ???? ifreq */
|
||||
};
|
||||
#define ife_ipia ife_uip.ifeu_ia /* IP address as in_addr */
|
||||
#define ife_ipint ife_uip.ifeu_ia.s_addr /* IP address as integer */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user