Commit c031e234ee304b507b79f76a7677ea0a7a8890e8
Committed by
David S. Miller
1 parent
7f0e44ac9f
Exists in
master
and in
20 other branches
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. Reported-by: David Howells <dhowells@redhat.com> Acked-by: Dmitry Torokhov <dtor@vmware.com> Signed-off-by: Andy King <acking@vmware.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 2 changed files with 31 additions and 15 deletions Side-by-side Diff
include/linux/vm_sockets.h
1 | +/* | |
2 | + * VMware vSockets Driver | |
3 | + * | |
4 | + * Copyright (C) 2007-2013 VMware, Inc. All rights reserved. | |
5 | + * | |
6 | + * This program is free software; you can redistribute it and/or modify it | |
7 | + * under the terms of the GNU General Public License as published by the Free | |
8 | + * Software Foundation version 2 and no later version. | |
9 | + * | |
10 | + * This program is distributed in the hope that it will be useful, but WITHOUT | |
11 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
13 | + * more details. | |
14 | + */ | |
15 | + | |
16 | +#ifndef _VM_SOCKETS_H | |
17 | +#define _VM_SOCKETS_H | |
18 | + | |
19 | +#include <uapi/linux/vm_sockets.h> | |
20 | + | |
21 | +int vm_sockets_get_local_cid(void); | |
22 | + | |
23 | +#endif /* _VM_SOCKETS_H */ |
include/uapi/linux/vm_sockets.h
... | ... | @@ -13,12 +13,10 @@ |
13 | 13 | * more details. |
14 | 14 | */ |
15 | 15 | |
16 | -#ifndef _VM_SOCKETS_H_ | |
17 | -#define _VM_SOCKETS_H_ | |
16 | +#ifndef _UAPI_VM_SOCKETS_H | |
17 | +#define _UAPI_VM_SOCKETS_H | |
18 | 18 | |
19 | -#if !defined(__KERNEL__) | |
20 | -#include <sys/socket.h> | |
21 | -#endif | |
19 | +#include <linux/socket.h> | |
22 | 20 | |
23 | 21 | /* Option name for STREAM socket buffer size. Use as the option name in |
24 | 22 | * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that |
25 | 23 | |
... | ... | @@ -137,14 +135,13 @@ |
137 | 135 | #define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF)) |
138 | 136 | |
139 | 137 | /* Address structure for vSockets. The address family should be set to |
140 | - * whatever vmci_sock_get_af_value_fd() returns. The structure members should | |
141 | - * all align on their natural boundaries without resorting to compiler packing | |
142 | - * directives. The total size of this structure should be exactly the same as | |
143 | - * that of struct sockaddr. | |
138 | + * AF_VSOCK. The structure members should all align on their natural | |
139 | + * boundaries without resorting to compiler packing directives. The total size | |
140 | + * of this structure should be exactly the same as that of struct sockaddr. | |
144 | 141 | */ |
145 | 142 | |
146 | 143 | struct sockaddr_vm { |
147 | - sa_family_t svm_family; | |
144 | + __kernel_sa_family_t svm_family; | |
148 | 145 | unsigned short svm_reserved1; |
149 | 146 | unsigned int svm_port; |
150 | 147 | unsigned int svm_cid; |
... | ... | @@ -156,9 +153,5 @@ |
156 | 153 | |
157 | 154 | #define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9) |
158 | 155 | |
159 | -#if defined(__KERNEL__) | |
160 | -int vm_sockets_get_local_cid(void); | |
161 | -#endif | |
162 | - | |
163 | -#endif | |
156 | +#endif /* _UAPI_VM_SOCKETS_H */ |