diff options
author | brooks <brooks@FreeBSD.org> | 2004-05-26 22:59:55 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2004-05-26 22:59:55 +0000 |
commit | 5b46c790ee2be794d0ddffea63668fec51c8f260 (patch) | |
tree | 911a427f57cebda0e7dc45f2fcb3047e0dfcc019 /usr.sbin/dconschat/dconschat.c | |
parent | 5ae1bd47055bb0a8824b70db8ecac0a96fa662c1 (diff) | |
download | FreeBSD-src-5b46c790ee2be794d0ddffea63668fec51c8f260.zip FreeBSD-src-5b46c790ee2be794d0ddffea63668fec51c8f260.tar.gz |
Use new eui64(3) functions to print EUI-64s and to allow access to nodes
by EUI-64 and name.
Reviewed by: simokawa
Diffstat (limited to 'usr.sbin/dconschat/dconschat.c')
-rw-r--r-- | usr.sbin/dconschat/dconschat.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/dconschat/dconschat.c b/usr.sbin/dconschat/dconschat.c index 9c8b89d..d343811 100644 --- a/usr.sbin/dconschat/dconschat.c +++ b/usr.sbin/dconschat/dconschat.c @@ -50,6 +50,7 @@ #include <netdb.h> #include <err.h> #include <string.h> +#include <sys/eui64.h> #include <sys/event.h> #include <sys/time.h> #include <arpa/telnet.h> @@ -809,11 +810,11 @@ main(int argc, char **argv) { struct dcons_state *dc; struct fw_eui64 eui; + struct eui64 target; char devname[256], *core = NULL, *system = NULL; int i, ch, error; int unit=0, wildcard=0; int port[DCONS_NPORT]; - u_int64_t target = 0; bzero(&sc, sizeof(sc)); dc = ≻ @@ -841,9 +842,11 @@ main(int argc, char **argv) dc->flags |= F_REPLAY; break; case 't': - target = strtoull(optarg, NULL, 0); - eui.hi = target >> 32; - eui.lo = target & (((u_int64_t)1 << 32) - 1); + if (eui64_hostton(optarg, &target) != 0 && + eui64_aton(optarg, &target) != 0) + errx(1, "invalid target: %s", optarg); + eui.hi = ntohl(*(u_int32_t*)&(target.octet[0])); + eui.lo = ntohl(*(u_int32_t*)&(target.octet[4])); dc->type = TYPE_FW; break; case 'u': |