#include <sys/vsock.h>
sys/vsock.h
macroVMADDR_CID_ANY
#define VMADDR_CID_ANY (-1U)
macroVMADDR_CID_HYPERVISOR
#define VMADDR_CID_HYPERVISOR 0
macroVMADDR_CID_RESERVED
#define VMADDR_CID_RESERVED 1
macroVMADDR_CID_HOST
#define VMADDR_CID_HOST 2
macroVMADDR_PORT_ANY
#define VMADDR_PORT_ANY (-1U)
macroIOCTL_VM_SOCKETS_GET_LOCAL_CID
#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IOR('s', 209, uint32_t)
structsockaddr_vm
| __uint8_t | svm_len | total length |
| sa_family_t | svm_family | Address family: AF_VSOCK |
| __uint16_t | svm_reserved1 | |
| __uint32_t | svm_port | Port # in host byte order |
| __uint32_t | svm_cid | Address in host byte order |
typedefvsock_gen_t
typedef u_quad_t vsock_gen_t
structxvsockpcb
| u_int32_t | xv_len | length of this structure |
| u_int64_t | xv_vsockpp | |
| u_int32_t | xvp_local_cid | local address cid |
| u_int32_t | xvp_local_port | local address port |
| u_int32_t | xvp_remote_cid | remote address cid |
| u_int32_t | xvp_remote_port | remote address port |
| u_int32_t | xvp_rxcnt | bytes received |
| u_int32_t | xvp_txcnt | bytes transmitted |
| u_int32_t | xvp_peer_rxhiwat | peer's receive buffer |
| u_int32_t | xvp_peer_rxcnt | bytes received by peer |
| pid_t | xvp_last_pid | last pid |
| vsock_gen_t | xvp_gencnt | vsock generation count |
| struct xsocket | xv_socket |
structxvsockpgen
| u_int32_t | xvg_len | length of this structure |
| u_int64_t | xvg_count | number of PCBs at this time |
| vsock_gen_t | xvg_gen | generation count at this time |
| so_gen_t | xvg_sogen | current socket generation count |