FW: IP-resolve issues.

Christopher R. Hertel crh at nts.umn.edu
Thu Jan 4 21:07:53 GMT 2001


> Adding support to smbclient to handle "smbclient //1.2.3.4/share" could
> also be added to smbmount. They are practially the same program (just a
> slight exaggeration).

Then it's really just a question of setting up a call to the
name_status_query() function.  Most of the code can be pulled from
nmblookup. 

> If smbclient can connect and smbmount can't, then there is something that
> hasn't been changed in both files.

My own tests show that "smbclient //1.2.3.4/share" will attempt to use
"1.2.3.4" as the CALLED NAME, then "1", then "*SMBSERVER".  These will all
fail unless the server supports the "*SMBSHARE" generic name.  smbclient 
does not try to do a status query.

The name_status_query() function needs these parameters:
  fd     - open UDP socket
  &nname - a struct nmb_name into which to place the name we are querying. 
           In this case, we would pass the wildcard name:
           "*\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", with suffix '\0'.
           I think that make_nmb_name() may handle this automatically.
  ip     - The IP to which to send.  In our example, 1.2.3.4.
  &count - pointer to an int.  This will tell us how many names we got.

Returned is a struct node_status.  I assume that this will have the name
list.  Run through the list to find one with suffix 0x20 and that's the
name we want.

It's been a while since I played with this stuff, so it should be double 
checked.

Chris -)-----

-- 
Christopher R. Hertel -)-----                   University of Minnesota
crh at nts.umn.edu              Networking and Telecommunications Services

    Ideals are like stars; you will not succeed in touching them
    with your hands...you choose them as your guides, and following
    them you will reach your destiny.  --Carl Schultz





More information about the samba-technical mailing list