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)];
66
// Machine characteristics; for internal use.
69
sizeofPtr = C.sizeofPtr
70
sizeofShort = C.sizeof_short
71
sizeofInt = C.sizeof_int
72
sizeofLong = C.sizeof_long
73
sizeofLongLong = C.sizeof_longlong
82
_C_long_long C.longlong
87
type Timespec C.struct_timespec
89
type Timeval C.struct_timeval
93
type Rusage C.struct_rusage
95
type Rlimit C.struct_rlimit
101
const ( // Directory mode bits
109
S_IFSOCK = C.S_IFSOCK
118
type Stat_t C.struct_stat
120
type Statfs_t C.struct_statfs
122
type Flock_t C.struct_flock
124
type Dirent C.struct_dirent
126
type Fsid C.struct_fsid
130
type RawSockaddrInet4 C.struct_sockaddr_in
132
type RawSockaddrInet6 C.struct_sockaddr_in6
134
type RawSockaddrUnix C.struct_sockaddr_un
136
type RawSockaddrDatalink C.struct_sockaddr_dl
138
type RawSockaddr C.struct_sockaddr
140
type RawSockaddrAny C.struct_sockaddr_any
142
type _Socklen C.socklen_t
144
type Linger C.struct_linger
146
type Iovec C.struct_iovec
148
type IPMreq C.struct_ip_mreq
150
type IPv6Mreq C.struct_ipv6_mreq
152
type Msghdr C.struct_msghdr
154
type Cmsghdr C.struct_cmsghdr
156
type Inet6Pktinfo C.struct_in6_pktinfo
158
type IPv6MTUInfo C.struct_ip6_mtuinfo
160
type ICMPv6Filter C.struct_icmp6_filter
163
SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
164
SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
165
SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
166
SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
167
SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
168
SizeofLinger = C.sizeof_struct_linger
169
SizeofIPMreq = C.sizeof_struct_ip_mreq
170
SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
171
SizeofMsghdr = C.sizeof_struct_msghdr
172
SizeofCmsghdr = C.sizeof_struct_cmsghdr
173
SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
174
SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
175
SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
181
PTRACE_TRACEME = C.PT_TRACE_ME
182
PTRACE_CONT = C.PT_CONTINUE
183
PTRACE_KILL = C.PT_KILL
186
// Events (kqueue, kevent)
188
type Kevent_t C.struct_kevent
194
// Routing and interface messages
197
SizeofIfMsghdr = C.sizeof_struct_if_msghdr
198
SizeofIfData = C.sizeof_struct_if_data
199
SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
200
SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr
201
SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
202
SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
203
SizeofRtMetrics = C.sizeof_struct_rt_metrics
206
type IfMsghdr C.struct_if_msghdr
208
type IfData C.struct_if_data
210
type IfaMsghdr C.struct_ifa_msghdr
212
type IfmaMsghdr C.struct_ifma_msghdr
214
type IfAnnounceMsghdr C.struct_if_announcemsghdr
216
type RtMsghdr C.struct_rt_msghdr
218
type RtMetrics C.struct_rt_metrics
220
// Berkeley packet filter
223
SizeofBpfVersion = C.sizeof_struct_bpf_version
224
SizeofBpfStat = C.sizeof_struct_bpf_stat
225
SizeofBpfProgram = C.sizeof_struct_bpf_program
226
SizeofBpfInsn = C.sizeof_struct_bpf_insn
227
SizeofBpfHdr = C.sizeof_struct_bpf_hdr
230
type BpfVersion C.struct_bpf_version
232
type BpfStat C.struct_bpf_stat
234
type BpfProgram C.struct_bpf_program
236
type BpfInsn C.struct_bpf_insn
238
type BpfHdr C.struct_bpf_hdr
242
type Termios C.struct_termios