IP address and SMB server info available through libsmbclient
marcos at unitron.com.br
Wed Sep 5 02:05:16 GMT 2007
Currently one can not obtain the IP address or any other SMB server info
using only libsmbclient.
I do believe such information is very interesting for debugging
purposes. It is kind of wired that one can connect to
smb://18.104.22.168 using libsmbclient, but one can not obtain the IP
address of a server connected using the name.
I willing to implement such a feature, as long as somebody promess it
will be accepted in the main trunk of samba.
The server_type , server_os , server_domain and port (all of them are
in struct cli_state, from client.h would also be interesting data
available to other applications.
The implementation is actually trivial.
One simple function has to be added to libsmbclient.c
Such function will receive an SMBCFILE ( actually struct _SMBCFILE,
from libsmb_internal.h ), read the data from "struct cli_state" which is
inside it and return it back to the caller.
Who agrees with me ?
Thank you very much
More information about the samba-technical