smbclient...

Eugen SAVIN seugen at abc.ro
Wed Jun 4 18:05:42 GMT 2003


Dear Sir, 
Thank you for answering me.
Also thanka to Andrew.

I have one more question, nmblookup works fine, I could use some code
from there.

What happens when the remote host, that one I want to send a winpopup
message is located onto a diffrent C class?

I will query the remote host with nmblookup and I will obtain a NetBios
name. After that I will use smbclient -M {hostname}.

The smbclient will send a broadcast message to the local C class. Am I
mistaking? 

The point is: How can I send winpopup messages to a remote windows host
that does not reside into the same C class the sender is?

Thank you in advance.
Eugen.

> > Why not use nmblookup to translate the IP address into the netbios name?
> > 
> > [root at pluto bin]# nmblookup -U 10.105.102.26 -T '*'
> > querying * on 10.105.102.26
> > esh.tricord.com, 10.105.102.26 *<00>
> > 
> > My machine name is 'ESH'.
> 
> Because the NetBIOS machine name and the DNS machine name are not
> necessarily the same.  The two exist in separate namespaces and the fact
> that they often match is a convenience.  Windows tries to ensure that both 
> names match, but they do so at the application layer (that is, the dialog 
> boxes urge you to use the same name for both NetBIOS and DNS).  You can 
> easily override this on the Windows systems I've seen.
> 
> Samba defaults to using the hostname as the NetBIOS machine name but, 
> again, it can be overridden (which is good).
> 
> > [root at pluto bin]# echo "Hi there" | smbclient -M ESH
> > added interface ip=10.105.102.25 bcast=10.105.103.255 nmask=255.255.252.0
> > Connected. Type your message, ending it with a Control-D
> > sent 10 bytes
> 
> Note that the destination NetBIOS name in the above will be ESH<03>.  The
> Messanger Service listens on the <03> name.  In fact, it may listen on
> both machine<03> and user<03>.  Note that if your username is also "ESH",
> the there's an interesting dynamic to consider here.
> 
> In general, the "correct" way to find the destination name for a WinPopup
> (Messanger Service) message is to send an adapter status query and then
> scan the results for <03> names.
> 
> for f in `nmblookup -A ${IP} | fgrep "<03>" | awk '{ print $1 }'`
> do
>   echo ${MSG} | smbclient -M $f
> done
> 
> The above may result in duplicate messages to machines which have both 
> user<03> and machine<03> registered.  That's probably not a problem, 
> though.
> 
> Chris -)-----
> 
> --
> "Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
> Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
> jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
> ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
> OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org




More information about the samba-technical mailing list