Yuval Pavel Zholkover | 47bdb83 | 2017-08-08 13:31:41 +0300 | [diff] [blame] | 1 | // cgo -godefs -- -fsigned-char types_freebsd.go | go run mkpost.go |
| 2 | // Code generated by the command above; see README.md. DO NOT EDIT. |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 3 | |
Russ Cox | 9a76102 | 2021-02-19 22:57:36 -0500 | [diff] [blame] | 4 | //go:build arm && freebsd |
Shenghou Ma | 379497e | 2015-05-16 21:52:17 -0400 | [diff] [blame] | 5 | // +build arm,freebsd |
| 6 | |
Rob Pike | 8442dd2 | 2014-08-11 15:58:26 -0700 | [diff] [blame] | 7 | package unix |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 8 | |
| 9 | const ( |
Tobias Klauser | 8469e31 | 2018-10-04 13:51:19 +0200 | [diff] [blame] | 10 | SizeofPtr = 0x4 |
| 11 | SizeofShort = 0x2 |
| 12 | SizeofInt = 0x4 |
| 13 | SizeofLong = 0x4 |
| 14 | SizeofLongLong = 0x8 |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 15 | ) |
| 16 | |
| 17 | type ( |
| 18 | _C_short int16 |
| 19 | _C_int int32 |
| 20 | _C_long int32 |
| 21 | _C_long_long int64 |
| 22 | ) |
| 23 | |
| 24 | type Timespec struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 25 | Sec int64 |
| 26 | Nsec int32 |
| 27 | _ [4]byte |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 28 | } |
| 29 | |
| 30 | type Timeval struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 31 | Sec int64 |
| 32 | Usec int32 |
| 33 | _ [4]byte |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 34 | } |
| 35 | |
jharshman | aa78b53 | 2021-09-07 12:41:54 -0600 | [diff] [blame] | 36 | type Time_t int32 |
| 37 | |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 38 | type Rusage struct { |
| 39 | Utime Timeval |
| 40 | Stime Timeval |
| 41 | Maxrss int32 |
| 42 | Ixrss int32 |
| 43 | Idrss int32 |
| 44 | Isrss int32 |
| 45 | Minflt int32 |
| 46 | Majflt int32 |
| 47 | Nswap int32 |
| 48 | Inblock int32 |
| 49 | Oublock int32 |
| 50 | Msgsnd int32 |
| 51 | Msgrcv int32 |
| 52 | Nsignals int32 |
| 53 | Nvcsw int32 |
| 54 | Nivcsw int32 |
| 55 | } |
| 56 | |
| 57 | type Rlimit struct { |
| 58 | Cur int64 |
| 59 | Max int64 |
| 60 | } |
| 61 | |
| 62 | type _Gid_t uint32 |
| 63 | |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 64 | const ( |
| 65 | _statfsVersion = 0x20140518 |
| 66 | _dirblksiz = 0x400 |
| 67 | ) |
| 68 | |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 69 | type Stat_t struct { |
Yuval Pavel Zholkover | 87c8727 | 2019-05-15 09:04:31 +0300 | [diff] [blame] | 70 | Dev uint64 |
| 71 | Ino uint64 |
| 72 | Nlink uint64 |
| 73 | Mode uint16 |
| 74 | _0 int16 |
| 75 | Uid uint32 |
| 76 | Gid uint32 |
| 77 | _1 int32 |
| 78 | Rdev uint64 |
| 79 | Atim Timespec |
| 80 | Mtim Timespec |
| 81 | Ctim Timespec |
| 82 | Btim Timespec |
| 83 | Size int64 |
| 84 | Blocks int64 |
| 85 | Blksize int32 |
| 86 | Flags uint32 |
| 87 | Gen uint64 |
| 88 | Spare [10]uint64 |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | type stat_freebsd11_t struct { |
Yuval Pavel Zholkover | 87c8727 | 2019-05-15 09:04:31 +0300 | [diff] [blame] | 92 | Dev uint32 |
| 93 | Ino uint32 |
| 94 | Mode uint16 |
| 95 | Nlink uint16 |
| 96 | Uid uint32 |
| 97 | Gid uint32 |
| 98 | Rdev uint32 |
| 99 | Atim Timespec |
| 100 | Mtim Timespec |
| 101 | Ctim Timespec |
| 102 | Size int64 |
| 103 | Blocks int64 |
| 104 | Blksize int32 |
| 105 | Flags uint32 |
| 106 | Gen uint32 |
| 107 | Lspare int32 |
| 108 | Btim Timespec |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | type Statfs_t struct { |
| 112 | Version uint32 |
| 113 | Type uint32 |
| 114 | Flags uint64 |
| 115 | Bsize uint64 |
| 116 | Iosize uint64 |
| 117 | Blocks uint64 |
| 118 | Bfree uint64 |
| 119 | Bavail int64 |
| 120 | Files uint64 |
| 121 | Ffree int64 |
| 122 | Syncwrites uint64 |
| 123 | Asyncwrites uint64 |
| 124 | Syncreads uint64 |
| 125 | Asyncreads uint64 |
| 126 | Spare [10]uint64 |
| 127 | Namemax uint32 |
| 128 | Owner uint32 |
| 129 | Fsid Fsid |
| 130 | Charspare [80]int8 |
Tobias Klauser | 4b0db7f | 2020-06-22 17:59:10 +0200 | [diff] [blame] | 131 | Fstypename [16]byte |
| 132 | Mntfromname [1024]byte |
| 133 | Mntonname [1024]byte |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | type statfs_freebsd11_t struct { |
| 137 | Version uint32 |
| 138 | Type uint32 |
| 139 | Flags uint64 |
| 140 | Bsize uint64 |
| 141 | Iosize uint64 |
| 142 | Blocks uint64 |
| 143 | Bfree uint64 |
| 144 | Bavail int64 |
| 145 | Files uint64 |
| 146 | Ffree int64 |
| 147 | Syncwrites uint64 |
| 148 | Asyncwrites uint64 |
| 149 | Syncreads uint64 |
| 150 | Asyncreads uint64 |
| 151 | Spare [10]uint64 |
| 152 | Namemax uint32 |
| 153 | Owner uint32 |
| 154 | Fsid Fsid |
| 155 | Charspare [80]int8 |
Tobias Klauser | ed371f2 | 2020-06-22 23:07:51 +0200 | [diff] [blame] | 156 | Fstypename [16]byte |
| 157 | Mntfromname [88]byte |
| 158 | Mntonname [88]byte |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | type Flock_t struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 162 | Start int64 |
| 163 | Len int64 |
| 164 | Pid int32 |
| 165 | Type int16 |
| 166 | Whence int16 |
| 167 | Sysid int32 |
| 168 | _ [4]byte |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 169 | } |
| 170 | |
| 171 | type Dirent struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 172 | Fileno uint64 |
| 173 | Off int64 |
| 174 | Reclen uint16 |
| 175 | Type uint8 |
| 176 | Pad0 uint8 |
| 177 | Namlen uint16 |
| 178 | Pad1 uint16 |
| 179 | Name [256]int8 |
| 180 | } |
| 181 | |
| 182 | type dirent_freebsd11 struct { |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 183 | Fileno uint32 |
| 184 | Reclen uint16 |
| 185 | Type uint8 |
| 186 | Namlen uint8 |
| 187 | Name [256]int8 |
| 188 | } |
| 189 | |
| 190 | type Fsid struct { |
| 191 | Val [2]int32 |
| 192 | } |
| 193 | |
Yuval Pavel Zholkover | 47bdb83 | 2017-08-08 13:31:41 +0300 | [diff] [blame] | 194 | const ( |
Tobias Klauser | 1d2aa6d | 2017-12-13 12:26:59 +0100 | [diff] [blame] | 195 | PathMax = 0x400 |
| 196 | ) |
| 197 | |
| 198 | const ( |
Yuval Pavel Zholkover | 47bdb83 | 2017-08-08 13:31:41 +0300 | [diff] [blame] | 199 | FADV_NORMAL = 0x0 |
| 200 | FADV_RANDOM = 0x1 |
| 201 | FADV_SEQUENTIAL = 0x2 |
| 202 | FADV_WILLNEED = 0x3 |
| 203 | FADV_DONTNEED = 0x4 |
| 204 | FADV_NOREUSE = 0x5 |
| 205 | ) |
| 206 | |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 207 | type RawSockaddrInet4 struct { |
| 208 | Len uint8 |
| 209 | Family uint8 |
| 210 | Port uint16 |
| 211 | Addr [4]byte /* in_addr */ |
| 212 | Zero [8]int8 |
| 213 | } |
| 214 | |
| 215 | type RawSockaddrInet6 struct { |
| 216 | Len uint8 |
| 217 | Family uint8 |
| 218 | Port uint16 |
| 219 | Flowinfo uint32 |
| 220 | Addr [16]byte /* in6_addr */ |
| 221 | Scope_id uint32 |
| 222 | } |
| 223 | |
| 224 | type RawSockaddrUnix struct { |
| 225 | Len uint8 |
| 226 | Family uint8 |
| 227 | Path [104]int8 |
| 228 | } |
| 229 | |
| 230 | type RawSockaddrDatalink struct { |
| 231 | Len uint8 |
| 232 | Family uint8 |
| 233 | Index uint16 |
| 234 | Type uint8 |
| 235 | Nlen uint8 |
| 236 | Alen uint8 |
| 237 | Slen uint8 |
| 238 | Data [46]int8 |
| 239 | } |
| 240 | |
| 241 | type RawSockaddr struct { |
| 242 | Len uint8 |
| 243 | Family uint8 |
| 244 | Data [14]int8 |
| 245 | } |
| 246 | |
| 247 | type RawSockaddrAny struct { |
| 248 | Addr RawSockaddr |
| 249 | Pad [92]int8 |
| 250 | } |
| 251 | |
| 252 | type _Socklen uint32 |
| 253 | |
Tobias Klauser | 7937bea | 2021-02-23 09:50:22 +0100 | [diff] [blame] | 254 | type Xucred struct { |
| 255 | Version uint32 |
| 256 | Uid uint32 |
| 257 | Ngroups int16 |
| 258 | Groups [16]uint32 |
| 259 | _ *byte |
| 260 | } |
| 261 | |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 262 | type Linger struct { |
| 263 | Onoff int32 |
| 264 | Linger int32 |
| 265 | } |
| 266 | |
| 267 | type Iovec struct { |
| 268 | Base *byte |
| 269 | Len uint32 |
| 270 | } |
| 271 | |
| 272 | type IPMreq struct { |
| 273 | Multiaddr [4]byte /* in_addr */ |
| 274 | Interface [4]byte /* in_addr */ |
| 275 | } |
| 276 | |
| 277 | type IPMreqn struct { |
| 278 | Multiaddr [4]byte /* in_addr */ |
| 279 | Address [4]byte /* in_addr */ |
| 280 | Ifindex int32 |
| 281 | } |
| 282 | |
| 283 | type IPv6Mreq struct { |
| 284 | Multiaddr [16]byte /* in6_addr */ |
| 285 | Interface uint32 |
| 286 | } |
| 287 | |
| 288 | type Msghdr struct { |
| 289 | Name *byte |
| 290 | Namelen uint32 |
| 291 | Iov *Iovec |
| 292 | Iovlen int32 |
| 293 | Control *byte |
| 294 | Controllen uint32 |
| 295 | Flags int32 |
| 296 | } |
| 297 | |
| 298 | type Cmsghdr struct { |
| 299 | Len uint32 |
| 300 | Level int32 |
| 301 | Type int32 |
| 302 | } |
| 303 | |
| 304 | type Inet6Pktinfo struct { |
| 305 | Addr [16]byte /* in6_addr */ |
| 306 | Ifindex uint32 |
| 307 | } |
| 308 | |
| 309 | type IPv6MTUInfo struct { |
| 310 | Addr RawSockaddrInet6 |
| 311 | Mtu uint32 |
| 312 | } |
| 313 | |
| 314 | type ICMPv6Filter struct { |
| 315 | Filt [8]uint32 |
| 316 | } |
| 317 | |
| 318 | const ( |
| 319 | SizeofSockaddrInet4 = 0x10 |
| 320 | SizeofSockaddrInet6 = 0x1c |
| 321 | SizeofSockaddrAny = 0x6c |
| 322 | SizeofSockaddrUnix = 0x6a |
| 323 | SizeofSockaddrDatalink = 0x36 |
Tobias Klauser | 7937bea | 2021-02-23 09:50:22 +0100 | [diff] [blame] | 324 | SizeofXucred = 0x50 |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 325 | SizeofLinger = 0x8 |
Tobias Klauser | 7d0127a | 2020-12-18 00:58:35 +0100 | [diff] [blame] | 326 | SizeofIovec = 0x8 |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 327 | SizeofIPMreq = 0x8 |
| 328 | SizeofIPMreqn = 0xc |
| 329 | SizeofIPv6Mreq = 0x14 |
| 330 | SizeofMsghdr = 0x1c |
| 331 | SizeofCmsghdr = 0xc |
| 332 | SizeofInet6Pktinfo = 0x14 |
| 333 | SizeofIPv6MTUInfo = 0x20 |
| 334 | SizeofICMPv6Filter = 0x20 |
| 335 | ) |
| 336 | |
| 337 | const ( |
rayrapetyan | bf70e46 | 2019-06-21 04:51:29 +0000 | [diff] [blame] | 338 | PTRACE_ATTACH = 0xa |
| 339 | PTRACE_CONT = 0x7 |
| 340 | PTRACE_DETACH = 0xb |
| 341 | PTRACE_GETFPREGS = 0x23 |
| 342 | PTRACE_GETFSBASE = 0x47 |
| 343 | PTRACE_GETLWPLIST = 0xf |
| 344 | PTRACE_GETNUMLWPS = 0xe |
| 345 | PTRACE_GETREGS = 0x21 |
| 346 | PTRACE_GETXSTATE = 0x45 |
| 347 | PTRACE_IO = 0xc |
| 348 | PTRACE_KILL = 0x8 |
| 349 | PTRACE_LWPEVENTS = 0x18 |
| 350 | PTRACE_LWPINFO = 0xd |
| 351 | PTRACE_SETFPREGS = 0x24 |
| 352 | PTRACE_SETREGS = 0x22 |
| 353 | PTRACE_SINGLESTEP = 0x9 |
| 354 | PTRACE_TRACEME = 0x0 |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 355 | ) |
| 356 | |
rayrapetyan | bf70e46 | 2019-06-21 04:51:29 +0000 | [diff] [blame] | 357 | const ( |
| 358 | PIOD_READ_D = 0x1 |
| 359 | PIOD_WRITE_D = 0x2 |
| 360 | PIOD_READ_I = 0x3 |
| 361 | PIOD_WRITE_I = 0x4 |
| 362 | ) |
| 363 | |
| 364 | const ( |
| 365 | PL_FLAG_BORN = 0x100 |
| 366 | PL_FLAG_EXITED = 0x200 |
| 367 | PL_FLAG_SI = 0x20 |
| 368 | ) |
| 369 | |
| 370 | const ( |
| 371 | TRAP_BRKPT = 0x1 |
| 372 | TRAP_TRACE = 0x2 |
| 373 | ) |
| 374 | |
| 375 | type PtraceLwpInfoStruct struct { |
| 376 | Lwpid int32 |
| 377 | Event int32 |
| 378 | Flags int32 |
| 379 | Sigmask Sigset_t |
| 380 | Siglist Sigset_t |
| 381 | Siginfo __Siginfo |
| 382 | Tdname [20]int8 |
| 383 | Child_pid int32 |
| 384 | Syscall_code uint32 |
| 385 | Syscall_narg uint32 |
| 386 | } |
| 387 | |
| 388 | type __Siginfo struct { |
| 389 | Signo int32 |
| 390 | Errno int32 |
| 391 | Code int32 |
| 392 | Pid int32 |
| 393 | Uid uint32 |
| 394 | Status int32 |
| 395 | Addr *byte |
| 396 | Value [4]byte |
| 397 | X_reason [32]byte |
| 398 | } |
| 399 | |
| 400 | type Sigset_t struct { |
| 401 | Val [4]uint32 |
| 402 | } |
| 403 | |
| 404 | type Reg struct { |
| 405 | R [13]uint32 |
| 406 | R_sp uint32 |
| 407 | R_lr uint32 |
| 408 | R_pc uint32 |
| 409 | R_cpsr uint32 |
| 410 | } |
| 411 | |
| 412 | type FpReg struct { |
| 413 | Fpr_fpsr uint32 |
| 414 | Fpr [8][3]uint32 |
| 415 | } |
| 416 | |
| 417 | type PtraceIoDesc struct { |
| 418 | Op int32 |
| 419 | Offs *byte |
| 420 | Addr *byte |
Tobias Klauser | 34d2753 | 2020-01-20 16:40:54 +0100 | [diff] [blame] | 421 | Len uint32 |
rayrapetyan | bf70e46 | 2019-06-21 04:51:29 +0000 | [diff] [blame] | 422 | } |
| 423 | |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 424 | type Kevent_t struct { |
| 425 | Ident uint32 |
| 426 | Filter int16 |
| 427 | Flags uint16 |
| 428 | Fflags uint32 |
| 429 | Data int32 |
| 430 | Udata *byte |
| 431 | } |
| 432 | |
| 433 | type FdSet struct { |
Tobias Klauser | 5ac8a44 | 2018-11-16 09:11:09 +0000 | [diff] [blame] | 434 | Bits [32]uint32 |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 435 | } |
| 436 | |
| 437 | const ( |
Yuval Pavel Zholkover | 47bdb83 | 2017-08-08 13:31:41 +0300 | [diff] [blame] | 438 | sizeofIfMsghdr = 0xa8 |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 439 | SizeofIfMsghdr = 0x70 |
Yuval Pavel Zholkover | 47bdb83 | 2017-08-08 13:31:41 +0300 | [diff] [blame] | 440 | sizeofIfData = 0x98 |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 441 | SizeofIfData = 0x60 |
| 442 | SizeofIfaMsghdr = 0x14 |
| 443 | SizeofIfmaMsghdr = 0x10 |
| 444 | SizeofIfAnnounceMsghdr = 0x18 |
| 445 | SizeofRtMsghdr = 0x5c |
| 446 | SizeofRtMetrics = 0x38 |
| 447 | ) |
| 448 | |
| 449 | type ifMsghdr struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 450 | Msglen uint16 |
| 451 | Version uint8 |
| 452 | Type uint8 |
| 453 | Addrs int32 |
| 454 | Flags int32 |
| 455 | Index uint16 |
| 456 | _ [2]byte |
| 457 | Data ifData |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 458 | } |
| 459 | |
| 460 | type IfMsghdr struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 461 | Msglen uint16 |
| 462 | Version uint8 |
| 463 | Type uint8 |
| 464 | Addrs int32 |
| 465 | Flags int32 |
| 466 | Index uint16 |
| 467 | _ [2]byte |
| 468 | Data IfData |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 469 | } |
| 470 | |
| 471 | type ifData struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 472 | Type uint8 |
| 473 | Physical uint8 |
| 474 | Addrlen uint8 |
| 475 | Hdrlen uint8 |
| 476 | Link_state uint8 |
| 477 | Vhid uint8 |
| 478 | Datalen uint16 |
| 479 | Mtu uint32 |
| 480 | Metric uint32 |
| 481 | Baudrate uint64 |
| 482 | Ipackets uint64 |
| 483 | Ierrors uint64 |
| 484 | Opackets uint64 |
| 485 | Oerrors uint64 |
| 486 | Collisions uint64 |
| 487 | Ibytes uint64 |
| 488 | Obytes uint64 |
| 489 | Imcasts uint64 |
| 490 | Omcasts uint64 |
| 491 | Iqdrops uint64 |
| 492 | Oqdrops uint64 |
| 493 | Noproto uint64 |
| 494 | Hwassist uint64 |
| 495 | _ [8]byte |
| 496 | _ [16]byte |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 497 | } |
| 498 | |
| 499 | type IfData struct { |
| 500 | Type uint8 |
| 501 | Physical uint8 |
| 502 | Addrlen uint8 |
| 503 | Hdrlen uint8 |
| 504 | Link_state uint8 |
| 505 | Spare_char1 uint8 |
| 506 | Spare_char2 uint8 |
| 507 | Datalen uint8 |
| 508 | Mtu uint32 |
| 509 | Metric uint32 |
| 510 | Baudrate uint32 |
| 511 | Ipackets uint32 |
| 512 | Ierrors uint32 |
| 513 | Opackets uint32 |
| 514 | Oerrors uint32 |
| 515 | Collisions uint32 |
| 516 | Ibytes uint32 |
| 517 | Obytes uint32 |
| 518 | Imcasts uint32 |
| 519 | Omcasts uint32 |
| 520 | Iqdrops uint32 |
| 521 | Noproto uint32 |
| 522 | Hwassist uint32 |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 523 | _ [4]byte |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 524 | Epoch int64 |
| 525 | Lastchange Timeval |
| 526 | } |
| 527 | |
| 528 | type IfaMsghdr struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 529 | Msglen uint16 |
| 530 | Version uint8 |
| 531 | Type uint8 |
| 532 | Addrs int32 |
| 533 | Flags int32 |
| 534 | Index uint16 |
| 535 | _ [2]byte |
| 536 | Metric int32 |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 537 | } |
| 538 | |
| 539 | type IfmaMsghdr struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 540 | Msglen uint16 |
| 541 | Version uint8 |
| 542 | Type uint8 |
| 543 | Addrs int32 |
| 544 | Flags int32 |
| 545 | Index uint16 |
| 546 | _ [2]byte |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 547 | } |
| 548 | |
| 549 | type IfAnnounceMsghdr struct { |
| 550 | Msglen uint16 |
| 551 | Version uint8 |
| 552 | Type uint8 |
| 553 | Index uint16 |
| 554 | Name [16]int8 |
| 555 | What uint16 |
| 556 | } |
| 557 | |
| 558 | type RtMsghdr struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 559 | Msglen uint16 |
| 560 | Version uint8 |
| 561 | Type uint8 |
| 562 | Index uint16 |
| 563 | _ [2]byte |
| 564 | Flags int32 |
| 565 | Addrs int32 |
| 566 | Pid int32 |
| 567 | Seq int32 |
| 568 | Errno int32 |
| 569 | Fmask int32 |
| 570 | Inits uint32 |
| 571 | Rmx RtMetrics |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 572 | } |
| 573 | |
| 574 | type RtMetrics struct { |
| 575 | Locks uint32 |
| 576 | Mtu uint32 |
| 577 | Hopcount uint32 |
| 578 | Expire uint32 |
| 579 | Recvpipe uint32 |
| 580 | Sendpipe uint32 |
| 581 | Ssthresh uint32 |
| 582 | Rtt uint32 |
| 583 | Rttvar uint32 |
| 584 | Pksent uint32 |
| 585 | Weight uint32 |
| 586 | Filler [3]uint32 |
| 587 | } |
| 588 | |
| 589 | const ( |
| 590 | SizeofBpfVersion = 0x4 |
| 591 | SizeofBpfStat = 0x8 |
| 592 | SizeofBpfZbuf = 0xc |
| 593 | SizeofBpfProgram = 0x8 |
| 594 | SizeofBpfInsn = 0x8 |
| 595 | SizeofBpfHdr = 0x20 |
| 596 | SizeofBpfZbufHeader = 0x20 |
| 597 | ) |
| 598 | |
| 599 | type BpfVersion struct { |
| 600 | Major uint16 |
| 601 | Minor uint16 |
| 602 | } |
| 603 | |
| 604 | type BpfStat struct { |
| 605 | Recv uint32 |
| 606 | Drop uint32 |
| 607 | } |
| 608 | |
| 609 | type BpfZbuf struct { |
| 610 | Bufa *byte |
| 611 | Bufb *byte |
| 612 | Buflen uint32 |
| 613 | } |
| 614 | |
| 615 | type BpfProgram struct { |
| 616 | Len uint32 |
| 617 | Insns *BpfInsn |
| 618 | } |
| 619 | |
| 620 | type BpfInsn struct { |
| 621 | Code uint16 |
| 622 | Jt uint8 |
| 623 | Jf uint8 |
| 624 | K uint32 |
| 625 | } |
| 626 | |
| 627 | type BpfHdr struct { |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 628 | Tstamp Timeval |
| 629 | Caplen uint32 |
| 630 | Datalen uint32 |
| 631 | Hdrlen uint16 |
| 632 | _ [6]byte |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 633 | } |
| 634 | |
| 635 | type BpfZbufHeader struct { |
| 636 | Kernel_gen uint32 |
| 637 | Kernel_len uint32 |
| 638 | User_gen uint32 |
Yuval Pavel Zholkover | 5535b4e | 2018-09-23 09:28:39 +0000 | [diff] [blame] | 639 | _ [5]uint32 |
Rob Pike | 20acc5c | 2014-08-11 14:48:46 -0700 | [diff] [blame] | 640 | } |
| 641 | |
| 642 | type Termios struct { |
| 643 | Iflag uint32 |
| 644 | Oflag uint32 |
| 645 | Cflag uint32 |
| 646 | Lflag uint32 |
| 647 | Cc [20]uint8 |
| 648 | Ispeed uint32 |
| 649 | Ospeed uint32 |
| 650 | } |
Tobias Klauser | e312636 | 2017-08-02 12:44:58 +0000 | [diff] [blame] | 651 | |
| 652 | type Winsize struct { |
| 653 | Row uint16 |
| 654 | Col uint16 |
| 655 | Xpixel uint16 |
| 656 | Ypixel uint16 |
| 657 | } |
Yuval Pavel Zholkover | 47bdb83 | 2017-08-08 13:31:41 +0300 | [diff] [blame] | 658 | |
| 659 | const ( |
| 660 | AT_FDCWD = -0x64 |
Tobias Klauser | 1a9c977 | 2021-06-09 18:25:33 +0200 | [diff] [blame] | 661 | AT_EACCESS = 0x100 |
Yuval Pavel Zholkover | 47bdb83 | 2017-08-08 13:31:41 +0300 | [diff] [blame] | 662 | AT_SYMLINK_NOFOLLOW = 0x200 |
Tobias Klauser | 1a9c977 | 2021-06-09 18:25:33 +0200 | [diff] [blame] | 663 | AT_SYMLINK_FOLLOW = 0x400 |
| 664 | AT_REMOVEDIR = 0x800 |
Yuval Pavel Zholkover | 47bdb83 | 2017-08-08 13:31:41 +0300 | [diff] [blame] | 665 | ) |
| 666 | |
Tobias Klauser | 92ac112 | 2017-10-25 14:15:45 +0000 | [diff] [blame] | 667 | type PollFd struct { |
| 668 | Fd int32 |
| 669 | Events int16 |
| 670 | Revents int16 |
| 671 | } |
| 672 | |
| 673 | const ( |
| 674 | POLLERR = 0x8 |
| 675 | POLLHUP = 0x10 |
| 676 | POLLIN = 0x1 |
| 677 | POLLINIGNEOF = 0x2000 |
| 678 | POLLNVAL = 0x20 |
| 679 | POLLOUT = 0x4 |
| 680 | POLLPRI = 0x2 |
| 681 | POLLRDBAND = 0x80 |
| 682 | POLLRDNORM = 0x40 |
| 683 | POLLWRBAND = 0x100 |
| 684 | POLLWRNORM = 0x4 |
| 685 | ) |
| 686 | |
Yuval Pavel Zholkover | 47bdb83 | 2017-08-08 13:31:41 +0300 | [diff] [blame] | 687 | type CapRights struct { |
| 688 | Rights [2]uint64 |
| 689 | } |
Tobias Klauser | 096928d | 2017-11-27 08:53:11 +0000 | [diff] [blame] | 690 | |
| 691 | type Utsname struct { |
| 692 | Sysname [256]byte |
| 693 | Nodename [256]byte |
| 694 | Release [256]byte |
| 695 | Version [256]byte |
| 696 | Machine [256]byte |
| 697 | } |
Tobias Klauser | 548cf77 | 2020-01-07 15:19:56 +0100 | [diff] [blame] | 698 | |
| 699 | const SizeofClockinfo = 0x14 |
| 700 | |
| 701 | type Clockinfo struct { |
| 702 | Hz int32 |
| 703 | Tick int32 |
| 704 | Spare int32 |
| 705 | Stathz int32 |
| 706 | Profhz int32 |
| 707 | } |