1
// Copyright 2009 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
8
Input to cgo -godefs. See also mkerrors.sh and mkall.sh
11
// +godefs map struct_in_addr [4]byte /* in_addr */
12
// +godefs map struct_in6_addr [16]byte /* in6_addr */
24
#include <sys/event.h>
26
#include <sys/mount.h>
27
#include <sys/param.h>
28
#include <sys/ptrace.h>
29
#include <sys/resource.h>
30
#include <sys/select.h>
31
#include <sys/signal.h>
32
#include <sys/socket.h>
35
#include <sys/types.h>
40
#include <net/if_dl.h>
41
#include <net/route.h>
42
#include <netinet/in.h>
43
#include <netinet/icmp6.h>
44
#include <netinet/tcp.h>
47
sizeofPtr = sizeof(void*),
51
struct sockaddr s1; // this one gets used for fields
52
struct sockaddr_in s2; // these pad it out
53
struct sockaddr_in6 s3;
54
struct sockaddr_un s4;
55
struct sockaddr_dl s5;
60
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
63
// This structure is a duplicate of stat on FreeBSD 8-STABLE.
64
// See /usr/include/sys/stat.h.
66
#undef st_atimespec st_atim
67
#undef st_mtimespec st_mtim
68
#undef st_ctimespec st_ctim
69
#undef st_birthtimespec st_birthtim
78
struct timespec st_atimespec;
79
struct timespec st_mtimespec;
80
struct timespec st_ctimespec;
96
struct timespec st_birthtimespec;
97
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));
98
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));
101
long st_birthtimensec;
102
unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec));
103
unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec));
107
// This structure is a duplicate of if_data on FreeBSD 8-STABLE.
108
// See /usr/include/net/if.h.
114
u_char ifi_link_state;
115
u_char ifi_spare_char1;
116
u_char ifi_spare_char2;
125
u_long ifi_collisions;
134
struct timeval ifi_lastchange;
137
// This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE.
138
// See /usr/include/net/if.h.
146
struct if_data8 ifm_data;
151
// Machine characteristics; for internal use.
154
sizeofPtr = C.sizeofPtr
155
sizeofShort = C.sizeof_short
156
sizeofInt = C.sizeof_int
157
sizeofLong = C.sizeof_long
158
sizeofLongLong = C.sizeof_longlong
167
_C_long_long C.longlong
172
type Timespec C.struct_timespec
174
type Timeval C.struct_timeval
178
type Rusage C.struct_rusage
180
type Rlimit C.struct_rlimit
186
const ( // Directory mode bits
194
S_IFSOCK = C.S_IFSOCK
203
type Stat_t C.struct_stat8
205
type Statfs_t C.struct_statfs
207
type Flock_t C.struct_flock
209
type Dirent C.struct_dirent
211
type Fsid C.struct_fsid
216
FADV_NORMAL = C.POSIX_FADV_NORMAL
217
FADV_RANDOM = C.POSIX_FADV_RANDOM
218
FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL
219
FADV_WILLNEED = C.POSIX_FADV_WILLNEED
220
FADV_DONTNEED = C.POSIX_FADV_DONTNEED
221
FADV_NOREUSE = C.POSIX_FADV_NOREUSE
226
type RawSockaddrInet4 C.struct_sockaddr_in
228
type RawSockaddrInet6 C.struct_sockaddr_in6
230
type RawSockaddrUnix C.struct_sockaddr_un
232
type RawSockaddrDatalink C.struct_sockaddr_dl
234
type RawSockaddr C.struct_sockaddr
236
type RawSockaddrAny C.struct_sockaddr_any
238
type _Socklen C.socklen_t
240
type Linger C.struct_linger
242
type Iovec C.struct_iovec
244
type IPMreq C.struct_ip_mreq
246
type IPMreqn C.struct_ip_mreqn
248
type IPv6Mreq C.struct_ipv6_mreq
250
type Msghdr C.struct_msghdr
252
type Cmsghdr C.struct_cmsghdr
254
type Inet6Pktinfo C.struct_in6_pktinfo
256
type IPv6MTUInfo C.struct_ip6_mtuinfo
258
type ICMPv6Filter C.struct_icmp6_filter
261
SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
262
SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
263
SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
264
SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
265
SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
266
SizeofLinger = C.sizeof_struct_linger
267
SizeofIPMreq = C.sizeof_struct_ip_mreq
268
SizeofIPMreqn = C.sizeof_struct_ip_mreqn
269
SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
270
SizeofMsghdr = C.sizeof_struct_msghdr
271
SizeofCmsghdr = C.sizeof_struct_cmsghdr
272
SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
273
SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
274
SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
280
PTRACE_TRACEME = C.PT_TRACE_ME
281
PTRACE_CONT = C.PT_CONTINUE
282
PTRACE_KILL = C.PT_KILL
285
// Events (kqueue, kevent)
287
type Kevent_t C.struct_kevent
293
// Routing and interface messages
296
sizeofIfMsghdr = C.sizeof_struct_if_msghdr
297
SizeofIfMsghdr = C.sizeof_struct_if_msghdr8
298
sizeofIfData = C.sizeof_struct_if_data
299
SizeofIfData = C.sizeof_struct_if_data8
300
SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
301
SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr
302
SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
303
SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
304
SizeofRtMetrics = C.sizeof_struct_rt_metrics
307
type ifMsghdr C.struct_if_msghdr
309
type IfMsghdr C.struct_if_msghdr8
311
type ifData C.struct_if_data
313
type IfData C.struct_if_data8
315
type IfaMsghdr C.struct_ifa_msghdr
317
type IfmaMsghdr C.struct_ifma_msghdr
319
type IfAnnounceMsghdr C.struct_if_announcemsghdr
321
type RtMsghdr C.struct_rt_msghdr
323
type RtMetrics C.struct_rt_metrics
325
// Berkeley packet filter
328
SizeofBpfVersion = C.sizeof_struct_bpf_version
329
SizeofBpfStat = C.sizeof_struct_bpf_stat
330
SizeofBpfZbuf = C.sizeof_struct_bpf_zbuf
331
SizeofBpfProgram = C.sizeof_struct_bpf_program
332
SizeofBpfInsn = C.sizeof_struct_bpf_insn
333
SizeofBpfHdr = C.sizeof_struct_bpf_hdr
334
SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header
337
type BpfVersion C.struct_bpf_version
339
type BpfStat C.struct_bpf_stat
341
type BpfZbuf C.struct_bpf_zbuf
343
type BpfProgram C.struct_bpf_program
345
type BpfInsn C.struct_bpf_insn
347
type BpfHdr C.struct_bpf_hdr
349
type BpfZbufHeader C.struct_bpf_zbuf_header
353
type Termios C.struct_termios