more uapi bits
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
/* SPDX-License-Identifier: Unlicense */
|
||||
#ifndef __ZINNIA_UAPI_SOCKET_H
|
||||
#define __ZINNIA_UAPI_SOCKET_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <uapi/types.h>
|
||||
|
||||
typedef uint32_t __socklen_t;
|
||||
typedef uint16_t __sa_family_t;
|
||||
|
||||
struct __msghdr {
|
||||
uintptr_t msg_name;
|
||||
__socklen_t msg_namelen;
|
||||
uintptr_t msg_iov;
|
||||
int msg_iovlen;
|
||||
uintptr_t msg_control;
|
||||
__socklen_t msg_controllen;
|
||||
int msg_flags;
|
||||
};
|
||||
|
||||
struct __cmsghdr {
|
||||
__socklen_t cmsg_len;
|
||||
int cmsg_level;
|
||||
int cmsg_type;
|
||||
};
|
||||
|
||||
struct __sockaddr {
|
||||
__sa_family_t sa_family;
|
||||
char sa_data[14];
|
||||
};
|
||||
|
||||
struct __sockaddr_storage {
|
||||
__sa_family_t ss_family;
|
||||
char __padding[128 - sizeof(__sa_family_t) - sizeof(uintptr_t)];
|
||||
uintptr_t __alignment;
|
||||
};
|
||||
|
||||
struct __sockaddr_un {
|
||||
__sa_family_t sun_family;
|
||||
char sun_path[108];
|
||||
};
|
||||
|
||||
struct __ucred {
|
||||
__pid_t pid;
|
||||
__uid_t uid;
|
||||
__gid_t gid;
|
||||
};
|
||||
|
||||
#define __SCM_RIGHTS 1
|
||||
#define __SCM_CREDENTIALS 0x02
|
||||
|
||||
#define __SOCK_DGRAM (1 << 0)
|
||||
#define __SOCK_RAW (1 << 1)
|
||||
#define __SOCK_STREAM (1 << 2)
|
||||
#define __SOCK_SEQPACKET (1 << 3)
|
||||
#define __SOCK_NONBLOCK (1 << 15)
|
||||
#define __SOCK_CLOEXEC (1 << 16)
|
||||
#define __SOCK_CLOFORK (1 << 17)
|
||||
|
||||
#define __SOL_SOCKET 1
|
||||
|
||||
#define __SO_ACCEPTCONN 1
|
||||
#define __SO_BROADCAST 2
|
||||
#define __SO_DEBUG 3
|
||||
#define __SO_DONTROUTE 4
|
||||
#define __SO_ERROR 5
|
||||
#define __SO_KEEPALIVE 6
|
||||
#define __SO_LINGER 7
|
||||
#define __SO_OOBINLINE 8
|
||||
#define __SO_RCVBUF 9
|
||||
#define __SO_RCVLOWAT 10
|
||||
#define __SO_RCVTIMEO 11
|
||||
#define __SO_REUSEADDR 12
|
||||
#define __SO_SNDBUF 13
|
||||
#define __SO_SNDLOWAT 14
|
||||
#define __SO_SNDTIMEO 15
|
||||
#define __SO_TYPE 16
|
||||
#define __SO_SNDBUFFORCE 17
|
||||
#define __SO_PEERCRED 18
|
||||
#define __SO_PASSCRED 20
|
||||
#define __SO_RCVBUFFORCE 21
|
||||
#define __SO_PROTOCOL 23
|
||||
#define __SO_REUSEPORT 24
|
||||
#define __SO_DOMAIN 28
|
||||
|
||||
#define __SOMAXCONN 128
|
||||
|
||||
#define __MSG_CTRUNC 0x1
|
||||
#define __MSG_DONTROUTE 0x2
|
||||
#define __MSG_EOR 0x4
|
||||
#define __MSG_OOB 0x8
|
||||
#define __MSG_NOSIGNAL 0x10
|
||||
#define __MSG_PEEK 0x20
|
||||
#define __MSG_TRUNC 0x40
|
||||
#define __MSG_WAITALL 0x80
|
||||
#define __MSG_FIN 0x200
|
||||
#define __MSG_CONFIRM 0x800
|
||||
#define __MSG_DONTWAIT 0x1000
|
||||
#define __MSG_CMSG_CLOEXEC 0x2000
|
||||
#define __MSG_MORE 0x4000
|
||||
|
||||
#define __AF_UNSPEC 0
|
||||
#define __AF_INET 1
|
||||
#define __AF_INET6 2
|
||||
#define __AF_UNIX 3
|
||||
#define __AF_PACKET 11
|
||||
|
||||
#define __SHUT_RD 1
|
||||
#define __SHUT_WR 2
|
||||
#define __SHUT_RDWR (__SHUT_RD | __SHUT_WR)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user