Add bind address and port to cmdline arguments. Add log of address and port.
[umurmur.git] / src / main.c
index a4c1c12b3182045174f8af9e8ee0c106d6e8bcc9..d1351ddc080f9c76a761023f1f43fb2e288975b6 100644 (file)
@@ -51,6 +51,8 @@
 #include "version.h"
 
 char system_string[64], version_string[64];
+int bindport;
+char *bindaddr;
 
 void lockfile(const char *pidfile)
 {
@@ -129,6 +131,8 @@ void printhelp()
        printf("       -p <pidfile>   - Write PID to this file\n");
        printf("       -c <conf file> - Specify configuration file\n");
        printf("       -r             - Run with realtime priority\n");
+       printf("       -a <address>   - Bind to IP address\n");
+       printf("       -b <port>      - Bind to port\n");
        printf("       -h             - Print this help\n");
        exit(0);
 }
@@ -142,7 +146,7 @@ int main(int argc, char **argv)
        struct utsname utsbuf;
        
        /* Arguments */
-       while ((c = getopt(argc, argv, "drp:c:h")) != EOF) {
+       while ((c = getopt(argc, argv, "drp:c:a:b:h")) != EOF) {
                switch(c) {
                case 'c':
                        conffile = optarg;
@@ -150,6 +154,12 @@ int main(int argc, char **argv)
                case 'p':
                        pidfile = optarg;
                        break;
+               case 'a':
+                       bindaddr = optarg;
+                       break;
+               case 'b':
+                       bindport = atoi(optarg);
+                       break;
                case 'd':
                        nodaemon = true;
                        break;