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 README.md
11 // +godefs map struct_in_addr [4]byte /* in_addr */
12 // +godefs map struct_in6_addr [16]byte /* in6_addr */
24 #include <sys/param.h>
25 #include <sys/types.h>
26 #include <sys/event.h>
28 #include <sys/mount.h>
29 #include <sys/ptrace.h>
30 #include <sys/resource.h>
31 #include <sys/select.h>
32 #include <sys/signal.h>
33 #include <sys/socket.h>
35 #include <sys/sysctl.h>
42 #include <net/if_dl.h>
43 #include <net/route.h>
44 #include <netinet/in.h>
45 #include <netinet/icmp6.h>
46 #include <netinet/tcp.h>
49 sizeofPtr = sizeof(void*),
53 struct sockaddr s1; // this one gets used for fields
54 struct sockaddr_in s2; // these pad it out
55 struct sockaddr_in6 s3;
56 struct sockaddr_un s4;
57 struct sockaddr_dl s5;
62 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
68 // Machine characteristics; for internal use.
71 sizeofPtr = C.sizeofPtr
72 sizeofShort = C.sizeof_short
73 sizeofInt = C.sizeof_int
74 sizeofLong = C.sizeof_long
75 sizeofLongLong = C.sizeof_longlong
84 _C_long_long C.longlong
89 type Timespec C.struct_timespec
91 type Timeval C.struct_timeval
95 type Rusage C.struct_rusage
97 type Rlimit C.struct_rlimit
103 type Stat_t C.struct_stat
105 type Statfs_t C.struct_statfs
107 type Flock_t C.struct_flock
109 type Dirent C.struct_dirent
115 type RawSockaddrInet4 C.struct_sockaddr_in
117 type RawSockaddrInet6 C.struct_sockaddr_in6
119 type RawSockaddrUnix C.struct_sockaddr_un
121 type RawSockaddrDatalink C.struct_sockaddr_dl
123 type RawSockaddr C.struct_sockaddr
125 type RawSockaddrAny C.struct_sockaddr_any
127 type _Socklen C.socklen_t
129 type Linger C.struct_linger
131 type Iovec C.struct_iovec
133 type IPMreq C.struct_ip_mreq
135 type IPv6Mreq C.struct_ipv6_mreq
137 type Msghdr C.struct_msghdr
139 type Cmsghdr C.struct_cmsghdr
141 type Inet6Pktinfo C.struct_in6_pktinfo
143 type IPv6MTUInfo C.struct_ip6_mtuinfo
145 type ICMPv6Filter C.struct_icmp6_filter
148 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
149 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
150 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
151 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
152 SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
153 SizeofLinger = C.sizeof_struct_linger
154 SizeofIPMreq = C.sizeof_struct_ip_mreq
155 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
156 SizeofMsghdr = C.sizeof_struct_msghdr
157 SizeofCmsghdr = C.sizeof_struct_cmsghdr
158 SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
159 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
160 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
166 PTRACE_TRACEME = C.PT_TRACE_ME
167 PTRACE_CONT = C.PT_CONTINUE
168 PTRACE_KILL = C.PT_KILL
171 // Events (kqueue, kevent)
173 type Kevent_t C.struct_kevent
179 // Routing and interface messages
182 SizeofIfMsghdr = C.sizeof_struct_if_msghdr
183 SizeofIfData = C.sizeof_struct_if_data
184 SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
185 SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
186 SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
187 SizeofRtMetrics = C.sizeof_struct_rt_metrics
190 type IfMsghdr C.struct_if_msghdr
192 type IfData C.struct_if_data
194 type IfaMsghdr C.struct_ifa_msghdr
196 type IfAnnounceMsghdr C.struct_if_announcemsghdr
198 type RtMsghdr C.struct_rt_msghdr
200 type RtMetrics C.struct_rt_metrics
202 type Mclpool C.struct_mclpool
204 // Berkeley packet filter
207 SizeofBpfVersion = C.sizeof_struct_bpf_version
208 SizeofBpfStat = C.sizeof_struct_bpf_stat
209 SizeofBpfProgram = C.sizeof_struct_bpf_program
210 SizeofBpfInsn = C.sizeof_struct_bpf_insn
211 SizeofBpfHdr = C.sizeof_struct_bpf_hdr
214 type BpfVersion C.struct_bpf_version
216 type BpfStat C.struct_bpf_stat
218 type BpfProgram C.struct_bpf_program
220 type BpfInsn C.struct_bpf_insn
222 type BpfHdr C.struct_bpf_hdr
224 type BpfTimeval C.struct_bpf_timeval
228 type Termios C.struct_termios
230 // fchmodat-like syscalls.
233 AT_FDCWD = C.AT_FDCWD
234 AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
239 type Sysctlnode C.struct_sysctlnode