summaryrefslogtreecommitdiffstats
path: root/net_rx.c
diff options
context:
space:
mode:
authorJames <31272717+gpd-pocket-hacker@users.noreply.github.com>2020-11-09 16:10:37 +0000
committerJames <31272717+gpd-pocket-hacker@users.noreply.github.com>2020-11-09 16:24:06 +0000
commitbfac22dc79164bab10185188e12cee313ab96de9 (patch)
tree4cee4dd9631304042982ddb0a248a541d9b6af12 /net_rx.c
parent6a27a521f99c7babc9d000465b661f66b54ee101 (diff)
downloadgalaxy_tools-bfac22dc79164bab10185188e12cee313ab96de9.tar.gz
galaxy_tools-bfac22dc79164bab10185188e12cee313ab96de9.tar.bz2
galaxy_tools-bfac22dc79164bab10185188e12cee313ab96de9.zip
add email support
Diffstat (limited to 'net_rx.c')
-rw-r--r--net_rx.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net_rx.c b/net_rx.c
index 1ea0993..15e181b 100644
--- a/net_rx.c
+++ b/net_rx.c
@@ -10,13 +10,13 @@
#include "util.h"
#include "sia.h"
-extern int new_block (int fd, SIA_Block *b, int log);
+extern int new_block (int fd, SIA_Block *b, int log, const char *email);
extern void periodic_task (void);
static int usage (const char *name)
{
fprintf (stderr, "Usage:\n");
- fprintf (stderr, "%s [ -l ] [ -p listen_port ]\n\n", name);
+ fprintf (stderr, "%s [ -l ] [ -p listen_port ] [ -m email address]\n\n", name);
fprintf (stderr, "listen_port defaults to 10002\n");
return 1;
@@ -38,8 +38,10 @@ int main (int argc, char *argv[])
unsigned char buf[SIA_MAX_BLOCK_LENGTH];
unsigned ptr = 0;
+ const char *email = NULL;
- while ((opt = getopt (argc, argv, "p:l")) != -1) {
+
+ while ((opt = getopt (argc, argv, "p:lm:")) != -1) {
switch (opt) {
case 'p':
port = atoi (optarg);
@@ -49,6 +51,10 @@ int main (int argc, char *argv[])
log++;
break;
+ case 'm':
+ email = optarg;
+ break;
+
default: /* '?' */
return usage (argv[0]);
}
@@ -117,7 +123,7 @@ int main (int argc, char *argv[])
break;
default: /*Valid block */
- new_block (afd, &b, log);
+ new_block (afd, &b, log, email);
ptr = 0;
break;
}