struct protocol {
char name[PROTO_NAME_LEN]; /* protocol name, zero-terminated */
struct proto_fam *fam; /* protocol family */
+ int ctrl_type; /* control layer type (SOCK_STREAM/SOCK_DGRAM) */
int sock_domain; /* socket domain, as passed to socket() */
int sock_type; /* socket type, as passed to socket() */
int sock_prot; /* socket protocol, as passed to socket() */
static struct protocol proto_sockpair = {
.name = "sockpair",
.fam = &proto_fam_sockpair,
+ .ctrl_type = SOCK_STREAM,
.sock_domain = AF_CUST_SOCKPAIR,
.sock_type = SOCK_STREAM,
.sock_prot = 0,
static struct protocol proto_tcpv4 = {
.name = "tcpv4",
.fam = &proto_fam_inet4,
+ .ctrl_type = SOCK_STREAM,
.sock_domain = AF_INET,
.sock_type = SOCK_STREAM,
.sock_prot = IPPROTO_TCP,
static struct protocol proto_tcpv6 = {
.name = "tcpv6",
.fam = &proto_fam_inet6,
+ .ctrl_type = SOCK_STREAM,
.sock_domain = AF_INET6,
.sock_type = SOCK_STREAM,
.sock_prot = IPPROTO_TCP,
static struct protocol proto_udp4 = {
.name = "udp4",
.fam = &proto_fam_inet4,
+ .ctrl_type = SOCK_DGRAM,
.sock_domain = AF_CUST_UDP4,
.sock_type = SOCK_DGRAM,
.sock_prot = IPPROTO_UDP,
static struct protocol proto_udp6 = {
.name = "udp6",
.fam = &proto_fam_inet6,
+ .ctrl_type = SOCK_DGRAM,
.sock_domain = AF_CUST_UDP6,
.sock_type = SOCK_DGRAM,
.sock_prot = IPPROTO_UDP,
static struct protocol proto_unix = {
.name = "unix_stream",
.fam = &proto_fam_unix,
+ .ctrl_type = SOCK_STREAM,
.sock_domain = PF_UNIX,
.sock_type = SOCK_STREAM,
.sock_prot = 0,