Operating System - Linux
1820644 Members
1688 Online
109626 Solutions
New Discussion юеВ

socklen_t in sockaddr_storage meaning

 
SOLVED
Go to solution
test_goraz
Occasional Advisor

socklen_t in sockaddr_storage meaning

Hi everyone,

I have interest to learn more about ipv4-->ipv6 porting process particulaty things related to network applications porting process.
So I am reading some books and there is a lot of materials on net, but I cannot understand one thing ...
For example in code snnipet "
static char addr_buf[100];
static int initialised;
struct sockaddr_storage ss;
socklen_t length = sizeof ss;
char *ssh_info, *p;

taken from web location...
http://www.samba.org/ftp/unpacked/rsync/clientname.c

I cannot understand where is defined

socklen_t

As I said I am reading various web sources and
what is socklen_t in this case.

Thanks and Regards,



2 REPLIES 2
Steven Schweda
Honored Contributor
Solution

Re: socklen_t in sockaddr_storage meaning

td176> grep socklen_t /usr/include/*/*.h
/usr/include/sys/socket.h:typedef size_t socklen_t;
[...]

I'd look in socket.h (wherever yours
actually resides).
test_goraz
Occasional Advisor

Re: socklen_t in sockaddr_storage meaning

Thanks :). Exactly what you suggested.

Regards