Re: [Dev-C++] Socket Programming - Newbie - sockaddr 16 bytes?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <sa...@op...> - 2004-11-07 07:07:13
|
Daniel K. O. napisał(a): > Krzysztof Kapuścik wrote: > >> This is not exactly true. The BSD standard says that the AF_ value >> will be the same as PF_ value (this could be found on linux man pages). > > > Hm... really? From what I remember, it says they are *generally* the > same, but I may be wrong. > I'm curious now, does anyone know if it's possible to find on the > internet exactly what the BSD standard says? (for free, obviously... I > don't want to buy a book, I'm not THAT curious) > You could be right. I don't have the standard so I cannot be sure - if I am wrong and anyone have more accurate information - please reply. In Linux socket.h header file you can find: #define PF_INET x #define ... /* Address families AF_ - same as PF_ */ <== note this I think we could assume that the values will be always equal. Why? Just because there are so many sources using AF_INET (as I found in google the PF_INET was added later, so AF_INET was used before) - any change in standard will make them not runnable. The only addition will probably be adding some other AF_ to one PF_ (many address families for one protocol family) but probably it will be done this way: #define AF_INET PF_INET #define AF_SUPERINET (PF_INET + 1) #define AF_UNIT PF_UNIX to provide compability (this could be not true, it's just my imagination). The third thing is that socket() (as I found in google) checks for both AF_INET and PF_INET in function call and for sockaddr address family definition too - so probably it the contants change (AF_ not equal PF_) the socket() will work good. --- Have a nice day, Krzysztof Kapuscik |