commit - 47c9f5f0b2b3086e00efc35ad9451dcaadc24e7e
commit + 1565432acd4544e7ec7645b347334be41e556243
blob - a61c6268de48d7570eaed8b9ecbb79082c02a396
blob + 163c4341b7e9445c742f1acf71e5391c6f176492
--- thingsctl/thingsctl.8
+++ thingsctl/thingsctl.8
.Pp
The following commands are available:
.Bl -tag -width Ds
+.It Cm echo Ar string
+Echo a thing's packets by its name.
+A thing could be sending hostile data!
+Use at your own risk.
+.It Cm kill Ar string
+Disconnect a subscribed client from thingsd by client name.
.It Cm list clients
Show all clients connected to things.
.It Cm list sockets
Enable verbose logging.
.It Cm log debug
Enable very noisy debug logging.
-.It Cm kill Ar string
-Disconnect a subscribed client from thingsd by client name.
-.It Cm show Ar string
-View string version of a thing's packets by its name.
-Showing packets blocks all other calls.
-A thing could be sending binary data!
-Use at your own risk.
+.It Cm show client Ar string
+Show the data for a single client by name.
+.It Cm show control
+Return control process logging verbosity.
+.It Cm show parent
+Return parent process logging verbosity.
+.It Cm show socket Ar string
+Show the data for a single socket by name.
+.It Cm show thing Ar string
+Show the data for a single thing by name.
.El
.Sh FILES
.Bl -tag -width "/var/run/thingsd.sockXX" -compact
.Sh SEE ALSO
.Xr thingsd.conf 5 ,
.Xr thingsd 8
-.Sh HISTORY
-The
-.Nm
-program first appeared in
-.Ox 6.5 .
blob - 6c20a6a5fdae73708b6be52e071567afac3895e2
blob + 655da0ab34ce892b14d8c19f9560e1c200d4110a
--- thingsctl/thingsctl.c
+++ thingsctl/thingsctl.c
0, -1, NULL, 0);
break;
case SHOW_PACKETS:
- imsg_compose(ibuf, IMSG_SHOW_PACKETS_REQUEST, 0,
- 0, -1, res->name, sizeof(res->name));
+ printf("\nEchoing thing packets may have unexcpected ");
+ printf("consequences!\n");
+ printf("Are you sure you want to echo packets? (y|n) ");
+ ch = getchar();
+ if (ch == 'y' || ch == 'Y') {
+ printf("Waiting for incoming packets\n");
+ imsg_compose(ibuf, IMSG_SHOW_PACKETS_REQUEST, 0,
+ 0, -1, res->name, sizeof(res->name));
+ } else
+ printf("Echo packets ignored\n");
+ printf("\n");
break;
case SHOW_PARENT:
imsg_compose(ibuf, IMSG_GET_INFO_PARENT_REQUEST, 0,
blob - dbe8eccfd67314d4a604784e98e583b0cf5c6d13
blob + a5ac19820cc9a642b5ee12c59f37f7448cd135a6
--- thingsd/things.c
+++ thingsd/things.c
packet_client->imsg = *imsg;
memcpy(packet_client->name, imsg->data, sizeof(packet_client->name));
+ log_debug("control packet echo request for %s", packet_client->name);
TAILQ_INSERT_TAIL(thingsd_env->packet_clients, packet_client, entry);
}
if (fd == packet_client->imsg.hdr.peerid) {
TAILQ_REMOVE(thingsd_env->packet_clients,
packet_client, entry);
+ log_debug("control packet echo request stopping for %s",
+ packet_client->name);
free(packet_client);
thingsd_env->conn_retry) {
dead_thing->dtime = time(NULL);
- log_info("attempting to reconnect %s",
+ log_debug("attempting to reconnect %s",
dead_thing->name);
switch (dead_thing->type) {