#include <stdio.h>
static void
{
if (!srv_addr) {
return;
}
if (!map_reader) {
return;
}
SOL_WRN(
"Could not convert network address to string");
return;
}
printf(
"\tkey: '%s', value: ", field.
key);
printf(
"uint(%" PRIu64
")\n", field.
v_uint);
break;
printf(
"int(%" PRIi64
")\n", field.
v_int);
break;
break;
break;
printf("bytestr() [not dumping]\n");
break;
break;
printf(
"float(%f)\n", field.
v_float);
break;
break;
printf(
"boolean(%s)\n", field.
v_boolean ?
"true" :
"false");
break;
printf("\tkey: '%s', value: unsupported cbor code(%" PRIi64 ")\n",
break;
default:
printf(
"unknown(%d)\n", field.
type);
}
}
printf("}\n\n");
}
static bool
{
static const char digits[] = "0123456789abcdef";
uint16_t idx;
if (!res)
return false;
SOL_WRN(
"Could not convert network address to string");
return false;
}
printf("Flags:\n"
" - observable: %s\n"
" - secure: %s\n",
printf("Device ID: ");
for (idx = 0; idx < 16; idx++) {
putchar(digits[(digit >> 4) & 0x0f]);
putchar(digits[digit & 0x0f]);
}
putchar('\n');
printf("Resource types:\n");
printf("Resource interfaces:\n");
if (!request)
return false;
printf("\n");
return false;
}
int
main(
int argc,
char *argv[])
{
.port = 5683 };
const char *resource_type;
if (argc < 2) {
printf("Usage: %s <address> [resource_type]\n", argv[0]);
return 0;
}
if (!strchr(argv[1], ':'))
printf("Could not convert IP address to sockaddr_in\n");
return 1;
}
if (argc < 3) {
printf("No rt filter specified, assuming everything\n");
resource_type = NULL;
} else {
printf("Finding resources with resource type %s\n", argv[2]);
resource_type = argv[2];
}
return 0;
}