History

VSOCK: Split vm_sockets.h into kernel/uapi

Split the vSockets header into kernel and UAPI parts. The former gets the bits that used to be in __KERNEL__ guards, while the latter gets everything that is user-visible. Tested by compiling vsock (+transport) and a simple user-mode vSockets application.

Andy King committed 13 years ago

Commit c031e231 parent 7f0e44a2 files · +31 −15Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/vm_sockets.h+8−15
@@ -13,12 +13,10 @@ · 12 unmodified lines
13 * more details.13 * more details.
14 */14 */
15 15
16#ifndef _VM_SOCKETS_H_16#ifndef _UAPI_VM_SOCKETS_H
17#define _VM_SOCKETS_H_17#define _UAPI_VM_SOCKETS_H
18 18
19#if !defined(__KERNEL__)19#include <linux/socket.h>
20#include <sys/socket.h>
21#endif
22 20
23/* Option name for STREAM socket buffer size. Use as the option name in21/* Option name for STREAM socket buffer size. Use as the option name in
24 * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that22 * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that
@@ -137,14 +135,13 @@ · 112 unmodified lines
137#define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF))135#define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF))
138 136
139/* Address structure for vSockets. The address family should be set to137/* Address structure for vSockets. The address family should be set to
140 * whatever vmci_sock_get_af_value_fd() returns. The structure members should138 * AF_VSOCK. The structure members should all align on their natural
141 * all align on their natural boundaries without resorting to compiler packing139 * boundaries without resorting to compiler packing directives. The total size
142 * directives. The total size of this structure should be exactly the same as140 * of this structure should be exactly the same as that of struct sockaddr.
143 * that of struct sockaddr.
144 */141 */
145 142
146struct sockaddr_vm {143struct sockaddr_vm {
147 sa_family_t svm_family;144 __kernel_sa_family_t svm_family;
148 unsigned short svm_reserved1;145 unsigned short svm_reserved1;
149 unsigned int svm_port;146 unsigned int svm_port;
150 unsigned int svm_cid;147 unsigned int svm_cid;
@@ -156,8 +153,4 @@ struct sockaddr_vm { · 5 unmodified lines
156 153
157#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)154#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)
158 155
159#if defined(__KERNEL__)156#endif /* _UAPI_VM_SOCKETS_H */
160int vm_sockets_get_local_cid(void);
161#endif
162
163#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t