summaryrefslogtreecommitdiff
path: root/source3/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
commit805749baab4e79fbdb9897f22b2c801d9dd9efc2 (patch)
treeaabf74ff61c45ea907a0a4c3fb07822ba9aa8ba0 /source3/utils/nmblookup.c
parent502a377794f157502cc1432c3d923209a6d69ff4 (diff)
downloadsamba-805749baab4e79fbdb9897f22b2c801d9dd9efc2.tar.gz
samba-805749baab4e79fbdb9897f22b2c801d9dd9efc2.tar.bz2
samba-805749baab4e79fbdb9897f22b2c801d9dd9efc2.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) (This used to be commit 53915bd160eda8c099482ddcef74d1d7606e752b)
Diffstat (limited to 'source3/utils/nmblookup.c')
-rw-r--r--source3/utils/nmblookup.c18
1 files changed, 17 insertions, 1 deletions
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 <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");