1
0
mirror of https://github.com/PDP-10/klh10.git synced 2026-02-17 21:18:18 +00:00

Make a string available that indicates the supported networking options.

dpni20 and dpimp print it on error or when -debug is given.
enaddr prints it with -v, but this does not reflect TUN since it doesn't use it.
This commit is contained in:
Olaf Seibert
2016-02-17 20:13:15 +01:00
parent 7fedb55643
commit bf51af5874
5 changed files with 38 additions and 6 deletions

View File

@@ -428,8 +428,10 @@ main(int argc, char **argv)
}
}
}
if (initdebug)
dbprint("Starting");
if (initdebug) {
dbprintln("Starting");
dbprintln("Supported ifmeth=%s", osn_networking);
}
/* Right off the bat attempt to get the highest scheduling priority
** we can, since a slow response will cause the 10 monitor to declare

View File

@@ -308,8 +308,10 @@ main(int argc, char **argv)
}
}
}
if (initdebug)
dbprint("Starting");
if (initdebug) {
dbprintln("Starting");
dbprintln("Supported ifmeth=%s", osn_networking);
}
/* Right off the bat attempt to get the highest scheduling priority
** we can. It's important that the NI respond as quickly as possible

View File

@@ -313,6 +313,8 @@ main(int argc, char **argv)
}
}
printf("Supported network interface methods:%s\n", osn_networking);
/* First, show interface info if desired */
osn_iftab_init();

View File

@@ -81,6 +81,29 @@ static ssize_t osn_pfwrite_vde(struct pfdata *pfdata, const void *buf, size_t nb
static void osn_virt_ether(struct pfdata *pfdata, struct osnpf *osnpf);
#endif /* TUN || TAP || VDE */
/*
* Put together a string that shows which network interface methods
* are supported.
*/
char osn_networking[] =
""
#if KLH10_NET_PCAP
" pcap"
#endif
#if KLH10_NET_TUN
" tun"
#endif
#if KLH10_NET_TAP
" tap"
#endif
#if KLH10_NET_TAP && KLH10_NET_BRIDGE
" tap+bridge"
#endif
#if KLH10_NET_VDE
" vde"
#endif
;
/* Get a socket descriptor suitable for general net interface
examination and manipulation; this is not necessarily suitable for
use as a packetfilter.
@@ -1379,7 +1402,8 @@ osn_pfinit(struct pfdata *pfdata, struct osnpf *osnpf, void *pfarg)
}
#endif /* KLH10_NET_VDE */
esfatal(1, "Interface method \"%s\" not supported", method);
esfatal(1, "Interface method \"%s\" not supported (only%s)",
method, osn_networking);
}
ssize_t

View File

@@ -60,7 +60,7 @@
# define ossock_t int /* No typedef until code revised */
#endif /* CENV_SYS_UNIX */
#if HAVE_NET_IF_TUN_H
#if HAVE_NET_IF_TUN_H && OSN_USE_IPONLY
# include <net/if_tun.h>
# define KLH10_NET_TUN 1
#endif
@@ -363,4 +363,6 @@ void osn_pfdeinit(struct pfdata *, struct osnpf *);
ssize_t osn_pfread(struct pfdata *pfdata, void *buf, size_t nbytes);
int osn_pfwrite(struct pfdata *pfdata, const void *buf, size_t nbytes);
extern char osn_networking[];
#endif /* ifndef OSDNET_INCLUDED */