directing smbc_opendir(url) to an explicit interface

Christopher R. Hertel crh at
Thu Nov 13 03:30:20 GMT 2003


There is no way that I can see to use a URL to indicate which interface 
should be used.  That is, there is nothing in the URL format that would 
apply to the problem you've raised, as I understand it.  If I'm missing 
something, please let me know.

I'm at the IETF meeting now (sitting on the floor during the Plenary).  
We've had some discussion regarding the current SMB URL draft.  I will be 
adding an appendix or two, but otherwise the consensus reached at dinner 
in the Thai restaurant is that I should go through the steps of moving the 
draft to RFC format.  Now would be a good time to let me know if there are 
any problems in the draft.

Chris -)-----

On Wed, Nov 12, 2003 at 06:23:00PM -0800, David Wuertele wrote:
> My computer has two interfaces, eth0 and eth1.
> Each interface is on a different private subnet: and
> respectively.  There is no router forwarding packets.
> Each subnet contains a separate WORKGROUP with separate netbios scope.
> I do not mean ScopeID, I mean scope in terms of reachability.
> These two WORKGROUPs are *meant* to be separated from each other.
> My host is the only one that can see both.
> I am writing a client program that uses libsmbclient to enumerate the
> shares on each of these workgroups.  Here is the code that I'm using:
>     snprintf (url, MAX_BUFF_SIZE, "smb://WORKGROUP");
>     smbc_init (auth_fn, 0);
>     dh = smbc_opendir (url);
>     while (dirptr = smbc_readdir (dh)) {
>       if (debug > 2) fprintf (stderr, "found server %s\n", dirptr->name);
>     }
> Unfortunately, this only prints the servers on the WORKGROUP found on
> the *first* subnet, eth0.
> The URL syntax doesn't seem to provide for differentiating these two
>   smb://[[[domain;]user[:password@]]server[/share[/path[/file]]]]
> Is it possible to tell "smbc_opendir(url)" which interface to use?
> Dave

"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team --     -)-----   Christopher R. Hertel
jCIFS Team --   -)-----   ubiqx development, uninq.
ubiqx Team --     -)-----   crh at
OnLineBook --    -)-----   crh at

More information about the samba-technical mailing list