Commit c031e234 authored by Andy King's avatar Andy King Committed by David S. Miller

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: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarDmitry Torokhov <dtor@vmware.com>
Signed-off-by: default avatarAndy King <acking@vmware.com>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7f0e44ac
/*
* VMware vSockets Driver
*
* Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation version 2 and no later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#ifndef _VM_SOCKETS_H
#define _VM_SOCKETS_H
#include <uapi/linux/vm_sockets.h>
int vm_sockets_get_local_cid(void);
#endif /* _VM_SOCKETS_H */
...@@ -13,12 +13,10 @@ ...@@ -13,12 +13,10 @@
* more details. * more details.
*/ */
#ifndef _VM_SOCKETS_H_ #ifndef _UAPI_VM_SOCKETS_H
#define _VM_SOCKETS_H_ #define _UAPI_VM_SOCKETS_H
#if !defined(__KERNEL__) #include <linux/socket.h>
#include <sys/socket.h>
#endif
/* Option name for STREAM socket buffer size. Use as the option name in /* Option name for STREAM socket buffer size. Use as the option name in
* setsockopt(3) or getsockopt(3) to set or get an unsigned long long that * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that
...@@ -137,14 +135,13 @@ ...@@ -137,14 +135,13 @@
#define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF)) #define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF))
/* Address structure for vSockets. The address family should be set to /* Address structure for vSockets. The address family should be set to
* whatever vmci_sock_get_af_value_fd() returns. The structure members should * AF_VSOCK. The structure members should all align on their natural
* all align on their natural boundaries without resorting to compiler packing * boundaries without resorting to compiler packing directives. The total size
* directives. The total size of this structure should be exactly the same as * of this structure should be exactly the same as that of struct sockaddr.
* that of struct sockaddr.
*/ */
struct sockaddr_vm { struct sockaddr_vm {
sa_family_t svm_family; __kernel_sa_family_t svm_family;
unsigned short svm_reserved1; unsigned short svm_reserved1;
unsigned int svm_port; unsigned int svm_port;
unsigned int svm_cid; unsigned int svm_cid;
...@@ -156,8 +153,4 @@ struct sockaddr_vm { ...@@ -156,8 +153,4 @@ struct sockaddr_vm {
#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9) #define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)
#if defined(__KERNEL__) #endif /* _UAPI_VM_SOCKETS_H */
int vm_sockets_get_local_cid(void);
#endif
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment