Haiku Network Kit: R5 compatibility issues

Unfortunatly, R5 and sooner (net_server based) network stack development header file (/develop/headers/be/net/socket.h) definition of network structures and constantes are not BSD standard ones.
BONE, otherwise, try to follow at best these standards definitions which, in turn, break binary compatibility with R5 network apps compiled for R5 network stack.
Hence why you needs to link against libsocket.so, libbind.so and libbnetapi.so BONE apps instead of R5 libnet.so and libnetapi.so libraries...

So, here we are. By design, we must:

Network definitions differences:

ItemR5 stackBONE stackHaiku stack
socket.h header file be/net/socket.h be/bone/sys/socket.h posix/sys/socket.h
SOCK_DGRAM12idem as BONE
SOCK_STREAM21idem as BONE
SOCK_RAWnot defined3idem as BONE
SOCK_MISCnot defined255idem as BONE
SOL_SOCKET10xffffffffidem as BONE
SO_DEBUG10x00000004idem as BONE
SO_REUSEADDR20x00000040idem as BONE
SO_NONBLOCK30x40000009idem as BONE
SO_REUSEPORT40x00000080idem as BONE
SO_FIONREAD5??
sockaddr struct sockaddr {
  unsigned short sa_family;
  char sa_data[10];
};
struct sockaddr {
  uint8 sa_len;
  uint8 sa_family;
  uint8 sa_data[30];
};
idem as BONE
closesocket() definednot defineddefined, call close()
in.h header file be/net/netinet/in.h, which in turn include
be/net/socket.h
be/bone/netinet/in.h posix/netinet/in.h


Philippe Houdoin, July 30th, 2004