What does 'AF' of AF_INET stand for ?

as title. and how is it different from PF_INET ?

also, any one knows sin_family , sin_port , sin_addr ..etc ? why are they called 'sin' ?

finally, htons() host to network short , htonl() host to network long , ntohs() network to host short , ntohl() network to host long. why would programmers care about 'short' or 'long' here ? why not just use either one of them ? :confused:

I remember that AF stands for Address Family and PF stands for Protocol Family.

Also INET stands for INTERNET

The "Richard Stevens" Unix Network Programming book throws more light on that.

Thanks
Nagarajan G

As for the long and short, one is 16 bits and the other 32 bits. You can't use 16 bits when you have 32 bits of data. The data won't fit and programmers care about that. You could use 32 bits when you have 16 bits of data, but you would be transmitting 16 bits of zeros for no good purpose. You would need to convince everyone else to do that. The protocols presently do not allow you to toss in extra zero bytes. But this would slow stuff down and waste space and programmers care about that.

thanks folks.

do you have an esay quick real example of what 32-bit(and 16-bit) data are like ? :confused:

32 bit number...

$ nslookup www.unix.com
Server:  dslrouter
Address:  192.168.1.1

Non-authoritative answer:
Name:    www.unix.com
Address:  81.17.242.186

$

16 bit number...

$ grep http /etc/services
http               80/tcp    www www-http           #World Wide Web
https             443/tcp    MCom
https             443/udp    MCom

i see... 32 bit is for ip , and 16 bit is for port. one quicky question: ip address consists of 2 parts, one is network address, the other is host address. since unix.com is at 81.17.242.186, what is its network as well as its host address ? :confused:

I don't know what you mean. The ip address is all there is. It could be called network address. And it could be called host address.