RPi Locator and Display Services
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <libgssdp/gssdp.h>
#include <glib-unix.h>
#include <gio/gnetworking.h>
#include <ifaddrs.h>
Go to the source code of this file.
Data Structures | |
struct | _ipBroadcastArray |
struct | _signalData |
struct | _registryData |
struct | _gssdpRegistryData |
struct | _controlData |
Macros | |
#define | PACKAGE_VERSION "0.9.0" |
#define | PACKAGE_NAME "gssdpDC" |
#define | PACKAGE_DESCRIPTION "Send Message to Raspberry Pi's on the network." |
#define | G_OPTION_FLAG_NONE 0 |
#define | UDP_DISPLAY_COMM_PORT 48029 |
#define | UDP_BROADCAST_PORT 48028 |
#define | UDP_REGULAR_PORT 48027 |
#define | UDP_CLIENTS_PORT 48026 |
#define | MS_TEN_MINUTES 600000 |
#define | MSG_DELAY_INTERVAL 10 |
#define | SZ_TIMESTAMP_BUFF 32 |
#define | SZ_PARAMS_BUFF 64 |
#define | SZ_RMTADDR_BUFF 256 |
#define | SZ_MESSAGE_BUFF 512 |
#define | SZ_RESPONSE_BUFF 256 |
#define | SZ_CHAR_LABEL 48 |
#define | SZ_INFO_BUFF 256 |
#define | SZ_CHAR_BUFF 128 |
#define | SZ_LINE_BUFF 512 |
#define | SZ_COMM_BUFF 256 |
#define | SKN_UDP_ANY_PORT 0 |
#define | ARY_MAX_INTF 8 |
#define | PLATFORM_ERROR -1 |
Typedefs | |
typedef struct _ipBroadcastArray | IPBroadcastArray |
typedef struct _ipBroadcastArray * | PIPBroadcastArray |
typedef struct _signalData | USignalData |
typedef struct _signalData * | PUSignalData |
typedef struct _registryData | RegData |
typedef struct _registryData * | PRegData |
typedef struct _registryData ** | PPRegData |
typedef struct _gssdpRegistryData | GSSDPRegData |
typedef struct _gssdpRegistryData * | PGSSDPRegData |
typedef struct _controlData | ControlData |
typedef struct _controlData * | PControlData |
#define ARY_MAX_INTF 8 |
Definition at line 63 of file gssdpDC.c.
Referenced by skn_get_broadcast_ip_array().
#define PACKAGE_DESCRIPTION "Send Message to Raspberry Pi's on the network." |
#define PACKAGE_VERSION "0.9.0" |
gssdpDC.c IOT/RaspberryPi message display client gcc -v pkg-config --cflags --libs glib-2.0 gio-2.0
-O3 -Wall -o gssdpDC gssdpDC.c
Program Flow:
#define PLATFORM_ERROR -1 |
Definition at line 64 of file gssdpDC.c.
Referenced by skn_get_broadcast_ip_array(), and skn_get_default_interface_name_and_ipv4_address().
#define SKN_UDP_ANY_PORT 0 |
Definition at line 62 of file gssdpDC.c.
Referenced by udp_initialize_message_send().
#define SZ_CHAR_BUFF 128 |
Definition at line 58 of file gssdpDC.c.
Referenced by skn_get_broadcast_ip_array(), and skn_get_default_interface_name_and_ipv4_address().
#define SZ_INFO_BUFF 256 |
Definition at line 57 of file gssdpDC.c.
Referenced by skn_get_default_interface_name().
typedef struct _controlData ControlData |
typedef struct _gssdpRegistryData GSSDPRegData |
typedef struct _ipBroadcastArray IPBroadcastArray |
typedef struct _controlData * PControlData |
typedef struct _gssdpRegistryData * PGSSDPRegData |
typedef struct _ipBroadcastArray * PIPBroadcastArray |
typedef struct _registryData ** PPRegData |
typedef struct _registryData * PRegData |
typedef struct _signalData * PUSignalData |
typedef struct _registryData RegData |
typedef struct _signalData USignalData |
|
static |
Definition at line 529 of file gssdpDC.c.
References _gssdpRegistryData::ch_location, _gssdpRegistryData::ch_status, _gssdpRegistryData::ch_timestamp, _gssdpRegistryData::ch_urn, _controlData::glRegistry, and skn_get_timestamp().
Referenced by skn_gssdp_browse().
|
static |
Definition at line 401 of file gssdpDC.c.
References _controlData::ch_display_service_name, _controlData::ch_message, _controlData::gErrorCount, _controlData::gsDSAddr, _controlData::gSock, and _controlData::loop.
Referenced by udp_initialize_message_send().
|
static |
Definition at line 337 of file gssdpDC.c.
References _controlData::ch_request, _controlData::ch_response, _controlData::gErrorCount, _controlData::loop, _controlData::oneShot, _controlData::resolver, and skn_get_timestamp().
Referenced by udp_initialize_message_send().
|
static |
Definition at line 473 of file gssdpDC.c.
References _controlData::ch_display_service_name, _registryData::ch_ip, _gssdpRegistryData::ch_location, _registryData::ch_name, _registryData::ch_port, _gssdpRegistryData::ch_urn, FALSE, _controlData::glRegistry, _controlData::gMsgDelay, _controlData::gReady, _controlData::gRegistryQueries, _controlData::gsDSAddr, _controlData::resource_browser, TRUE, udp_initialize_message_send(), and udp_registry_find_by_name().
Referenced by main().
|
static |
Definition at line 586 of file gssdpDC.c.
References _signalData::loop, and _signalData::signalName.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 592 of file gssdpDC.c.
References cb_udp_registry_select_handler(), cb_unix_signal_handler(), _controlData::ch_display_service_name, _controlData::ch_intfName, _controlData::ch_message, _controlData::ch_this_ip, FALSE, G_OPTION_FLAG_NONE, _controlData::gCommSource, _controlData::gErrorCount, _controlData::glRegistry, _controlData::gMsgDelay, _controlData::gReady, _controlData::gRegCount, _controlData::gRegistryQueries, _controlData::gsAddr, _controlData::gsDSAddr, _controlData::gSock, _controlData::gssdp_rgroup_client, _signalData::loop, _controlData::loop, MSG_DELAY_INTERVAL, _controlData::oneShot, _controlData::paB, _controlData::pch_search, _controlData::resolver, _controlData::resource_browser, _controlData::sigHup, _controlData::sigInt, _signalData::signalName, _controlData::sigTerm, skn_get_default_interface_name_and_ipv4_address(), skn_gssdp_browse(), and TRUE.
gint skn_get_broadcast_ip_array | ( | PIPBroadcastArray | paB | ) |
Collect IP and Broadcast Addresses for this machine
Definition at line 196 of file gssdpDC.c.
References ARY_MAX_INTF, _ipBroadcastArray::broadAddrStr, _ipBroadcastArray::cbName, _ipBroadcastArray::chDefaultIntfName, _ipBroadcastArray::count, _ipBroadcastArray::defaultIndex, _ipBroadcastArray::ifNameStr, _ipBroadcastArray::ipAddrStr, _ipBroadcastArray::maskAddrStr, PLATFORM_ERROR, skn_get_default_interface_name(), and SZ_CHAR_BUFF.
Referenced by skn_get_default_interface_name_and_ipv4_address().
gint skn_get_default_interface_name | ( | char * | pchDefaultInterfaceName | ) |
Retrieves default internet interface name into param
[jscott OSX]$ route -n get 0.0.0.0 route to: default destination: default mask: default gateway: 10.21.1.254 interface: en3 flags: <UP,GATEWAY,DONE,STATIC,PRCLONING> recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0
Definition at line 257 of file gssdpDC.c.
References skn_strip(), and SZ_INFO_BUFF.
Referenced by skn_get_broadcast_ip_array().
PIPBroadcastArray skn_get_default_interface_name_and_ipv4_address | ( | char * | intf, |
char * | ipv4 | ||
) |
PIPBroadcastArray skn_get_default_interface_name_and_ipv4_address | ( | gchar * | intf, |
gchar * | ipv4 | ||
) |
Definition at line 176 of file gssdpDC.c.
References _ipBroadcastArray::chDefaultIntfName, _ipBroadcastArray::defaultIndex, _ipBroadcastArray::ipAddrStr, PLATFORM_ERROR, skn_get_broadcast_ip_array(), and SZ_CHAR_BUFF.
gchar* skn_get_timestamp | ( | ) |
Definition at line 300 of file gssdpDC.c.
Referenced by cb_gssdp_resource_available(), and cb_udp_comm_response_handler().
gchar* skn_gio_condition_to_string | ( | GIOCondition | condition | ) |
gboolean skn_gssdp_browse | ( | PControlData | pctrl | ) |
Setup a monitor for the registry page
Definition at line 568 of file gssdpDC.c.
References cb_gssdp_resource_available(), FALSE, _controlData::gssdp_rgroup_client, _controlData::pch_search, _controlData::resource_browser, and TRUE.
Referenced by main().
gchar* skn_strip | ( | gchar * | alpha | ) |
Remove Trailing and Leading Blanks
Definition at line 150 of file gssdpDC.c.
Referenced by skn_get_default_interface_name().
gboolean udp_initialize_message_send | ( | PControlData | pctrl | ) |
Definition at line 428 of file gssdpDC.c.
References cb_udp_comm_request_handler(), cb_udp_comm_response_handler(), FALSE, _controlData::gCommSource, _controlData::gMsgDelay, _controlData::gsAddr, _controlData::gSock, SKN_UDP_ANY_PORT, and TRUE.
Referenced by cb_udp_registry_select_handler().
gint udp_registry_find_by_name | ( | PGSSDPRegData | pr, |
gchar * | pch_name | ||
) |
Definition at line 465 of file gssdpDC.c.
References _gssdpRegistryData::ch_urn.
Referenced by cb_udp_registry_select_handler().