-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunsock.h
executable file
·63 lines (52 loc) · 1.32 KB
/
unsock.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// unsock.h
// unsock
//
#ifndef unsock_h
#define unsock_h
#include <stdint.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <linux/vm_sockets.h>
#include <linux/tipc.h>
#define UNSOCK_SOCKET_INFO_MAGIC 0x4b534e55
#define UNSOCK_SOCKET_INFO_OPT_FIRECRACKER_PROXY 1
typedef struct __attribute__((packed, aligned(4))) {
uint32_t group;
uint32_t key;
union {
int32_t int32;
uint32_t uint32;
int64_t int64;
uint64_t uint64;
struct timeval timeval;
struct tipc_group_req tipc_group_req;
char bytes[32];
} value;
} unsock_param_t;
struct __attribute__((packed, aligned(4))) unsock_socket_info {
uint64_t magicHeader;
uint64_t options;
uint32_t proxyLen;
uint32_t destLen;
uint32_t optionsCount;
uint32_t reserved0;
union {
struct sockaddr addr;
struct sockaddr_un un;
char bytes[128];
} proxy;
union {
struct sockaddr addr;
struct sockaddr_un un;
struct sockaddr_vm vsock;
struct sockaddr_tipc tipc;
char bytes[128];
} dest;
// run up to four setsockopt commands by default upon connect or bind.
unsock_param_t parameters[4];
uint32_t reserved1;
};
CK_VISIBILITY_INTERNAL char* getenv_unsock(char *key);
#endif /* unsock_h */