The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nanoprobe/nanoprobe.c
Go to the documentation of this file.
1 
24 #include <projectcommon.h>
25 #include <stdlib.h>
26 #ifdef HAVE_UNISTD_H
27 # include <unistd.h>
28 #endif
29 #include <string.h>
30 #include <signal.h>
31 #include <errno.h>
32 #include <framesettypes.h>
33 #include <frameset.h>
34 #include <ctype.h>
35 #include <netgsource.h>
36 #include <reliableudp.h>
37 #include <netaddr.h>
38 #include <authlistener.h>
39 #include <signframe.h>
40 #include <cryptframe.h>
41 #include <compressframe.h>
42 #include <intframe.h>
43 #include <addrframe.h>
44 #include <cstringframe.h>
45 #include <frametypes.h>
46 #include <misc.h>
47 #include <nanoprobe.h>
48 
50 
51 #ifdef WIN32
52 #define SEP "\\"
53 # undef HAS_FORK
54 WINIMPORT int errcount;
55 WINIMPORT GMainLoop* mainloop;
56 WINEXPORT void remove_pid_file(const char * pidfile);
57 WINEXPORT void daemonize_me(gboolean stay_in_foreground, const char * dirtorunin, char* pidfile);
58 WINEXPORT PidRunningStat are_we_already_running(const char * pidfile, int* pid);
59 WINEXPORT int kill_pid_service(const char * pidfile, int signal);
60 #else
61 #define SEP "/"
62 # define HAS_FORK
63 #endif
64 
65 const char * localaddr = NULL;
66 const char * cmaaddr = NULL;
67 const char * procname = "nanoprobe";
68 
69 gint64 pktcount = 0;
75 int pcapcount = 0;
76 int wirepktcount = 0;
77 
78 
79 // Signals...
80 gboolean sigint = FALSE;
81 gboolean sigterm = FALSE;
82 gboolean sighup = FALSE;
83 gboolean sigusr1 = FALSE;
84 gboolean sigusr2 = FALSE;
85 
86 
87 FSTATIC void catch_a_signal(int signum);
88 FSTATIC gboolean check_for_signals(gpointer ignored);
89 FSTATIC gboolean gotnetpkt(Listener*, FrameSet* fs, NetAddr* srcaddr);
90 FSTATIC void usage(const char * cmdname);
91 
92 
94 FSTATIC gboolean
96  FrameSet* fs,
97  NetAddr* srcaddr
98  )
99 {
100  (void)l; (void)srcaddr;
101  ++wirepktcount;
102  switch(fs->fstype) {
104  g_message("%s.%d: Received back alive notification (type %d) over the 'wire'."
105  , __FUNCTION__, __LINE__, fs->fstype);
106  break;
107 
108  default:
110  g_warning("%s.%d: Received a FrameSet of type %d over the 'wire' (OOPS!)."
111  , __FUNCTION__, __LINE__, fs->fstype);
112  }else{
113  DEBUGMSG3("%s.%d: Received a FrameSet of type %d over the 'wire'."
114  , __FUNCTION__, __LINE__, fs->fstype);
115  }
116  }
117  DUMP3(__FUNCTION__, &srcaddr->baseclass, " Was address received from.");
118  DUMP3(__FUNCTION__, &fs->baseclass, " Was the frameset received.");
119  UNREF(fs);
120  return TRUE;
121 }
122 
124 FSTATIC void
125 catch_a_signal(int signum)
126 {
127  switch(signum) {
128  case SIGINT:
129  sigint = TRUE;
130  break;
131  case SIGTERM:
132  sigterm = TRUE;
133  break;
134 #ifndef WIN32
135  case SIGHUP:
136  sighup = TRUE;
137  break;
138  case SIGUSR1:
139  proj_class_incr_debug(NULL);
140  sigusr1 = TRUE;
141  break;
142  case SIGUSR2:
143  proj_class_decr_debug(NULL);
144  sigusr2 = TRUE;
145  break;
146 #endif
147  }
148 }
149 
150 // If our output is all ACKed, then go ahead and shutdown
151 
153 FSTATIC gboolean
154 check_for_signals(gpointer ignored)
155 {
156  (void)ignored;
157  if (sigterm || sigint) {
158  g_message("%s: exiting on %s.", procname, (sigterm ? "SIGTERM" : "SIGINT"));
159  return nano_initiate_shutdown();
160  return FALSE;
161  }
162  if (sigusr1) {
163  sigusr1 = FALSE;
164  }
165  if (sigusr2) {
166  sigusr2 = FALSE;
167  }
168  return TRUE;
169 }
170 
171 FSTATIC void
172 usage(const char * cmdname)
173 {
174  fprintf(stderr, "usage: %s [arguments...]\n", cmdname);
175  fprintf(stderr, "Legal arguments are:\n");
176  fprintf(stderr, "\t-c --cmaaddr <address:port-of-CMA>\n");
177  fprintf(stderr, "\t-b --bind <address:port-to-listen-on-locally>\n");
178  fprintf(stderr, "\t-t --ttl <multi cast ttl (default == 31)>\n");
179 #ifndef WIN32
180 #ifdef HAS_FORK
181  fprintf(stderr, "\t-f --foreground (stay in foreground.)\n");
182 #endif
183  fprintf(stderr, "\t-k --kill (send SIGTERM to the running service.)\n");
184  fprintf(stderr, "\t-p --pidfile <pid-file-pathname>.\n");
185  fprintf(stderr, "\t-s --status (report nanoprobe status)\n");
186 #endif
187  fprintf(stderr, "\t-d --debug <debug-level (0-5)>\n");
188  fprintf(stderr, "\t-D --dynamic\n");
189 }
190 
196 int
197 main(int argc, char **argv)
198 {
199  static char defaultCMAaddr[] = CMAADDR;
200  static char defaultlocaladdress [] = NANOLISTENADDR;
201  SignFrame* signature = signframe_new(G_CHECKSUM_SHA256, 0);
203  Listener* otherlistener;
205  PacketDecoder* decoder = nano_packet_decoder();
206 #ifdef HAVE_SIGACTION
207  struct sigaction sigact;
208 #endif
209  static char * localaddr = defaultlocaladdress;
210  static char * cmaaddr = defaultCMAaddr;
211  static int debug = 0;
212  gboolean anyportpermitted = TRUE;
213  static int mcast_ttl = 31;
214  static gboolean stay_in_foreground = FALSE;
215  static gboolean dostatusonly = FALSE;
216  static gboolean dokillonly = FALSE;
217  static gboolean dynamicport = FALSE;
218  static char* pidfile = NULL;
219  gboolean bindret = FALSE;
220  PidRunningStat rstat;
221  int ret;
222 
223  GError *error = NULL;
224  static GOptionEntry long_options[] = {
225  {"bind", 'b', 0, G_OPTION_ARG_STRING, &localaddr, "<address:port-to-listen-on-locally>", NULL},
226  {"cmaaddr", 'c', 0, G_OPTION_ARG_STRING, &cmaaddr, "<address:port-of-CMA>", NULL},
227  {"debug", 'd', 0, G_OPTION_ARG_INT, &debug, "set debug level", NULL},
228  {"dynamic", 'D', 0, G_OPTION_ARG_NONE, &dynamicport," force dynamic port", NULL},
229  {"ttl", 't', 0, G_OPTION_ARG_INT, &mcast_ttl, "<multicast-ttl> (default is 31)", NULL},
230  {"kill", 'k', 0, G_OPTION_ARG_NONE, &dokillonly, "send SIGTERM to the running service", NULL},
231  {"pidfile", 'p', 0, G_OPTION_ARG_STRING, &pidfile, "<pid-file-pathname>", NULL},
232  {"status", 's', 0, G_OPTION_ARG_NONE, &dostatusonly, "report nanoprobe status", NULL},
233 #ifdef HAS_FORK
234  {"foreground", 'f', 0, G_OPTION_ARG_NONE, &stay_in_foreground, "stay in foreground", NULL},
235 #endif
236  {NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL}
237  };
238 
239  GOptionContext *context = g_option_context_new("- start nanoprobe");
240  g_option_context_add_main_entries(context, long_options, NULL);
242 
243 
244  if(!(g_option_context_parse(context, &argc, &argv, &error))) {
245  g_print("option parsing failed %s\n", error->message);
246  usage(argv[0]);
247  exit(1);
248  }
249 
250  BINDDEBUG(NanoprobeMain);
251 
252  if(debug > 0 && debug <= 5) {
253  while(debug--) {
254  proj_class_incr_debug(NULL);
255  }
256  }
257 
258 
259  if (pidfile == NULL) {
261  }
262 
263  if (dostatusonly) {
264  rstat = are_we_already_running(pidfile, NULL);
265  ret = pidrunningstat_to_status(rstat);
266  g_free(pidfile);
267  exit(ret);
268  }
269  if (dokillonly) {
270  int rc = kill_pid_service(pidfile, SIGTERM);
271  if (rc != 0) {
272  fprintf(stderr, "%s: could not stop service [%s]\n", "nanoprobe", g_strerror(errno));
273  g_warning("%s: could not stop service [%s]\n", "nanoprobe", g_strerror(errno));
274  g_free(pidfile);
275  exit(1);
276  }
277  while (are_we_already_running(pidfile, NULL) == PID_RUNNING) {
278  usleep(100000); // 1/10 second
279  }
280  g_free(pidfile);
281  exit(0);
282  }
283  daemonize_me(stay_in_foreground, SEP, pidfile);
284 
285  assimilation_openlog(argv[0]);
286 
288  g_warning("This OS DOES NOT support dual ipv4/v6 sockets - this may not work!!");
289  }
290 #ifndef HAVE_SIGACTION
291  signal(SIGTERM, catch_a_signal);
292  if (stay_in_foreground) {
293  if (signal(SIGINT, catch_a_signal) == SIG_IGN) {
294  signal(SIGINT, SIG_IGN);
295  }
296  }else{
297  signal(SIGINT, SIG_IGN);
298  }
299 #else
300  memset(&sigact, 0, sizeof(sigact));
301  sigact.sa_handler = catch_a_signal;
302  sigaction(SIGTERM, &sigact, NULL);
303  if (stay_in_foreground) {
304  struct sigaction oldact;
305  sigaction(SIGINT, &sigact, &oldact); // Need to check to see if it's already blocked.
306  if (oldact.sa_handler == SIG_IGN) {
307  // OOPS - put it back like it was
308  sigaction(SIGINT, &oldact, NULL);
309  }
310  }else{
311  // Always ignore SIGINT when in the background
312  struct sigaction ignoreme;
313  memset(&ignoreme, 0, sizeof(ignoreme));
314  ignoreme.sa_handler = SIG_IGN;
315  sigaction(SIGINT, &ignoreme, NULL);
316  }
317  sigaction(SIGUSR1, &sigact, NULL);
318  sigaction(SIGUSR2, &sigact, NULL);
319 #endif
320 
321  config->setframe(config, CONFIGNAME_OUTSIG, &signature->baseclass);
322  config->setframe(config, CONFIGNAME_COMPRESS, &compression->baseclass);
323 
324  // Create a network transport object for normal UDP packets
325  nettransport = &(reliableudp_new(0, config, decoder, 0)->baseclass.baseclass);
326  g_return_val_if_fail(NULL != nettransport, 2);
327 
328 
329  // Construct the NetAddr we'll talk to (it defaults to a mcast address nowadays)
330  destaddr = netaddr_string_new(cmaaddr);
331  g_info("CMA address: %s", cmaaddr);
332  if (destaddr->ismcast(destaddr)) {
333  if (!nettransport->setmcast_ttl(nettransport, mcast_ttl)) {
334  g_warning("Unable to set multicast TTL to %d [%s %d]", mcast_ttl
335  , g_strerror(errno), errno);
336  }
337  }
338 
339  g_return_val_if_fail(NULL != destaddr, 3);
340  g_return_val_if_fail(destaddr->port(destaddr) != 0, 4);
341  config->setaddr(config, CONFIGNAME_CMAINIT, destaddr);
342 
343 
344  if (dynamicport) {
345  anyportpermitted = TRUE;
346  }else{
347  // Construct a NetAddr to bind to (listen from) (normally ANY address)
348  localbindaddr = netaddr_string_new(localaddr);
349  g_return_val_if_fail(NULL != localbindaddr, 5);
350 
351  // Bind to the requested address (defaults to ANY as noted above)
352  bindret = nettransport->bindaddr(nettransport, localbindaddr, anyportpermitted);
353  UNREF(localbindaddr);
354  }
355  if (!bindret) {
356  // OOPS! Address:Port already busy...
357  if (anyportpermitted) {
358  guint8 anyaddr[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
359  localbindaddr = netaddr_ipv6_new(anyaddr, 0);
360  g_return_val_if_fail(NULL != localbindaddr, 5);
361  bindret = nettransport->bindaddr(nettransport, localbindaddr, FALSE);
362  UNREF(localbindaddr);
363  localbindaddr = NULL;
364  g_return_val_if_fail(bindret, 6);
365  }else{
366  g_warning("Cannot bind to local address [%s] and cannot use any free port."
367  , localaddr);
368  return(5);
369  }
370  }
371  {
372  NetAddr* boundaddr = nettransport->boundaddr(nettransport);
373  if (boundaddr) {
374  char * boundstr = boundaddr->baseclass.toString(&boundaddr->baseclass);
375  g_info("Local address: %s", boundstr);
376  g_free(boundstr);
377  UNREF(boundaddr);
378  }else{
379  g_warning("Unable to determine local address!");
380  }
381  }
382 
383  // Connect up our network transport into the g_main_loop paradigm
384  // so we get dispatched when packets arrive
385  netpkt = netgsource_new(nettransport, NULL, G_PRIORITY_HIGH, FALSE, NULL, 0, NULL);
386 
387  // Observe all unclaimed packets
388  otherlistener = listener_new(config, 0);
389  otherlistener->got_frameset = gotnetpkt;
390  netpkt->addListener(netpkt, 0, otherlistener);
391  otherlistener->associate(otherlistener,netpkt);
392  g_timeout_add_seconds(1, check_for_signals, NULL);
393 
394  // Unref the "other" listener - netpkt et al holds references to it
395  UNREF(otherlistener);
396 
397  // Free signature frame
398  UNREF2(signature);
399  // Free compression frame
400  UNREF2(compression);
401 
402  // Free misc addresses
403  UNREF(destaddr);
404 
405  nano_start_full("netconfig", 900, netpkt, config);
406  g_info("Starting version %s: licensed under %s", VERSION_STRING, LONG_LICENSE_STRING);
407 
408  // Free config object
409  UNREF(config);
410 
411  mainloop = g_main_loop_new(g_main_context_default(), TRUE);
412 
413  /********************************************************************
414  * Start up the main loop - run our test program...
415  * (the one pretending to be both the nanoprobe and the CMA)
416  ********************************************************************/
417  g_main_loop_run(mainloop);
418 
419  /********************************************************************
420  * We exited the main loop. Shut things down.
421  ********************************************************************/
422 
423  remove_pid_file(pidfile);
424  g_free(pidfile);
425 
426  nano_shutdown(TRUE); // Tell it to shutdown and print stats
427  g_info("%-35s %8d", "Count of 'other' pkts received:", wirepktcount);
428 
429  UNREF(nettransport);
430 
431  // This two calls need to be last - and in this order...
432  // (I wish the documentation on this stuff was clearer... Sigh...)
433  //g_main_context_unref(g_main_context_default());
434  g_main_loop_unref(mainloop);
435  g_source_unref(&netpkt->baseclass); // Not sure why this is needed...
436  g_source_destroy(&netpkt->baseclass); // Not sure why this is needed...
437  mainloop = NULL; netpkt = NULL;
438 
439 
440  // At this point - nothing should show up - we should have freed everything
441  if (proj_class_live_object_count() > 0) {
443  g_warning("Too many objects (%d) alive at end of test.",
445  ++errcount;
446  }else{
447  g_info("No objects left alive. Awesome!");
448  }
450  return(errcount <= 127 ? errcount : 127);
451 }
GSource baseclass
Parent GSource Object pointer.
Definition: netgsource.h:44
AssimObj baseclass
Definition: frameset.h:46
guint16(* port)(const NetAddr *self)
Return port from this address.
Definition: netaddr.h:46
gboolean sigterm
Defines miscellaneous interfaces.
NetAddr * localbindaddr
NetAddr * destaddr
PacketDecoder * nano_packet_decoder(void)
Return our nanoprobe packet decoder map.
Describes interfaces to Signature Frame (Signframe) C-Class - providing digital signatures.
Listener * listener_new(ConfigContext *config, gsize objsize)
Construct a new Listener - setting up GSource and timeout data structures for it. ...
Definition: listener.c:82
const char * localaddr
WINEXPORT GMainLoop * mainloop
Implements minimal client-oriented Frame and Frameset capabilities.
const char * procname
process name
#define CONFIGNAME_OUTSIG
SignFrame to use to sign/verify packets.
int main(int argc, char **argv)
Nanoprobe main program.
NetGSource * netgsource_new(NetIO *iosrc, GDestroyNotify notify, gint priority, gboolean can_recurse, GMainContext *context, gsize objsize, gpointer userdata)
Create a new (abstract) NetGSource object.
Definition: netgsource.c:74
void proj_class_finalize_sys(void)
Shut down (finalize) our object class system. Only do on shutdown to make valgrind happy :-D...
Definition: proj_classes.c:88
Describes interfaces to C-String Frame (Cstringframe) C-Class It holds conventional zero-terminated b...
AssimObj baseclass
Definition: netaddr.h:44
gboolean sigusr2
#define LONG_LICENSE_STRING
WINEXPORT void nano_start_full(const char *initdiscoverpath, guint discover_interval, NetGSource *io, ConfigContext *config)
Here is how the startup process works:
FSTATIC void usage(const char *cmdname)
gboolean bindaddr(NetIO *self, const NetAddr *, gboolean silent)
<[in] Bind this NetIO to the given address
#define NANOLISTENADDR
The SignFrame class object - implements digital signatures for FrameSets.
Definition: signframe.h:40
#define WINEXPORT
Definition: projectcommon.h:45
#define FSTATIC
Definition: projectcommon.h:31
#define DEBUGMSG3(...)
Definition: proj_classes.h:91
int signal
Definition: childprocess.c:238
guint16 fstype
Type of frameset.
Definition: frameset.h:51
NetIO * nettransport
void proj_class_decr_debug(const char *Cclass)
Decrement debug level for this class and all its subclasses by one.
Definition: proj_classes.c:148
void(* setaddr)(ConfigContext *, const char *, NetAddr *)
Set NetAddr value.
Definition: configcontext.h:93
#define BINDDEBUG(Cclass)
BINDDEBUG is for telling the class system where the debug variable for this class is - put it in the ...
Definition: proj_classes.h:82
void(* setframe)(ConfigContext *, const char *, Frame *)
Set Frame value.
Definition: configcontext.h:91
Implements the IntFrame class - integers in a frame.
#define __FUNCTION__
CompressFrame * compressframe_new(guint16 frame_type, guint16 compression_method)
This is our CompressFrame class object - used for representing a compression method.
Definition: compressframe.h:41
#define FRAMESETTYPE_SENDHB
Send Heartbeats to these addresses.
Definition: framesettypes.h:47
Describes interfaces to C-String Frame (Cstringframe) C-Class It holds conventional zero-terminated b...
Implements the Reliable UDP network I/O transport (ReliableUDP) class.
#define DUMP3(prefix, obj, suffix)
Definition: proj_classes.h:97
void assimilation_openlog(const char *logname)
Open logs in our style (syslog)
Definition: misc.c:192
WINEXPORT int errcount
error count
FSTATIC gboolean check_for_signals(gpointer ignored)
Check for signals periodically.
int pcapcount
#define VERSION_STRING
Header file defining all known FrameSet types THIS FILE MECHANICALLY GENERATED by "/home/alanr/assim/...
#define COMPRESS_ZLIB
Compression using 'zlib'.
Definition: compressframe.h:38
gboolean(* ismcast)(const NetAddr *self)
Return TRUE if this address is a multicast address.
Definition: netaddr.h:48
gboolean netio_is_dual_ipv4v6_stack(void)
Definition: netio.c:743
Describes interfaces to C-String Frame (Compressframe) C-Class It holds conventional zero-terminated ...
NetAddr * netaddr_ipv6_new(gconstpointer ipbuf, guint16 port)
Create new NetAddr from a IPv6 address.
Definition: netaddr.c:1032
FSTATIC gboolean gotnetpkt(Listener *, FrameSet *fs, NetAddr *srcaddr)
Test routine called when an otherwise-unclaimed NetIO packet is received.
const char * cmaaddr
include file defining functions to be called by a main to instantiate a nanoprobe.
guint32 proj_class_live_object_count(void)
Return the count of live C class objects.
Definition: proj_classes.c:406
Project common header file.
int kill_pid_service(const char *pidfile, int signal)
kill the service that goes with our current pid file - return negative iff pidfile pid is running and...
Definition: misc.c:470
Header file defining the data layouts for our Frames.
NetAddr *(* boundaddr)(const NetIO *self)
[in] Object to return bound address/port of
Definition: netio.h:79
NetAddr * anyaddr
Definition: pcap+mainloop.c:84
#define FRAMESETTYPE_HBBACKALIVE
System named in packet sent heartbeat after being marked dead.
Definition: framesettypes.h:42
gboolean sigusr1
SignFrame * signframe_new(GChecksumType sigtype, gsize framesize)
Construct a new SignFrame - allowing for "derived" frame types...
Definition: signframe.c:208
WINEXPORT gboolean nano_initiate_shutdown(void)
Initiate shutdown - return TRUE if we have shut down immediately...
PidRunningStat
Status of pid file and/or running processes referred to by it - analogous to "service status"...
Definition: misc.h:37
#define CONFIGNAME_COMPRESS
Frame to use for compressing/decompressing.
guint pidrunningstat_to_status(PidRunningStat stat)
Convert PidRunningStat to an exit code for status.
Definition: misc.c:520
ReliableUDP * reliableudp_new(gsize objsize, ConfigContext *config, PacketDecoder *decoder, guint rexmit_timer_uS)
Construct new UDP NetIO object (and its socket, etc)
Definition: reliableudp.c:68
void proj_class_incr_debug(const char *Cclass)
Increment debug level for this class and all its subclasses by one.
Definition: proj_classes.c:140
void daemonize_me(gboolean stay_in_foreground, const char *dirtorunin, char *pidfile)
Function to get system name (uname -n in UNIX terms)
Definition: misc.c:90
NetGSource * netpkt
void(* addListener)(NetGSource *, guint16, Listener *)
Register a new listener.
Definition: netgsource.h:55
void remove_pid_file(const char *pidfile)
Remove the pid file that goes with this service iff we created one during this invocation.
Definition: misc.c:461
The NetAddr class class represents a general network address - whether IP, MAC, or any other type of ...
Definition: netaddr.h:43
Describes interfaces to Address Frame (AddrFrame) C-Class.
gboolean(* got_frameset)(Listener *self, FrameSet *fs, NetAddr *na)
called when a FrameSet arrives
Definition: listener.h:45
Defines interfaces for the NetAddr (network address) object.
#define g_info(...)
Definition: projectcommon.h:66
NetIO baseclass
Base class (NetIO) object.
Definition: netioudp.h:40
gboolean sigint
FrameSet class - used for collecting Frames when not on the wire, and for marshalling/demarshalling t...
Definition: frameset.h:45
#define CMAADDR
Definition: projectcommon.h:99
char * get_default_pid_fileName(const char *procname)
get default pid file name
Definition: misc.c:448
gchar *(* toString)(gconstpointer)
Produce malloc-ed string representation.
Definition: assimobj.h:58
gboolean sighup
#define SEP
WINEXPORT void nano_shutdown(gboolean report)
Shut down the things started up by nano_start_full() - mainly free storage to make valgrind happy...
PidRunningStat are_we_already_running(const char *pidfile, int *pidarg)
See if the pid file suggests we are already running or not.
Definition: misc.c:298
Implements NetIO GSource object.
#define FRAMESETTYPE_STARTUP
System originating packet looking for heartbeat configuration.
Definition: framesettypes.h:38
#define DEBUGDECLARATIONS
Definition: proj_classes.h:79
#define CONFIGNAME_CMAINIT
Initial startup contact address for the CMA.
void proj_class_dump_live_objects(void)
Dump all live C class objects (address and Class)
Definition: proj_classes.c:356
void(* associate)(Listener *self, NetGSource *source)
NetGSource class to associate with
Definition: listener.h:49
Defines Listener interfaces for packets coming from the Collective Authority.
ConfigContext * configcontext_new(gsize objsize)
Construct a new ConfigContext object - with no values defaulted.
Frame baseclass
Base Frame class object.
Definition: signframe.h:41
int heartbeatcount
NetIOudp baseclass
Base class (NetIO) object.
Definition: reliableudp.h:44
NetAddr * netaddr_string_new(const char *addrstr)
Create a NetAddr from an ipv4, ipv6 or MAC address string.
Definition: netaddr.c:915
#define UNREF2(obj)
Definition: assimobj.h:36
#define FRAMETYPE_COMPRESS
FRAMETYPE_COMPRESS Frame (frametype 3) Frame subclass - CompressFrame class.
Definition: frametypes.h:116
#define UNREF(obj)
Definition: assimobj.h:35
This is a basic NetIO class abstract class for doing network I/O.
Definition: netio.h:58
int wirepktcount
The NetGSource class objects integrate NetIO class objects into the g_main_loop paradigm.
Definition: netgsource.h:43
gboolean setmcast_ttl(NetIO *self, guint8 ttl)
< Set ipv4 multicast TTL
This is the Listener class. object - which generically listens for packets.
Definition: listener.h:41
gint64 pktcount
FSTATIC void catch_a_signal(int signum)
Signal reception function - signals stop by here...