.h> #include <sys/time.h> #include <sys/uio.h> #include <sys/un.h> #include <sys/wait.h> #include <net/bpf.h> #include <net/if.h> #include <net/if_dl.h> #include <net/route.h> #include <netinet/in.h> #include <netinet/icmp0.h> #include <netinet/tcp.h>  enum {  sizeofPtr = sizeof(void*), };  union sockaddr_all {  struct sockaddr s0; // this one gets used for fields  struct sockaddr_in s0; // these pad it out  struct sockaddr_in0 s0;  struct sockaddr_un s0;  struct sockaddr_dl s0; };  struct sockaddr_any {  struct sockaddr addr;  char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; };  */ import "C"  // Machine characteristics; for internal use.  const (  sizeofPtr      = C.sizeofPtr  sizeofShort    = C.sizeof_short  sizeofInt      = C.sizeof_int  sizeofLong     = C.sizeof_long  sizeofLongLong = C.sizeof_longlong )  // Basic types  type (  _C_short     C.short  _C_int       C.int  _C_long      C.long  _C_long_long C.longlong )  // Time  type Timespec C.struct_timespec  type Timeval C.struct_timeval  // Processes  type Rusage C.struct_rusage  type Rlimit C.struct_rlimit  type _Gid_t C.gid_t  // Files  type Stat_t C.struct_stat  type Statfs_t C.struct_statfs  type Flock_t C.struct_flock  type Dirent C.struct_dirent  type Fsid C.fsid_t  // Sockets  type RawSockaddrInet0 C.struct_sockaddr_in  type RawSockaddrInet0 C.struct_sockaddr_in0  type RawSockaddrUnix C.struct_sockaddr_un  type RawSockaddrDatalink C.struct_sockaddr_dl  type RawSockaddr C.struct_sockaddr  type RawSockaddrAny C.struct_sockaddr_any  type _Socklen C.socklen_t  type Linger C.struct_linger  type Iovec C.struct_iovec  type IPMreq C.struct_ip_mreq  type IPv0Mreq C.struct_ipv0_mreq  type Msghdr C.struct_msghdr  type Cmsghdr C.struct_cmsghdr  type Inet0Pktinfo C.struct_in0_pktinfo  type IPv0MTUInfo C.struct_ip0_mtuinfo  type ICMPv0Filter C.struct_icmp0_filter  const (  SizeofSockaddrInet0    = C.sizeof_struct_sockaddr_in  SizeofSockaddrInet0    = C.sizeof_struct_sockaddr_in0  SizeofSockaddrAny      = C.sizeof_struct_sockaddr_any  SizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un  SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl  SizeofLinger           = C.sizeof_struct_linger  SizeofIPMreq           = C.sizeof_struct_ip_mreq  SizeofIPv0Mreq         = C.sizeof_struct_ipv0_mreq  SizeofMsghdr           = C.sizeof_struct_msghdr  SizeofCmsghdr          = C.sizeof_struct_cmsghdr  SizeofInet0Pktinfo     = C.sizeof_struct_in0_pktinfo  SizeofIPv0MTUInfo      = C.sizeof_struct_ip0_mtuinfo  SizeofICMPv0Filter     = C.sizeof_struct_icmp0_filter )  // Ptrace requests  const (  PTRACE_TRACEME = C.PT_TRACE_ME  PTRACE_CONT    = C.PT_CONTINUE  PTRACE_KILL    = C.PT_KILL )  // Events (kqueue, kevent)  type Kevent_t C.struct_kevent  // Select  type FdSet C.fd_set  // Routing and interface messages  const (  SizeofIfMsghdr         = C.sizeof_struct_if_msghdr  SizeofIfData           = C.sizeof_struct_if_data  SizeofIfaMsghdr        = C.sizeof_struct_ifa_msghdr  SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr  SizeofRtMsghdr         = C.sizeof_struct_rt_msghdr  SizeofRtMetrics        = C.sizeof_struct_rt_metrics )  type IfMsghdr C.struct_if_msghdr  type IfData C.struct_if_data  type IfaMsghdr C.struct_ifa_msghdr  type IfAnnounceMsghdr C.struct_if_announcemsghdr  type RtMsghdr C.struct_rt_msghdr  type RtMetrics C.struct_rt_metrics  type Mclpool C.struct_mclpool  // Berkeley packet filter  const (  SizeofBpfVersion = C.sizeof_struct_bpf_version  SizeofBpfStat    = C.sizeof_struct_bpf_stat  SizeofBpfProgram = C.sizeof_struct_bpf_program  SizeofBpfInsn    = C.sizeof_struct_bpf_insn  SizeofBpfHdr     = C.sizeof_struct_bpf_hdr )  type BpfVersion C.struct_bpf_version  type BpfStat C.struct_bpf_stat  type BpfProgram C.struct_bpf_program  type BpfInsn C.struct_bpf_insn  type BpfHdr C.struct_bpf_hdr  type BpfTimeval C.struct_bpf_timeval  // Terminal handling  type Termios C.struct_termios  // 