udp_locator_client.c
cmdline: ./udp_locator_client -m "<request-message-string>"
Definition at line 11 of file udp_locator_client.c.
References gd_i_socket, gd_pch_message, gd_pch_service_name, gi_exit_flag, _serviceEntry::ip, _serviceEntry::name, _serviceEntry::port, SD_DEBUG, service_registry_destroy(), service_registry_entry_count(), service_registry_find_entry(), service_registry_get_via_udp_broadcast(), service_registry_list_entries(), signals_cleanup(), signals_init(), skn_handle_locator_command_line(), skn_program_name_and_description_set(), skn_udp_host_create_broadcast_socket(), and SZ_COMM_BUFF.
15 memset(request, 0,
sizeof(request));
16 strcpy(request,
"Raspberry Pi where are you?");
20 "Collect IPv4 Address/Port Service info from all providers." 32 }
else if (argc == 2) {
33 strcpy(request, argv[1]);
35 skn_logger(
SD_DEBUG,
"Request Message [%s]", request);
51 char *service_name =
"lcd_display_service";
62 skn_logger(
" ",
"\nLCD DisplayService (%s) is located at IPv4: %s:%d\n", pre->
name, pre->
ip, pre->
port);
char * gd_pch_service_name
int service_registry_entry_count(PServiceRegistry psr)
void signals_cleanup(int sig)
int skn_handle_locator_command_line(int argc, char **argv)
PServiceRegistry service_registry_get_via_udp_broadcast(int i_socket, char *request)
sig_atomic_t gi_exit_flag
int service_registry_list_entries(PServiceRegistry psr)
void service_registry_destroy(PServiceRegistry psreg)
int skn_udp_host_create_broadcast_socket(int port, double rcvTimeout)
void skn_program_name_and_description_set(const char *name, const char *desc)
PRegistryEntry service_registry_find_entry(PServiceRegistry psreg, char *serviceName)