-
Notifications
You must be signed in to change notification settings - Fork 0
/
hostan.c
341 lines (312 loc) · 17.4 KB
/
hostan.c
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
/* source: hostan.c */
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */
/* Published under the GNU General Public License V.2, see file COPYING */
/* the subroutine hostan makes a "HOST ANalysis". It gathers information
about the host environment it is running in without modifying its state
(almost).
*/
#include "xiosysincludes.h"
#include "mytypes.h"
#include "compat.h"
#include "error.h"
#include "sycls.h"
#include "sysutils.h"
#include "filan.h"
#include "hostan.h"
static int iffan(FILE *outfile);
static int vsockan(FILE *outfile);
int hostan(FILE *outfile) {
fprintf(outfile, "\nC TYPE SIZES\n");
fprintf(outfile, "sizeof(char) = %u\n", (unsigned int)sizeof(char));
fprintf(outfile, "sizeof(short) = %u\n", (unsigned int)sizeof(short));
fprintf(outfile, "sizeof(int) = %u\n", (unsigned int)sizeof(int));
fprintf(outfile, "sizeof(long) = %u\n", (unsigned int)sizeof(long));
#if HAVE_TYPE_LONGLONG
fprintf(outfile, "sizeof(long long) = %u\n", (unsigned int)sizeof(long long));
#endif
fprintf(outfile, "sizeof(size_t) = %u\n", (unsigned int)sizeof(size_t));
# if HAVE_BASIC_SIZE_T==2
fprintf(outfile, "typedef unsigned short size_t; /* sizeof(size_t) = %u */\n", (unsigned int)sizeof(size_t));
#elif HAVE_BASIC_SIZE_T==4
fprintf(outfile, "typedef unsigned int size_t; /* sizeof(size_t) = %u */\n", (unsigned int)sizeof(size_t));
#elif HAVE_BASIC_SIZE_T==6
fprintf(outfile, "typedef unsigned long size_t; /* sizeof(size_t) = %u */\n", (unsigned int)sizeof(size_t));
#elif HAVE_BASIC_SIZE_T==8
fprintf(outfile, "typedef unsigned long long size_t; /* sizeof(size_t) = %u */\n", (unsigned int)sizeof(size_t));
#endif
# if HAVE_BASIC_MODE_T==1
fprintf(outfile, "typedef short mode_t; /* sizeof(mode_t) = %u */\n", (unsigned int)sizeof(mode_t));
#elif HAVE_BASIC_MODE_T==2
fprintf(outfile, "typedef unsigned short mode_t; /* sizeof(mode_t) = %u */\n", (unsigned int)sizeof(mode_t));
#elif HAVE_BASIC_MODE_T==3
fprintf(outfile, "typedef int mode_t; /* sizeof(mode_t) = %u */\n", (unsigned int)sizeof(mode_t));
#elif HAVE_BASIC_MODE_T==4
fprintf(outfile, "typedef unsigned int mode_t; /* sizeof(mode_t) = %u */\n", (unsigned int)sizeof(mode_t));
#elif HAVE_BASIC_MODE_T==5
fprintf(outfile, "typedef long mode_t; /* sizeof(mode_t) = %u */\n", (unsigned int)sizeof(mode_t));
#elif HAVE_BASIC_MODE_T==6
fprintf(outfile, "typedef unsigned long mode_t; /* sizeof(mode_t) = %u */\n", (unsigned int)sizeof(mode_t));
#elif HAVE_BASIC_MODE_T==7
fprintf(outfile, "typedef long long mode_t; /* sizeof(mode_t) = %u */\n", (unsigned int)sizeof(mode_t));
#elif HAVE_BASIC_MODE_T==8
fprintf(outfile, "typedef unsigned long long mode_t; /* sizeof(mode_t) = %u */\n", (unsigned int)sizeof(mode_t));
#endif
# if HAVE_BASIC_PID_T==1
fprintf(outfile, "typedef short pid_t; /* sizeof(pid_t) = %u */\n", (unsigned int)sizeof(pid_t));
#elif HAVE_BASIC_PID_T==2
fprintf(outfile, "typedef unsigned short pid_t; /* sizeof(pid_t) = %u */\n", (unsigned int)sizeof(pid_t));
#elif HAVE_BASIC_PID_T==3
fprintf(outfile, "typedef int pid_t; /* sizeof(pid_t) = %u */\n", (unsigned int)sizeof(pid_t));
#elif HAVE_BASIC_PID_T==4
fprintf(outfile, "typedef unsigned int pid_t; /* sizeof(pid_t) = %u */\n", (unsigned int)sizeof(pid_t));
#elif HAVE_BASIC_PID_T==5
fprintf(outfile, "typedef long pid_t; /* sizeof(pid_t) = %u */\n", (unsigned int)sizeof(pid_t));
#elif HAVE_BASIC_PID_T==6
fprintf(outfile, "typedef unsigned long pid_t; /* sizeof(pid_t) = %u */\n", (unsigned int)sizeof(pid_t));
#elif HAVE_BASIC_PID_T==7
fprintf(outfile, "typedef long long pid_t; /* sizeof(pid_t) = %u */\n", (unsigned int)sizeof(pid_t));
#elif HAVE_BASIC_PID_T==8
fprintf(outfile, "typedef unsigned long long pid_t; /* sizeof(pid_t) = %u */\n", (unsigned int)sizeof(pid_t));
#endif
# if HAVE_BASIC_UID_T==1
fprintf(outfile, "typedef short uid_t; /* sizeof(uid_t) = %u */\n", (unsigned int)sizeof(uid_t));
#elif HAVE_BASIC_UID_T==2
fprintf(outfile, "typedef unsigned short uid_t; /* sizeof(uid_t) = %u */\n", (unsigned int)sizeof(uid_t));
#elif HAVE_BASIC_UID_T==3
fprintf(outfile, "typedef int uid_t; /* sizeof(uid_t) = %u */\n", (unsigned int)sizeof(uid_t));
#elif HAVE_BASIC_UID_T==4
fprintf(outfile, "typedef unsigned int uid_t; /* sizeof(uid_t) = %u */\n", (unsigned int)sizeof(uid_t));
#elif HAVE_BASIC_UID_T==5
fprintf(outfile, "typedef long uid_t; /* sizeof(uid_t) = %u */\n", (unsigned int)sizeof(uid_t));
#elif HAVE_BASIC_UID_T==6
fprintf(outfile, "typedef unsigned long uid_t; /* sizeof(uid_t) = %u */\n", (unsigned int)sizeof(uid_t));
#elif HAVE_BASIC_UID_T==7
fprintf(outfile, "typedef long long uid_t; /* sizeof(uid_t) = %u */\n", (unsigned int)sizeof(uid_t));
#elif HAVE_BASIC_UID_T==8
fprintf(outfile, "typedef unsigned long long uid_t; /* sizeof(uid_t) = %u */\n", (unsigned int)sizeof(uid_t));
#endif
# if HAVE_BASIC_GID_T==1
fprintf(outfile, "typedef short gid_t; /* sizeof(gid_t) = %u */\n", (unsigned int)sizeof(gid_t));
#elif HAVE_BASIC_GID_T==2
fprintf(outfile, "typedef unsigned short gid_t; /* sizeof(gid_t) = %u */\n", (unsigned int)sizeof(gid_t));
#elif HAVE_BASIC_GID_T==3
fprintf(outfile, "typedef int gid_t; /* sizeof(gid_t) = %u */\n", (unsigned int)sizeof(gid_t));
#elif HAVE_BASIC_GID_T==4
fprintf(outfile, "typedef unsigned int gid_t; /* sizeof(gid_t) = %u */\n", (unsigned int)sizeof(gid_t));
#elif HAVE_BASIC_GID_T==5
fprintf(outfile, "typedef long gid_t; /* sizeof(gid_t) = %u */\n", (unsigned int)sizeof(gid_t));
#elif HAVE_BASIC_GID_T==6
fprintf(outfile, "typedef unsigned long gid_t; /* sizeof(gid_t) = %u */\n", (unsigned int)sizeof(gid_t));
#elif HAVE_BASIC_GID_T==7
fprintf(outfile, "typedef long long gid_t; /* sizeof(gid_t) = %u */\n", (unsigned int)sizeof(gid_t));
#elif HAVE_BASIC_GID_T==8
fprintf(outfile, "typedef unsigned long long gid_t; /* sizeof(gid_t) = %u */\n", (unsigned int)sizeof(gid_t));
#endif
# if HAVE_BASIC_TIME_T==1
fprintf(outfile, "typedef short time_t; /* sizeof(time_t) = %u */\n", (unsigned int)sizeof(time_t));
#elif HAVE_BASIC_TIME_T==2
fprintf(outfile, "typedef unsigned short time_t; /* sizeof(time_t) = %u */\n", (unsigned int)sizeof(time_t));
#elif HAVE_BASIC_TIME_T==3
fprintf(outfile, "typedef int time_t; /* sizeof(time_t) = %u */\n", (unsigned int)sizeof(time_t));
#elif HAVE_BASIC_TIME_T==4
fprintf(outfile, "typedef unsigned int time_t; /* sizeof(time_t) = %u */\n", (unsigned int)sizeof(time_t));
#elif HAVE_BASIC_TIME_T==5
fprintf(outfile, "typedef long time_t; /* sizeof(time_t) = %u */\n", (unsigned int)sizeof(time_t));
#elif HAVE_BASIC_TIME_T==6
fprintf(outfile, "typedef unsigned long time_t; /* sizeof(time_t) = %u */\n", (unsigned int)sizeof(time_t));
#elif HAVE_BASIC_TIME_T==7
fprintf(outfile, "typedef long long time_t; /* sizeof(time_t) = %u */\n", (unsigned int)sizeof(time_t));
#elif HAVE_BASIC_TIME_T==8
fprintf(outfile, "typedef unsigned long long time_t; /* sizeof(time_t) = %u */\n", (unsigned int)sizeof(time_t));
#endif
# if HAVE_BASIC_SOCKLEN_T==1
fprintf(outfile, "typedef short socklen_t; /* sizeof(socklen_t) = %u */\n", (unsigned int)sizeof(socklen_t));
#elif HAVE_BASIC_SOCKLEN_T==2
fprintf(outfile, "typedef unsigned short socklen_t; /* sizeof(socklen_t) = %u */\n", (unsigned int)sizeof(socklen_t));
#elif HAVE_BASIC_SOCKLEN_T==3
fprintf(outfile, "typedef int socklen_t; /* sizeof(socklen_t) = %u */\n", (unsigned int)sizeof(socklen_t));
#elif HAVE_BASIC_SOCKLEN_T==4
fprintf(outfile, "typedef unsigned int socklen_t; /* sizeof(socklen_t) = %u */\n", (unsigned int)sizeof(socklen_t));
#elif HAVE_BASIC_SOCKLEN_T==5
fprintf(outfile, "typedef long socklen_t; /* sizeof(socklen_t) = %u */\n", (unsigned int)sizeof(socklen_t));
#elif HAVE_BASIC_SOCKLEN_T==6
fprintf(outfile, "typedef unsigned long socklen_t; /* sizeof(socklen_t) = %u */\n", (unsigned int)sizeof(socklen_t));
#elif HAVE_BASIC_SOCKLEN_T==7
fprintf(outfile, "typedef long long socklen_t; /* sizeof(socklen_t) = %u */\n", (unsigned int)sizeof(socklen_t));
#elif HAVE_BASIC_SOCKLEN_T==8
fprintf(outfile, "typedef unsigned long long socklen_t; /* sizeof(socklen_t) = %u */\n", (unsigned int)sizeof(socklen_t));
#endif
# if HAVE_BASIC_OFF_T==1
fprintf(outfile, "typedef short off_t; /* sizeof(off_t) = %u */\n", (unsigned int)sizeof(off_t));
#elif HAVE_BASIC_OFF_T==2
fprintf(outfile, "typedef unsigned short off_t; /* sizeof(off_t) = %u */\n", (unsigned int)sizeof(off_t));
#elif HAVE_BASIC_OFF_T==3
fprintf(outfile, "typedef int off_t; /* sizeof(off_t) = %u */\n", (unsigned int)sizeof(off_t));
#elif HAVE_BASIC_OFF_T==4
fprintf(outfile, "typedef unsigned int off_t; /* sizeof(off_t) = %u */\n", (unsigned int)sizeof(off_t));
#elif HAVE_BASIC_OFF_T==5
fprintf(outfile, "typedef long off_t; /* sizeof(off_t) = %u */\n", (unsigned int)sizeof(off_t));
#elif HAVE_BASIC_OFF_T==6
fprintf(outfile, "typedef unsigned long off_t; /* sizeof(off_t) = %u */\n", (unsigned int)sizeof(off_t));
#elif HAVE_BASIC_OFF_T==7
fprintf(outfile, "typedef long long off_t; /* sizeof(off_t) = %u */\n", (unsigned int)sizeof(off_t));
#elif HAVE_BASIC_OFF_T==8
fprintf(outfile, "typedef unsigned long long off_t; /* sizeof(off_t) = %u */\n", (unsigned int)sizeof(off_t));
#endif
#if HAVE_TYPE_OFF64 && defined(HAVE_BASIC_OFF64_T) && HAVE_BASIC_OFF64_T
# if HAVE_BASIC_OFF64_T==1
fprintf(outfile, "typedef short off64_t; /* sizeof(off64_t) = %u */\n", (unsigned int)sizeof(off64_t));
#elif HAVE_BASIC_OFF64_T==2
fprintf(outfile, "typedef unsigned short off64_t; /* sizeof(off64_t) = %u */\n", (unsigned int)sizeof(off64_t));
#elif HAVE_BASIC_OFF64_T==3
fprintf(outfile, "typedef int off64_t; /* sizeof(off64_t) = %u */\n", (unsigned int)sizeof(off64_t));
#elif HAVE_BASIC_OFF64_T==4
fprintf(outfile, "typedef unsigned int off64_t; /* sizeof(off64_t) = %u */\n", (unsigned int)sizeof(off64_t));
#elif HAVE_BASIC_OFF64_T==5
fprintf(outfile, "typedef long off64_t; /* sizeof(off64_t) = %u */\n", (unsigned int)sizeof(off64_t));
#elif HAVE_BASIC_OFF64_T==6
fprintf(outfile, "typedef unsigned long off64_t; /* sizeof(off64_t) = %u */\n", (unsigned int)sizeof(off64_t));
#elif HAVE_BASIC_OFF64_T==7
fprintf(outfile, "typedef long long off64_t; /* sizeof(off64_t) = %u */\n", (unsigned int)sizeof(off64_t));
#elif HAVE_BASIC_OFF64_T==8
fprintf(outfile, "typedef unsigned long long off64_t; /* sizeof(off64_t) = %u */\n", (unsigned int)sizeof(off64_t));
#endif
#endif /* defined(HAVE_BASIC_OFF64_T) && HAVE_BASIC_OFF64_T */
# if HAVE_BASIC_DEV_T==1
fprintf(outfile, "typedef short dev_t; /* sizeof(dev_t) = %u */\n", (unsigned int)sizeof(dev_t));
#elif HAVE_BASIC_DEV_T==2
fprintf(outfile, "typedef unsigned short dev_t; /* sizeof(dev_t) = %u */\n", (unsigned int)sizeof(dev_t));
#elif HAVE_BASIC_DEV_T==3
fprintf(outfile, "typedef int dev_t; /* sizeof(dev_t) = %u */\n", (unsigned int)sizeof(dev_t));
#elif HAVE_BASIC_DEV_T==4
fprintf(outfile, "typedef unsigned int dev_t; /* sizeof(dev_t) = %u */\n", (unsigned int)sizeof(dev_t));
#elif HAVE_BASIC_DEV_T==5
fprintf(outfile, "typedef long dev_t; /* sizeof(dev_t) = %u */\n", (unsigned int)sizeof(dev_t));
#elif HAVE_BASIC_DEV_T==6
fprintf(outfile, "typedef unsigned long dev_t; /* sizeof(dev_t) = %u */\n", (unsigned int)sizeof(dev_t));
#elif HAVE_BASIC_DEV_T==7
fprintf(outfile, "typedef long long dev_t; /* sizeof(dev_t) = %u */\n", (unsigned int)sizeof(dev_t));
#elif HAVE_BASIC_DEV_T==8
fprintf(outfile, "typedef unsigned long long dev_t; /* sizeof(dev_t) = %u */\n", (unsigned int)sizeof(dev_t));
#endif
{
struct stat x;
# if HAVE_TYPEOF_ST_INO==1
fprintf(outfile, "typedef short ino_t; /* sizeof(ino_t) = %u */\n", (unsigned int)sizeof(x.st_ino));
#elif HAVE_TYPEOF_ST_INO==2
fprintf(outfile, "typedef unsigned short ino_t; /* sizeof(ino_t) = %u */\n", (unsigned int)sizeof(x.st_ino));
#elif HAVE_TYPEOF_ST_INO==3
fprintf(outfile, "typedef int ino_t; /* sizeof(ino_t) = %u */\n", (unsigned int)sizeof(x.st_ino));
#elif HAVE_TYPEOF_ST_INO==4
fprintf(outfile, "typedef unsigned int ino_t; /* sizeof(ino_t) = %u */\n", (unsigned int)sizeof(x.st_ino));
#elif HAVE_TYPEOF_ST_INO==5
fprintf(outfile, "typedef long ino_t; /* sizeof(ino_t) = %u */\n", (unsigned int)sizeof(x.st_ino));
#elif HAVE_TYPEOF_ST_INO==6
fprintf(outfile, "typedef unsigned long ino_t; /* sizeof(ino_t) = %u */\n", (unsigned int)sizeof(x.st_ino));
#elif HAVE_TYPEOF_ST_INO==7
fprintf(outfile, "typedef long long ino_t; /* sizeof(ino_t) = %u */\n", (unsigned int)sizeof(x.st_ino));
#elif HAVE_TYPEOF_ST_INO==8
fprintf(outfile, "typedef unsigned long long ino_t; /* sizeof(ino_t) = %u */\n", (unsigned int)sizeof(x.st_ino));
#endif
}
{
unsigned short x = 0x100;
if (x == ntohs(0x100)) {
fprintf(outfile, "#define __BYTE_ORDER __BIG_ENDIAN\t/* Motorola ea.*/\n");
} else {
fprintf(outfile, "#define __BYTE_ORDER __LITTLE_ENDIAN\t/* Intel ea.*/\n");
}
}
#include <sys/time.h> /* select(); OpenBSD: struct timespec */
fprintf(outfile, "sizeof(struct timespec) = %u\n", (unsigned int)sizeof(struct timespec));
fprintf(outfile, "\n");
fprintf(outfile, "/* Socat types */\n");
fprintf(outfile, "sizeof(struct diag_dgram) = %u\n", (unsigned int)sizeof(struct diag_dgram));
fprintf(outfile, "((struct diag_dgram *)0)->op-((struct diag_dgram *)0) = %u\n", (unsigned int)((char *)(&((struct diag_dgram *)0)->op)-(char *)((struct diag_dgram *)0)));
fprintf(outfile, "((struct diag_dgram *)0)->now-((struct diag_dgram *)0) = %u\n", (unsigned int)((char *)(&((struct diag_dgram *)0)->now)-(char *)((struct diag_dgram *)0)));
fprintf(outfile, "((struct diag_dgram *)0)->exitcode-((struct diag_dgram *)0) = %u\n", (unsigned int)((char *)(&((struct diag_dgram *)0)->exitcode)-(char *)((struct diag_dgram *)0)));
fprintf(outfile, "((struct diag_dgram *)0)->text-((struct diag_dgram *)0) = %u\n", (unsigned int)((((struct diag_dgram *)0)->text)-(char *)((struct diag_dgram *)0)));
#if _WITH_SOCKET && (_WITH_IP4 || _WITH_IP6)
fprintf(outfile, "\nIP INTERFACES\n");
iffan(outfile);
#endif
#if WITH_VSOCK
vsockan(outfile);
#endif
return 0;
}
#if _WITH_SOCKET && (_WITH_IP4 || _WITH_IP6)
static int iffan(FILE *outfile) {
/* Linux: man 7 netdevice */
/* FreeBSD, NetBSD: man 4 networking */
/* Solaris: man 7 if_tcp */
/* currently we support Linux and a little FreeBSD */
#ifdef SIOCGIFCONF /* not Solaris */
#define IFBUFSIZ 32*sizeof(struct ifreq) /*1024*/
int s;
unsigned char buff[IFBUFSIZ];
struct ifconf ic;
int i;
if ((s = Socket(PF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0) {
Warn1("socket(PF_INET, SOCK_DGRAM, IPPROTO_IP): %s", strerror(errno));
return -1;
}
for (i=0; i < IFBUFSIZ; ++i) {
buff[i] = 255;
}
ic.ifc_len = sizeof(buff);
ic.ifc_ifcu.ifcu_buf = (caddr_t)buff;
if (Ioctl(s, SIOCGIFCONF, &ic) < 0) {
Warn3("ioctl(%d, SIOCGIFCONF, %p): %s", s, &ic, strerror(errno));
return -1;
}
for (i = 0; i < ic.ifc_len; i += sizeof(struct ifreq)) {
struct ifreq *ifp = (struct ifreq *)((caddr_t)ic.ifc_req + i);
#if 0 || defined(SIOCGIFINDEX) /* not NetBSD, OpenBSD */
struct ifreq ifr;
#endif
#if 0 || defined(SIOCGIFINDEX) /* not NetBSD, OpenBSD */
strcpy(ifr.ifr_name, ifp->ifr_name);
if (Ioctl(s, SIOCGIFINDEX, &ifr) < 0) {
Warn3("ioctl(%d, SIOCGIFINDEX, {\"%s\"}): %s",
s, ifr.ifr_name, strerror(errno));
return 1;
}
#if HAVE_STRUCT_IFREQ_IFR_INDEX
fprintf(outfile, "%2d: %s\n", ifr.ifr_index, ifp->ifr_name);
#elif HAVE_STRUCT_IFREQ_IFR_IFINDEX
fprintf(outfile, "%2d: %s\n", ifr.ifr_ifindex, ifp->ifr_name);
#endif /* HAVE_STRUCT_IFREQ_IFR_INDEX */
#else /* !defined(SIOCGIFINDEX) */
fprintf(outfile, "%2d: %s\n", i/(int)sizeof(struct ifreq), ifp->ifr_name);
#endif /* defined(SIOCGIFINDEX) */
}
Close(s);
#endif /* defined(SIOCGIFCONF) */
return 0;
}
#endif /* _WITH_SOCKET */
#if WITH_VSOCK
static int vsockan(FILE *outfile) {
unsigned int cid;
int vsock;
if (Getuid() != 0) {
return 1;
}
if ((vsock = Open("/dev/vsock", O_RDONLY, 0)) < 0 ) {
Warn1("open(\"/dev/vsock\", ...): %s", strerror(errno));
return -1;
} else if (Ioctl(vsock, IOCTL_VM_SOCKETS_GET_LOCAL_CID, &cid) < 0) {
Warn2("ioctl(%d, IOCTL_VM_SOCKETS_GET_LOCAL_CID, ...): %s",
vsock, strerror(errno));
return -1;
} else {
Notice1("VSOCK CID=%u", cid);
fprintf(outfile, "\nVSOCK_CID = %u\n", cid);
}
if (vsock >= 0) {
Close(vsock);
}
return 0;
}
#endif /* WITH_VSOCK */