The Linux provided header file "/usr/include/linux/socket.h" contains definitions for Supported address families and Protocol families:
/* Supported address families. */
#define AF_UNSPEC 0
....
/* Protocol families, same as address families. */
#define PF_UNSPEC AF_UNSPEC
...
But why does it not define socket types?
I can find it's definition in "/usr/include/bits/socket.h" as
enum sock_type {
SOCK_DGRAM = 1,
SOCK_STREAM = 2,
SOCK_RAW = 3,
SOCK_RDM = 4,
SOCK_SEQPACKET = 5,
SOCK_DCCP = 6,
SOCK_PACKET = 10,
};
I wonder why these are not defined in the header file provided by Linux?
#include
that you will have access to the correct defines. DO NOT just look them up and use the numbers. – CodeClown42