summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-12-13 14:16:07 +0000
committerJeremy Allison <jra@samba.org>1997-12-13 14:16:07 +0000
commit64f0348a3f994334abe64a4d4896109c3c8c9039 (patch)
tree50867cc9ccbc060ceb46ea1e8f8bd8ec2a8ca05e /source3/utils
parent164c9db4de87ea851a631f1c9d431e0a4525802e (diff)
downloadsamba-64f0348a3f994334abe64a4d4896109c3c8c9039.tar.gz
samba-64f0348a3f994334abe64a4d4896109c3c8c9039.tar.bz2
samba-64f0348a3f994334abe64a4d4896109c3c8c9039.zip
This is it ! The mega-merge of the JRA_NMBD_REWRITE branch
back into the main tree. For the cvs logs of all the files starting nmbd_*.c, look in the JRA_NMBD_REWRITE branch. That branch has now been discontinued. Jeremy. (This used to be commit d80b0cb645f81d16734929a0b27a91c6650499bb)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/nmblookup.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c
index 1f74d7a130..b14887afab 100644
--- a/source3/utils/nmblookup.c
+++ b/source3/utils/nmblookup.c
@@ -186,9 +186,10 @@ int main(int argc,char *argv[])
for (i=optind;i<argc;i++)
{
- int retries = 2;
+ int j, count, retries = 2;
char *p;
struct in_addr ip;
+ struct in_addr *ip_list;
fstrcpy(lookup,argv[i]);
@@ -219,26 +220,23 @@ int main(int argc,char *argv[])
retries = 1;
}
- if (name_query(ServerFD,lookup,lookup_type,use_bcast,recursion_desired,
- bcast_addr,&ip,NULL))
- {
- printf("%s %s\n",inet_ntoa(ip),lookup);
-
- /* We can only do find_status if the ip address returned
- was valid - ie. name_query returned true.
- */
- if (find_status)
- {
- printf("Looking up status of %s\n",inet_ntoa(ip));
- name_status(ServerFD,lookup,lookup_type,True,ip,NULL,NULL,NULL);
- printf("\n");
- }
- }
- else
- {
- printf("name_query failed to find name %s\n", lookup);
+ if ((ip_list = name_query(ServerFD,lookup,lookup_type,use_bcast,recursion_desired,
+ bcast_addr,&count,NULL))) {
+ for (j=0;j<count;j++)
+ printf("%s %s<%02x>\n",inet_ntoa(ip_list[j]),lookup, lookup_type);
+
+ /* We can only do find_status if the ip address returned
+ was valid - ie. name_query returned true.
+ */
+ if (find_status) {
+ printf("Looking up status of %s\n",inet_ntoa(ip_list[0]));
+ name_status(ServerFD,lookup,lookup_type,True,ip_list[0],NULL,NULL,NULL);
+ printf("\n");
+ }
+ } else {
+ printf("name_query failed to find name %s\n", lookup);
}
}
-
+
return(0);
}