2019-07-27 15:48:10 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "../src/ipc.h"
|
|
|
|
|
2020-01-01 12:11:34 +01:00
|
|
|
int main (int argc, char *argv[])
|
2019-07-27 15:48:10 +02:00
|
|
|
{
|
2020-01-01 12:11:34 +01:00
|
|
|
(void)argc;
|
|
|
|
(void)argv;
|
2019-07-27 15:48:10 +02:00
|
|
|
|
2020-01-01 12:11:34 +01:00
|
|
|
SECURE_DECLARATION (struct ipc_error, ret);
|
2019-07-27 15:48:10 +02:00
|
|
|
SECURE_DECLARATION (struct ipc_connection_info, srv);
|
|
|
|
|
|
|
|
if (argc != 2) {
|
|
|
|
fprintf (stderr, "usage: %s service_name\n", argv[0]);
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *service_name = argv[1];
|
|
|
|
|
2020-01-01 12:11:34 +01:00
|
|
|
ret = ipc_contact_networkd (&srv, service_name);
|
2019-07-27 15:48:10 +02:00
|
|
|
|
2020-01-01 12:11:34 +01:00
|
|
|
printf ("ret = %d\n", ret.error_code);
|
2019-07-27 15:48:10 +02:00
|
|
|
|
2020-01-01 12:11:34 +01:00
|
|
|
if (ret.error_code == IPC_ERROR_NONE && srv.fd != 0) {
|
2019-07-27 15:48:10 +02:00
|
|
|
printf ("Success\n");
|
2020-01-01 12:11:34 +01:00
|
|
|
} else {
|
2019-07-27 15:48:10 +02:00
|
|
|
printf ("Ow. :(\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
usock_close (srv.fd);
|
|
|
|
|
2020-01-01 12:11:34 +01:00
|
|
|
return EXIT_SUCCESS;
|
2019-07-27 15:48:10 +02:00
|
|
|
}
|