[Samba] RE: sockaddr structure elements

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue May 8 12:38:47 GMT 2007


On Tue, May 08, 2007 at 08:04:11PM +0800, Uravakonda Sridhar-A20881 wrote:
> Can anyone please reply for the below query ? I am still stuck here.
>  
> Regards,
> Sridhar
> 
> ________________________________
> 
> From: Uravakonda Sridhar-A20881 
> Sent: Thursday, May 03, 2007 12:00 PM
> To: 'samba at lists.samba.org'
> Subject: sockaddr structure elements
> 
> 
> Dear All,
>  
> We are using samba 3.0.24 compiled for xscale on two devices:
>  
> We are running a smbclient and smb daemon on two different devices,
> 192.168.1.39 (smbd) and 192.168.1.24 (smbclient). When we establish a
> smbclient connection from client -> Server, in the
> smbd/server.c:open_sockets_smbd() function, we are getting sockaddr
> structure values as follows (caught at debug data on smbd):
>  
> smbd/server.c:open_sockets_smbd():addr
> sockaddr
> sa_family = AF_INET
> sa_addr[14] = 4, 5, 192, 168, 1, 24, 220, 126, 47, 204, 180, 41, 11, 192
>  
> definition:
> struct sockaddr {
>     sa_family_t     sa_family;          /* Address family, AF_xxx */
>     char               sa_data[14];       /* 14 bytes of protocol
> address */
> }
>  
> According to the above definition, the sa_data should contain
>  
>  2-byte port no:, local IP, remote IP. But it doesn't seem to be so by
> looking at the data.

This depends on your operating system and your libc. You
might better write some little test programs that deal with
sockets and bind/connect/getpeername to experiment with what
you have.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba/attachments/20070508/7ff4fe75/attachment.bin


More information about the samba mailing list