nmblookup.c:
[samba.git] / source3 / utils / nmblookup.c
index aebbc4292cab7b8069cfe55a49dc6de37316b452..36905aa5ae33dd1674e24f78fd9640636fb8114e 100644 (file)
@@ -35,6 +35,8 @@ extern struct in_addr ipzero;
 
 int ServerFD= -1;
 
 
 int ServerFD= -1;
 
+int RootPort = 0;
+
 /****************************************************************************
   open the socket communication
   **************************************************************************/
 /****************************************************************************
   open the socket communication
   **************************************************************************/
@@ -49,7 +51,10 @@ static BOOL open_sockets(void)
       return False;
     }   
 
       return False;
     }   
 
-  ServerFD = open_socket_in(SOCK_DGRAM, 0,3,interpret_addr(lp_socket_address()));
+  ServerFD = open_socket_in( SOCK_DGRAM,
+                             (RootPort ? 137 :0),
+                             3,
+                             interpret_addr(lp_socket_address()) );
 
   if (ServerFD == -1)
     return(False);
 
   if (ServerFD == -1)
     return(False);
@@ -113,7 +118,7 @@ int main(int argc,char *argv[])
 
   charset_initialise();
 
 
   charset_initialise();
 
-  while ((opt = getopt(argc, argv, "p:d:B:i:s:SMh")) != EOF)
+  while ((opt = getopt(argc, argv, "d:B:i:s:SMrh")) != EOF)
     switch (opt)
       {
       case 'B':
     switch (opt)
       {
       case 'B':
@@ -137,6 +142,9 @@ int main(int argc,char *argv[])
       case 's':
        pstrcpy(servicesf, optarg);
        break;
       case 's':
        pstrcpy(servicesf, optarg);
        break;
+      case 'r':
+        RootPort = -1;
+        break;
       case 'h':
        usage();
        exit(0);
       case 'h':
        usage();
        exit(0);