1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef NET_COMPAT_H 2 #ifndef NET_COMPAT_H 3 #define NET_COMPAT_H 3 #define NET_COMPAT_H 4 4 5 5 6 struct sock; 6 struct sock; 7 7 >> 8 #if defined(CONFIG_COMPAT) >> 9 8 #include <linux/compat.h> 10 #include <linux/compat.h> 9 11 10 struct compat_msghdr { 12 struct compat_msghdr { 11 compat_uptr_t msg_name; /* voi 13 compat_uptr_t msg_name; /* void * */ 12 compat_int_t msg_namelen; 14 compat_int_t msg_namelen; 13 compat_uptr_t msg_iov; /* str 15 compat_uptr_t msg_iov; /* struct compat_iovec * */ 14 compat_size_t msg_iovlen; 16 compat_size_t msg_iovlen; 15 compat_uptr_t msg_control; /* voi 17 compat_uptr_t msg_control; /* void * */ 16 compat_size_t msg_controllen; 18 compat_size_t msg_controllen; 17 compat_uint_t msg_flags; 19 compat_uint_t msg_flags; 18 }; 20 }; 19 21 20 struct compat_mmsghdr { 22 struct compat_mmsghdr { 21 struct compat_msghdr msg_hdr; 23 struct compat_msghdr msg_hdr; 22 compat_uint_t msg_len; 24 compat_uint_t msg_len; 23 }; 25 }; 24 26 25 struct compat_cmsghdr { 27 struct compat_cmsghdr { 26 compat_size_t cmsg_len; 28 compat_size_t cmsg_len; 27 compat_int_t cmsg_level; 29 compat_int_t cmsg_level; 28 compat_int_t cmsg_type; 30 compat_int_t cmsg_type; 29 }; 31 }; 30 32 31 struct compat_rtentry { !! 33 #else /* defined(CONFIG_COMPAT) */ 32 u32 rt_pad1; !! 34 /* 33 struct sockaddr rt_dst; /* tar !! 35 * To avoid compiler warnings: 34 struct sockaddr rt_gateway; /* gat !! 36 */ 35 struct sockaddr rt_genmask; /* tar !! 37 #define compat_msghdr msghdr 36 unsigned short rt_flags; !! 38 #define compat_mmsghdr mmsghdr 37 short rt_pad2; !! 39 #endif /* defined(CONFIG_COMPAT) */ 38 u32 rt_pad3; !! 40 39 unsigned char rt_tos; !! 41 int __get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg, 40 unsigned char rt_class; !! 42 struct sockaddr __user **save_addr, compat_uptr_t *ptr, 41 short rt_pad4; !! 43 compat_size_t *len); 42 short rt_metric; /* +1 << 43 compat_uptr_t rt_dev; /* for << 44 u32 rt_mtu; /* per << 45 u32 rt_window; /* Win << 46 unsigned short rt_irtt; /* Ini << 47 }; << 48 << 49 int __get_compat_msghdr(struct msghdr *kmsg, s << 50 struct sockaddr __user << 51 int get_compat_msghdr(struct msghdr *, struct 44 int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *, 52 struct sockaddr __user * 45 struct sockaddr __user **, struct iovec **); >> 46 struct sock_fprog __user *get_compat_bpf_fprog(char __user *optval); 53 int put_cmsg_compat(struct msghdr*, int, int, 47 int put_cmsg_compat(struct msghdr*, int, int, int, void *); 54 48 55 int cmsghdr_from_user_compat_to_kern(struct ms 49 int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, 56 unsigned 50 unsigned char *, int); 57 51 58 struct compat_group_req { !! 52 int compat_mc_setsockopt(struct sock *, int, int, char __user *, unsigned int, 59 __u32 gr_in !! 53 int (*)(struct sock *, int, int, char __user *, 60 struct __kernel_sockaddr_storage gr_gr !! 54 unsigned int)); 61 __aligned(4); !! 55 int compat_mc_getsockopt(struct sock *, int, int, char __user *, int __user *, 62 } __packed; !! 56 int (*)(struct sock *, int, int, char __user *, 63 !! 57 int __user *)); 64 struct compat_group_source_req { << 65 __u32 gsr_i << 66 struct __kernel_sockaddr_storage gsr_g << 67 __aligned(4); << 68 struct __kernel_sockaddr_storage gsr_s << 69 __aligned(4); << 70 } __packed; << 71 << 72 struct compat_group_filter { << 73 union { << 74 struct { << 75 __u32 << 76 struct __kernel_sockad << 77 __aligned(4); << 78 __u32 << 79 __u32 << 80 struct __kernel_sockad << 81 __aligned(4); << 82 } __packed; << 83 struct { << 84 __u32 << 85 struct __kernel_sockad << 86 __aligned(4); << 87 __u32 << 88 __u32 << 89 struct __kernel_sockad << 90 __aligned(4); << 91 } __packed; << 92 }; << 93 } __packed; << 94 58 95 #endif /* NET_COMPAT_H */ 59 #endif /* NET_COMPAT_H */ 96 60
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.