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 | |
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')
-rw-r--r-- | usr.sbin/dconschat/dconschat.8 | 11 | ||||
-rw-r--r-- | usr.sbin/dconschat/dconschat.c | 11 |
2 files changed, 13 insertions, 9 deletions
diff --git a/usr.sbin/dconschat/dconschat.8 b/usr.sbin/dconschat/dconschat.8 index 4f17d30..e11d224 100644 --- a/usr.sbin/dconschat/dconschat.8 +++ b/usr.sbin/dconschat/dconschat.8 @@ -157,9 +157,9 @@ bus follow. .Bd -literal -offset indent # fwcontrol 2 devices (info_len=2) -node EUI64 status - 1 0x7766554433221100 0 - 0 0x0011223344556677 1 +node EUI64 status + 1 77-66-55-44-33-22-11-00 0 + 0 00-11-22-33-44-55-66-77 1 .Ed .Pp The EUI64 doesn't change unless you change the hardware @@ -168,7 +168,7 @@ as the ethernet address. Now we can run the .Nm . .Bd -literal -offset indent -# dconschat -br -G 12345 -t 0x00112233445566677 +# dconschat -br -G 12345 -t 00-11-22-33-44-55-66-77 .Ed .Pp You'll get console output of the target and login prompt if a getty is @@ -213,7 +213,7 @@ console local { console remote { master localhost; type exec; - exec /usr/sbin/dconschat -rh 25 -t 0x0011223344556677; + exec /usr/sbin/dconschat -rh 25 -t 00-11-22-33-44-55-66-77; } .Ed .Sh FILES @@ -232,6 +232,7 @@ console remote { .Xr firewire 4 , .Xr fwohci 4 , .Xr gdb 4 , +.Xr eui64 5 , .Xr fwcontrol 8 .Sh AUTHORS .An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org 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': |