summaryrefslogtreecommitdiffstats
path: root/source/utils/nmblookup.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-10-10 01:32:26 +0000
committerJeremy Allison <jra@samba.org>1997-10-10 01:32:26 +0000
commit53915bd160eda8c099482ddcef74d1d7606e752b (patch)
tree965a5b50eeb3e0f51dd619f93256c19242c93f71 /source/utils/nmblookup.c
parent229b6c409240a8dca9172702b8fefb31aa3b13a1 (diff)
downloadsamba-53915bd160eda8c099482ddcef74d1d7606e752b.tar.gz
samba-53915bd160eda8c099482ddcef74d1d7606e752b.tar.xz
samba-53915bd160eda8c099482ddcef74d1d7606e752b.zip
nmblookup.c: Added -A ability to do status on ip address.
smb.h: Added defines we will need for NT SMB calls. trans2.c: Fixed SMB_QUERY_FILE_ALT_NAME_INFO return - this is only for short name returns (and only used when you negotiate NT SMB calls to boot !). Jeremy (jallison@whistle.com)
Diffstat (limited to 'source/utils/nmblookup.c')
-rw-r--r--source/utils/nmblookup.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source/utils/nmblookup.c b/source/utils/nmblookup.c
index 36905aa5ae3..63ca156449f 100644
--- a/source/utils/nmblookup.c
+++ b/source/utils/nmblookup.c
@@ -88,6 +88,8 @@ static void usage(void)
printf("\t-B broadcast address the address to use for broadcasts\n");
printf("\t-M searches for a master browser\n");
printf("\t-S lookup node status as well\n");
+ printf("\t-r Use root port 137 (Win95 only replies to this)\n");
+ printf("\t-A Do a node status on <name> as an IP Address\n");
printf("\n");
}
@@ -108,6 +110,7 @@ int main(int argc,char *argv[])
static pstring servicesf = CONFIGFILE;
struct in_addr bcast_addr;
BOOL got_bcast = False;
+ BOOL lookup_by_ip = False;
DEBUGLEVEL = 1;
*lookup = 0;
@@ -118,7 +121,7 @@ int main(int argc,char *argv[])
charset_initialise();
- while ((opt = getopt(argc, argv, "d:B:i:s:SMrh")) != EOF)
+ while ((opt = getopt(argc, argv, "d:B:i:s:SMrhA")) != EOF)
switch (opt)
{
case 'B':
@@ -149,6 +152,9 @@ int main(int argc,char *argv[])
usage();
exit(0);
break;
+ case 'A':
+ lookup_by_ip = True;
+ break;
default:
usage();
exit(1);
@@ -182,6 +188,16 @@ int main(int argc,char *argv[])
fstrcpy(lookup,argv[i]);
+ if(lookup_by_ip)
+ {
+ strcpy(lookup,"*");
+ ip = *interpret_addr2(argv[i]);
+ printf("Looking up status of %s\n",inet_ntoa(ip));
+ name_status(ServerFD,lookup,lookup_type,True,ip,NULL,NULL,NULL);
+ printf("\n");
+ continue;
+ }
+
if (find_master) {
if (*lookup == '-') {
strcpy(lookup,"\01\02__MSBROWSE__\02");