#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#define DEFAULT_UDP_PORT 5683
static void
{
uint8_t observe = 1;
int i, r;
if (!pkt)
return;
for (i = 0; path[i].
data; i++)
return;
err:
}
static bool
{
static int count;
size_t offset;
if (!req || !cliaddr)
return false;
if (++count == 10)
return true;
}
int
main(
int argc,
char *argv[])
{
uint8_t observe = 0;
int i, r;
.port = 0 };
uint8_t token[4] = { 0x41, 0x42, 0x43, 0x44 };
if (argc < 3) {
printf("Usage: %s <address> <path> [path]\n", argv[0]);
return 0;
}
if (!server) {
SOL_WRN(
"Could not create a coap server.");
return -1;
}
if (!req) {
SOL_WRN(
"Could not make a GET request to resource %s", argv[2]);
return -1;
}
if (r < 0) {
SOL_WRN(
"Could not set coap header token.");
goto err;
}
path = calloc(argc - 1, sizeof(*path));
if (!path) {
SOL_WRN(
"Could not allocate the path");
goto err;
}
for (i = 2; i < argc; i++) {
}
for (i = 0; path[i].
data; i++)
SOL_WRN(
"%s is an invalid IPv6 address", argv[1]);
goto err_addr;
}
free(path);
return 0;
err_addr:
free(path);
err:
return -1;
}