#include <errno.h>
#include <getopt.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
};
static bool
{
ssize_t r;
if (r < 0) {
fprintf(stderr, "ERROR: Failed in receiving the message\n");
goto err;
}
return true;
err:
return false;
}
static bool
{
int r = -1;
if (r < 0) {
fprintf(stderr, "ERROR: Could not send data\n");
return false;
}
return false;
}
static void
{
char *addr = NULL;
static const struct option opts[] = {
{ "address", required_argument, NULL, 'a' },
{ "port", required_argument, NULL, 'p' },
{ "help", no_argument, NULL, 'h' },
{ 0, 0, 0, 0 }
};
},
};
while ((c = getopt_long(argc, argv, "a:p:h", opts, &opt_idx)) != -1) {
switch (c) {
case 'a':
addr = optarg;
break;
case 'p':
address.
port = atoi(optarg);
break;
case 'h':
default:
fprintf(stderr,
"Usage:\n\t%s -a <ip address> -p <address port> value\n", argv[0]);
return;
}
}
if (!addr) {
fprintf(stderr, "ERROR: No address was given\n");
goto err;
}
fprintf(stderr, "ERROR: No data was given, use -h for help\n");
goto err;
}
if (!sock) {
fprintf(stderr, "ERROR: Could not create the socket\n");
goto err;
}
fprintf(stderr, "ERROR: Could not convert the address: %s\n", addr);
goto err;
}
return;
err:
}
static void
{
if (sock)
}