1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright (c) 2016 Fujitsu Ltd. 4 * Author: Xiao Yang <yangx.jy@cn.fujitsu.com> 5 */ 6 7 #ifndef LAPI_SOCKET_H__ 8 #define LAPI_SOCKET_H__ 9 10 #include "config.h" 11 #include <sys/socket.h> 12 13 #ifndef MSG_ZEROCOPY 14 # define MSG_ZEROCOPY 0x4000000 /* Use user data in kernel path */ 15 #endif 16 17 #ifndef MSG_FASTOPEN 18 # define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */ 19 #endif 20 21 #ifndef SO_REUSEPORT 22 # define SO_REUSEPORT 15 23 #endif 24 25 #ifndef SO_BUSY_POLL 26 # define SO_BUSY_POLL 46 27 #endif 28 29 #ifndef SO_ATTACH_BPF 30 # define SO_ATTACH_BPF 50 31 #endif 32 33 #ifndef SO_ZEROCOPY 34 # define SO_ZEROCOPY 60 35 #endif 36 37 #ifndef SOCK_DCCP 38 # define SOCK_DCCP 6 39 #endif 40 41 #ifndef SOCK_CLOEXEC 42 # define SOCK_CLOEXEC 02000000 43 #endif 44 45 #ifndef AF_ALG 46 # define AF_ALG 38 47 #endif 48 49 #ifndef SOL_SCTP 50 # define SOL_SCTP 132 51 #endif 52 53 #ifndef SOL_UDPLITE 54 # define SOL_UDPLITE 136 /* UDP-Lite (RFC 3828) */ 55 #endif 56 57 #ifndef SOL_DCCP 58 # define SOL_DCCP 269 59 #endif 60 61 #ifndef SOL_ALG 62 # define SOL_ALG 279 63 #endif 64 65 #ifndef HAVE_STRUCT_MMSGHDR 66 struct mmsghdr { 67 struct msghdr msg_hdr; 68 unsigned int msg_len; 69 }; 70 #endif 71 72 #endif /* LAPI_SOCKET_H__ */ 73