From 805749baab4e79fbdb9897f22b2c801d9dd9efc2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 10 Oct 1997 01:32:26 +0000 Subject: 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) (This used to be commit 53915bd160eda8c099482ddcef74d1d7606e752b) --- source3/utils/nmblookup.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'source3/utils/nmblookup.c') diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c index 36905aa5ae..63ca156449 100644 --- a/source3/utils/nmblookup.c +++ b/source3/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 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"); -- cgit