RPi Locator and Display Services
skn_network_helpers.h
Go to the documentation of this file.
1 
8 #ifndef SKN_NETWORK_HELPERS_H__
9 #define SKN_NETWORK_HELPERS_H__
10 
11 #include "skn_common_headers.h"
12 #include <sys/utsname.h>
13 
14 //extern PDisplayLine skn_display_manager_add_line(PDisplayManager pdmx, char * client_request_message);
15 
16 
17 /*
18  * Globals defined in skn_network_helpers.c
19 */
20 extern sig_atomic_t gi_exit_flag;
21 extern char *gd_pch_message;
22 extern signed int gd_i_debug;
23 extern int gd_i_socket;
24 extern char gd_ch_program_name[SZ_INFO_BUFF];
25 extern char gd_ch_program_desc[SZ_INFO_BUFF];
26 extern char *gd_pch_effective_userid;
27 extern char gd_ch_ipAddress[SZ_CHAR_BUFF];
28 extern char gd_ch_intfName[SZ_CHAR_BUFF];
29 extern char gd_ch_hostName[SZ_CHAR_BUFF];
31 extern int gd_i_display;
32 extern int gd_i_unique_registry;
33 extern int gd_i_update;
34 extern char * gd_pch_service_name;
35 extern int gd_i_i2c_address;
36 
37 /*
38  * General Utilities
39 */
40 extern long skn_get_number_of_cpu_cores();
41 extern int generate_loadavg_info(char *msg);
42 extern int generate_uname_info(char *msg);
43 extern int generate_datetime_info(char *msg);
44 extern double skn_duration_in_milliseconds(struct timeval *pstart, struct timeval *pend);
45 extern void skn_program_name_and_description_set(const char *name, const char *desc);
46 extern int skn_logger(const char *level, const char *format, ...);
47 extern int skn_handle_locator_command_line(int argc, char **argv);
48 extern int skn_time_delay(double delay_time);
49 //extern void skn_delay_microseconds (int delay_us);
50 extern char * skn_strip(char * alpha);
51 extern uid_t skn_get_userids();
52 
53 extern void signals_init();
54 extern void signals_cleanup(int sig);
55 
56 /*
57  * Server/Client Communication Routines
58 */
59 extern int skn_udp_host_create_broadcast_socket(int port, double rcvTimeout);
60 extern int skn_udp_host_create_regular_socket(int port, double rcvTimeout);
61 extern PServiceRequest skn_service_request_create(PRegistryEntry pre, int host_socket, char *request);
65 
66 extern int get_default_interface_name(char *pchDefaultInterfaceName);
68 extern void service_registry_entry_response_message_log(const char * response);
69 extern void get_default_interface_name_and_ipv4_address(char * intf, char * ipv4);
70 
71 /*
72  * Service Registry Public Routines
73  */
74 extern PServiceRegistry service_registry_valiadated_registry(const char *response);
75 extern int service_registry_valiadate_response_format(const char *response);
76 extern int service_registry_provider(int i_socket, char *response);
77 extern PServiceRegistry service_registry_get_via_udp_broadcast(int i_socket, char *request);
80 extern PRegistryEntry service_registry_find_entry(PServiceRegistry psreg, char *serviceName);
81 extern void * service_registry_get_entry_field_ref(PRegistryEntry prent, char *field);
83 
84 #endif // SKN_NETWORK_HELPERS_H__
void signals_init()
int generate_loadavg_info(char *msg)
int skn_handle_locator_command_line(int argc, char **argv)
void * service_registry_get_entry_field_ref(PRegistryEntry prent, char *field)
uid_t skn_get_userids()
int skn_display_manager_message_consumer_startup(PDisplayManager pdm)
int gd_i_update
void get_default_interface_name_and_ipv4_address(char *intf, char *ipv4)
char * gd_pch_effective_userid
void service_registry_entry_response_message_log(const char *response)
int gd_i_i2c_address
int service_registry_entry_count(PServiceRegistry psr)
void skn_display_manager_message_consumer_shutdown(PDisplayManager pdm)
long skn_get_number_of_cpu_cores()
int service_registry_provider(int i_socket, char *response)
int gd_i_display
#define SZ_CHAR_BUFF
Definition: cmdDC.c:57
PRegistryEntry service_registry_find_entry(PServiceRegistry psreg, char *serviceName)
char gd_ch_hostName[SZ_CHAR_BUFF]
int service_registry_list_entries(PServiceRegistry psr)
void service_registry_destroy(PServiceRegistry psreg)
char gd_ch_ipAddress[SZ_CHAR_BUFF]
char * skn_strip(char *alpha)
PServiceRegistry service_registry_get_via_udp_broadcast(int i_socket, char *request)
int get_broadcast_ip_array(PIPBroadcastArray paB)
double skn_duration_in_milliseconds(struct timeval *pstart, struct timeval *pend)
char gd_ch_program_name[SZ_INFO_BUFF]
int gd_i_socket
#define SZ_INFO_BUFF
Definition: cmdDC.c:56
int skn_udp_host_create_broadcast_socket(int port, double rcvTimeout)
sig_atomic_t gi_exit_flag
void signals_cleanup(int sig)
char gd_ch_program_desc[SZ_INFO_BUFF]
char * gd_pch_message
int generate_uname_info(char *msg)
signed int gd_i_debug
int get_default_interface_name(char *pchDefaultInterfaceName)
void skn_program_name_and_description_set(const char *name, const char *desc)
int service_registry_valiadate_response_format(const char *response)
int skn_udp_service_request(PServiceRequest psr)
PServiceRegistry service_registry_valiadated_registry(const char *response)
int generate_datetime_info(char *msg)
char * gd_pch_service_name
int skn_udp_host_create_regular_socket(int port, double rcvTimeout)
int gd_i_unique_registry
PServiceRequest skn_service_request_create(PRegistryEntry pre, int host_socket, char *request)
int skn_time_delay(double delay_time)
char gd_ch_intfName[SZ_CHAR_BUFF]
char gd_ch_hostShortName[SZ_CHAR_BUFF]