| 1 |
|
| 2 |
|
| 3 |
package linux |
| 4 |
|
| 5 |
import ( |
| 6 |
"inet.af/netstack/gohacks" |
| 7 |
"inet.af/netstack/hostarch" |
| 8 |
"inet.af/netstack/marshal" |
| 9 |
"io" |
| 10 |
"reflect" |
| 11 |
"runtime" |
| 12 |
"unsafe" |
| 13 |
) |
| 14 |
|
| 15 |
|
| 16 |
var _ marshal.Marshallable = (*BPFInstruction)(nil) |
| 17 |
var _ marshal.Marshallable = (*CString)(nil) |
| 18 |
var _ marshal.Marshallable = (*CapUserData)(nil) |
| 19 |
var _ marshal.Marshallable = (*CapUserHeader)(nil) |
| 20 |
var _ marshal.Marshallable = (*ClockT)(nil) |
| 21 |
var _ marshal.Marshallable = (*ControlMessageCredentials)(nil) |
| 22 |
var _ marshal.Marshallable = (*ControlMessageHeader)(nil) |
| 23 |
var _ marshal.Marshallable = (*ControlMessageIPPacketInfo)(nil) |
| 24 |
var _ marshal.Marshallable = (*ControlMessageIPv6PacketInfo)(nil) |
| 25 |
var _ marshal.Marshallable = (*DigestMetadata)(nil) |
| 26 |
var _ marshal.Marshallable = (*ElfHeader64)(nil) |
| 27 |
var _ marshal.Marshallable = (*ElfProg64)(nil) |
| 28 |
var _ marshal.Marshallable = (*ElfSection64)(nil) |
| 29 |
var _ marshal.Marshallable = (*ErrorName)(nil) |
| 30 |
var _ marshal.Marshallable = (*ExtensionName)(nil) |
| 31 |
var _ marshal.Marshallable = (*FOwnerEx)(nil) |
| 32 |
var _ marshal.Marshallable = (*FUSEAttr)(nil) |
| 33 |
var _ marshal.Marshallable = (*FUSECreateIn)(nil) |
| 34 |
var _ marshal.Marshallable = (*FUSECreateMeta)(nil) |
| 35 |
var _ marshal.Marshallable = (*FUSEDirent)(nil) |
| 36 |
var _ marshal.Marshallable = (*FUSEDirentMeta)(nil) |
| 37 |
var _ marshal.Marshallable = (*FUSEDirents)(nil) |
| 38 |
var _ marshal.Marshallable = (*FUSEEmptyIn)(nil) |
| 39 |
var _ marshal.Marshallable = (*FUSEEntryOut)(nil) |
| 40 |
var _ marshal.Marshallable = (*FUSEGetAttrIn)(nil) |
| 41 |
var _ marshal.Marshallable = (*FUSEGetAttrOut)(nil) |
| 42 |
var _ marshal.Marshallable = (*FUSEHeaderIn)(nil) |
| 43 |
var _ marshal.Marshallable = (*FUSEHeaderOut)(nil) |
| 44 |
var _ marshal.Marshallable = (*FUSEInitIn)(nil) |
| 45 |
var _ marshal.Marshallable = (*FUSEInitOut)(nil) |
| 46 |
var _ marshal.Marshallable = (*FUSELookupIn)(nil) |
| 47 |
var _ marshal.Marshallable = (*FUSEMkdirIn)(nil) |
| 48 |
var _ marshal.Marshallable = (*FUSEMkdirMeta)(nil) |
| 49 |
var _ marshal.Marshallable = (*FUSEMknodIn)(nil) |
| 50 |
var _ marshal.Marshallable = (*FUSEMknodMeta)(nil) |
| 51 |
var _ marshal.Marshallable = (*FUSEOpID)(nil) |
| 52 |
var _ marshal.Marshallable = (*FUSEOpcode)(nil) |
| 53 |
var _ marshal.Marshallable = (*FUSEOpenIn)(nil) |
| 54 |
var _ marshal.Marshallable = (*FUSEOpenOut)(nil) |
| 55 |
var _ marshal.Marshallable = (*FUSEReadIn)(nil) |
| 56 |
var _ marshal.Marshallable = (*FUSEReleaseIn)(nil) |
| 57 |
var _ marshal.Marshallable = (*FUSERmDirIn)(nil) |
| 58 |
var _ marshal.Marshallable = (*FUSESetAttrIn)(nil) |
| 59 |
var _ marshal.Marshallable = (*FUSESymlinkIn)(nil) |
| 60 |
var _ marshal.Marshallable = (*FUSEUnlinkIn)(nil) |
| 61 |
var _ marshal.Marshallable = (*FUSEWriteIn)(nil) |
| 62 |
var _ marshal.Marshallable = (*FUSEWriteOut)(nil) |
| 63 |
var _ marshal.Marshallable = (*FileMode)(nil) |
| 64 |
var _ marshal.Marshallable = (*Flock)(nil) |
| 65 |
var _ marshal.Marshallable = (*IFConf)(nil) |
| 66 |
var _ marshal.Marshallable = (*IFReq)(nil) |
| 67 |
var _ marshal.Marshallable = (*IOCallback)(nil) |
| 68 |
var _ marshal.Marshallable = (*IOEvent)(nil) |
| 69 |
var _ marshal.Marshallable = (*IP6TEntry)(nil) |
| 70 |
var _ marshal.Marshallable = (*IP6TIP)(nil) |
| 71 |
var _ marshal.Marshallable = (*IP6TReplace)(nil) |
| 72 |
var _ marshal.Marshallable = (*IPCPerm)(nil) |
| 73 |
var _ marshal.Marshallable = (*IPTEntry)(nil) |
| 74 |
var _ marshal.Marshallable = (*IPTGetEntries)(nil) |
| 75 |
var _ marshal.Marshallable = (*IPTGetinfo)(nil) |
| 76 |
var _ marshal.Marshallable = (*IPTIP)(nil) |
| 77 |
var _ marshal.Marshallable = (*IPTOwnerInfo)(nil) |
| 78 |
var _ marshal.Marshallable = (*IPTReplace)(nil) |
| 79 |
var _ marshal.Marshallable = (*Inet6Addr)(nil) |
| 80 |
var _ marshal.Marshallable = (*Inet6MulticastRequest)(nil) |
| 81 |
var _ marshal.Marshallable = (*InetAddr)(nil) |
| 82 |
var _ marshal.Marshallable = (*InetMulticastRequest)(nil) |
| 83 |
var _ marshal.Marshallable = (*InetMulticastRequestWithNIC)(nil) |
| 84 |
var _ marshal.Marshallable = (*InterfaceAddrMessage)(nil) |
| 85 |
var _ marshal.Marshallable = (*InterfaceInfoMessage)(nil) |
| 86 |
var _ marshal.Marshallable = (*ItimerVal)(nil) |
| 87 |
var _ marshal.Marshallable = (*Itimerspec)(nil) |
| 88 |
var _ marshal.Marshallable = (*KernelIP6TEntry)(nil) |
| 89 |
var _ marshal.Marshallable = (*KernelIP6TGetEntries)(nil) |
| 90 |
var _ marshal.Marshallable = (*KernelIPTEntry)(nil) |
| 91 |
var _ marshal.Marshallable = (*KernelIPTGetEntries)(nil) |
| 92 |
var _ marshal.Marshallable = (*Linger)(nil) |
| 93 |
var _ marshal.Marshallable = (*MqAttr)(nil) |
| 94 |
var _ marshal.Marshallable = (*MsgBuf)(nil) |
| 95 |
var _ marshal.Marshallable = (*MsgInfo)(nil) |
| 96 |
var _ marshal.Marshallable = (*MsqidDS)(nil) |
| 97 |
var _ marshal.Marshallable = (*NFNATRange)(nil) |
| 98 |
var _ marshal.Marshallable = (*NetlinkAttrHeader)(nil) |
| 99 |
var _ marshal.Marshallable = (*NetlinkErrorMessage)(nil) |
| 100 |
var _ marshal.Marshallable = (*NetlinkMessageHeader)(nil) |
| 101 |
var _ marshal.Marshallable = (*NfNATIPV4MultiRangeCompat)(nil) |
| 102 |
var _ marshal.Marshallable = (*NfNATIPV4Range)(nil) |
| 103 |
var _ marshal.Marshallable = (*NumaPolicy)(nil) |
| 104 |
var _ marshal.Marshallable = (*PollFD)(nil) |
| 105 |
var _ marshal.Marshallable = (*RSeqCriticalSection)(nil) |
| 106 |
var _ marshal.Marshallable = (*RobustListHead)(nil) |
| 107 |
var _ marshal.Marshallable = (*RouteMessage)(nil) |
| 108 |
var _ marshal.Marshallable = (*Rusage)(nil) |
| 109 |
var _ marshal.Marshallable = (*SeccompData)(nil) |
| 110 |
var _ marshal.Marshallable = (*SemInfo)(nil) |
| 111 |
var _ marshal.Marshallable = (*Sembuf)(nil) |
| 112 |
var _ marshal.Marshallable = (*ShmInfo)(nil) |
| 113 |
var _ marshal.Marshallable = (*ShmParams)(nil) |
| 114 |
var _ marshal.Marshallable = (*ShmidDS)(nil) |
| 115 |
var _ marshal.Marshallable = (*SigAction)(nil) |
| 116 |
var _ marshal.Marshallable = (*Sigevent)(nil) |
| 117 |
var _ marshal.Marshallable = (*SignalInfo)(nil) |
| 118 |
var _ marshal.Marshallable = (*SignalSet)(nil) |
| 119 |
var _ marshal.Marshallable = (*SignalStack)(nil) |
| 120 |
var _ marshal.Marshallable = (*SignalfdSiginfo)(nil) |
| 121 |
var _ marshal.Marshallable = (*SockAddrInet)(nil) |
| 122 |
var _ marshal.Marshallable = (*SockAddrInet6)(nil) |
| 123 |
var _ marshal.Marshallable = (*SockAddrLink)(nil) |
| 124 |
var _ marshal.Marshallable = (*SockAddrNetlink)(nil) |
| 125 |
var _ marshal.Marshallable = (*SockAddrUnix)(nil) |
| 126 |
var _ marshal.Marshallable = (*SockErrCMsgIPv4)(nil) |
| 127 |
var _ marshal.Marshallable = (*SockErrCMsgIPv6)(nil) |
| 128 |
var _ marshal.Marshallable = (*SockExtendedErr)(nil) |
| 129 |
var _ marshal.Marshallable = (*Statfs)(nil) |
| 130 |
var _ marshal.Marshallable = (*Statx)(nil) |
| 131 |
var _ marshal.Marshallable = (*StatxTimestamp)(nil) |
| 132 |
var _ marshal.Marshallable = (*Sysinfo)(nil) |
| 133 |
var _ marshal.Marshallable = (*TCPInfo)(nil) |
| 134 |
var _ marshal.Marshallable = (*TableName)(nil) |
| 135 |
var _ marshal.Marshallable = (*Termios)(nil) |
| 136 |
var _ marshal.Marshallable = (*TimeT)(nil) |
| 137 |
var _ marshal.Marshallable = (*TimerID)(nil) |
| 138 |
var _ marshal.Marshallable = (*Timespec)(nil) |
| 139 |
var _ marshal.Marshallable = (*Timeval)(nil) |
| 140 |
var _ marshal.Marshallable = (*Tms)(nil) |
| 141 |
var _ marshal.Marshallable = (*Utime)(nil) |
| 142 |
var _ marshal.Marshallable = (*UtsName)(nil) |
| 143 |
var _ marshal.Marshallable = (*WindowSize)(nil) |
| 144 |
var _ marshal.Marshallable = (*Winsize)(nil) |
| 145 |
var _ marshal.Marshallable = (*XTCounters)(nil) |
| 146 |
var _ marshal.Marshallable = (*XTEntryMatch)(nil) |
| 147 |
var _ marshal.Marshallable = (*XTEntryTarget)(nil) |
| 148 |
var _ marshal.Marshallable = (*XTErrorTarget)(nil) |
| 149 |
var _ marshal.Marshallable = (*XTGetRevision)(nil) |
| 150 |
var _ marshal.Marshallable = (*XTRedirectTarget)(nil) |
| 151 |
var _ marshal.Marshallable = (*XTSNATTarget)(nil) |
| 152 |
var _ marshal.Marshallable = (*XTStandardTarget)(nil) |
| 153 |
var _ marshal.Marshallable = (*XTTCP)(nil) |
| 154 |
var _ marshal.Marshallable = (*XTUDP)(nil) |
| 155 |
|
| 156 |
|
| 157 |
func (i *IOCallback) SizeBytes() int { |
| 158 |
return 64 |
| 159 |
} |
| 160 |
|
| 161 |
|
| 162 |
func (i *IOCallback) MarshalBytes(dst []byte) []byte { |
| 163 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Data)) |
| 164 |
dst = dst[8:] |
| 165 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Key)) |
| 166 |
dst = dst[4:] |
| 167 |
|
| 168 |
dst = dst[4:] |
| 169 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.OpCode)) |
| 170 |
dst = dst[2:] |
| 171 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.ReqPrio)) |
| 172 |
dst = dst[2:] |
| 173 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD)) |
| 174 |
dst = dst[4:] |
| 175 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Buf)) |
| 176 |
dst = dst[8:] |
| 177 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Bytes)) |
| 178 |
dst = dst[8:] |
| 179 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Offset)) |
| 180 |
dst = dst[8:] |
| 181 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Reserved2)) |
| 182 |
dst = dst[8:] |
| 183 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Flags)) |
| 184 |
dst = dst[4:] |
| 185 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.ResFD)) |
| 186 |
dst = dst[4:] |
| 187 |
return dst |
| 188 |
} |
| 189 |
|
| 190 |
|
| 191 |
func (i *IOCallback) UnmarshalBytes(src []byte) []byte { |
| 192 |
i.Data = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 193 |
src = src[8:] |
| 194 |
i.Key = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 195 |
src = src[4:] |
| 196 |
|
| 197 |
src = src[4:] |
| 198 |
i.OpCode = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 199 |
src = src[2:] |
| 200 |
i.ReqPrio = int16(hostarch.ByteOrder.Uint16(src[:2])) |
| 201 |
src = src[2:] |
| 202 |
i.FD = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 203 |
src = src[4:] |
| 204 |
i.Buf = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 205 |
src = src[8:] |
| 206 |
i.Bytes = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 207 |
src = src[8:] |
| 208 |
i.Offset = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 209 |
src = src[8:] |
| 210 |
i.Reserved2 = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 211 |
src = src[8:] |
| 212 |
i.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 213 |
src = src[4:] |
| 214 |
i.ResFD = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 215 |
src = src[4:] |
| 216 |
return src |
| 217 |
} |
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
func (i *IOCallback) Packed() bool { |
| 222 |
return true |
| 223 |
} |
| 224 |
|
| 225 |
|
| 226 |
func (i *IOCallback) MarshalUnsafe(dst []byte) []byte { |
| 227 |
size := i.SizeBytes() |
| 228 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 229 |
return dst[size:] |
| 230 |
} |
| 231 |
|
| 232 |
|
| 233 |
func (i *IOCallback) UnmarshalUnsafe(src []byte) []byte { |
| 234 |
size := i.SizeBytes() |
| 235 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 236 |
return src[size:] |
| 237 |
} |
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
func (i *IOCallback) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 242 |
|
| 243 |
var buf []byte |
| 244 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 245 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 246 |
hdr.Len = i.SizeBytes() |
| 247 |
hdr.Cap = i.SizeBytes() |
| 248 |
|
| 249 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 250 |
|
| 251 |
|
| 252 |
runtime.KeepAlive(i) |
| 253 |
return length, err |
| 254 |
} |
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
func (i *IOCallback) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 259 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 260 |
} |
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
func (i *IOCallback) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 265 |
|
| 266 |
var buf []byte |
| 267 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 268 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 269 |
hdr.Len = i.SizeBytes() |
| 270 |
hdr.Cap = i.SizeBytes() |
| 271 |
|
| 272 |
length, err := cc.CopyInBytes(addr, buf) |
| 273 |
|
| 274 |
|
| 275 |
runtime.KeepAlive(i) |
| 276 |
return length, err |
| 277 |
} |
| 278 |
|
| 279 |
|
| 280 |
func (i *IOCallback) WriteTo(writer io.Writer) (int64, error) { |
| 281 |
|
| 282 |
var buf []byte |
| 283 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 284 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 285 |
hdr.Len = i.SizeBytes() |
| 286 |
hdr.Cap = i.SizeBytes() |
| 287 |
|
| 288 |
length, err := writer.Write(buf) |
| 289 |
|
| 290 |
|
| 291 |
runtime.KeepAlive(i) |
| 292 |
return int64(length), err |
| 293 |
} |
| 294 |
|
| 295 |
|
| 296 |
func (i *IOEvent) SizeBytes() int { |
| 297 |
return 32 |
| 298 |
} |
| 299 |
|
| 300 |
|
| 301 |
func (i *IOEvent) MarshalBytes(dst []byte) []byte { |
| 302 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Data)) |
| 303 |
dst = dst[8:] |
| 304 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Obj)) |
| 305 |
dst = dst[8:] |
| 306 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Result)) |
| 307 |
dst = dst[8:] |
| 308 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Result2)) |
| 309 |
dst = dst[8:] |
| 310 |
return dst |
| 311 |
} |
| 312 |
|
| 313 |
|
| 314 |
func (i *IOEvent) UnmarshalBytes(src []byte) []byte { |
| 315 |
i.Data = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 316 |
src = src[8:] |
| 317 |
i.Obj = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 318 |
src = src[8:] |
| 319 |
i.Result = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 320 |
src = src[8:] |
| 321 |
i.Result2 = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 322 |
src = src[8:] |
| 323 |
return src |
| 324 |
} |
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
func (i *IOEvent) Packed() bool { |
| 329 |
return true |
| 330 |
} |
| 331 |
|
| 332 |
|
| 333 |
func (i *IOEvent) MarshalUnsafe(dst []byte) []byte { |
| 334 |
size := i.SizeBytes() |
| 335 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 336 |
return dst[size:] |
| 337 |
} |
| 338 |
|
| 339 |
|
| 340 |
func (i *IOEvent) UnmarshalUnsafe(src []byte) []byte { |
| 341 |
size := i.SizeBytes() |
| 342 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 343 |
return src[size:] |
| 344 |
} |
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
func (i *IOEvent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 349 |
|
| 350 |
var buf []byte |
| 351 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 352 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 353 |
hdr.Len = i.SizeBytes() |
| 354 |
hdr.Cap = i.SizeBytes() |
| 355 |
|
| 356 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 357 |
|
| 358 |
|
| 359 |
runtime.KeepAlive(i) |
| 360 |
return length, err |
| 361 |
} |
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
func (i *IOEvent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 366 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 367 |
} |
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
func (i *IOEvent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 372 |
|
| 373 |
var buf []byte |
| 374 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 375 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 376 |
hdr.Len = i.SizeBytes() |
| 377 |
hdr.Cap = i.SizeBytes() |
| 378 |
|
| 379 |
length, err := cc.CopyInBytes(addr, buf) |
| 380 |
|
| 381 |
|
| 382 |
runtime.KeepAlive(i) |
| 383 |
return length, err |
| 384 |
} |
| 385 |
|
| 386 |
|
| 387 |
func (i *IOEvent) WriteTo(writer io.Writer) (int64, error) { |
| 388 |
|
| 389 |
var buf []byte |
| 390 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 391 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 392 |
hdr.Len = i.SizeBytes() |
| 393 |
hdr.Cap = i.SizeBytes() |
| 394 |
|
| 395 |
length, err := writer.Write(buf) |
| 396 |
|
| 397 |
|
| 398 |
runtime.KeepAlive(i) |
| 399 |
return int64(length), err |
| 400 |
} |
| 401 |
|
| 402 |
|
| 403 |
func (b *BPFInstruction) SizeBytes() int { |
| 404 |
return 8 |
| 405 |
} |
| 406 |
|
| 407 |
|
| 408 |
func (b *BPFInstruction) MarshalBytes(dst []byte) []byte { |
| 409 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(b.OpCode)) |
| 410 |
dst = dst[2:] |
| 411 |
dst[0] = byte(b.JumpIfTrue) |
| 412 |
dst = dst[1:] |
| 413 |
dst[0] = byte(b.JumpIfFalse) |
| 414 |
dst = dst[1:] |
| 415 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(b.K)) |
| 416 |
dst = dst[4:] |
| 417 |
return dst |
| 418 |
} |
| 419 |
|
| 420 |
|
| 421 |
func (b *BPFInstruction) UnmarshalBytes(src []byte) []byte { |
| 422 |
b.OpCode = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 423 |
src = src[2:] |
| 424 |
b.JumpIfTrue = uint8(src[0]) |
| 425 |
src = src[1:] |
| 426 |
b.JumpIfFalse = uint8(src[0]) |
| 427 |
src = src[1:] |
| 428 |
b.K = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 429 |
src = src[4:] |
| 430 |
return src |
| 431 |
} |
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
func (b *BPFInstruction) Packed() bool { |
| 436 |
return true |
| 437 |
} |
| 438 |
|
| 439 |
|
| 440 |
func (b *BPFInstruction) MarshalUnsafe(dst []byte) []byte { |
| 441 |
size := b.SizeBytes() |
| 442 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(b), uintptr(size)) |
| 443 |
return dst[size:] |
| 444 |
} |
| 445 |
|
| 446 |
|
| 447 |
func (b *BPFInstruction) UnmarshalUnsafe(src []byte) []byte { |
| 448 |
size := b.SizeBytes() |
| 449 |
gohacks.Memmove(unsafe.Pointer(b), unsafe.Pointer(&src[0]), uintptr(size)) |
| 450 |
return src[size:] |
| 451 |
} |
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
func (b *BPFInstruction) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 456 |
|
| 457 |
var buf []byte |
| 458 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 459 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(b))) |
| 460 |
hdr.Len = b.SizeBytes() |
| 461 |
hdr.Cap = b.SizeBytes() |
| 462 |
|
| 463 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 464 |
|
| 465 |
|
| 466 |
runtime.KeepAlive(b) |
| 467 |
return length, err |
| 468 |
} |
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
func (b *BPFInstruction) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 473 |
return b.CopyOutN(cc, addr, b.SizeBytes()) |
| 474 |
} |
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
func (b *BPFInstruction) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 479 |
|
| 480 |
var buf []byte |
| 481 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 482 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(b))) |
| 483 |
hdr.Len = b.SizeBytes() |
| 484 |
hdr.Cap = b.SizeBytes() |
| 485 |
|
| 486 |
length, err := cc.CopyInBytes(addr, buf) |
| 487 |
|
| 488 |
|
| 489 |
runtime.KeepAlive(b) |
| 490 |
return length, err |
| 491 |
} |
| 492 |
|
| 493 |
|
| 494 |
func (b *BPFInstruction) WriteTo(writer io.Writer) (int64, error) { |
| 495 |
|
| 496 |
var buf []byte |
| 497 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 498 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(b))) |
| 499 |
hdr.Len = b.SizeBytes() |
| 500 |
hdr.Cap = b.SizeBytes() |
| 501 |
|
| 502 |
length, err := writer.Write(buf) |
| 503 |
|
| 504 |
|
| 505 |
runtime.KeepAlive(b) |
| 506 |
return int64(length), err |
| 507 |
} |
| 508 |
|
| 509 |
|
| 510 |
func CopyBPFInstructionSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []BPFInstruction) (int, error) { |
| 511 |
count := len(dst) |
| 512 |
if count == 0 { |
| 513 |
return 0, nil |
| 514 |
} |
| 515 |
size := (*BPFInstruction)(nil).SizeBytes() |
| 516 |
|
| 517 |
ptr := unsafe.Pointer(&dst) |
| 518 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 519 |
|
| 520 |
|
| 521 |
var buf []byte |
| 522 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 523 |
hdr.Data = uintptr(val) |
| 524 |
hdr.Len = size * count |
| 525 |
hdr.Cap = size * count |
| 526 |
|
| 527 |
length, err := cc.CopyInBytes(addr, buf) |
| 528 |
|
| 529 |
|
| 530 |
runtime.KeepAlive(dst) |
| 531 |
return length, err |
| 532 |
} |
| 533 |
|
| 534 |
|
| 535 |
func CopyBPFInstructionSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []BPFInstruction) (int, error) { |
| 536 |
count := len(src) |
| 537 |
if count == 0 { |
| 538 |
return 0, nil |
| 539 |
} |
| 540 |
size := (*BPFInstruction)(nil).SizeBytes() |
| 541 |
|
| 542 |
ptr := unsafe.Pointer(&src) |
| 543 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 544 |
|
| 545 |
|
| 546 |
var buf []byte |
| 547 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 548 |
hdr.Data = uintptr(val) |
| 549 |
hdr.Len = size * count |
| 550 |
hdr.Cap = size * count |
| 551 |
|
| 552 |
length, err := cc.CopyOutBytes(addr, buf) |
| 553 |
|
| 554 |
|
| 555 |
runtime.KeepAlive(src) |
| 556 |
return length, err |
| 557 |
} |
| 558 |
|
| 559 |
|
| 560 |
func MarshalUnsafeBPFInstructionSlice(src []BPFInstruction, dst []byte) []byte { |
| 561 |
count := len(src) |
| 562 |
if count == 0 { |
| 563 |
return dst |
| 564 |
} |
| 565 |
|
| 566 |
size := (*BPFInstruction)(nil).SizeBytes() |
| 567 |
buf := dst[:size*count] |
| 568 |
gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) |
| 569 |
return dst[size*count:] |
| 570 |
} |
| 571 |
|
| 572 |
|
| 573 |
func UnmarshalUnsafeBPFInstructionSlice(dst []BPFInstruction, src []byte) []byte { |
| 574 |
count := len(dst) |
| 575 |
if count == 0 { |
| 576 |
return src |
| 577 |
} |
| 578 |
|
| 579 |
size := (*BPFInstruction)(nil).SizeBytes() |
| 580 |
buf := src[:size*count] |
| 581 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) |
| 582 |
return src[size*count:] |
| 583 |
} |
| 584 |
|
| 585 |
|
| 586 |
func (c *CapUserData) SizeBytes() int { |
| 587 |
return 12 |
| 588 |
} |
| 589 |
|
| 590 |
|
| 591 |
func (c *CapUserData) MarshalBytes(dst []byte) []byte { |
| 592 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Effective)) |
| 593 |
dst = dst[4:] |
| 594 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Permitted)) |
| 595 |
dst = dst[4:] |
| 596 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Inheritable)) |
| 597 |
dst = dst[4:] |
| 598 |
return dst |
| 599 |
} |
| 600 |
|
| 601 |
|
| 602 |
func (c *CapUserData) UnmarshalBytes(src []byte) []byte { |
| 603 |
c.Effective = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 604 |
src = src[4:] |
| 605 |
c.Permitted = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 606 |
src = src[4:] |
| 607 |
c.Inheritable = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 608 |
src = src[4:] |
| 609 |
return src |
| 610 |
} |
| 611 |
|
| 612 |
|
| 613 |
|
| 614 |
func (c *CapUserData) Packed() bool { |
| 615 |
return true |
| 616 |
} |
| 617 |
|
| 618 |
|
| 619 |
func (c *CapUserData) MarshalUnsafe(dst []byte) []byte { |
| 620 |
size := c.SizeBytes() |
| 621 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) |
| 622 |
return dst[size:] |
| 623 |
} |
| 624 |
|
| 625 |
|
| 626 |
func (c *CapUserData) UnmarshalUnsafe(src []byte) []byte { |
| 627 |
size := c.SizeBytes() |
| 628 |
gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) |
| 629 |
return src[size:] |
| 630 |
} |
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
func (c *CapUserData) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 635 |
|
| 636 |
var buf []byte |
| 637 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 638 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 639 |
hdr.Len = c.SizeBytes() |
| 640 |
hdr.Cap = c.SizeBytes() |
| 641 |
|
| 642 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 643 |
|
| 644 |
|
| 645 |
runtime.KeepAlive(c) |
| 646 |
return length, err |
| 647 |
} |
| 648 |
|
| 649 |
|
| 650 |
|
| 651 |
func (c *CapUserData) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 652 |
return c.CopyOutN(cc, addr, c.SizeBytes()) |
| 653 |
} |
| 654 |
|
| 655 |
|
| 656 |
|
| 657 |
func (c *CapUserData) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 658 |
|
| 659 |
var buf []byte |
| 660 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 661 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 662 |
hdr.Len = c.SizeBytes() |
| 663 |
hdr.Cap = c.SizeBytes() |
| 664 |
|
| 665 |
length, err := cc.CopyInBytes(addr, buf) |
| 666 |
|
| 667 |
|
| 668 |
runtime.KeepAlive(c) |
| 669 |
return length, err |
| 670 |
} |
| 671 |
|
| 672 |
|
| 673 |
func (c *CapUserData) WriteTo(writer io.Writer) (int64, error) { |
| 674 |
|
| 675 |
var buf []byte |
| 676 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 677 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 678 |
hdr.Len = c.SizeBytes() |
| 679 |
hdr.Cap = c.SizeBytes() |
| 680 |
|
| 681 |
length, err := writer.Write(buf) |
| 682 |
|
| 683 |
|
| 684 |
runtime.KeepAlive(c) |
| 685 |
return int64(length), err |
| 686 |
} |
| 687 |
|
| 688 |
|
| 689 |
func CopyCapUserDataSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []CapUserData) (int, error) { |
| 690 |
count := len(dst) |
| 691 |
if count == 0 { |
| 692 |
return 0, nil |
| 693 |
} |
| 694 |
size := (*CapUserData)(nil).SizeBytes() |
| 695 |
|
| 696 |
ptr := unsafe.Pointer(&dst) |
| 697 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 698 |
|
| 699 |
|
| 700 |
var buf []byte |
| 701 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 702 |
hdr.Data = uintptr(val) |
| 703 |
hdr.Len = size * count |
| 704 |
hdr.Cap = size * count |
| 705 |
|
| 706 |
length, err := cc.CopyInBytes(addr, buf) |
| 707 |
|
| 708 |
|
| 709 |
runtime.KeepAlive(dst) |
| 710 |
return length, err |
| 711 |
} |
| 712 |
|
| 713 |
|
| 714 |
func CopyCapUserDataSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []CapUserData) (int, error) { |
| 715 |
count := len(src) |
| 716 |
if count == 0 { |
| 717 |
return 0, nil |
| 718 |
} |
| 719 |
size := (*CapUserData)(nil).SizeBytes() |
| 720 |
|
| 721 |
ptr := unsafe.Pointer(&src) |
| 722 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 723 |
|
| 724 |
|
| 725 |
var buf []byte |
| 726 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 727 |
hdr.Data = uintptr(val) |
| 728 |
hdr.Len = size * count |
| 729 |
hdr.Cap = size * count |
| 730 |
|
| 731 |
length, err := cc.CopyOutBytes(addr, buf) |
| 732 |
|
| 733 |
|
| 734 |
runtime.KeepAlive(src) |
| 735 |
return length, err |
| 736 |
} |
| 737 |
|
| 738 |
|
| 739 |
func MarshalUnsafeCapUserDataSlice(src []CapUserData, dst []byte) []byte { |
| 740 |
count := len(src) |
| 741 |
if count == 0 { |
| 742 |
return dst |
| 743 |
} |
| 744 |
|
| 745 |
size := (*CapUserData)(nil).SizeBytes() |
| 746 |
buf := dst[:size*count] |
| 747 |
gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) |
| 748 |
return dst[size*count:] |
| 749 |
} |
| 750 |
|
| 751 |
|
| 752 |
func UnmarshalUnsafeCapUserDataSlice(dst []CapUserData, src []byte) []byte { |
| 753 |
count := len(dst) |
| 754 |
if count == 0 { |
| 755 |
return src |
| 756 |
} |
| 757 |
|
| 758 |
size := (*CapUserData)(nil).SizeBytes() |
| 759 |
buf := src[:size*count] |
| 760 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) |
| 761 |
return src[size*count:] |
| 762 |
} |
| 763 |
|
| 764 |
|
| 765 |
func (c *CapUserHeader) SizeBytes() int { |
| 766 |
return 8 |
| 767 |
} |
| 768 |
|
| 769 |
|
| 770 |
func (c *CapUserHeader) MarshalBytes(dst []byte) []byte { |
| 771 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Version)) |
| 772 |
dst = dst[4:] |
| 773 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Pid)) |
| 774 |
dst = dst[4:] |
| 775 |
return dst |
| 776 |
} |
| 777 |
|
| 778 |
|
| 779 |
func (c *CapUserHeader) UnmarshalBytes(src []byte) []byte { |
| 780 |
c.Version = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 781 |
src = src[4:] |
| 782 |
c.Pid = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 783 |
src = src[4:] |
| 784 |
return src |
| 785 |
} |
| 786 |
|
| 787 |
|
| 788 |
|
| 789 |
func (c *CapUserHeader) Packed() bool { |
| 790 |
return true |
| 791 |
} |
| 792 |
|
| 793 |
|
| 794 |
func (c *CapUserHeader) MarshalUnsafe(dst []byte) []byte { |
| 795 |
size := c.SizeBytes() |
| 796 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) |
| 797 |
return dst[size:] |
| 798 |
} |
| 799 |
|
| 800 |
|
| 801 |
func (c *CapUserHeader) UnmarshalUnsafe(src []byte) []byte { |
| 802 |
size := c.SizeBytes() |
| 803 |
gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) |
| 804 |
return src[size:] |
| 805 |
} |
| 806 |
|
| 807 |
|
| 808 |
|
| 809 |
func (c *CapUserHeader) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 810 |
|
| 811 |
var buf []byte |
| 812 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 813 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 814 |
hdr.Len = c.SizeBytes() |
| 815 |
hdr.Cap = c.SizeBytes() |
| 816 |
|
| 817 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 818 |
|
| 819 |
|
| 820 |
runtime.KeepAlive(c) |
| 821 |
return length, err |
| 822 |
} |
| 823 |
|
| 824 |
|
| 825 |
|
| 826 |
func (c *CapUserHeader) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 827 |
return c.CopyOutN(cc, addr, c.SizeBytes()) |
| 828 |
} |
| 829 |
|
| 830 |
|
| 831 |
|
| 832 |
func (c *CapUserHeader) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 833 |
|
| 834 |
var buf []byte |
| 835 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 836 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 837 |
hdr.Len = c.SizeBytes() |
| 838 |
hdr.Cap = c.SizeBytes() |
| 839 |
|
| 840 |
length, err := cc.CopyInBytes(addr, buf) |
| 841 |
|
| 842 |
|
| 843 |
runtime.KeepAlive(c) |
| 844 |
return length, err |
| 845 |
} |
| 846 |
|
| 847 |
|
| 848 |
func (c *CapUserHeader) WriteTo(writer io.Writer) (int64, error) { |
| 849 |
|
| 850 |
var buf []byte |
| 851 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 852 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 853 |
hdr.Len = c.SizeBytes() |
| 854 |
hdr.Cap = c.SizeBytes() |
| 855 |
|
| 856 |
length, err := writer.Write(buf) |
| 857 |
|
| 858 |
|
| 859 |
runtime.KeepAlive(c) |
| 860 |
return int64(length), err |
| 861 |
} |
| 862 |
|
| 863 |
|
| 864 |
func (e *ElfHeader64) SizeBytes() int { |
| 865 |
return 48 + |
| 866 |
1*16 |
| 867 |
} |
| 868 |
|
| 869 |
|
| 870 |
func (e *ElfHeader64) MarshalBytes(dst []byte) []byte { |
| 871 |
for idx := 0; idx < 16; idx++ { |
| 872 |
dst[0] = byte(e.Ident[idx]) |
| 873 |
dst = dst[1:] |
| 874 |
} |
| 875 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Type)) |
| 876 |
dst = dst[2:] |
| 877 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Machine)) |
| 878 |
dst = dst[2:] |
| 879 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Version)) |
| 880 |
dst = dst[4:] |
| 881 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Entry)) |
| 882 |
dst = dst[8:] |
| 883 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Phoff)) |
| 884 |
dst = dst[8:] |
| 885 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Shoff)) |
| 886 |
dst = dst[8:] |
| 887 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Flags)) |
| 888 |
dst = dst[4:] |
| 889 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Ehsize)) |
| 890 |
dst = dst[2:] |
| 891 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Phentsize)) |
| 892 |
dst = dst[2:] |
| 893 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Phnum)) |
| 894 |
dst = dst[2:] |
| 895 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Shentsize)) |
| 896 |
dst = dst[2:] |
| 897 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Shnum)) |
| 898 |
dst = dst[2:] |
| 899 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Shstrndx)) |
| 900 |
dst = dst[2:] |
| 901 |
return dst |
| 902 |
} |
| 903 |
|
| 904 |
|
| 905 |
func (e *ElfHeader64) UnmarshalBytes(src []byte) []byte { |
| 906 |
for idx := 0; idx < 16; idx++ { |
| 907 |
e.Ident[idx] = src[0] |
| 908 |
src = src[1:] |
| 909 |
} |
| 910 |
e.Type = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 911 |
src = src[2:] |
| 912 |
e.Machine = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 913 |
src = src[2:] |
| 914 |
e.Version = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 915 |
src = src[4:] |
| 916 |
e.Entry = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 917 |
src = src[8:] |
| 918 |
e.Phoff = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 919 |
src = src[8:] |
| 920 |
e.Shoff = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 921 |
src = src[8:] |
| 922 |
e.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 923 |
src = src[4:] |
| 924 |
e.Ehsize = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 925 |
src = src[2:] |
| 926 |
e.Phentsize = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 927 |
src = src[2:] |
| 928 |
e.Phnum = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 929 |
src = src[2:] |
| 930 |
e.Shentsize = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 931 |
src = src[2:] |
| 932 |
e.Shnum = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 933 |
src = src[2:] |
| 934 |
e.Shstrndx = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 935 |
src = src[2:] |
| 936 |
return src |
| 937 |
} |
| 938 |
|
| 939 |
|
| 940 |
|
| 941 |
func (e *ElfHeader64) Packed() bool { |
| 942 |
return true |
| 943 |
} |
| 944 |
|
| 945 |
|
| 946 |
func (e *ElfHeader64) MarshalUnsafe(dst []byte) []byte { |
| 947 |
size := e.SizeBytes() |
| 948 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(e), uintptr(size)) |
| 949 |
return dst[size:] |
| 950 |
} |
| 951 |
|
| 952 |
|
| 953 |
func (e *ElfHeader64) UnmarshalUnsafe(src []byte) []byte { |
| 954 |
size := e.SizeBytes() |
| 955 |
gohacks.Memmove(unsafe.Pointer(e), unsafe.Pointer(&src[0]), uintptr(size)) |
| 956 |
return src[size:] |
| 957 |
} |
| 958 |
|
| 959 |
|
| 960 |
|
| 961 |
func (e *ElfHeader64) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 962 |
|
| 963 |
var buf []byte |
| 964 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 965 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) |
| 966 |
hdr.Len = e.SizeBytes() |
| 967 |
hdr.Cap = e.SizeBytes() |
| 968 |
|
| 969 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 970 |
|
| 971 |
|
| 972 |
runtime.KeepAlive(e) |
| 973 |
return length, err |
| 974 |
} |
| 975 |
|
| 976 |
|
| 977 |
|
| 978 |
func (e *ElfHeader64) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 979 |
return e.CopyOutN(cc, addr, e.SizeBytes()) |
| 980 |
} |
| 981 |
|
| 982 |
|
| 983 |
|
| 984 |
func (e *ElfHeader64) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 985 |
|
| 986 |
var buf []byte |
| 987 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 988 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) |
| 989 |
hdr.Len = e.SizeBytes() |
| 990 |
hdr.Cap = e.SizeBytes() |
| 991 |
|
| 992 |
length, err := cc.CopyInBytes(addr, buf) |
| 993 |
|
| 994 |
|
| 995 |
runtime.KeepAlive(e) |
| 996 |
return length, err |
| 997 |
} |
| 998 |
|
| 999 |
|
| 1000 |
func (e *ElfHeader64) WriteTo(writer io.Writer) (int64, error) { |
| 1001 |
|
| 1002 |
var buf []byte |
| 1003 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1004 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) |
| 1005 |
hdr.Len = e.SizeBytes() |
| 1006 |
hdr.Cap = e.SizeBytes() |
| 1007 |
|
| 1008 |
length, err := writer.Write(buf) |
| 1009 |
|
| 1010 |
|
| 1011 |
runtime.KeepAlive(e) |
| 1012 |
return int64(length), err |
| 1013 |
} |
| 1014 |
|
| 1015 |
|
| 1016 |
func (e *ElfProg64) SizeBytes() int { |
| 1017 |
return 56 |
| 1018 |
} |
| 1019 |
|
| 1020 |
|
| 1021 |
func (e *ElfProg64) MarshalBytes(dst []byte) []byte { |
| 1022 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Type)) |
| 1023 |
dst = dst[4:] |
| 1024 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Flags)) |
| 1025 |
dst = dst[4:] |
| 1026 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Off)) |
| 1027 |
dst = dst[8:] |
| 1028 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Vaddr)) |
| 1029 |
dst = dst[8:] |
| 1030 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Paddr)) |
| 1031 |
dst = dst[8:] |
| 1032 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Filesz)) |
| 1033 |
dst = dst[8:] |
| 1034 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Memsz)) |
| 1035 |
dst = dst[8:] |
| 1036 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Align)) |
| 1037 |
dst = dst[8:] |
| 1038 |
return dst |
| 1039 |
} |
| 1040 |
|
| 1041 |
|
| 1042 |
func (e *ElfProg64) UnmarshalBytes(src []byte) []byte { |
| 1043 |
e.Type = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1044 |
src = src[4:] |
| 1045 |
e.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1046 |
src = src[4:] |
| 1047 |
e.Off = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1048 |
src = src[8:] |
| 1049 |
e.Vaddr = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1050 |
src = src[8:] |
| 1051 |
e.Paddr = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1052 |
src = src[8:] |
| 1053 |
e.Filesz = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1054 |
src = src[8:] |
| 1055 |
e.Memsz = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1056 |
src = src[8:] |
| 1057 |
e.Align = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1058 |
src = src[8:] |
| 1059 |
return src |
| 1060 |
} |
| 1061 |
|
| 1062 |
|
| 1063 |
|
| 1064 |
func (e *ElfProg64) Packed() bool { |
| 1065 |
return true |
| 1066 |
} |
| 1067 |
|
| 1068 |
|
| 1069 |
func (e *ElfProg64) MarshalUnsafe(dst []byte) []byte { |
| 1070 |
size := e.SizeBytes() |
| 1071 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(e), uintptr(size)) |
| 1072 |
return dst[size:] |
| 1073 |
} |
| 1074 |
|
| 1075 |
|
| 1076 |
func (e *ElfProg64) UnmarshalUnsafe(src []byte) []byte { |
| 1077 |
size := e.SizeBytes() |
| 1078 |
gohacks.Memmove(unsafe.Pointer(e), unsafe.Pointer(&src[0]), uintptr(size)) |
| 1079 |
return src[size:] |
| 1080 |
} |
| 1081 |
|
| 1082 |
|
| 1083 |
|
| 1084 |
func (e *ElfProg64) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 1085 |
|
| 1086 |
var buf []byte |
| 1087 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1088 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) |
| 1089 |
hdr.Len = e.SizeBytes() |
| 1090 |
hdr.Cap = e.SizeBytes() |
| 1091 |
|
| 1092 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 1093 |
|
| 1094 |
|
| 1095 |
runtime.KeepAlive(e) |
| 1096 |
return length, err |
| 1097 |
} |
| 1098 |
|
| 1099 |
|
| 1100 |
|
| 1101 |
func (e *ElfProg64) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1102 |
return e.CopyOutN(cc, addr, e.SizeBytes()) |
| 1103 |
} |
| 1104 |
|
| 1105 |
|
| 1106 |
|
| 1107 |
func (e *ElfProg64) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1108 |
|
| 1109 |
var buf []byte |
| 1110 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1111 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) |
| 1112 |
hdr.Len = e.SizeBytes() |
| 1113 |
hdr.Cap = e.SizeBytes() |
| 1114 |
|
| 1115 |
length, err := cc.CopyInBytes(addr, buf) |
| 1116 |
|
| 1117 |
|
| 1118 |
runtime.KeepAlive(e) |
| 1119 |
return length, err |
| 1120 |
} |
| 1121 |
|
| 1122 |
|
| 1123 |
func (e *ElfProg64) WriteTo(writer io.Writer) (int64, error) { |
| 1124 |
|
| 1125 |
var buf []byte |
| 1126 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1127 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) |
| 1128 |
hdr.Len = e.SizeBytes() |
| 1129 |
hdr.Cap = e.SizeBytes() |
| 1130 |
|
| 1131 |
length, err := writer.Write(buf) |
| 1132 |
|
| 1133 |
|
| 1134 |
runtime.KeepAlive(e) |
| 1135 |
return int64(length), err |
| 1136 |
} |
| 1137 |
|
| 1138 |
|
| 1139 |
func (e *ElfSection64) SizeBytes() int { |
| 1140 |
return 64 |
| 1141 |
} |
| 1142 |
|
| 1143 |
|
| 1144 |
func (e *ElfSection64) MarshalBytes(dst []byte) []byte { |
| 1145 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Name)) |
| 1146 |
dst = dst[4:] |
| 1147 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Type)) |
| 1148 |
dst = dst[4:] |
| 1149 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Flags)) |
| 1150 |
dst = dst[8:] |
| 1151 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Addr)) |
| 1152 |
dst = dst[8:] |
| 1153 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Off)) |
| 1154 |
dst = dst[8:] |
| 1155 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Size)) |
| 1156 |
dst = dst[8:] |
| 1157 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Link)) |
| 1158 |
dst = dst[4:] |
| 1159 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Info)) |
| 1160 |
dst = dst[4:] |
| 1161 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Addralign)) |
| 1162 |
dst = dst[8:] |
| 1163 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Entsize)) |
| 1164 |
dst = dst[8:] |
| 1165 |
return dst |
| 1166 |
} |
| 1167 |
|
| 1168 |
|
| 1169 |
func (e *ElfSection64) UnmarshalBytes(src []byte) []byte { |
| 1170 |
e.Name = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1171 |
src = src[4:] |
| 1172 |
e.Type = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1173 |
src = src[4:] |
| 1174 |
e.Flags = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1175 |
src = src[8:] |
| 1176 |
e.Addr = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1177 |
src = src[8:] |
| 1178 |
e.Off = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1179 |
src = src[8:] |
| 1180 |
e.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1181 |
src = src[8:] |
| 1182 |
e.Link = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1183 |
src = src[4:] |
| 1184 |
e.Info = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1185 |
src = src[4:] |
| 1186 |
e.Addralign = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1187 |
src = src[8:] |
| 1188 |
e.Entsize = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1189 |
src = src[8:] |
| 1190 |
return src |
| 1191 |
} |
| 1192 |
|
| 1193 |
|
| 1194 |
|
| 1195 |
func (e *ElfSection64) Packed() bool { |
| 1196 |
return true |
| 1197 |
} |
| 1198 |
|
| 1199 |
|
| 1200 |
func (e *ElfSection64) MarshalUnsafe(dst []byte) []byte { |
| 1201 |
size := e.SizeBytes() |
| 1202 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(e), uintptr(size)) |
| 1203 |
return dst[size:] |
| 1204 |
} |
| 1205 |
|
| 1206 |
|
| 1207 |
func (e *ElfSection64) UnmarshalUnsafe(src []byte) []byte { |
| 1208 |
size := e.SizeBytes() |
| 1209 |
gohacks.Memmove(unsafe.Pointer(e), unsafe.Pointer(&src[0]), uintptr(size)) |
| 1210 |
return src[size:] |
| 1211 |
} |
| 1212 |
|
| 1213 |
|
| 1214 |
|
| 1215 |
func (e *ElfSection64) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 1216 |
|
| 1217 |
var buf []byte |
| 1218 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1219 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) |
| 1220 |
hdr.Len = e.SizeBytes() |
| 1221 |
hdr.Cap = e.SizeBytes() |
| 1222 |
|
| 1223 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 1224 |
|
| 1225 |
|
| 1226 |
runtime.KeepAlive(e) |
| 1227 |
return length, err |
| 1228 |
} |
| 1229 |
|
| 1230 |
|
| 1231 |
|
| 1232 |
func (e *ElfSection64) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1233 |
return e.CopyOutN(cc, addr, e.SizeBytes()) |
| 1234 |
} |
| 1235 |
|
| 1236 |
|
| 1237 |
|
| 1238 |
func (e *ElfSection64) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1239 |
|
| 1240 |
var buf []byte |
| 1241 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1242 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) |
| 1243 |
hdr.Len = e.SizeBytes() |
| 1244 |
hdr.Cap = e.SizeBytes() |
| 1245 |
|
| 1246 |
length, err := cc.CopyInBytes(addr, buf) |
| 1247 |
|
| 1248 |
|
| 1249 |
runtime.KeepAlive(e) |
| 1250 |
return length, err |
| 1251 |
} |
| 1252 |
|
| 1253 |
|
| 1254 |
func (e *ElfSection64) WriteTo(writer io.Writer) (int64, error) { |
| 1255 |
|
| 1256 |
var buf []byte |
| 1257 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1258 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) |
| 1259 |
hdr.Len = e.SizeBytes() |
| 1260 |
hdr.Cap = e.SizeBytes() |
| 1261 |
|
| 1262 |
length, err := writer.Write(buf) |
| 1263 |
|
| 1264 |
|
| 1265 |
runtime.KeepAlive(e) |
| 1266 |
return int64(length), err |
| 1267 |
} |
| 1268 |
|
| 1269 |
|
| 1270 |
func (s *SockErrCMsgIPv4) SizeBytes() int { |
| 1271 |
return 0 + |
| 1272 |
(*SockExtendedErr)(nil).SizeBytes() + |
| 1273 |
(*SockAddrInet)(nil).SizeBytes() |
| 1274 |
} |
| 1275 |
|
| 1276 |
|
| 1277 |
func (s *SockErrCMsgIPv4) MarshalBytes(dst []byte) []byte { |
| 1278 |
dst = s.SockExtendedErr.MarshalUnsafe(dst) |
| 1279 |
dst = s.Offender.MarshalUnsafe(dst) |
| 1280 |
return dst |
| 1281 |
} |
| 1282 |
|
| 1283 |
|
| 1284 |
func (s *SockErrCMsgIPv4) UnmarshalBytes(src []byte) []byte { |
| 1285 |
src = s.SockExtendedErr.UnmarshalUnsafe(src) |
| 1286 |
src = s.Offender.UnmarshalUnsafe(src) |
| 1287 |
return src |
| 1288 |
} |
| 1289 |
|
| 1290 |
|
| 1291 |
|
| 1292 |
func (s *SockErrCMsgIPv4) Packed() bool { |
| 1293 |
return s.Offender.Packed() && s.SockExtendedErr.Packed() |
| 1294 |
} |
| 1295 |
|
| 1296 |
|
| 1297 |
func (s *SockErrCMsgIPv4) MarshalUnsafe(dst []byte) []byte { |
| 1298 |
if s.Offender.Packed() && s.SockExtendedErr.Packed() { |
| 1299 |
size := s.SizeBytes() |
| 1300 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 1301 |
return dst[size:] |
| 1302 |
} |
| 1303 |
|
| 1304 |
return s.MarshalBytes(dst) |
| 1305 |
} |
| 1306 |
|
| 1307 |
|
| 1308 |
func (s *SockErrCMsgIPv4) UnmarshalUnsafe(src []byte) []byte { |
| 1309 |
if s.Offender.Packed() && s.SockExtendedErr.Packed() { |
| 1310 |
size := s.SizeBytes() |
| 1311 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 1312 |
return src[size:] |
| 1313 |
} |
| 1314 |
|
| 1315 |
return s.UnmarshalBytes(src) |
| 1316 |
} |
| 1317 |
|
| 1318 |
|
| 1319 |
|
| 1320 |
func (s *SockErrCMsgIPv4) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 1321 |
if !s.Offender.Packed() && s.SockExtendedErr.Packed() { |
| 1322 |
|
| 1323 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 1324 |
s.MarshalBytes(buf) |
| 1325 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 1326 |
} |
| 1327 |
|
| 1328 |
|
| 1329 |
var buf []byte |
| 1330 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1331 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 1332 |
hdr.Len = s.SizeBytes() |
| 1333 |
hdr.Cap = s.SizeBytes() |
| 1334 |
|
| 1335 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 1336 |
|
| 1337 |
|
| 1338 |
runtime.KeepAlive(s) |
| 1339 |
return length, err |
| 1340 |
} |
| 1341 |
|
| 1342 |
|
| 1343 |
|
| 1344 |
func (s *SockErrCMsgIPv4) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1345 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 1346 |
} |
| 1347 |
|
| 1348 |
|
| 1349 |
|
| 1350 |
func (s *SockErrCMsgIPv4) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1351 |
if !s.Offender.Packed() && s.SockExtendedErr.Packed() { |
| 1352 |
|
| 1353 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 1354 |
length, err := cc.CopyInBytes(addr, buf) |
| 1355 |
|
| 1356 |
|
| 1357 |
s.UnmarshalBytes(buf) |
| 1358 |
return length, err |
| 1359 |
} |
| 1360 |
|
| 1361 |
|
| 1362 |
var buf []byte |
| 1363 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1364 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 1365 |
hdr.Len = s.SizeBytes() |
| 1366 |
hdr.Cap = s.SizeBytes() |
| 1367 |
|
| 1368 |
length, err := cc.CopyInBytes(addr, buf) |
| 1369 |
|
| 1370 |
|
| 1371 |
runtime.KeepAlive(s) |
| 1372 |
return length, err |
| 1373 |
} |
| 1374 |
|
| 1375 |
|
| 1376 |
func (s *SockErrCMsgIPv4) WriteTo(writer io.Writer) (int64, error) { |
| 1377 |
if !s.Offender.Packed() && s.SockExtendedErr.Packed() { |
| 1378 |
|
| 1379 |
buf := make([]byte, s.SizeBytes()) |
| 1380 |
s.MarshalBytes(buf) |
| 1381 |
length, err := writer.Write(buf) |
| 1382 |
return int64(length), err |
| 1383 |
} |
| 1384 |
|
| 1385 |
|
| 1386 |
var buf []byte |
| 1387 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1388 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 1389 |
hdr.Len = s.SizeBytes() |
| 1390 |
hdr.Cap = s.SizeBytes() |
| 1391 |
|
| 1392 |
length, err := writer.Write(buf) |
| 1393 |
|
| 1394 |
|
| 1395 |
runtime.KeepAlive(s) |
| 1396 |
return int64(length), err |
| 1397 |
} |
| 1398 |
|
| 1399 |
|
| 1400 |
func (s *SockErrCMsgIPv6) SizeBytes() int { |
| 1401 |
return 0 + |
| 1402 |
(*SockExtendedErr)(nil).SizeBytes() + |
| 1403 |
(*SockAddrInet6)(nil).SizeBytes() |
| 1404 |
} |
| 1405 |
|
| 1406 |
|
| 1407 |
func (s *SockErrCMsgIPv6) MarshalBytes(dst []byte) []byte { |
| 1408 |
dst = s.SockExtendedErr.MarshalUnsafe(dst) |
| 1409 |
dst = s.Offender.MarshalUnsafe(dst) |
| 1410 |
return dst |
| 1411 |
} |
| 1412 |
|
| 1413 |
|
| 1414 |
func (s *SockErrCMsgIPv6) UnmarshalBytes(src []byte) []byte { |
| 1415 |
src = s.SockExtendedErr.UnmarshalUnsafe(src) |
| 1416 |
src = s.Offender.UnmarshalUnsafe(src) |
| 1417 |
return src |
| 1418 |
} |
| 1419 |
|
| 1420 |
|
| 1421 |
|
| 1422 |
func (s *SockErrCMsgIPv6) Packed() bool { |
| 1423 |
return s.Offender.Packed() && s.SockExtendedErr.Packed() |
| 1424 |
} |
| 1425 |
|
| 1426 |
|
| 1427 |
func (s *SockErrCMsgIPv6) MarshalUnsafe(dst []byte) []byte { |
| 1428 |
if s.Offender.Packed() && s.SockExtendedErr.Packed() { |
| 1429 |
size := s.SizeBytes() |
| 1430 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 1431 |
return dst[size:] |
| 1432 |
} |
| 1433 |
|
| 1434 |
return s.MarshalBytes(dst) |
| 1435 |
} |
| 1436 |
|
| 1437 |
|
| 1438 |
func (s *SockErrCMsgIPv6) UnmarshalUnsafe(src []byte) []byte { |
| 1439 |
if s.Offender.Packed() && s.SockExtendedErr.Packed() { |
| 1440 |
size := s.SizeBytes() |
| 1441 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 1442 |
return src[size:] |
| 1443 |
} |
| 1444 |
|
| 1445 |
return s.UnmarshalBytes(src) |
| 1446 |
} |
| 1447 |
|
| 1448 |
|
| 1449 |
|
| 1450 |
func (s *SockErrCMsgIPv6) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 1451 |
if !s.Offender.Packed() && s.SockExtendedErr.Packed() { |
| 1452 |
|
| 1453 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 1454 |
s.MarshalBytes(buf) |
| 1455 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 1456 |
} |
| 1457 |
|
| 1458 |
|
| 1459 |
var buf []byte |
| 1460 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1461 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 1462 |
hdr.Len = s.SizeBytes() |
| 1463 |
hdr.Cap = s.SizeBytes() |
| 1464 |
|
| 1465 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 1466 |
|
| 1467 |
|
| 1468 |
runtime.KeepAlive(s) |
| 1469 |
return length, err |
| 1470 |
} |
| 1471 |
|
| 1472 |
|
| 1473 |
|
| 1474 |
func (s *SockErrCMsgIPv6) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1475 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 1476 |
} |
| 1477 |
|
| 1478 |
|
| 1479 |
|
| 1480 |
func (s *SockErrCMsgIPv6) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1481 |
if !s.Offender.Packed() && s.SockExtendedErr.Packed() { |
| 1482 |
|
| 1483 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 1484 |
length, err := cc.CopyInBytes(addr, buf) |
| 1485 |
|
| 1486 |
|
| 1487 |
s.UnmarshalBytes(buf) |
| 1488 |
return length, err |
| 1489 |
} |
| 1490 |
|
| 1491 |
|
| 1492 |
var buf []byte |
| 1493 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1494 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 1495 |
hdr.Len = s.SizeBytes() |
| 1496 |
hdr.Cap = s.SizeBytes() |
| 1497 |
|
| 1498 |
length, err := cc.CopyInBytes(addr, buf) |
| 1499 |
|
| 1500 |
|
| 1501 |
runtime.KeepAlive(s) |
| 1502 |
return length, err |
| 1503 |
} |
| 1504 |
|
| 1505 |
|
| 1506 |
func (s *SockErrCMsgIPv6) WriteTo(writer io.Writer) (int64, error) { |
| 1507 |
if !s.Offender.Packed() && s.SockExtendedErr.Packed() { |
| 1508 |
|
| 1509 |
buf := make([]byte, s.SizeBytes()) |
| 1510 |
s.MarshalBytes(buf) |
| 1511 |
length, err := writer.Write(buf) |
| 1512 |
return int64(length), err |
| 1513 |
} |
| 1514 |
|
| 1515 |
|
| 1516 |
var buf []byte |
| 1517 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1518 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 1519 |
hdr.Len = s.SizeBytes() |
| 1520 |
hdr.Cap = s.SizeBytes() |
| 1521 |
|
| 1522 |
length, err := writer.Write(buf) |
| 1523 |
|
| 1524 |
|
| 1525 |
runtime.KeepAlive(s) |
| 1526 |
return int64(length), err |
| 1527 |
} |
| 1528 |
|
| 1529 |
|
| 1530 |
func (s *SockExtendedErr) SizeBytes() int { |
| 1531 |
return 16 |
| 1532 |
} |
| 1533 |
|
| 1534 |
|
| 1535 |
func (s *SockExtendedErr) MarshalBytes(dst []byte) []byte { |
| 1536 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Errno)) |
| 1537 |
dst = dst[4:] |
| 1538 |
dst[0] = byte(s.Origin) |
| 1539 |
dst = dst[1:] |
| 1540 |
dst[0] = byte(s.Type) |
| 1541 |
dst = dst[1:] |
| 1542 |
dst[0] = byte(s.Code) |
| 1543 |
dst = dst[1:] |
| 1544 |
dst[0] = byte(s.Pad) |
| 1545 |
dst = dst[1:] |
| 1546 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Info)) |
| 1547 |
dst = dst[4:] |
| 1548 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Data)) |
| 1549 |
dst = dst[4:] |
| 1550 |
return dst |
| 1551 |
} |
| 1552 |
|
| 1553 |
|
| 1554 |
func (s *SockExtendedErr) UnmarshalBytes(src []byte) []byte { |
| 1555 |
s.Errno = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1556 |
src = src[4:] |
| 1557 |
s.Origin = uint8(src[0]) |
| 1558 |
src = src[1:] |
| 1559 |
s.Type = uint8(src[0]) |
| 1560 |
src = src[1:] |
| 1561 |
s.Code = uint8(src[0]) |
| 1562 |
src = src[1:] |
| 1563 |
s.Pad = uint8(src[0]) |
| 1564 |
src = src[1:] |
| 1565 |
s.Info = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1566 |
src = src[4:] |
| 1567 |
s.Data = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1568 |
src = src[4:] |
| 1569 |
return src |
| 1570 |
} |
| 1571 |
|
| 1572 |
|
| 1573 |
|
| 1574 |
func (s *SockExtendedErr) Packed() bool { |
| 1575 |
return true |
| 1576 |
} |
| 1577 |
|
| 1578 |
|
| 1579 |
func (s *SockExtendedErr) MarshalUnsafe(dst []byte) []byte { |
| 1580 |
size := s.SizeBytes() |
| 1581 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 1582 |
return dst[size:] |
| 1583 |
} |
| 1584 |
|
| 1585 |
|
| 1586 |
func (s *SockExtendedErr) UnmarshalUnsafe(src []byte) []byte { |
| 1587 |
size := s.SizeBytes() |
| 1588 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 1589 |
return src[size:] |
| 1590 |
} |
| 1591 |
|
| 1592 |
|
| 1593 |
|
| 1594 |
func (s *SockExtendedErr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 1595 |
|
| 1596 |
var buf []byte |
| 1597 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1598 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 1599 |
hdr.Len = s.SizeBytes() |
| 1600 |
hdr.Cap = s.SizeBytes() |
| 1601 |
|
| 1602 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 1603 |
|
| 1604 |
|
| 1605 |
runtime.KeepAlive(s) |
| 1606 |
return length, err |
| 1607 |
} |
| 1608 |
|
| 1609 |
|
| 1610 |
|
| 1611 |
func (s *SockExtendedErr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1612 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 1613 |
} |
| 1614 |
|
| 1615 |
|
| 1616 |
|
| 1617 |
func (s *SockExtendedErr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1618 |
|
| 1619 |
var buf []byte |
| 1620 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1621 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 1622 |
hdr.Len = s.SizeBytes() |
| 1623 |
hdr.Cap = s.SizeBytes() |
| 1624 |
|
| 1625 |
length, err := cc.CopyInBytes(addr, buf) |
| 1626 |
|
| 1627 |
|
| 1628 |
runtime.KeepAlive(s) |
| 1629 |
return length, err |
| 1630 |
} |
| 1631 |
|
| 1632 |
|
| 1633 |
func (s *SockExtendedErr) WriteTo(writer io.Writer) (int64, error) { |
| 1634 |
|
| 1635 |
var buf []byte |
| 1636 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1637 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 1638 |
hdr.Len = s.SizeBytes() |
| 1639 |
hdr.Cap = s.SizeBytes() |
| 1640 |
|
| 1641 |
length, err := writer.Write(buf) |
| 1642 |
|
| 1643 |
|
| 1644 |
runtime.KeepAlive(s) |
| 1645 |
return int64(length), err |
| 1646 |
} |
| 1647 |
|
| 1648 |
|
| 1649 |
func (f *FOwnerEx) SizeBytes() int { |
| 1650 |
return 8 |
| 1651 |
} |
| 1652 |
|
| 1653 |
|
| 1654 |
func (f *FOwnerEx) MarshalBytes(dst []byte) []byte { |
| 1655 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Type)) |
| 1656 |
dst = dst[4:] |
| 1657 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.PID)) |
| 1658 |
dst = dst[4:] |
| 1659 |
return dst |
| 1660 |
} |
| 1661 |
|
| 1662 |
|
| 1663 |
func (f *FOwnerEx) UnmarshalBytes(src []byte) []byte { |
| 1664 |
f.Type = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1665 |
src = src[4:] |
| 1666 |
f.PID = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1667 |
src = src[4:] |
| 1668 |
return src |
| 1669 |
} |
| 1670 |
|
| 1671 |
|
| 1672 |
|
| 1673 |
func (f *FOwnerEx) Packed() bool { |
| 1674 |
return true |
| 1675 |
} |
| 1676 |
|
| 1677 |
|
| 1678 |
func (f *FOwnerEx) MarshalUnsafe(dst []byte) []byte { |
| 1679 |
size := f.SizeBytes() |
| 1680 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 1681 |
return dst[size:] |
| 1682 |
} |
| 1683 |
|
| 1684 |
|
| 1685 |
func (f *FOwnerEx) UnmarshalUnsafe(src []byte) []byte { |
| 1686 |
size := f.SizeBytes() |
| 1687 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 1688 |
return src[size:] |
| 1689 |
} |
| 1690 |
|
| 1691 |
|
| 1692 |
|
| 1693 |
func (f *FOwnerEx) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 1694 |
|
| 1695 |
var buf []byte |
| 1696 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1697 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 1698 |
hdr.Len = f.SizeBytes() |
| 1699 |
hdr.Cap = f.SizeBytes() |
| 1700 |
|
| 1701 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 1702 |
|
| 1703 |
|
| 1704 |
runtime.KeepAlive(f) |
| 1705 |
return length, err |
| 1706 |
} |
| 1707 |
|
| 1708 |
|
| 1709 |
|
| 1710 |
func (f *FOwnerEx) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1711 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 1712 |
} |
| 1713 |
|
| 1714 |
|
| 1715 |
|
| 1716 |
func (f *FOwnerEx) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1717 |
|
| 1718 |
var buf []byte |
| 1719 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1720 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 1721 |
hdr.Len = f.SizeBytes() |
| 1722 |
hdr.Cap = f.SizeBytes() |
| 1723 |
|
| 1724 |
length, err := cc.CopyInBytes(addr, buf) |
| 1725 |
|
| 1726 |
|
| 1727 |
runtime.KeepAlive(f) |
| 1728 |
return length, err |
| 1729 |
} |
| 1730 |
|
| 1731 |
|
| 1732 |
func (f *FOwnerEx) WriteTo(writer io.Writer) (int64, error) { |
| 1733 |
|
| 1734 |
var buf []byte |
| 1735 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1736 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 1737 |
hdr.Len = f.SizeBytes() |
| 1738 |
hdr.Cap = f.SizeBytes() |
| 1739 |
|
| 1740 |
length, err := writer.Write(buf) |
| 1741 |
|
| 1742 |
|
| 1743 |
runtime.KeepAlive(f) |
| 1744 |
return int64(length), err |
| 1745 |
} |
| 1746 |
|
| 1747 |
|
| 1748 |
func (f *Flock) SizeBytes() int { |
| 1749 |
return 24 + |
| 1750 |
1*4 + |
| 1751 |
1*4 |
| 1752 |
} |
| 1753 |
|
| 1754 |
|
| 1755 |
func (f *Flock) MarshalBytes(dst []byte) []byte { |
| 1756 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(f.Type)) |
| 1757 |
dst = dst[2:] |
| 1758 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(f.Whence)) |
| 1759 |
dst = dst[2:] |
| 1760 |
|
| 1761 |
dst = dst[1*(4):] |
| 1762 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Start)) |
| 1763 |
dst = dst[8:] |
| 1764 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Len)) |
| 1765 |
dst = dst[8:] |
| 1766 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.PID)) |
| 1767 |
dst = dst[4:] |
| 1768 |
|
| 1769 |
dst = dst[1*(4):] |
| 1770 |
return dst |
| 1771 |
} |
| 1772 |
|
| 1773 |
|
| 1774 |
func (f *Flock) UnmarshalBytes(src []byte) []byte { |
| 1775 |
f.Type = int16(hostarch.ByteOrder.Uint16(src[:2])) |
| 1776 |
src = src[2:] |
| 1777 |
f.Whence = int16(hostarch.ByteOrder.Uint16(src[:2])) |
| 1778 |
src = src[2:] |
| 1779 |
|
| 1780 |
src = src[1*(4):] |
| 1781 |
f.Start = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1782 |
src = src[8:] |
| 1783 |
f.Len = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 1784 |
src = src[8:] |
| 1785 |
f.PID = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 1786 |
src = src[4:] |
| 1787 |
|
| 1788 |
src = src[1*(4):] |
| 1789 |
return src |
| 1790 |
} |
| 1791 |
|
| 1792 |
|
| 1793 |
|
| 1794 |
func (f *Flock) Packed() bool { |
| 1795 |
return true |
| 1796 |
} |
| 1797 |
|
| 1798 |
|
| 1799 |
func (f *Flock) MarshalUnsafe(dst []byte) []byte { |
| 1800 |
size := f.SizeBytes() |
| 1801 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 1802 |
return dst[size:] |
| 1803 |
} |
| 1804 |
|
| 1805 |
|
| 1806 |
func (f *Flock) UnmarshalUnsafe(src []byte) []byte { |
| 1807 |
size := f.SizeBytes() |
| 1808 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 1809 |
return src[size:] |
| 1810 |
} |
| 1811 |
|
| 1812 |
|
| 1813 |
|
| 1814 |
func (f *Flock) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 1815 |
|
| 1816 |
var buf []byte |
| 1817 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1818 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 1819 |
hdr.Len = f.SizeBytes() |
| 1820 |
hdr.Cap = f.SizeBytes() |
| 1821 |
|
| 1822 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 1823 |
|
| 1824 |
|
| 1825 |
runtime.KeepAlive(f) |
| 1826 |
return length, err |
| 1827 |
} |
| 1828 |
|
| 1829 |
|
| 1830 |
|
| 1831 |
func (f *Flock) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1832 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 1833 |
} |
| 1834 |
|
| 1835 |
|
| 1836 |
|
| 1837 |
func (f *Flock) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1838 |
|
| 1839 |
var buf []byte |
| 1840 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1841 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 1842 |
hdr.Len = f.SizeBytes() |
| 1843 |
hdr.Cap = f.SizeBytes() |
| 1844 |
|
| 1845 |
length, err := cc.CopyInBytes(addr, buf) |
| 1846 |
|
| 1847 |
|
| 1848 |
runtime.KeepAlive(f) |
| 1849 |
return length, err |
| 1850 |
} |
| 1851 |
|
| 1852 |
|
| 1853 |
func (f *Flock) WriteTo(writer io.Writer) (int64, error) { |
| 1854 |
|
| 1855 |
var buf []byte |
| 1856 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1857 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 1858 |
hdr.Len = f.SizeBytes() |
| 1859 |
hdr.Cap = f.SizeBytes() |
| 1860 |
|
| 1861 |
length, err := writer.Write(buf) |
| 1862 |
|
| 1863 |
|
| 1864 |
runtime.KeepAlive(f) |
| 1865 |
return int64(length), err |
| 1866 |
} |
| 1867 |
|
| 1868 |
|
| 1869 |
|
| 1870 |
func (m *FileMode) SizeBytes() int { |
| 1871 |
return 2 |
| 1872 |
} |
| 1873 |
|
| 1874 |
|
| 1875 |
func (m *FileMode) MarshalBytes(dst []byte) []byte { |
| 1876 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(*m)) |
| 1877 |
return dst[2:] |
| 1878 |
} |
| 1879 |
|
| 1880 |
|
| 1881 |
func (m *FileMode) UnmarshalBytes(src []byte) []byte { |
| 1882 |
*m = FileMode(uint16(hostarch.ByteOrder.Uint16(src[:2]))) |
| 1883 |
return src[2:] |
| 1884 |
} |
| 1885 |
|
| 1886 |
|
| 1887 |
|
| 1888 |
func (m *FileMode) Packed() bool { |
| 1889 |
|
| 1890 |
return true |
| 1891 |
} |
| 1892 |
|
| 1893 |
|
| 1894 |
func (m *FileMode) MarshalUnsafe(dst []byte) []byte { |
| 1895 |
size := m.SizeBytes() |
| 1896 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(size)) |
| 1897 |
return dst[size:] |
| 1898 |
} |
| 1899 |
|
| 1900 |
|
| 1901 |
func (m *FileMode) UnmarshalUnsafe(src []byte) []byte { |
| 1902 |
size := m.SizeBytes() |
| 1903 |
gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(size)) |
| 1904 |
return src[size:] |
| 1905 |
} |
| 1906 |
|
| 1907 |
|
| 1908 |
|
| 1909 |
func (m *FileMode) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 1910 |
|
| 1911 |
var buf []byte |
| 1912 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1913 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) |
| 1914 |
hdr.Len = m.SizeBytes() |
| 1915 |
hdr.Cap = m.SizeBytes() |
| 1916 |
|
| 1917 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 1918 |
|
| 1919 |
|
| 1920 |
runtime.KeepAlive(m) |
| 1921 |
return length, err |
| 1922 |
} |
| 1923 |
|
| 1924 |
|
| 1925 |
|
| 1926 |
func (m *FileMode) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1927 |
return m.CopyOutN(cc, addr, m.SizeBytes()) |
| 1928 |
} |
| 1929 |
|
| 1930 |
|
| 1931 |
|
| 1932 |
func (m *FileMode) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 1933 |
|
| 1934 |
var buf []byte |
| 1935 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1936 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) |
| 1937 |
hdr.Len = m.SizeBytes() |
| 1938 |
hdr.Cap = m.SizeBytes() |
| 1939 |
|
| 1940 |
length, err := cc.CopyInBytes(addr, buf) |
| 1941 |
|
| 1942 |
|
| 1943 |
runtime.KeepAlive(m) |
| 1944 |
return length, err |
| 1945 |
} |
| 1946 |
|
| 1947 |
|
| 1948 |
func (m *FileMode) WriteTo(writer io.Writer) (int64, error) { |
| 1949 |
|
| 1950 |
var buf []byte |
| 1951 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 1952 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) |
| 1953 |
hdr.Len = m.SizeBytes() |
| 1954 |
hdr.Cap = m.SizeBytes() |
| 1955 |
|
| 1956 |
length, err := writer.Write(buf) |
| 1957 |
|
| 1958 |
|
| 1959 |
runtime.KeepAlive(m) |
| 1960 |
return int64(length), err |
| 1961 |
} |
| 1962 |
|
| 1963 |
|
| 1964 |
func (s *Statx) SizeBytes() int { |
| 1965 |
return 80 + |
| 1966 |
(*StatxTimestamp)(nil).SizeBytes() + |
| 1967 |
(*StatxTimestamp)(nil).SizeBytes() + |
| 1968 |
(*StatxTimestamp)(nil).SizeBytes() + |
| 1969 |
(*StatxTimestamp)(nil).SizeBytes() |
| 1970 |
} |
| 1971 |
|
| 1972 |
|
| 1973 |
func (s *Statx) MarshalBytes(dst []byte) []byte { |
| 1974 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Mask)) |
| 1975 |
dst = dst[4:] |
| 1976 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Blksize)) |
| 1977 |
dst = dst[4:] |
| 1978 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Attributes)) |
| 1979 |
dst = dst[8:] |
| 1980 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Nlink)) |
| 1981 |
dst = dst[4:] |
| 1982 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.UID)) |
| 1983 |
dst = dst[4:] |
| 1984 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.GID)) |
| 1985 |
dst = dst[4:] |
| 1986 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Mode)) |
| 1987 |
dst = dst[2:] |
| 1988 |
|
| 1989 |
dst = dst[2:] |
| 1990 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Ino)) |
| 1991 |
dst = dst[8:] |
| 1992 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Size)) |
| 1993 |
dst = dst[8:] |
| 1994 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Blocks)) |
| 1995 |
dst = dst[8:] |
| 1996 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.AttributesMask)) |
| 1997 |
dst = dst[8:] |
| 1998 |
dst = s.Atime.MarshalUnsafe(dst) |
| 1999 |
dst = s.Btime.MarshalUnsafe(dst) |
| 2000 |
dst = s.Ctime.MarshalUnsafe(dst) |
| 2001 |
dst = s.Mtime.MarshalUnsafe(dst) |
| 2002 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.RdevMajor)) |
| 2003 |
dst = dst[4:] |
| 2004 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.RdevMinor)) |
| 2005 |
dst = dst[4:] |
| 2006 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.DevMajor)) |
| 2007 |
dst = dst[4:] |
| 2008 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.DevMinor)) |
| 2009 |
dst = dst[4:] |
| 2010 |
return dst |
| 2011 |
} |
| 2012 |
|
| 2013 |
|
| 2014 |
func (s *Statx) UnmarshalBytes(src []byte) []byte { |
| 2015 |
s.Mask = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2016 |
src = src[4:] |
| 2017 |
s.Blksize = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2018 |
src = src[4:] |
| 2019 |
s.Attributes = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2020 |
src = src[8:] |
| 2021 |
s.Nlink = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2022 |
src = src[4:] |
| 2023 |
s.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2024 |
src = src[4:] |
| 2025 |
s.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2026 |
src = src[4:] |
| 2027 |
s.Mode = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 2028 |
src = src[2:] |
| 2029 |
|
| 2030 |
src = src[2:] |
| 2031 |
s.Ino = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2032 |
src = src[8:] |
| 2033 |
s.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2034 |
src = src[8:] |
| 2035 |
s.Blocks = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2036 |
src = src[8:] |
| 2037 |
s.AttributesMask = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2038 |
src = src[8:] |
| 2039 |
src = s.Atime.UnmarshalUnsafe(src) |
| 2040 |
src = s.Btime.UnmarshalUnsafe(src) |
| 2041 |
src = s.Ctime.UnmarshalUnsafe(src) |
| 2042 |
src = s.Mtime.UnmarshalUnsafe(src) |
| 2043 |
s.RdevMajor = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2044 |
src = src[4:] |
| 2045 |
s.RdevMinor = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2046 |
src = src[4:] |
| 2047 |
s.DevMajor = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2048 |
src = src[4:] |
| 2049 |
s.DevMinor = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2050 |
src = src[4:] |
| 2051 |
return src |
| 2052 |
} |
| 2053 |
|
| 2054 |
|
| 2055 |
|
| 2056 |
func (s *Statx) Packed() bool { |
| 2057 |
return s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() |
| 2058 |
} |
| 2059 |
|
| 2060 |
|
| 2061 |
func (s *Statx) MarshalUnsafe(dst []byte) []byte { |
| 2062 |
if s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { |
| 2063 |
size := s.SizeBytes() |
| 2064 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 2065 |
return dst[size:] |
| 2066 |
} |
| 2067 |
|
| 2068 |
return s.MarshalBytes(dst) |
| 2069 |
} |
| 2070 |
|
| 2071 |
|
| 2072 |
func (s *Statx) UnmarshalUnsafe(src []byte) []byte { |
| 2073 |
if s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { |
| 2074 |
size := s.SizeBytes() |
| 2075 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 2076 |
return src[size:] |
| 2077 |
} |
| 2078 |
|
| 2079 |
return s.UnmarshalBytes(src) |
| 2080 |
} |
| 2081 |
|
| 2082 |
|
| 2083 |
|
| 2084 |
func (s *Statx) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 2085 |
if !s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { |
| 2086 |
|
| 2087 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 2088 |
s.MarshalBytes(buf) |
| 2089 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 2090 |
} |
| 2091 |
|
| 2092 |
|
| 2093 |
var buf []byte |
| 2094 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2095 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 2096 |
hdr.Len = s.SizeBytes() |
| 2097 |
hdr.Cap = s.SizeBytes() |
| 2098 |
|
| 2099 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 2100 |
|
| 2101 |
|
| 2102 |
runtime.KeepAlive(s) |
| 2103 |
return length, err |
| 2104 |
} |
| 2105 |
|
| 2106 |
|
| 2107 |
|
| 2108 |
func (s *Statx) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2109 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 2110 |
} |
| 2111 |
|
| 2112 |
|
| 2113 |
|
| 2114 |
func (s *Statx) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2115 |
if !s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { |
| 2116 |
|
| 2117 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 2118 |
length, err := cc.CopyInBytes(addr, buf) |
| 2119 |
|
| 2120 |
|
| 2121 |
s.UnmarshalBytes(buf) |
| 2122 |
return length, err |
| 2123 |
} |
| 2124 |
|
| 2125 |
|
| 2126 |
var buf []byte |
| 2127 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2128 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 2129 |
hdr.Len = s.SizeBytes() |
| 2130 |
hdr.Cap = s.SizeBytes() |
| 2131 |
|
| 2132 |
length, err := cc.CopyInBytes(addr, buf) |
| 2133 |
|
| 2134 |
|
| 2135 |
runtime.KeepAlive(s) |
| 2136 |
return length, err |
| 2137 |
} |
| 2138 |
|
| 2139 |
|
| 2140 |
func (s *Statx) WriteTo(writer io.Writer) (int64, error) { |
| 2141 |
if !s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { |
| 2142 |
|
| 2143 |
buf := make([]byte, s.SizeBytes()) |
| 2144 |
s.MarshalBytes(buf) |
| 2145 |
length, err := writer.Write(buf) |
| 2146 |
return int64(length), err |
| 2147 |
} |
| 2148 |
|
| 2149 |
|
| 2150 |
var buf []byte |
| 2151 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2152 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 2153 |
hdr.Len = s.SizeBytes() |
| 2154 |
hdr.Cap = s.SizeBytes() |
| 2155 |
|
| 2156 |
length, err := writer.Write(buf) |
| 2157 |
|
| 2158 |
|
| 2159 |
runtime.KeepAlive(s) |
| 2160 |
return int64(length), err |
| 2161 |
} |
| 2162 |
|
| 2163 |
|
| 2164 |
func (s *Statx) CheckedMarshal(dst []byte) ([]byte, bool) { |
| 2165 |
if s.SizeBytes() > len(dst) { |
| 2166 |
return dst, false |
| 2167 |
} |
| 2168 |
return s.MarshalUnsafe(dst), true |
| 2169 |
} |
| 2170 |
|
| 2171 |
|
| 2172 |
func (s *Statx) CheckedUnmarshal(src []byte) ([]byte, bool) { |
| 2173 |
if s.SizeBytes() > len(src) { |
| 2174 |
return src, false |
| 2175 |
} |
| 2176 |
return s.UnmarshalUnsafe(src), true |
| 2177 |
} |
| 2178 |
|
| 2179 |
|
| 2180 |
func CopyStatxSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []Statx) (int, error) { |
| 2181 |
count := len(dst) |
| 2182 |
if count == 0 { |
| 2183 |
return 0, nil |
| 2184 |
} |
| 2185 |
size := (*Statx)(nil).SizeBytes() |
| 2186 |
|
| 2187 |
if !dst[0].Packed() { |
| 2188 |
|
| 2189 |
buf := cc.CopyScratchBuffer(size * count) |
| 2190 |
length, err := cc.CopyInBytes(addr, buf) |
| 2191 |
|
| 2192 |
|
| 2193 |
limit := length/size |
| 2194 |
for idx := 0; idx < limit; idx++ { |
| 2195 |
buf = dst[idx].UnmarshalBytes(buf) |
| 2196 |
} |
| 2197 |
|
| 2198 |
|
| 2199 |
|
| 2200 |
|
| 2201 |
if length%size != 0 { |
| 2202 |
dst[limit].UnmarshalBytes(buf) |
| 2203 |
} |
| 2204 |
|
| 2205 |
return length, err |
| 2206 |
} |
| 2207 |
|
| 2208 |
ptr := unsafe.Pointer(&dst) |
| 2209 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 2210 |
|
| 2211 |
|
| 2212 |
var buf []byte |
| 2213 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2214 |
hdr.Data = uintptr(val) |
| 2215 |
hdr.Len = size * count |
| 2216 |
hdr.Cap = size * count |
| 2217 |
|
| 2218 |
length, err := cc.CopyInBytes(addr, buf) |
| 2219 |
|
| 2220 |
|
| 2221 |
runtime.KeepAlive(dst) |
| 2222 |
return length, err |
| 2223 |
} |
| 2224 |
|
| 2225 |
|
| 2226 |
func CopyStatxSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []Statx) (int, error) { |
| 2227 |
count := len(src) |
| 2228 |
if count == 0 { |
| 2229 |
return 0, nil |
| 2230 |
} |
| 2231 |
size := (*Statx)(nil).SizeBytes() |
| 2232 |
|
| 2233 |
if !src[0].Packed() { |
| 2234 |
|
| 2235 |
buf := cc.CopyScratchBuffer(size * count) |
| 2236 |
curBuf := buf |
| 2237 |
for idx := 0; idx < count; idx++ { |
| 2238 |
curBuf = src[idx].MarshalBytes(curBuf) |
| 2239 |
} |
| 2240 |
return cc.CopyOutBytes(addr, buf) |
| 2241 |
} |
| 2242 |
|
| 2243 |
ptr := unsafe.Pointer(&src) |
| 2244 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 2245 |
|
| 2246 |
|
| 2247 |
var buf []byte |
| 2248 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2249 |
hdr.Data = uintptr(val) |
| 2250 |
hdr.Len = size * count |
| 2251 |
hdr.Cap = size * count |
| 2252 |
|
| 2253 |
length, err := cc.CopyOutBytes(addr, buf) |
| 2254 |
|
| 2255 |
|
| 2256 |
runtime.KeepAlive(src) |
| 2257 |
return length, err |
| 2258 |
} |
| 2259 |
|
| 2260 |
|
| 2261 |
func MarshalUnsafeStatxSlice(src []Statx, dst []byte) []byte { |
| 2262 |
count := len(src) |
| 2263 |
if count == 0 { |
| 2264 |
return dst |
| 2265 |
} |
| 2266 |
|
| 2267 |
if !src[0].Packed() { |
| 2268 |
|
| 2269 |
for idx := 0; idx < count; idx++ { |
| 2270 |
dst = src[idx].MarshalBytes(dst) |
| 2271 |
} |
| 2272 |
return dst |
| 2273 |
} |
| 2274 |
|
| 2275 |
size := (*Statx)(nil).SizeBytes() |
| 2276 |
buf := dst[:size*count] |
| 2277 |
gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) |
| 2278 |
return dst[size*count:] |
| 2279 |
} |
| 2280 |
|
| 2281 |
|
| 2282 |
func UnmarshalUnsafeStatxSlice(dst []Statx, src []byte) []byte { |
| 2283 |
count := len(dst) |
| 2284 |
if count == 0 { |
| 2285 |
return src |
| 2286 |
} |
| 2287 |
|
| 2288 |
if !dst[0].Packed() { |
| 2289 |
|
| 2290 |
for idx := 0; idx < count; idx++ { |
| 2291 |
src = dst[idx].UnmarshalBytes(src) |
| 2292 |
} |
| 2293 |
return src |
| 2294 |
} |
| 2295 |
|
| 2296 |
size := (*Statx)(nil).SizeBytes() |
| 2297 |
buf := src[:size*count] |
| 2298 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) |
| 2299 |
return src[size*count:] |
| 2300 |
} |
| 2301 |
|
| 2302 |
|
| 2303 |
func (s *Statfs) SizeBytes() int { |
| 2304 |
return 80 + |
| 2305 |
4*2 + |
| 2306 |
8*4 |
| 2307 |
} |
| 2308 |
|
| 2309 |
|
| 2310 |
func (s *Statfs) MarshalBytes(dst []byte) []byte { |
| 2311 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Type)) |
| 2312 |
dst = dst[8:] |
| 2313 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.BlockSize)) |
| 2314 |
dst = dst[8:] |
| 2315 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Blocks)) |
| 2316 |
dst = dst[8:] |
| 2317 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.BlocksFree)) |
| 2318 |
dst = dst[8:] |
| 2319 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.BlocksAvailable)) |
| 2320 |
dst = dst[8:] |
| 2321 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Files)) |
| 2322 |
dst = dst[8:] |
| 2323 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.FilesFree)) |
| 2324 |
dst = dst[8:] |
| 2325 |
for idx := 0; idx < 2; idx++ { |
| 2326 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.FSID[idx])) |
| 2327 |
dst = dst[4:] |
| 2328 |
} |
| 2329 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.NameLength)) |
| 2330 |
dst = dst[8:] |
| 2331 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.FragmentSize)) |
| 2332 |
dst = dst[8:] |
| 2333 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Flags)) |
| 2334 |
dst = dst[8:] |
| 2335 |
for idx := 0; idx < 4; idx++ { |
| 2336 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Spare[idx])) |
| 2337 |
dst = dst[8:] |
| 2338 |
} |
| 2339 |
return dst |
| 2340 |
} |
| 2341 |
|
| 2342 |
|
| 2343 |
func (s *Statfs) UnmarshalBytes(src []byte) []byte { |
| 2344 |
s.Type = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2345 |
src = src[8:] |
| 2346 |
s.BlockSize = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2347 |
src = src[8:] |
| 2348 |
s.Blocks = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2349 |
src = src[8:] |
| 2350 |
s.BlocksFree = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2351 |
src = src[8:] |
| 2352 |
s.BlocksAvailable = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2353 |
src = src[8:] |
| 2354 |
s.Files = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2355 |
src = src[8:] |
| 2356 |
s.FilesFree = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2357 |
src = src[8:] |
| 2358 |
for idx := 0; idx < 2; idx++ { |
| 2359 |
s.FSID[idx] = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2360 |
src = src[4:] |
| 2361 |
} |
| 2362 |
s.NameLength = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2363 |
src = src[8:] |
| 2364 |
s.FragmentSize = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2365 |
src = src[8:] |
| 2366 |
s.Flags = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2367 |
src = src[8:] |
| 2368 |
for idx := 0; idx < 4; idx++ { |
| 2369 |
s.Spare[idx] = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2370 |
src = src[8:] |
| 2371 |
} |
| 2372 |
return src |
| 2373 |
} |
| 2374 |
|
| 2375 |
|
| 2376 |
|
| 2377 |
func (s *Statfs) Packed() bool { |
| 2378 |
return true |
| 2379 |
} |
| 2380 |
|
| 2381 |
|
| 2382 |
func (s *Statfs) MarshalUnsafe(dst []byte) []byte { |
| 2383 |
size := s.SizeBytes() |
| 2384 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 2385 |
return dst[size:] |
| 2386 |
} |
| 2387 |
|
| 2388 |
|
| 2389 |
func (s *Statfs) UnmarshalUnsafe(src []byte) []byte { |
| 2390 |
size := s.SizeBytes() |
| 2391 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 2392 |
return src[size:] |
| 2393 |
} |
| 2394 |
|
| 2395 |
|
| 2396 |
|
| 2397 |
func (s *Statfs) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 2398 |
|
| 2399 |
var buf []byte |
| 2400 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2401 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 2402 |
hdr.Len = s.SizeBytes() |
| 2403 |
hdr.Cap = s.SizeBytes() |
| 2404 |
|
| 2405 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 2406 |
|
| 2407 |
|
| 2408 |
runtime.KeepAlive(s) |
| 2409 |
return length, err |
| 2410 |
} |
| 2411 |
|
| 2412 |
|
| 2413 |
|
| 2414 |
func (s *Statfs) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2415 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 2416 |
} |
| 2417 |
|
| 2418 |
|
| 2419 |
|
| 2420 |
func (s *Statfs) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2421 |
|
| 2422 |
var buf []byte |
| 2423 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2424 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 2425 |
hdr.Len = s.SizeBytes() |
| 2426 |
hdr.Cap = s.SizeBytes() |
| 2427 |
|
| 2428 |
length, err := cc.CopyInBytes(addr, buf) |
| 2429 |
|
| 2430 |
|
| 2431 |
runtime.KeepAlive(s) |
| 2432 |
return length, err |
| 2433 |
} |
| 2434 |
|
| 2435 |
|
| 2436 |
func (s *Statfs) WriteTo(writer io.Writer) (int64, error) { |
| 2437 |
|
| 2438 |
var buf []byte |
| 2439 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2440 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 2441 |
hdr.Len = s.SizeBytes() |
| 2442 |
hdr.Cap = s.SizeBytes() |
| 2443 |
|
| 2444 |
length, err := writer.Write(buf) |
| 2445 |
|
| 2446 |
|
| 2447 |
runtime.KeepAlive(s) |
| 2448 |
return int64(length), err |
| 2449 |
} |
| 2450 |
|
| 2451 |
|
| 2452 |
|
| 2453 |
func (s *CString) Packed() bool { |
| 2454 |
|
| 2455 |
return false |
| 2456 |
} |
| 2457 |
|
| 2458 |
|
| 2459 |
func (s *CString) MarshalUnsafe(dst []byte) []byte { |
| 2460 |
|
| 2461 |
return s.MarshalBytes(dst) |
| 2462 |
} |
| 2463 |
|
| 2464 |
|
| 2465 |
func (s *CString) UnmarshalUnsafe(src []byte) []byte { |
| 2466 |
|
| 2467 |
return s.UnmarshalBytes(src) |
| 2468 |
} |
| 2469 |
|
| 2470 |
|
| 2471 |
|
| 2472 |
func (s *CString) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 2473 |
|
| 2474 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 2475 |
s.MarshalBytes(buf) |
| 2476 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 2477 |
} |
| 2478 |
|
| 2479 |
|
| 2480 |
|
| 2481 |
func (s *CString) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2482 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 2483 |
} |
| 2484 |
|
| 2485 |
|
| 2486 |
|
| 2487 |
func (s *CString) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2488 |
|
| 2489 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 2490 |
length, err := cc.CopyInBytes(addr, buf) |
| 2491 |
|
| 2492 |
|
| 2493 |
s.UnmarshalBytes(buf) |
| 2494 |
return length, err |
| 2495 |
} |
| 2496 |
|
| 2497 |
|
| 2498 |
func (s *CString) WriteTo(writer io.Writer) (int64, error) { |
| 2499 |
|
| 2500 |
buf := make([]byte, s.SizeBytes()) |
| 2501 |
s.MarshalBytes(buf) |
| 2502 |
length, err := writer.Write(buf) |
| 2503 |
return int64(length), err |
| 2504 |
} |
| 2505 |
|
| 2506 |
|
| 2507 |
func (f *FUSEAttr) SizeBytes() int { |
| 2508 |
return 88 |
| 2509 |
} |
| 2510 |
|
| 2511 |
|
| 2512 |
func (f *FUSEAttr) MarshalBytes(dst []byte) []byte { |
| 2513 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Ino)) |
| 2514 |
dst = dst[8:] |
| 2515 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Size)) |
| 2516 |
dst = dst[8:] |
| 2517 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Blocks)) |
| 2518 |
dst = dst[8:] |
| 2519 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Atime)) |
| 2520 |
dst = dst[8:] |
| 2521 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Mtime)) |
| 2522 |
dst = dst[8:] |
| 2523 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Ctime)) |
| 2524 |
dst = dst[8:] |
| 2525 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.AtimeNsec)) |
| 2526 |
dst = dst[4:] |
| 2527 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.MtimeNsec)) |
| 2528 |
dst = dst[4:] |
| 2529 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.CtimeNsec)) |
| 2530 |
dst = dst[4:] |
| 2531 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mode)) |
| 2532 |
dst = dst[4:] |
| 2533 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Nlink)) |
| 2534 |
dst = dst[4:] |
| 2535 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.UID)) |
| 2536 |
dst = dst[4:] |
| 2537 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.GID)) |
| 2538 |
dst = dst[4:] |
| 2539 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Rdev)) |
| 2540 |
dst = dst[4:] |
| 2541 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.BlkSize)) |
| 2542 |
dst = dst[4:] |
| 2543 |
|
| 2544 |
dst = dst[4:] |
| 2545 |
return dst |
| 2546 |
} |
| 2547 |
|
| 2548 |
|
| 2549 |
func (f *FUSEAttr) UnmarshalBytes(src []byte) []byte { |
| 2550 |
f.Ino = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2551 |
src = src[8:] |
| 2552 |
f.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2553 |
src = src[8:] |
| 2554 |
f.Blocks = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2555 |
src = src[8:] |
| 2556 |
f.Atime = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2557 |
src = src[8:] |
| 2558 |
f.Mtime = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2559 |
src = src[8:] |
| 2560 |
f.Ctime = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2561 |
src = src[8:] |
| 2562 |
f.AtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2563 |
src = src[4:] |
| 2564 |
f.MtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2565 |
src = src[4:] |
| 2566 |
f.CtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2567 |
src = src[4:] |
| 2568 |
f.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2569 |
src = src[4:] |
| 2570 |
f.Nlink = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2571 |
src = src[4:] |
| 2572 |
f.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2573 |
src = src[4:] |
| 2574 |
f.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2575 |
src = src[4:] |
| 2576 |
f.Rdev = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2577 |
src = src[4:] |
| 2578 |
f.BlkSize = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2579 |
src = src[4:] |
| 2580 |
|
| 2581 |
src = src[4:] |
| 2582 |
return src |
| 2583 |
} |
| 2584 |
|
| 2585 |
|
| 2586 |
|
| 2587 |
func (f *FUSEAttr) Packed() bool { |
| 2588 |
return true |
| 2589 |
} |
| 2590 |
|
| 2591 |
|
| 2592 |
func (f *FUSEAttr) MarshalUnsafe(dst []byte) []byte { |
| 2593 |
size := f.SizeBytes() |
| 2594 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 2595 |
return dst[size:] |
| 2596 |
} |
| 2597 |
|
| 2598 |
|
| 2599 |
func (f *FUSEAttr) UnmarshalUnsafe(src []byte) []byte { |
| 2600 |
size := f.SizeBytes() |
| 2601 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 2602 |
return src[size:] |
| 2603 |
} |
| 2604 |
|
| 2605 |
|
| 2606 |
|
| 2607 |
func (f *FUSEAttr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 2608 |
|
| 2609 |
var buf []byte |
| 2610 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2611 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 2612 |
hdr.Len = f.SizeBytes() |
| 2613 |
hdr.Cap = f.SizeBytes() |
| 2614 |
|
| 2615 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 2616 |
|
| 2617 |
|
| 2618 |
runtime.KeepAlive(f) |
| 2619 |
return length, err |
| 2620 |
} |
| 2621 |
|
| 2622 |
|
| 2623 |
|
| 2624 |
func (f *FUSEAttr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2625 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 2626 |
} |
| 2627 |
|
| 2628 |
|
| 2629 |
|
| 2630 |
func (f *FUSEAttr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2631 |
|
| 2632 |
var buf []byte |
| 2633 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2634 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 2635 |
hdr.Len = f.SizeBytes() |
| 2636 |
hdr.Cap = f.SizeBytes() |
| 2637 |
|
| 2638 |
length, err := cc.CopyInBytes(addr, buf) |
| 2639 |
|
| 2640 |
|
| 2641 |
runtime.KeepAlive(f) |
| 2642 |
return length, err |
| 2643 |
} |
| 2644 |
|
| 2645 |
|
| 2646 |
func (f *FUSEAttr) WriteTo(writer io.Writer) (int64, error) { |
| 2647 |
|
| 2648 |
var buf []byte |
| 2649 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2650 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 2651 |
hdr.Len = f.SizeBytes() |
| 2652 |
hdr.Cap = f.SizeBytes() |
| 2653 |
|
| 2654 |
length, err := writer.Write(buf) |
| 2655 |
|
| 2656 |
|
| 2657 |
runtime.KeepAlive(f) |
| 2658 |
return int64(length), err |
| 2659 |
} |
| 2660 |
|
| 2661 |
|
| 2662 |
|
| 2663 |
func (r *FUSECreateIn) Packed() bool { |
| 2664 |
|
| 2665 |
return false |
| 2666 |
} |
| 2667 |
|
| 2668 |
|
| 2669 |
func (r *FUSECreateIn) MarshalUnsafe(dst []byte) []byte { |
| 2670 |
|
| 2671 |
return r.MarshalBytes(dst) |
| 2672 |
} |
| 2673 |
|
| 2674 |
|
| 2675 |
func (r *FUSECreateIn) UnmarshalUnsafe(src []byte) []byte { |
| 2676 |
|
| 2677 |
return r.UnmarshalBytes(src) |
| 2678 |
} |
| 2679 |
|
| 2680 |
|
| 2681 |
|
| 2682 |
func (r *FUSECreateIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 2683 |
|
| 2684 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 2685 |
r.MarshalBytes(buf) |
| 2686 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 2687 |
} |
| 2688 |
|
| 2689 |
|
| 2690 |
|
| 2691 |
func (r *FUSECreateIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2692 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 2693 |
} |
| 2694 |
|
| 2695 |
|
| 2696 |
|
| 2697 |
func (r *FUSECreateIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2698 |
|
| 2699 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 2700 |
length, err := cc.CopyInBytes(addr, buf) |
| 2701 |
|
| 2702 |
|
| 2703 |
r.UnmarshalBytes(buf) |
| 2704 |
return length, err |
| 2705 |
} |
| 2706 |
|
| 2707 |
|
| 2708 |
func (r *FUSECreateIn) WriteTo(writer io.Writer) (int64, error) { |
| 2709 |
|
| 2710 |
buf := make([]byte, r.SizeBytes()) |
| 2711 |
r.MarshalBytes(buf) |
| 2712 |
length, err := writer.Write(buf) |
| 2713 |
return int64(length), err |
| 2714 |
} |
| 2715 |
|
| 2716 |
|
| 2717 |
func (f *FUSECreateMeta) SizeBytes() int { |
| 2718 |
return 16 |
| 2719 |
} |
| 2720 |
|
| 2721 |
|
| 2722 |
func (f *FUSECreateMeta) MarshalBytes(dst []byte) []byte { |
| 2723 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) |
| 2724 |
dst = dst[4:] |
| 2725 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mode)) |
| 2726 |
dst = dst[4:] |
| 2727 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Umask)) |
| 2728 |
dst = dst[4:] |
| 2729 |
|
| 2730 |
dst = dst[4:] |
| 2731 |
return dst |
| 2732 |
} |
| 2733 |
|
| 2734 |
|
| 2735 |
func (f *FUSECreateMeta) UnmarshalBytes(src []byte) []byte { |
| 2736 |
f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2737 |
src = src[4:] |
| 2738 |
f.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2739 |
src = src[4:] |
| 2740 |
f.Umask = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2741 |
src = src[4:] |
| 2742 |
|
| 2743 |
src = src[4:] |
| 2744 |
return src |
| 2745 |
} |
| 2746 |
|
| 2747 |
|
| 2748 |
|
| 2749 |
func (f *FUSECreateMeta) Packed() bool { |
| 2750 |
return true |
| 2751 |
} |
| 2752 |
|
| 2753 |
|
| 2754 |
func (f *FUSECreateMeta) MarshalUnsafe(dst []byte) []byte { |
| 2755 |
size := f.SizeBytes() |
| 2756 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 2757 |
return dst[size:] |
| 2758 |
} |
| 2759 |
|
| 2760 |
|
| 2761 |
func (f *FUSECreateMeta) UnmarshalUnsafe(src []byte) []byte { |
| 2762 |
size := f.SizeBytes() |
| 2763 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 2764 |
return src[size:] |
| 2765 |
} |
| 2766 |
|
| 2767 |
|
| 2768 |
|
| 2769 |
func (f *FUSECreateMeta) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 2770 |
|
| 2771 |
var buf []byte |
| 2772 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2773 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 2774 |
hdr.Len = f.SizeBytes() |
| 2775 |
hdr.Cap = f.SizeBytes() |
| 2776 |
|
| 2777 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 2778 |
|
| 2779 |
|
| 2780 |
runtime.KeepAlive(f) |
| 2781 |
return length, err |
| 2782 |
} |
| 2783 |
|
| 2784 |
|
| 2785 |
|
| 2786 |
func (f *FUSECreateMeta) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2787 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 2788 |
} |
| 2789 |
|
| 2790 |
|
| 2791 |
|
| 2792 |
func (f *FUSECreateMeta) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2793 |
|
| 2794 |
var buf []byte |
| 2795 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2796 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 2797 |
hdr.Len = f.SizeBytes() |
| 2798 |
hdr.Cap = f.SizeBytes() |
| 2799 |
|
| 2800 |
length, err := cc.CopyInBytes(addr, buf) |
| 2801 |
|
| 2802 |
|
| 2803 |
runtime.KeepAlive(f) |
| 2804 |
return length, err |
| 2805 |
} |
| 2806 |
|
| 2807 |
|
| 2808 |
func (f *FUSECreateMeta) WriteTo(writer io.Writer) (int64, error) { |
| 2809 |
|
| 2810 |
var buf []byte |
| 2811 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2812 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 2813 |
hdr.Len = f.SizeBytes() |
| 2814 |
hdr.Cap = f.SizeBytes() |
| 2815 |
|
| 2816 |
length, err := writer.Write(buf) |
| 2817 |
|
| 2818 |
|
| 2819 |
runtime.KeepAlive(f) |
| 2820 |
return int64(length), err |
| 2821 |
} |
| 2822 |
|
| 2823 |
|
| 2824 |
|
| 2825 |
func (r *FUSEDirent) Packed() bool { |
| 2826 |
|
| 2827 |
return false |
| 2828 |
} |
| 2829 |
|
| 2830 |
|
| 2831 |
func (r *FUSEDirent) MarshalUnsafe(dst []byte) []byte { |
| 2832 |
|
| 2833 |
return r.MarshalBytes(dst) |
| 2834 |
} |
| 2835 |
|
| 2836 |
|
| 2837 |
func (r *FUSEDirent) UnmarshalUnsafe(src []byte) []byte { |
| 2838 |
|
| 2839 |
return r.UnmarshalBytes(src) |
| 2840 |
} |
| 2841 |
|
| 2842 |
|
| 2843 |
|
| 2844 |
func (r *FUSEDirent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 2845 |
|
| 2846 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 2847 |
r.MarshalBytes(buf) |
| 2848 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 2849 |
} |
| 2850 |
|
| 2851 |
|
| 2852 |
|
| 2853 |
func (r *FUSEDirent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2854 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 2855 |
} |
| 2856 |
|
| 2857 |
|
| 2858 |
|
| 2859 |
func (r *FUSEDirent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2860 |
|
| 2861 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 2862 |
length, err := cc.CopyInBytes(addr, buf) |
| 2863 |
|
| 2864 |
|
| 2865 |
r.UnmarshalBytes(buf) |
| 2866 |
return length, err |
| 2867 |
} |
| 2868 |
|
| 2869 |
|
| 2870 |
func (r *FUSEDirent) WriteTo(writer io.Writer) (int64, error) { |
| 2871 |
|
| 2872 |
buf := make([]byte, r.SizeBytes()) |
| 2873 |
r.MarshalBytes(buf) |
| 2874 |
length, err := writer.Write(buf) |
| 2875 |
return int64(length), err |
| 2876 |
} |
| 2877 |
|
| 2878 |
|
| 2879 |
func (f *FUSEDirentMeta) SizeBytes() int { |
| 2880 |
return 24 |
| 2881 |
} |
| 2882 |
|
| 2883 |
|
| 2884 |
func (f *FUSEDirentMeta) MarshalBytes(dst []byte) []byte { |
| 2885 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Ino)) |
| 2886 |
dst = dst[8:] |
| 2887 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Off)) |
| 2888 |
dst = dst[8:] |
| 2889 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.NameLen)) |
| 2890 |
dst = dst[4:] |
| 2891 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Type)) |
| 2892 |
dst = dst[4:] |
| 2893 |
return dst |
| 2894 |
} |
| 2895 |
|
| 2896 |
|
| 2897 |
func (f *FUSEDirentMeta) UnmarshalBytes(src []byte) []byte { |
| 2898 |
f.Ino = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2899 |
src = src[8:] |
| 2900 |
f.Off = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 2901 |
src = src[8:] |
| 2902 |
f.NameLen = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2903 |
src = src[4:] |
| 2904 |
f.Type = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 2905 |
src = src[4:] |
| 2906 |
return src |
| 2907 |
} |
| 2908 |
|
| 2909 |
|
| 2910 |
|
| 2911 |
func (f *FUSEDirentMeta) Packed() bool { |
| 2912 |
return true |
| 2913 |
} |
| 2914 |
|
| 2915 |
|
| 2916 |
func (f *FUSEDirentMeta) MarshalUnsafe(dst []byte) []byte { |
| 2917 |
size := f.SizeBytes() |
| 2918 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 2919 |
return dst[size:] |
| 2920 |
} |
| 2921 |
|
| 2922 |
|
| 2923 |
func (f *FUSEDirentMeta) UnmarshalUnsafe(src []byte) []byte { |
| 2924 |
size := f.SizeBytes() |
| 2925 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 2926 |
return src[size:] |
| 2927 |
} |
| 2928 |
|
| 2929 |
|
| 2930 |
|
| 2931 |
func (f *FUSEDirentMeta) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 2932 |
|
| 2933 |
var buf []byte |
| 2934 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2935 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 2936 |
hdr.Len = f.SizeBytes() |
| 2937 |
hdr.Cap = f.SizeBytes() |
| 2938 |
|
| 2939 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 2940 |
|
| 2941 |
|
| 2942 |
runtime.KeepAlive(f) |
| 2943 |
return length, err |
| 2944 |
} |
| 2945 |
|
| 2946 |
|
| 2947 |
|
| 2948 |
func (f *FUSEDirentMeta) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2949 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 2950 |
} |
| 2951 |
|
| 2952 |
|
| 2953 |
|
| 2954 |
func (f *FUSEDirentMeta) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 2955 |
|
| 2956 |
var buf []byte |
| 2957 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2958 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 2959 |
hdr.Len = f.SizeBytes() |
| 2960 |
hdr.Cap = f.SizeBytes() |
| 2961 |
|
| 2962 |
length, err := cc.CopyInBytes(addr, buf) |
| 2963 |
|
| 2964 |
|
| 2965 |
runtime.KeepAlive(f) |
| 2966 |
return length, err |
| 2967 |
} |
| 2968 |
|
| 2969 |
|
| 2970 |
func (f *FUSEDirentMeta) WriteTo(writer io.Writer) (int64, error) { |
| 2971 |
|
| 2972 |
var buf []byte |
| 2973 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 2974 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 2975 |
hdr.Len = f.SizeBytes() |
| 2976 |
hdr.Cap = f.SizeBytes() |
| 2977 |
|
| 2978 |
length, err := writer.Write(buf) |
| 2979 |
|
| 2980 |
|
| 2981 |
runtime.KeepAlive(f) |
| 2982 |
return int64(length), err |
| 2983 |
} |
| 2984 |
|
| 2985 |
|
| 2986 |
|
| 2987 |
func (r *FUSEDirents) Packed() bool { |
| 2988 |
|
| 2989 |
return false |
| 2990 |
} |
| 2991 |
|
| 2992 |
|
| 2993 |
func (r *FUSEDirents) MarshalUnsafe(dst []byte) []byte { |
| 2994 |
|
| 2995 |
return r.MarshalBytes(dst) |
| 2996 |
} |
| 2997 |
|
| 2998 |
|
| 2999 |
func (r *FUSEDirents) UnmarshalUnsafe(src []byte) []byte { |
| 3000 |
|
| 3001 |
return r.UnmarshalBytes(src) |
| 3002 |
} |
| 3003 |
|
| 3004 |
|
| 3005 |
|
| 3006 |
func (r *FUSEDirents) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 3007 |
|
| 3008 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 3009 |
r.MarshalBytes(buf) |
| 3010 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 3011 |
} |
| 3012 |
|
| 3013 |
|
| 3014 |
|
| 3015 |
func (r *FUSEDirents) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3016 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 3017 |
} |
| 3018 |
|
| 3019 |
|
| 3020 |
|
| 3021 |
func (r *FUSEDirents) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3022 |
|
| 3023 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 3024 |
length, err := cc.CopyInBytes(addr, buf) |
| 3025 |
|
| 3026 |
|
| 3027 |
r.UnmarshalBytes(buf) |
| 3028 |
return length, err |
| 3029 |
} |
| 3030 |
|
| 3031 |
|
| 3032 |
func (r *FUSEDirents) WriteTo(writer io.Writer) (int64, error) { |
| 3033 |
|
| 3034 |
buf := make([]byte, r.SizeBytes()) |
| 3035 |
r.MarshalBytes(buf) |
| 3036 |
length, err := writer.Write(buf) |
| 3037 |
return int64(length), err |
| 3038 |
} |
| 3039 |
|
| 3040 |
|
| 3041 |
|
| 3042 |
func (r *FUSEEmptyIn) Packed() bool { |
| 3043 |
|
| 3044 |
return false |
| 3045 |
} |
| 3046 |
|
| 3047 |
|
| 3048 |
func (r *FUSEEmptyIn) MarshalUnsafe(dst []byte) []byte { |
| 3049 |
|
| 3050 |
return r.MarshalBytes(dst) |
| 3051 |
} |
| 3052 |
|
| 3053 |
|
| 3054 |
func (r *FUSEEmptyIn) UnmarshalUnsafe(src []byte) []byte { |
| 3055 |
|
| 3056 |
return r.UnmarshalBytes(src) |
| 3057 |
} |
| 3058 |
|
| 3059 |
|
| 3060 |
|
| 3061 |
func (r *FUSEEmptyIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 3062 |
|
| 3063 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 3064 |
r.MarshalBytes(buf) |
| 3065 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 3066 |
} |
| 3067 |
|
| 3068 |
|
| 3069 |
|
| 3070 |
func (r *FUSEEmptyIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3071 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 3072 |
} |
| 3073 |
|
| 3074 |
|
| 3075 |
|
| 3076 |
func (r *FUSEEmptyIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3077 |
|
| 3078 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 3079 |
length, err := cc.CopyInBytes(addr, buf) |
| 3080 |
|
| 3081 |
|
| 3082 |
r.UnmarshalBytes(buf) |
| 3083 |
return length, err |
| 3084 |
} |
| 3085 |
|
| 3086 |
|
| 3087 |
func (r *FUSEEmptyIn) WriteTo(writer io.Writer) (int64, error) { |
| 3088 |
|
| 3089 |
buf := make([]byte, r.SizeBytes()) |
| 3090 |
r.MarshalBytes(buf) |
| 3091 |
length, err := writer.Write(buf) |
| 3092 |
return int64(length), err |
| 3093 |
} |
| 3094 |
|
| 3095 |
|
| 3096 |
func (f *FUSEEntryOut) SizeBytes() int { |
| 3097 |
return 40 + |
| 3098 |
(*FUSEAttr)(nil).SizeBytes() |
| 3099 |
} |
| 3100 |
|
| 3101 |
|
| 3102 |
func (f *FUSEEntryOut) MarshalBytes(dst []byte) []byte { |
| 3103 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.NodeID)) |
| 3104 |
dst = dst[8:] |
| 3105 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Generation)) |
| 3106 |
dst = dst[8:] |
| 3107 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.EntryValid)) |
| 3108 |
dst = dst[8:] |
| 3109 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.AttrValid)) |
| 3110 |
dst = dst[8:] |
| 3111 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.EntryValidNSec)) |
| 3112 |
dst = dst[4:] |
| 3113 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.AttrValidNSec)) |
| 3114 |
dst = dst[4:] |
| 3115 |
dst = f.Attr.MarshalUnsafe(dst) |
| 3116 |
return dst |
| 3117 |
} |
| 3118 |
|
| 3119 |
|
| 3120 |
func (f *FUSEEntryOut) UnmarshalBytes(src []byte) []byte { |
| 3121 |
f.NodeID = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 3122 |
src = src[8:] |
| 3123 |
f.Generation = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 3124 |
src = src[8:] |
| 3125 |
f.EntryValid = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 3126 |
src = src[8:] |
| 3127 |
f.AttrValid = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 3128 |
src = src[8:] |
| 3129 |
f.EntryValidNSec = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3130 |
src = src[4:] |
| 3131 |
f.AttrValidNSec = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3132 |
src = src[4:] |
| 3133 |
src = f.Attr.UnmarshalUnsafe(src) |
| 3134 |
return src |
| 3135 |
} |
| 3136 |
|
| 3137 |
|
| 3138 |
|
| 3139 |
func (f *FUSEEntryOut) Packed() bool { |
| 3140 |
return f.Attr.Packed() |
| 3141 |
} |
| 3142 |
|
| 3143 |
|
| 3144 |
func (f *FUSEEntryOut) MarshalUnsafe(dst []byte) []byte { |
| 3145 |
if f.Attr.Packed() { |
| 3146 |
size := f.SizeBytes() |
| 3147 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 3148 |
return dst[size:] |
| 3149 |
} |
| 3150 |
|
| 3151 |
return f.MarshalBytes(dst) |
| 3152 |
} |
| 3153 |
|
| 3154 |
|
| 3155 |
func (f *FUSEEntryOut) UnmarshalUnsafe(src []byte) []byte { |
| 3156 |
if f.Attr.Packed() { |
| 3157 |
size := f.SizeBytes() |
| 3158 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 3159 |
return src[size:] |
| 3160 |
} |
| 3161 |
|
| 3162 |
return f.UnmarshalBytes(src) |
| 3163 |
} |
| 3164 |
|
| 3165 |
|
| 3166 |
|
| 3167 |
func (f *FUSEEntryOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 3168 |
if !f.Attr.Packed() { |
| 3169 |
|
| 3170 |
buf := cc.CopyScratchBuffer(f.SizeBytes()) |
| 3171 |
f.MarshalBytes(buf) |
| 3172 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 3173 |
} |
| 3174 |
|
| 3175 |
|
| 3176 |
var buf []byte |
| 3177 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3178 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3179 |
hdr.Len = f.SizeBytes() |
| 3180 |
hdr.Cap = f.SizeBytes() |
| 3181 |
|
| 3182 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 3183 |
|
| 3184 |
|
| 3185 |
runtime.KeepAlive(f) |
| 3186 |
return length, err |
| 3187 |
} |
| 3188 |
|
| 3189 |
|
| 3190 |
|
| 3191 |
func (f *FUSEEntryOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3192 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 3193 |
} |
| 3194 |
|
| 3195 |
|
| 3196 |
|
| 3197 |
func (f *FUSEEntryOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3198 |
if !f.Attr.Packed() { |
| 3199 |
|
| 3200 |
buf := cc.CopyScratchBuffer(f.SizeBytes()) |
| 3201 |
length, err := cc.CopyInBytes(addr, buf) |
| 3202 |
|
| 3203 |
|
| 3204 |
f.UnmarshalBytes(buf) |
| 3205 |
return length, err |
| 3206 |
} |
| 3207 |
|
| 3208 |
|
| 3209 |
var buf []byte |
| 3210 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3211 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3212 |
hdr.Len = f.SizeBytes() |
| 3213 |
hdr.Cap = f.SizeBytes() |
| 3214 |
|
| 3215 |
length, err := cc.CopyInBytes(addr, buf) |
| 3216 |
|
| 3217 |
|
| 3218 |
runtime.KeepAlive(f) |
| 3219 |
return length, err |
| 3220 |
} |
| 3221 |
|
| 3222 |
|
| 3223 |
func (f *FUSEEntryOut) WriteTo(writer io.Writer) (int64, error) { |
| 3224 |
if !f.Attr.Packed() { |
| 3225 |
|
| 3226 |
buf := make([]byte, f.SizeBytes()) |
| 3227 |
f.MarshalBytes(buf) |
| 3228 |
length, err := writer.Write(buf) |
| 3229 |
return int64(length), err |
| 3230 |
} |
| 3231 |
|
| 3232 |
|
| 3233 |
var buf []byte |
| 3234 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3235 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3236 |
hdr.Len = f.SizeBytes() |
| 3237 |
hdr.Cap = f.SizeBytes() |
| 3238 |
|
| 3239 |
length, err := writer.Write(buf) |
| 3240 |
|
| 3241 |
|
| 3242 |
runtime.KeepAlive(f) |
| 3243 |
return int64(length), err |
| 3244 |
} |
| 3245 |
|
| 3246 |
|
| 3247 |
func (f *FUSEGetAttrIn) SizeBytes() int { |
| 3248 |
return 16 |
| 3249 |
} |
| 3250 |
|
| 3251 |
|
| 3252 |
func (f *FUSEGetAttrIn) MarshalBytes(dst []byte) []byte { |
| 3253 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.GetAttrFlags)) |
| 3254 |
dst = dst[4:] |
| 3255 |
|
| 3256 |
dst = dst[4:] |
| 3257 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) |
| 3258 |
dst = dst[8:] |
| 3259 |
return dst |
| 3260 |
} |
| 3261 |
|
| 3262 |
|
| 3263 |
func (f *FUSEGetAttrIn) UnmarshalBytes(src []byte) []byte { |
| 3264 |
f.GetAttrFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3265 |
src = src[4:] |
| 3266 |
|
| 3267 |
src = src[4:] |
| 3268 |
f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 3269 |
src = src[8:] |
| 3270 |
return src |
| 3271 |
} |
| 3272 |
|
| 3273 |
|
| 3274 |
|
| 3275 |
func (f *FUSEGetAttrIn) Packed() bool { |
| 3276 |
return true |
| 3277 |
} |
| 3278 |
|
| 3279 |
|
| 3280 |
func (f *FUSEGetAttrIn) MarshalUnsafe(dst []byte) []byte { |
| 3281 |
size := f.SizeBytes() |
| 3282 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 3283 |
return dst[size:] |
| 3284 |
} |
| 3285 |
|
| 3286 |
|
| 3287 |
func (f *FUSEGetAttrIn) UnmarshalUnsafe(src []byte) []byte { |
| 3288 |
size := f.SizeBytes() |
| 3289 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 3290 |
return src[size:] |
| 3291 |
} |
| 3292 |
|
| 3293 |
|
| 3294 |
|
| 3295 |
func (f *FUSEGetAttrIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 3296 |
|
| 3297 |
var buf []byte |
| 3298 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3299 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3300 |
hdr.Len = f.SizeBytes() |
| 3301 |
hdr.Cap = f.SizeBytes() |
| 3302 |
|
| 3303 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 3304 |
|
| 3305 |
|
| 3306 |
runtime.KeepAlive(f) |
| 3307 |
return length, err |
| 3308 |
} |
| 3309 |
|
| 3310 |
|
| 3311 |
|
| 3312 |
func (f *FUSEGetAttrIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3313 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 3314 |
} |
| 3315 |
|
| 3316 |
|
| 3317 |
|
| 3318 |
func (f *FUSEGetAttrIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3319 |
|
| 3320 |
var buf []byte |
| 3321 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3322 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3323 |
hdr.Len = f.SizeBytes() |
| 3324 |
hdr.Cap = f.SizeBytes() |
| 3325 |
|
| 3326 |
length, err := cc.CopyInBytes(addr, buf) |
| 3327 |
|
| 3328 |
|
| 3329 |
runtime.KeepAlive(f) |
| 3330 |
return length, err |
| 3331 |
} |
| 3332 |
|
| 3333 |
|
| 3334 |
func (f *FUSEGetAttrIn) WriteTo(writer io.Writer) (int64, error) { |
| 3335 |
|
| 3336 |
var buf []byte |
| 3337 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3338 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3339 |
hdr.Len = f.SizeBytes() |
| 3340 |
hdr.Cap = f.SizeBytes() |
| 3341 |
|
| 3342 |
length, err := writer.Write(buf) |
| 3343 |
|
| 3344 |
|
| 3345 |
runtime.KeepAlive(f) |
| 3346 |
return int64(length), err |
| 3347 |
} |
| 3348 |
|
| 3349 |
|
| 3350 |
func (f *FUSEGetAttrOut) SizeBytes() int { |
| 3351 |
return 16 + |
| 3352 |
(*FUSEAttr)(nil).SizeBytes() |
| 3353 |
} |
| 3354 |
|
| 3355 |
|
| 3356 |
func (f *FUSEGetAttrOut) MarshalBytes(dst []byte) []byte { |
| 3357 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.AttrValid)) |
| 3358 |
dst = dst[8:] |
| 3359 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.AttrValidNsec)) |
| 3360 |
dst = dst[4:] |
| 3361 |
|
| 3362 |
dst = dst[4:] |
| 3363 |
dst = f.Attr.MarshalUnsafe(dst) |
| 3364 |
return dst |
| 3365 |
} |
| 3366 |
|
| 3367 |
|
| 3368 |
func (f *FUSEGetAttrOut) UnmarshalBytes(src []byte) []byte { |
| 3369 |
f.AttrValid = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 3370 |
src = src[8:] |
| 3371 |
f.AttrValidNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3372 |
src = src[4:] |
| 3373 |
|
| 3374 |
src = src[4:] |
| 3375 |
src = f.Attr.UnmarshalUnsafe(src) |
| 3376 |
return src |
| 3377 |
} |
| 3378 |
|
| 3379 |
|
| 3380 |
|
| 3381 |
func (f *FUSEGetAttrOut) Packed() bool { |
| 3382 |
return f.Attr.Packed() |
| 3383 |
} |
| 3384 |
|
| 3385 |
|
| 3386 |
func (f *FUSEGetAttrOut) MarshalUnsafe(dst []byte) []byte { |
| 3387 |
if f.Attr.Packed() { |
| 3388 |
size := f.SizeBytes() |
| 3389 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 3390 |
return dst[size:] |
| 3391 |
} |
| 3392 |
|
| 3393 |
return f.MarshalBytes(dst) |
| 3394 |
} |
| 3395 |
|
| 3396 |
|
| 3397 |
func (f *FUSEGetAttrOut) UnmarshalUnsafe(src []byte) []byte { |
| 3398 |
if f.Attr.Packed() { |
| 3399 |
size := f.SizeBytes() |
| 3400 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 3401 |
return src[size:] |
| 3402 |
} |
| 3403 |
|
| 3404 |
return f.UnmarshalBytes(src) |
| 3405 |
} |
| 3406 |
|
| 3407 |
|
| 3408 |
|
| 3409 |
func (f *FUSEGetAttrOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 3410 |
if !f.Attr.Packed() { |
| 3411 |
|
| 3412 |
buf := cc.CopyScratchBuffer(f.SizeBytes()) |
| 3413 |
f.MarshalBytes(buf) |
| 3414 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 3415 |
} |
| 3416 |
|
| 3417 |
|
| 3418 |
var buf []byte |
| 3419 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3420 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3421 |
hdr.Len = f.SizeBytes() |
| 3422 |
hdr.Cap = f.SizeBytes() |
| 3423 |
|
| 3424 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 3425 |
|
| 3426 |
|
| 3427 |
runtime.KeepAlive(f) |
| 3428 |
return length, err |
| 3429 |
} |
| 3430 |
|
| 3431 |
|
| 3432 |
|
| 3433 |
func (f *FUSEGetAttrOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3434 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 3435 |
} |
| 3436 |
|
| 3437 |
|
| 3438 |
|
| 3439 |
func (f *FUSEGetAttrOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3440 |
if !f.Attr.Packed() { |
| 3441 |
|
| 3442 |
buf := cc.CopyScratchBuffer(f.SizeBytes()) |
| 3443 |
length, err := cc.CopyInBytes(addr, buf) |
| 3444 |
|
| 3445 |
|
| 3446 |
f.UnmarshalBytes(buf) |
| 3447 |
return length, err |
| 3448 |
} |
| 3449 |
|
| 3450 |
|
| 3451 |
var buf []byte |
| 3452 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3453 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3454 |
hdr.Len = f.SizeBytes() |
| 3455 |
hdr.Cap = f.SizeBytes() |
| 3456 |
|
| 3457 |
length, err := cc.CopyInBytes(addr, buf) |
| 3458 |
|
| 3459 |
|
| 3460 |
runtime.KeepAlive(f) |
| 3461 |
return length, err |
| 3462 |
} |
| 3463 |
|
| 3464 |
|
| 3465 |
func (f *FUSEGetAttrOut) WriteTo(writer io.Writer) (int64, error) { |
| 3466 |
if !f.Attr.Packed() { |
| 3467 |
|
| 3468 |
buf := make([]byte, f.SizeBytes()) |
| 3469 |
f.MarshalBytes(buf) |
| 3470 |
length, err := writer.Write(buf) |
| 3471 |
return int64(length), err |
| 3472 |
} |
| 3473 |
|
| 3474 |
|
| 3475 |
var buf []byte |
| 3476 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3477 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3478 |
hdr.Len = f.SizeBytes() |
| 3479 |
hdr.Cap = f.SizeBytes() |
| 3480 |
|
| 3481 |
length, err := writer.Write(buf) |
| 3482 |
|
| 3483 |
|
| 3484 |
runtime.KeepAlive(f) |
| 3485 |
return int64(length), err |
| 3486 |
} |
| 3487 |
|
| 3488 |
|
| 3489 |
func (f *FUSEHeaderIn) SizeBytes() int { |
| 3490 |
return 28 + |
| 3491 |
(*FUSEOpcode)(nil).SizeBytes() + |
| 3492 |
(*FUSEOpID)(nil).SizeBytes() |
| 3493 |
} |
| 3494 |
|
| 3495 |
|
| 3496 |
func (f *FUSEHeaderIn) MarshalBytes(dst []byte) []byte { |
| 3497 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Len)) |
| 3498 |
dst = dst[4:] |
| 3499 |
dst = f.Opcode.MarshalUnsafe(dst) |
| 3500 |
dst = f.Unique.MarshalUnsafe(dst) |
| 3501 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.NodeID)) |
| 3502 |
dst = dst[8:] |
| 3503 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.UID)) |
| 3504 |
dst = dst[4:] |
| 3505 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.GID)) |
| 3506 |
dst = dst[4:] |
| 3507 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.PID)) |
| 3508 |
dst = dst[4:] |
| 3509 |
|
| 3510 |
dst = dst[4:] |
| 3511 |
return dst |
| 3512 |
} |
| 3513 |
|
| 3514 |
|
| 3515 |
func (f *FUSEHeaderIn) UnmarshalBytes(src []byte) []byte { |
| 3516 |
f.Len = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3517 |
src = src[4:] |
| 3518 |
src = f.Opcode.UnmarshalUnsafe(src) |
| 3519 |
src = f.Unique.UnmarshalUnsafe(src) |
| 3520 |
f.NodeID = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 3521 |
src = src[8:] |
| 3522 |
f.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3523 |
src = src[4:] |
| 3524 |
f.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3525 |
src = src[4:] |
| 3526 |
f.PID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3527 |
src = src[4:] |
| 3528 |
|
| 3529 |
src = src[4:] |
| 3530 |
return src |
| 3531 |
} |
| 3532 |
|
| 3533 |
|
| 3534 |
|
| 3535 |
func (f *FUSEHeaderIn) Packed() bool { |
| 3536 |
return f.Opcode.Packed() && f.Unique.Packed() |
| 3537 |
} |
| 3538 |
|
| 3539 |
|
| 3540 |
func (f *FUSEHeaderIn) MarshalUnsafe(dst []byte) []byte { |
| 3541 |
if f.Opcode.Packed() && f.Unique.Packed() { |
| 3542 |
size := f.SizeBytes() |
| 3543 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 3544 |
return dst[size:] |
| 3545 |
} |
| 3546 |
|
| 3547 |
return f.MarshalBytes(dst) |
| 3548 |
} |
| 3549 |
|
| 3550 |
|
| 3551 |
func (f *FUSEHeaderIn) UnmarshalUnsafe(src []byte) []byte { |
| 3552 |
if f.Opcode.Packed() && f.Unique.Packed() { |
| 3553 |
size := f.SizeBytes() |
| 3554 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 3555 |
return src[size:] |
| 3556 |
} |
| 3557 |
|
| 3558 |
return f.UnmarshalBytes(src) |
| 3559 |
} |
| 3560 |
|
| 3561 |
|
| 3562 |
|
| 3563 |
func (f *FUSEHeaderIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 3564 |
if !f.Opcode.Packed() && f.Unique.Packed() { |
| 3565 |
|
| 3566 |
buf := cc.CopyScratchBuffer(f.SizeBytes()) |
| 3567 |
f.MarshalBytes(buf) |
| 3568 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 3569 |
} |
| 3570 |
|
| 3571 |
|
| 3572 |
var buf []byte |
| 3573 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3574 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3575 |
hdr.Len = f.SizeBytes() |
| 3576 |
hdr.Cap = f.SizeBytes() |
| 3577 |
|
| 3578 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 3579 |
|
| 3580 |
|
| 3581 |
runtime.KeepAlive(f) |
| 3582 |
return length, err |
| 3583 |
} |
| 3584 |
|
| 3585 |
|
| 3586 |
|
| 3587 |
func (f *FUSEHeaderIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3588 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 3589 |
} |
| 3590 |
|
| 3591 |
|
| 3592 |
|
| 3593 |
func (f *FUSEHeaderIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3594 |
if !f.Opcode.Packed() && f.Unique.Packed() { |
| 3595 |
|
| 3596 |
buf := cc.CopyScratchBuffer(f.SizeBytes()) |
| 3597 |
length, err := cc.CopyInBytes(addr, buf) |
| 3598 |
|
| 3599 |
|
| 3600 |
f.UnmarshalBytes(buf) |
| 3601 |
return length, err |
| 3602 |
} |
| 3603 |
|
| 3604 |
|
| 3605 |
var buf []byte |
| 3606 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3607 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3608 |
hdr.Len = f.SizeBytes() |
| 3609 |
hdr.Cap = f.SizeBytes() |
| 3610 |
|
| 3611 |
length, err := cc.CopyInBytes(addr, buf) |
| 3612 |
|
| 3613 |
|
| 3614 |
runtime.KeepAlive(f) |
| 3615 |
return length, err |
| 3616 |
} |
| 3617 |
|
| 3618 |
|
| 3619 |
func (f *FUSEHeaderIn) WriteTo(writer io.Writer) (int64, error) { |
| 3620 |
if !f.Opcode.Packed() && f.Unique.Packed() { |
| 3621 |
|
| 3622 |
buf := make([]byte, f.SizeBytes()) |
| 3623 |
f.MarshalBytes(buf) |
| 3624 |
length, err := writer.Write(buf) |
| 3625 |
return int64(length), err |
| 3626 |
} |
| 3627 |
|
| 3628 |
|
| 3629 |
var buf []byte |
| 3630 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3631 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3632 |
hdr.Len = f.SizeBytes() |
| 3633 |
hdr.Cap = f.SizeBytes() |
| 3634 |
|
| 3635 |
length, err := writer.Write(buf) |
| 3636 |
|
| 3637 |
|
| 3638 |
runtime.KeepAlive(f) |
| 3639 |
return int64(length), err |
| 3640 |
} |
| 3641 |
|
| 3642 |
|
| 3643 |
func (f *FUSEHeaderOut) SizeBytes() int { |
| 3644 |
return 8 + |
| 3645 |
(*FUSEOpID)(nil).SizeBytes() |
| 3646 |
} |
| 3647 |
|
| 3648 |
|
| 3649 |
func (f *FUSEHeaderOut) MarshalBytes(dst []byte) []byte { |
| 3650 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Len)) |
| 3651 |
dst = dst[4:] |
| 3652 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Error)) |
| 3653 |
dst = dst[4:] |
| 3654 |
dst = f.Unique.MarshalUnsafe(dst) |
| 3655 |
return dst |
| 3656 |
} |
| 3657 |
|
| 3658 |
|
| 3659 |
func (f *FUSEHeaderOut) UnmarshalBytes(src []byte) []byte { |
| 3660 |
f.Len = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3661 |
src = src[4:] |
| 3662 |
f.Error = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3663 |
src = src[4:] |
| 3664 |
src = f.Unique.UnmarshalUnsafe(src) |
| 3665 |
return src |
| 3666 |
} |
| 3667 |
|
| 3668 |
|
| 3669 |
|
| 3670 |
func (f *FUSEHeaderOut) Packed() bool { |
| 3671 |
return f.Unique.Packed() |
| 3672 |
} |
| 3673 |
|
| 3674 |
|
| 3675 |
func (f *FUSEHeaderOut) MarshalUnsafe(dst []byte) []byte { |
| 3676 |
if f.Unique.Packed() { |
| 3677 |
size := f.SizeBytes() |
| 3678 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 3679 |
return dst[size:] |
| 3680 |
} |
| 3681 |
|
| 3682 |
return f.MarshalBytes(dst) |
| 3683 |
} |
| 3684 |
|
| 3685 |
|
| 3686 |
func (f *FUSEHeaderOut) UnmarshalUnsafe(src []byte) []byte { |
| 3687 |
if f.Unique.Packed() { |
| 3688 |
size := f.SizeBytes() |
| 3689 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 3690 |
return src[size:] |
| 3691 |
} |
| 3692 |
|
| 3693 |
return f.UnmarshalBytes(src) |
| 3694 |
} |
| 3695 |
|
| 3696 |
|
| 3697 |
|
| 3698 |
func (f *FUSEHeaderOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 3699 |
if !f.Unique.Packed() { |
| 3700 |
|
| 3701 |
buf := cc.CopyScratchBuffer(f.SizeBytes()) |
| 3702 |
f.MarshalBytes(buf) |
| 3703 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 3704 |
} |
| 3705 |
|
| 3706 |
|
| 3707 |
var buf []byte |
| 3708 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3709 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3710 |
hdr.Len = f.SizeBytes() |
| 3711 |
hdr.Cap = f.SizeBytes() |
| 3712 |
|
| 3713 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 3714 |
|
| 3715 |
|
| 3716 |
runtime.KeepAlive(f) |
| 3717 |
return length, err |
| 3718 |
} |
| 3719 |
|
| 3720 |
|
| 3721 |
|
| 3722 |
func (f *FUSEHeaderOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3723 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 3724 |
} |
| 3725 |
|
| 3726 |
|
| 3727 |
|
| 3728 |
func (f *FUSEHeaderOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3729 |
if !f.Unique.Packed() { |
| 3730 |
|
| 3731 |
buf := cc.CopyScratchBuffer(f.SizeBytes()) |
| 3732 |
length, err := cc.CopyInBytes(addr, buf) |
| 3733 |
|
| 3734 |
|
| 3735 |
f.UnmarshalBytes(buf) |
| 3736 |
return length, err |
| 3737 |
} |
| 3738 |
|
| 3739 |
|
| 3740 |
var buf []byte |
| 3741 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3742 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3743 |
hdr.Len = f.SizeBytes() |
| 3744 |
hdr.Cap = f.SizeBytes() |
| 3745 |
|
| 3746 |
length, err := cc.CopyInBytes(addr, buf) |
| 3747 |
|
| 3748 |
|
| 3749 |
runtime.KeepAlive(f) |
| 3750 |
return length, err |
| 3751 |
} |
| 3752 |
|
| 3753 |
|
| 3754 |
func (f *FUSEHeaderOut) WriteTo(writer io.Writer) (int64, error) { |
| 3755 |
if !f.Unique.Packed() { |
| 3756 |
|
| 3757 |
buf := make([]byte, f.SizeBytes()) |
| 3758 |
f.MarshalBytes(buf) |
| 3759 |
length, err := writer.Write(buf) |
| 3760 |
return int64(length), err |
| 3761 |
} |
| 3762 |
|
| 3763 |
|
| 3764 |
var buf []byte |
| 3765 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3766 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3767 |
hdr.Len = f.SizeBytes() |
| 3768 |
hdr.Cap = f.SizeBytes() |
| 3769 |
|
| 3770 |
length, err := writer.Write(buf) |
| 3771 |
|
| 3772 |
|
| 3773 |
runtime.KeepAlive(f) |
| 3774 |
return int64(length), err |
| 3775 |
} |
| 3776 |
|
| 3777 |
|
| 3778 |
func (f *FUSEInitIn) SizeBytes() int { |
| 3779 |
return 16 |
| 3780 |
} |
| 3781 |
|
| 3782 |
|
| 3783 |
func (f *FUSEInitIn) MarshalBytes(dst []byte) []byte { |
| 3784 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Major)) |
| 3785 |
dst = dst[4:] |
| 3786 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Minor)) |
| 3787 |
dst = dst[4:] |
| 3788 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.MaxReadahead)) |
| 3789 |
dst = dst[4:] |
| 3790 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) |
| 3791 |
dst = dst[4:] |
| 3792 |
return dst |
| 3793 |
} |
| 3794 |
|
| 3795 |
|
| 3796 |
func (f *FUSEInitIn) UnmarshalBytes(src []byte) []byte { |
| 3797 |
f.Major = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3798 |
src = src[4:] |
| 3799 |
f.Minor = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3800 |
src = src[4:] |
| 3801 |
f.MaxReadahead = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3802 |
src = src[4:] |
| 3803 |
f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3804 |
src = src[4:] |
| 3805 |
return src |
| 3806 |
} |
| 3807 |
|
| 3808 |
|
| 3809 |
|
| 3810 |
func (f *FUSEInitIn) Packed() bool { |
| 3811 |
return true |
| 3812 |
} |
| 3813 |
|
| 3814 |
|
| 3815 |
func (f *FUSEInitIn) MarshalUnsafe(dst []byte) []byte { |
| 3816 |
size := f.SizeBytes() |
| 3817 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 3818 |
return dst[size:] |
| 3819 |
} |
| 3820 |
|
| 3821 |
|
| 3822 |
func (f *FUSEInitIn) UnmarshalUnsafe(src []byte) []byte { |
| 3823 |
size := f.SizeBytes() |
| 3824 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 3825 |
return src[size:] |
| 3826 |
} |
| 3827 |
|
| 3828 |
|
| 3829 |
|
| 3830 |
func (f *FUSEInitIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 3831 |
|
| 3832 |
var buf []byte |
| 3833 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3834 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3835 |
hdr.Len = f.SizeBytes() |
| 3836 |
hdr.Cap = f.SizeBytes() |
| 3837 |
|
| 3838 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 3839 |
|
| 3840 |
|
| 3841 |
runtime.KeepAlive(f) |
| 3842 |
return length, err |
| 3843 |
} |
| 3844 |
|
| 3845 |
|
| 3846 |
|
| 3847 |
func (f *FUSEInitIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3848 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 3849 |
} |
| 3850 |
|
| 3851 |
|
| 3852 |
|
| 3853 |
func (f *FUSEInitIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3854 |
|
| 3855 |
var buf []byte |
| 3856 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3857 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3858 |
hdr.Len = f.SizeBytes() |
| 3859 |
hdr.Cap = f.SizeBytes() |
| 3860 |
|
| 3861 |
length, err := cc.CopyInBytes(addr, buf) |
| 3862 |
|
| 3863 |
|
| 3864 |
runtime.KeepAlive(f) |
| 3865 |
return length, err |
| 3866 |
} |
| 3867 |
|
| 3868 |
|
| 3869 |
func (f *FUSEInitIn) WriteTo(writer io.Writer) (int64, error) { |
| 3870 |
|
| 3871 |
var buf []byte |
| 3872 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3873 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3874 |
hdr.Len = f.SizeBytes() |
| 3875 |
hdr.Cap = f.SizeBytes() |
| 3876 |
|
| 3877 |
length, err := writer.Write(buf) |
| 3878 |
|
| 3879 |
|
| 3880 |
runtime.KeepAlive(f) |
| 3881 |
return int64(length), err |
| 3882 |
} |
| 3883 |
|
| 3884 |
|
| 3885 |
func (f *FUSEInitOut) SizeBytes() int { |
| 3886 |
return 32 + |
| 3887 |
4*8 |
| 3888 |
} |
| 3889 |
|
| 3890 |
|
| 3891 |
func (f *FUSEInitOut) MarshalBytes(dst []byte) []byte { |
| 3892 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Major)) |
| 3893 |
dst = dst[4:] |
| 3894 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Minor)) |
| 3895 |
dst = dst[4:] |
| 3896 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.MaxReadahead)) |
| 3897 |
dst = dst[4:] |
| 3898 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) |
| 3899 |
dst = dst[4:] |
| 3900 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(f.MaxBackground)) |
| 3901 |
dst = dst[2:] |
| 3902 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(f.CongestionThreshold)) |
| 3903 |
dst = dst[2:] |
| 3904 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.MaxWrite)) |
| 3905 |
dst = dst[4:] |
| 3906 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.TimeGran)) |
| 3907 |
dst = dst[4:] |
| 3908 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(f.MaxPages)) |
| 3909 |
dst = dst[2:] |
| 3910 |
|
| 3911 |
dst = dst[2:] |
| 3912 |
|
| 3913 |
dst = dst[4*(8):] |
| 3914 |
return dst |
| 3915 |
} |
| 3916 |
|
| 3917 |
|
| 3918 |
func (f *FUSEInitOut) UnmarshalBytes(src []byte) []byte { |
| 3919 |
f.Major = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3920 |
src = src[4:] |
| 3921 |
f.Minor = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3922 |
src = src[4:] |
| 3923 |
f.MaxReadahead = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3924 |
src = src[4:] |
| 3925 |
f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3926 |
src = src[4:] |
| 3927 |
f.MaxBackground = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 3928 |
src = src[2:] |
| 3929 |
f.CongestionThreshold = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 3930 |
src = src[2:] |
| 3931 |
f.MaxWrite = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3932 |
src = src[4:] |
| 3933 |
f.TimeGran = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 3934 |
src = src[4:] |
| 3935 |
f.MaxPages = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 3936 |
src = src[2:] |
| 3937 |
|
| 3938 |
src = src[2:] |
| 3939 |
|
| 3940 |
src = src[4*(8):] |
| 3941 |
return src |
| 3942 |
} |
| 3943 |
|
| 3944 |
|
| 3945 |
|
| 3946 |
func (f *FUSEInitOut) Packed() bool { |
| 3947 |
return true |
| 3948 |
} |
| 3949 |
|
| 3950 |
|
| 3951 |
func (f *FUSEInitOut) MarshalUnsafe(dst []byte) []byte { |
| 3952 |
size := f.SizeBytes() |
| 3953 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 3954 |
return dst[size:] |
| 3955 |
} |
| 3956 |
|
| 3957 |
|
| 3958 |
func (f *FUSEInitOut) UnmarshalUnsafe(src []byte) []byte { |
| 3959 |
size := f.SizeBytes() |
| 3960 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 3961 |
return src[size:] |
| 3962 |
} |
| 3963 |
|
| 3964 |
|
| 3965 |
|
| 3966 |
func (f *FUSEInitOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 3967 |
|
| 3968 |
var buf []byte |
| 3969 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3970 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3971 |
hdr.Len = f.SizeBytes() |
| 3972 |
hdr.Cap = f.SizeBytes() |
| 3973 |
|
| 3974 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 3975 |
|
| 3976 |
|
| 3977 |
runtime.KeepAlive(f) |
| 3978 |
return length, err |
| 3979 |
} |
| 3980 |
|
| 3981 |
|
| 3982 |
|
| 3983 |
func (f *FUSEInitOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3984 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 3985 |
} |
| 3986 |
|
| 3987 |
|
| 3988 |
|
| 3989 |
func (f *FUSEInitOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 3990 |
|
| 3991 |
var buf []byte |
| 3992 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 3993 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 3994 |
hdr.Len = f.SizeBytes() |
| 3995 |
hdr.Cap = f.SizeBytes() |
| 3996 |
|
| 3997 |
length, err := cc.CopyInBytes(addr, buf) |
| 3998 |
|
| 3999 |
|
| 4000 |
runtime.KeepAlive(f) |
| 4001 |
return length, err |
| 4002 |
} |
| 4003 |
|
| 4004 |
|
| 4005 |
func (f *FUSEInitOut) WriteTo(writer io.Writer) (int64, error) { |
| 4006 |
|
| 4007 |
var buf []byte |
| 4008 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4009 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4010 |
hdr.Len = f.SizeBytes() |
| 4011 |
hdr.Cap = f.SizeBytes() |
| 4012 |
|
| 4013 |
length, err := writer.Write(buf) |
| 4014 |
|
| 4015 |
|
| 4016 |
runtime.KeepAlive(f) |
| 4017 |
return int64(length), err |
| 4018 |
} |
| 4019 |
|
| 4020 |
|
| 4021 |
|
| 4022 |
func (r *FUSELookupIn) Packed() bool { |
| 4023 |
|
| 4024 |
return false |
| 4025 |
} |
| 4026 |
|
| 4027 |
|
| 4028 |
func (r *FUSELookupIn) MarshalUnsafe(dst []byte) []byte { |
| 4029 |
|
| 4030 |
return r.MarshalBytes(dst) |
| 4031 |
} |
| 4032 |
|
| 4033 |
|
| 4034 |
func (r *FUSELookupIn) UnmarshalUnsafe(src []byte) []byte { |
| 4035 |
|
| 4036 |
return r.UnmarshalBytes(src) |
| 4037 |
} |
| 4038 |
|
| 4039 |
|
| 4040 |
|
| 4041 |
func (r *FUSELookupIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4042 |
|
| 4043 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 4044 |
r.MarshalBytes(buf) |
| 4045 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 4046 |
} |
| 4047 |
|
| 4048 |
|
| 4049 |
|
| 4050 |
func (r *FUSELookupIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4051 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 4052 |
} |
| 4053 |
|
| 4054 |
|
| 4055 |
|
| 4056 |
func (r *FUSELookupIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4057 |
|
| 4058 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 4059 |
length, err := cc.CopyInBytes(addr, buf) |
| 4060 |
|
| 4061 |
|
| 4062 |
r.UnmarshalBytes(buf) |
| 4063 |
return length, err |
| 4064 |
} |
| 4065 |
|
| 4066 |
|
| 4067 |
func (r *FUSELookupIn) WriteTo(writer io.Writer) (int64, error) { |
| 4068 |
|
| 4069 |
buf := make([]byte, r.SizeBytes()) |
| 4070 |
r.MarshalBytes(buf) |
| 4071 |
length, err := writer.Write(buf) |
| 4072 |
return int64(length), err |
| 4073 |
} |
| 4074 |
|
| 4075 |
|
| 4076 |
|
| 4077 |
func (r *FUSEMkdirIn) Packed() bool { |
| 4078 |
|
| 4079 |
return false |
| 4080 |
} |
| 4081 |
|
| 4082 |
|
| 4083 |
func (r *FUSEMkdirIn) MarshalUnsafe(dst []byte) []byte { |
| 4084 |
|
| 4085 |
return r.MarshalBytes(dst) |
| 4086 |
} |
| 4087 |
|
| 4088 |
|
| 4089 |
func (r *FUSEMkdirIn) UnmarshalUnsafe(src []byte) []byte { |
| 4090 |
|
| 4091 |
return r.UnmarshalBytes(src) |
| 4092 |
} |
| 4093 |
|
| 4094 |
|
| 4095 |
|
| 4096 |
func (r *FUSEMkdirIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4097 |
|
| 4098 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 4099 |
r.MarshalBytes(buf) |
| 4100 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 4101 |
} |
| 4102 |
|
| 4103 |
|
| 4104 |
|
| 4105 |
func (r *FUSEMkdirIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4106 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 4107 |
} |
| 4108 |
|
| 4109 |
|
| 4110 |
|
| 4111 |
func (r *FUSEMkdirIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4112 |
|
| 4113 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 4114 |
length, err := cc.CopyInBytes(addr, buf) |
| 4115 |
|
| 4116 |
|
| 4117 |
r.UnmarshalBytes(buf) |
| 4118 |
return length, err |
| 4119 |
} |
| 4120 |
|
| 4121 |
|
| 4122 |
func (r *FUSEMkdirIn) WriteTo(writer io.Writer) (int64, error) { |
| 4123 |
|
| 4124 |
buf := make([]byte, r.SizeBytes()) |
| 4125 |
r.MarshalBytes(buf) |
| 4126 |
length, err := writer.Write(buf) |
| 4127 |
return int64(length), err |
| 4128 |
} |
| 4129 |
|
| 4130 |
|
| 4131 |
func (f *FUSEMkdirMeta) SizeBytes() int { |
| 4132 |
return 8 |
| 4133 |
} |
| 4134 |
|
| 4135 |
|
| 4136 |
func (f *FUSEMkdirMeta) MarshalBytes(dst []byte) []byte { |
| 4137 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mode)) |
| 4138 |
dst = dst[4:] |
| 4139 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Umask)) |
| 4140 |
dst = dst[4:] |
| 4141 |
return dst |
| 4142 |
} |
| 4143 |
|
| 4144 |
|
| 4145 |
func (f *FUSEMkdirMeta) UnmarshalBytes(src []byte) []byte { |
| 4146 |
f.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4147 |
src = src[4:] |
| 4148 |
f.Umask = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4149 |
src = src[4:] |
| 4150 |
return src |
| 4151 |
} |
| 4152 |
|
| 4153 |
|
| 4154 |
|
| 4155 |
func (f *FUSEMkdirMeta) Packed() bool { |
| 4156 |
return true |
| 4157 |
} |
| 4158 |
|
| 4159 |
|
| 4160 |
func (f *FUSEMkdirMeta) MarshalUnsafe(dst []byte) []byte { |
| 4161 |
size := f.SizeBytes() |
| 4162 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 4163 |
return dst[size:] |
| 4164 |
} |
| 4165 |
|
| 4166 |
|
| 4167 |
func (f *FUSEMkdirMeta) UnmarshalUnsafe(src []byte) []byte { |
| 4168 |
size := f.SizeBytes() |
| 4169 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 4170 |
return src[size:] |
| 4171 |
} |
| 4172 |
|
| 4173 |
|
| 4174 |
|
| 4175 |
func (f *FUSEMkdirMeta) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4176 |
|
| 4177 |
var buf []byte |
| 4178 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4179 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4180 |
hdr.Len = f.SizeBytes() |
| 4181 |
hdr.Cap = f.SizeBytes() |
| 4182 |
|
| 4183 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 4184 |
|
| 4185 |
|
| 4186 |
runtime.KeepAlive(f) |
| 4187 |
return length, err |
| 4188 |
} |
| 4189 |
|
| 4190 |
|
| 4191 |
|
| 4192 |
func (f *FUSEMkdirMeta) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4193 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 4194 |
} |
| 4195 |
|
| 4196 |
|
| 4197 |
|
| 4198 |
func (f *FUSEMkdirMeta) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4199 |
|
| 4200 |
var buf []byte |
| 4201 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4202 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4203 |
hdr.Len = f.SizeBytes() |
| 4204 |
hdr.Cap = f.SizeBytes() |
| 4205 |
|
| 4206 |
length, err := cc.CopyInBytes(addr, buf) |
| 4207 |
|
| 4208 |
|
| 4209 |
runtime.KeepAlive(f) |
| 4210 |
return length, err |
| 4211 |
} |
| 4212 |
|
| 4213 |
|
| 4214 |
func (f *FUSEMkdirMeta) WriteTo(writer io.Writer) (int64, error) { |
| 4215 |
|
| 4216 |
var buf []byte |
| 4217 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4218 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4219 |
hdr.Len = f.SizeBytes() |
| 4220 |
hdr.Cap = f.SizeBytes() |
| 4221 |
|
| 4222 |
length, err := writer.Write(buf) |
| 4223 |
|
| 4224 |
|
| 4225 |
runtime.KeepAlive(f) |
| 4226 |
return int64(length), err |
| 4227 |
} |
| 4228 |
|
| 4229 |
|
| 4230 |
|
| 4231 |
func (r *FUSEMknodIn) Packed() bool { |
| 4232 |
|
| 4233 |
return false |
| 4234 |
} |
| 4235 |
|
| 4236 |
|
| 4237 |
func (r *FUSEMknodIn) MarshalUnsafe(dst []byte) []byte { |
| 4238 |
|
| 4239 |
return r.MarshalBytes(dst) |
| 4240 |
} |
| 4241 |
|
| 4242 |
|
| 4243 |
func (r *FUSEMknodIn) UnmarshalUnsafe(src []byte) []byte { |
| 4244 |
|
| 4245 |
return r.UnmarshalBytes(src) |
| 4246 |
} |
| 4247 |
|
| 4248 |
|
| 4249 |
|
| 4250 |
func (r *FUSEMknodIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4251 |
|
| 4252 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 4253 |
r.MarshalBytes(buf) |
| 4254 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 4255 |
} |
| 4256 |
|
| 4257 |
|
| 4258 |
|
| 4259 |
func (r *FUSEMknodIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4260 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 4261 |
} |
| 4262 |
|
| 4263 |
|
| 4264 |
|
| 4265 |
func (r *FUSEMknodIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4266 |
|
| 4267 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 4268 |
length, err := cc.CopyInBytes(addr, buf) |
| 4269 |
|
| 4270 |
|
| 4271 |
r.UnmarshalBytes(buf) |
| 4272 |
return length, err |
| 4273 |
} |
| 4274 |
|
| 4275 |
|
| 4276 |
func (r *FUSEMknodIn) WriteTo(writer io.Writer) (int64, error) { |
| 4277 |
|
| 4278 |
buf := make([]byte, r.SizeBytes()) |
| 4279 |
r.MarshalBytes(buf) |
| 4280 |
length, err := writer.Write(buf) |
| 4281 |
return int64(length), err |
| 4282 |
} |
| 4283 |
|
| 4284 |
|
| 4285 |
func (f *FUSEMknodMeta) SizeBytes() int { |
| 4286 |
return 16 |
| 4287 |
} |
| 4288 |
|
| 4289 |
|
| 4290 |
func (f *FUSEMknodMeta) MarshalBytes(dst []byte) []byte { |
| 4291 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mode)) |
| 4292 |
dst = dst[4:] |
| 4293 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Rdev)) |
| 4294 |
dst = dst[4:] |
| 4295 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Umask)) |
| 4296 |
dst = dst[4:] |
| 4297 |
|
| 4298 |
dst = dst[4:] |
| 4299 |
return dst |
| 4300 |
} |
| 4301 |
|
| 4302 |
|
| 4303 |
func (f *FUSEMknodMeta) UnmarshalBytes(src []byte) []byte { |
| 4304 |
f.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4305 |
src = src[4:] |
| 4306 |
f.Rdev = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4307 |
src = src[4:] |
| 4308 |
f.Umask = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4309 |
src = src[4:] |
| 4310 |
|
| 4311 |
src = src[4:] |
| 4312 |
return src |
| 4313 |
} |
| 4314 |
|
| 4315 |
|
| 4316 |
|
| 4317 |
func (f *FUSEMknodMeta) Packed() bool { |
| 4318 |
return true |
| 4319 |
} |
| 4320 |
|
| 4321 |
|
| 4322 |
func (f *FUSEMknodMeta) MarshalUnsafe(dst []byte) []byte { |
| 4323 |
size := f.SizeBytes() |
| 4324 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 4325 |
return dst[size:] |
| 4326 |
} |
| 4327 |
|
| 4328 |
|
| 4329 |
func (f *FUSEMknodMeta) UnmarshalUnsafe(src []byte) []byte { |
| 4330 |
size := f.SizeBytes() |
| 4331 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 4332 |
return src[size:] |
| 4333 |
} |
| 4334 |
|
| 4335 |
|
| 4336 |
|
| 4337 |
func (f *FUSEMknodMeta) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4338 |
|
| 4339 |
var buf []byte |
| 4340 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4341 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4342 |
hdr.Len = f.SizeBytes() |
| 4343 |
hdr.Cap = f.SizeBytes() |
| 4344 |
|
| 4345 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 4346 |
|
| 4347 |
|
| 4348 |
runtime.KeepAlive(f) |
| 4349 |
return length, err |
| 4350 |
} |
| 4351 |
|
| 4352 |
|
| 4353 |
|
| 4354 |
func (f *FUSEMknodMeta) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4355 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 4356 |
} |
| 4357 |
|
| 4358 |
|
| 4359 |
|
| 4360 |
func (f *FUSEMknodMeta) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4361 |
|
| 4362 |
var buf []byte |
| 4363 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4364 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4365 |
hdr.Len = f.SizeBytes() |
| 4366 |
hdr.Cap = f.SizeBytes() |
| 4367 |
|
| 4368 |
length, err := cc.CopyInBytes(addr, buf) |
| 4369 |
|
| 4370 |
|
| 4371 |
runtime.KeepAlive(f) |
| 4372 |
return length, err |
| 4373 |
} |
| 4374 |
|
| 4375 |
|
| 4376 |
func (f *FUSEMknodMeta) WriteTo(writer io.Writer) (int64, error) { |
| 4377 |
|
| 4378 |
var buf []byte |
| 4379 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4380 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4381 |
hdr.Len = f.SizeBytes() |
| 4382 |
hdr.Cap = f.SizeBytes() |
| 4383 |
|
| 4384 |
length, err := writer.Write(buf) |
| 4385 |
|
| 4386 |
|
| 4387 |
runtime.KeepAlive(f) |
| 4388 |
return int64(length), err |
| 4389 |
} |
| 4390 |
|
| 4391 |
|
| 4392 |
|
| 4393 |
func (f *FUSEOpID) SizeBytes() int { |
| 4394 |
return 8 |
| 4395 |
} |
| 4396 |
|
| 4397 |
|
| 4398 |
func (f *FUSEOpID) MarshalBytes(dst []byte) []byte { |
| 4399 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(*f)) |
| 4400 |
return dst[8:] |
| 4401 |
} |
| 4402 |
|
| 4403 |
|
| 4404 |
func (f *FUSEOpID) UnmarshalBytes(src []byte) []byte { |
| 4405 |
*f = FUSEOpID(uint64(hostarch.ByteOrder.Uint64(src[:8]))) |
| 4406 |
return src[8:] |
| 4407 |
} |
| 4408 |
|
| 4409 |
|
| 4410 |
|
| 4411 |
func (f *FUSEOpID) Packed() bool { |
| 4412 |
|
| 4413 |
return true |
| 4414 |
} |
| 4415 |
|
| 4416 |
|
| 4417 |
func (f *FUSEOpID) MarshalUnsafe(dst []byte) []byte { |
| 4418 |
size := f.SizeBytes() |
| 4419 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 4420 |
return dst[size:] |
| 4421 |
} |
| 4422 |
|
| 4423 |
|
| 4424 |
func (f *FUSEOpID) UnmarshalUnsafe(src []byte) []byte { |
| 4425 |
size := f.SizeBytes() |
| 4426 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 4427 |
return src[size:] |
| 4428 |
} |
| 4429 |
|
| 4430 |
|
| 4431 |
|
| 4432 |
func (f *FUSEOpID) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4433 |
|
| 4434 |
var buf []byte |
| 4435 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4436 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4437 |
hdr.Len = f.SizeBytes() |
| 4438 |
hdr.Cap = f.SizeBytes() |
| 4439 |
|
| 4440 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 4441 |
|
| 4442 |
|
| 4443 |
runtime.KeepAlive(f) |
| 4444 |
return length, err |
| 4445 |
} |
| 4446 |
|
| 4447 |
|
| 4448 |
|
| 4449 |
func (f *FUSEOpID) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4450 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 4451 |
} |
| 4452 |
|
| 4453 |
|
| 4454 |
|
| 4455 |
func (f *FUSEOpID) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4456 |
|
| 4457 |
var buf []byte |
| 4458 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4459 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4460 |
hdr.Len = f.SizeBytes() |
| 4461 |
hdr.Cap = f.SizeBytes() |
| 4462 |
|
| 4463 |
length, err := cc.CopyInBytes(addr, buf) |
| 4464 |
|
| 4465 |
|
| 4466 |
runtime.KeepAlive(f) |
| 4467 |
return length, err |
| 4468 |
} |
| 4469 |
|
| 4470 |
|
| 4471 |
func (f *FUSEOpID) WriteTo(writer io.Writer) (int64, error) { |
| 4472 |
|
| 4473 |
var buf []byte |
| 4474 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4475 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4476 |
hdr.Len = f.SizeBytes() |
| 4477 |
hdr.Cap = f.SizeBytes() |
| 4478 |
|
| 4479 |
length, err := writer.Write(buf) |
| 4480 |
|
| 4481 |
|
| 4482 |
runtime.KeepAlive(f) |
| 4483 |
return int64(length), err |
| 4484 |
} |
| 4485 |
|
| 4486 |
|
| 4487 |
|
| 4488 |
func (f *FUSEOpcode) SizeBytes() int { |
| 4489 |
return 4 |
| 4490 |
} |
| 4491 |
|
| 4492 |
|
| 4493 |
func (f *FUSEOpcode) MarshalBytes(dst []byte) []byte { |
| 4494 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(*f)) |
| 4495 |
return dst[4:] |
| 4496 |
} |
| 4497 |
|
| 4498 |
|
| 4499 |
func (f *FUSEOpcode) UnmarshalBytes(src []byte) []byte { |
| 4500 |
*f = FUSEOpcode(uint32(hostarch.ByteOrder.Uint32(src[:4]))) |
| 4501 |
return src[4:] |
| 4502 |
} |
| 4503 |
|
| 4504 |
|
| 4505 |
|
| 4506 |
func (f *FUSEOpcode) Packed() bool { |
| 4507 |
|
| 4508 |
return true |
| 4509 |
} |
| 4510 |
|
| 4511 |
|
| 4512 |
func (f *FUSEOpcode) MarshalUnsafe(dst []byte) []byte { |
| 4513 |
size := f.SizeBytes() |
| 4514 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 4515 |
return dst[size:] |
| 4516 |
} |
| 4517 |
|
| 4518 |
|
| 4519 |
func (f *FUSEOpcode) UnmarshalUnsafe(src []byte) []byte { |
| 4520 |
size := f.SizeBytes() |
| 4521 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 4522 |
return src[size:] |
| 4523 |
} |
| 4524 |
|
| 4525 |
|
| 4526 |
|
| 4527 |
func (f *FUSEOpcode) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4528 |
|
| 4529 |
var buf []byte |
| 4530 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4531 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4532 |
hdr.Len = f.SizeBytes() |
| 4533 |
hdr.Cap = f.SizeBytes() |
| 4534 |
|
| 4535 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 4536 |
|
| 4537 |
|
| 4538 |
runtime.KeepAlive(f) |
| 4539 |
return length, err |
| 4540 |
} |
| 4541 |
|
| 4542 |
|
| 4543 |
|
| 4544 |
func (f *FUSEOpcode) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4545 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 4546 |
} |
| 4547 |
|
| 4548 |
|
| 4549 |
|
| 4550 |
func (f *FUSEOpcode) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4551 |
|
| 4552 |
var buf []byte |
| 4553 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4554 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4555 |
hdr.Len = f.SizeBytes() |
| 4556 |
hdr.Cap = f.SizeBytes() |
| 4557 |
|
| 4558 |
length, err := cc.CopyInBytes(addr, buf) |
| 4559 |
|
| 4560 |
|
| 4561 |
runtime.KeepAlive(f) |
| 4562 |
return length, err |
| 4563 |
} |
| 4564 |
|
| 4565 |
|
| 4566 |
func (f *FUSEOpcode) WriteTo(writer io.Writer) (int64, error) { |
| 4567 |
|
| 4568 |
var buf []byte |
| 4569 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4570 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4571 |
hdr.Len = f.SizeBytes() |
| 4572 |
hdr.Cap = f.SizeBytes() |
| 4573 |
|
| 4574 |
length, err := writer.Write(buf) |
| 4575 |
|
| 4576 |
|
| 4577 |
runtime.KeepAlive(f) |
| 4578 |
return int64(length), err |
| 4579 |
} |
| 4580 |
|
| 4581 |
|
| 4582 |
func (f *FUSEOpenIn) SizeBytes() int { |
| 4583 |
return 8 |
| 4584 |
} |
| 4585 |
|
| 4586 |
|
| 4587 |
func (f *FUSEOpenIn) MarshalBytes(dst []byte) []byte { |
| 4588 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) |
| 4589 |
dst = dst[4:] |
| 4590 |
|
| 4591 |
dst = dst[4:] |
| 4592 |
return dst |
| 4593 |
} |
| 4594 |
|
| 4595 |
|
| 4596 |
func (f *FUSEOpenIn) UnmarshalBytes(src []byte) []byte { |
| 4597 |
f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4598 |
src = src[4:] |
| 4599 |
|
| 4600 |
src = src[4:] |
| 4601 |
return src |
| 4602 |
} |
| 4603 |
|
| 4604 |
|
| 4605 |
|
| 4606 |
func (f *FUSEOpenIn) Packed() bool { |
| 4607 |
return true |
| 4608 |
} |
| 4609 |
|
| 4610 |
|
| 4611 |
func (f *FUSEOpenIn) MarshalUnsafe(dst []byte) []byte { |
| 4612 |
size := f.SizeBytes() |
| 4613 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 4614 |
return dst[size:] |
| 4615 |
} |
| 4616 |
|
| 4617 |
|
| 4618 |
func (f *FUSEOpenIn) UnmarshalUnsafe(src []byte) []byte { |
| 4619 |
size := f.SizeBytes() |
| 4620 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 4621 |
return src[size:] |
| 4622 |
} |
| 4623 |
|
| 4624 |
|
| 4625 |
|
| 4626 |
func (f *FUSEOpenIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4627 |
|
| 4628 |
var buf []byte |
| 4629 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4630 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4631 |
hdr.Len = f.SizeBytes() |
| 4632 |
hdr.Cap = f.SizeBytes() |
| 4633 |
|
| 4634 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 4635 |
|
| 4636 |
|
| 4637 |
runtime.KeepAlive(f) |
| 4638 |
return length, err |
| 4639 |
} |
| 4640 |
|
| 4641 |
|
| 4642 |
|
| 4643 |
func (f *FUSEOpenIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4644 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 4645 |
} |
| 4646 |
|
| 4647 |
|
| 4648 |
|
| 4649 |
func (f *FUSEOpenIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4650 |
|
| 4651 |
var buf []byte |
| 4652 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4653 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4654 |
hdr.Len = f.SizeBytes() |
| 4655 |
hdr.Cap = f.SizeBytes() |
| 4656 |
|
| 4657 |
length, err := cc.CopyInBytes(addr, buf) |
| 4658 |
|
| 4659 |
|
| 4660 |
runtime.KeepAlive(f) |
| 4661 |
return length, err |
| 4662 |
} |
| 4663 |
|
| 4664 |
|
| 4665 |
func (f *FUSEOpenIn) WriteTo(writer io.Writer) (int64, error) { |
| 4666 |
|
| 4667 |
var buf []byte |
| 4668 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4669 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4670 |
hdr.Len = f.SizeBytes() |
| 4671 |
hdr.Cap = f.SizeBytes() |
| 4672 |
|
| 4673 |
length, err := writer.Write(buf) |
| 4674 |
|
| 4675 |
|
| 4676 |
runtime.KeepAlive(f) |
| 4677 |
return int64(length), err |
| 4678 |
} |
| 4679 |
|
| 4680 |
|
| 4681 |
func (f *FUSEOpenOut) SizeBytes() int { |
| 4682 |
return 16 |
| 4683 |
} |
| 4684 |
|
| 4685 |
|
| 4686 |
func (f *FUSEOpenOut) MarshalBytes(dst []byte) []byte { |
| 4687 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) |
| 4688 |
dst = dst[8:] |
| 4689 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.OpenFlag)) |
| 4690 |
dst = dst[4:] |
| 4691 |
|
| 4692 |
dst = dst[4:] |
| 4693 |
return dst |
| 4694 |
} |
| 4695 |
|
| 4696 |
|
| 4697 |
func (f *FUSEOpenOut) UnmarshalBytes(src []byte) []byte { |
| 4698 |
f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 4699 |
src = src[8:] |
| 4700 |
f.OpenFlag = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4701 |
src = src[4:] |
| 4702 |
|
| 4703 |
src = src[4:] |
| 4704 |
return src |
| 4705 |
} |
| 4706 |
|
| 4707 |
|
| 4708 |
|
| 4709 |
func (f *FUSEOpenOut) Packed() bool { |
| 4710 |
return true |
| 4711 |
} |
| 4712 |
|
| 4713 |
|
| 4714 |
func (f *FUSEOpenOut) MarshalUnsafe(dst []byte) []byte { |
| 4715 |
size := f.SizeBytes() |
| 4716 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 4717 |
return dst[size:] |
| 4718 |
} |
| 4719 |
|
| 4720 |
|
| 4721 |
func (f *FUSEOpenOut) UnmarshalUnsafe(src []byte) []byte { |
| 4722 |
size := f.SizeBytes() |
| 4723 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 4724 |
return src[size:] |
| 4725 |
} |
| 4726 |
|
| 4727 |
|
| 4728 |
|
| 4729 |
func (f *FUSEOpenOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4730 |
|
| 4731 |
var buf []byte |
| 4732 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4733 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4734 |
hdr.Len = f.SizeBytes() |
| 4735 |
hdr.Cap = f.SizeBytes() |
| 4736 |
|
| 4737 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 4738 |
|
| 4739 |
|
| 4740 |
runtime.KeepAlive(f) |
| 4741 |
return length, err |
| 4742 |
} |
| 4743 |
|
| 4744 |
|
| 4745 |
|
| 4746 |
func (f *FUSEOpenOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4747 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 4748 |
} |
| 4749 |
|
| 4750 |
|
| 4751 |
|
| 4752 |
func (f *FUSEOpenOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4753 |
|
| 4754 |
var buf []byte |
| 4755 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4756 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4757 |
hdr.Len = f.SizeBytes() |
| 4758 |
hdr.Cap = f.SizeBytes() |
| 4759 |
|
| 4760 |
length, err := cc.CopyInBytes(addr, buf) |
| 4761 |
|
| 4762 |
|
| 4763 |
runtime.KeepAlive(f) |
| 4764 |
return length, err |
| 4765 |
} |
| 4766 |
|
| 4767 |
|
| 4768 |
func (f *FUSEOpenOut) WriteTo(writer io.Writer) (int64, error) { |
| 4769 |
|
| 4770 |
var buf []byte |
| 4771 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4772 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4773 |
hdr.Len = f.SizeBytes() |
| 4774 |
hdr.Cap = f.SizeBytes() |
| 4775 |
|
| 4776 |
length, err := writer.Write(buf) |
| 4777 |
|
| 4778 |
|
| 4779 |
runtime.KeepAlive(f) |
| 4780 |
return int64(length), err |
| 4781 |
} |
| 4782 |
|
| 4783 |
|
| 4784 |
func (f *FUSEReadIn) SizeBytes() int { |
| 4785 |
return 40 |
| 4786 |
} |
| 4787 |
|
| 4788 |
|
| 4789 |
func (f *FUSEReadIn) MarshalBytes(dst []byte) []byte { |
| 4790 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) |
| 4791 |
dst = dst[8:] |
| 4792 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Offset)) |
| 4793 |
dst = dst[8:] |
| 4794 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Size)) |
| 4795 |
dst = dst[4:] |
| 4796 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.ReadFlags)) |
| 4797 |
dst = dst[4:] |
| 4798 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.LockOwner)) |
| 4799 |
dst = dst[8:] |
| 4800 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) |
| 4801 |
dst = dst[4:] |
| 4802 |
|
| 4803 |
dst = dst[4:] |
| 4804 |
return dst |
| 4805 |
} |
| 4806 |
|
| 4807 |
|
| 4808 |
func (f *FUSEReadIn) UnmarshalBytes(src []byte) []byte { |
| 4809 |
f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 4810 |
src = src[8:] |
| 4811 |
f.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 4812 |
src = src[8:] |
| 4813 |
f.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4814 |
src = src[4:] |
| 4815 |
f.ReadFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4816 |
src = src[4:] |
| 4817 |
f.LockOwner = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 4818 |
src = src[8:] |
| 4819 |
f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4820 |
src = src[4:] |
| 4821 |
|
| 4822 |
src = src[4:] |
| 4823 |
return src |
| 4824 |
} |
| 4825 |
|
| 4826 |
|
| 4827 |
|
| 4828 |
func (f *FUSEReadIn) Packed() bool { |
| 4829 |
return true |
| 4830 |
} |
| 4831 |
|
| 4832 |
|
| 4833 |
func (f *FUSEReadIn) MarshalUnsafe(dst []byte) []byte { |
| 4834 |
size := f.SizeBytes() |
| 4835 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 4836 |
return dst[size:] |
| 4837 |
} |
| 4838 |
|
| 4839 |
|
| 4840 |
func (f *FUSEReadIn) UnmarshalUnsafe(src []byte) []byte { |
| 4841 |
size := f.SizeBytes() |
| 4842 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 4843 |
return src[size:] |
| 4844 |
} |
| 4845 |
|
| 4846 |
|
| 4847 |
|
| 4848 |
func (f *FUSEReadIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4849 |
|
| 4850 |
var buf []byte |
| 4851 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4852 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4853 |
hdr.Len = f.SizeBytes() |
| 4854 |
hdr.Cap = f.SizeBytes() |
| 4855 |
|
| 4856 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 4857 |
|
| 4858 |
|
| 4859 |
runtime.KeepAlive(f) |
| 4860 |
return length, err |
| 4861 |
} |
| 4862 |
|
| 4863 |
|
| 4864 |
|
| 4865 |
func (f *FUSEReadIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4866 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 4867 |
} |
| 4868 |
|
| 4869 |
|
| 4870 |
|
| 4871 |
func (f *FUSEReadIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4872 |
|
| 4873 |
var buf []byte |
| 4874 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4875 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4876 |
hdr.Len = f.SizeBytes() |
| 4877 |
hdr.Cap = f.SizeBytes() |
| 4878 |
|
| 4879 |
length, err := cc.CopyInBytes(addr, buf) |
| 4880 |
|
| 4881 |
|
| 4882 |
runtime.KeepAlive(f) |
| 4883 |
return length, err |
| 4884 |
} |
| 4885 |
|
| 4886 |
|
| 4887 |
func (f *FUSEReadIn) WriteTo(writer io.Writer) (int64, error) { |
| 4888 |
|
| 4889 |
var buf []byte |
| 4890 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4891 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4892 |
hdr.Len = f.SizeBytes() |
| 4893 |
hdr.Cap = f.SizeBytes() |
| 4894 |
|
| 4895 |
length, err := writer.Write(buf) |
| 4896 |
|
| 4897 |
|
| 4898 |
runtime.KeepAlive(f) |
| 4899 |
return int64(length), err |
| 4900 |
} |
| 4901 |
|
| 4902 |
|
| 4903 |
func (f *FUSEReleaseIn) SizeBytes() int { |
| 4904 |
return 24 |
| 4905 |
} |
| 4906 |
|
| 4907 |
|
| 4908 |
func (f *FUSEReleaseIn) MarshalBytes(dst []byte) []byte { |
| 4909 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) |
| 4910 |
dst = dst[8:] |
| 4911 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) |
| 4912 |
dst = dst[4:] |
| 4913 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.ReleaseFlags)) |
| 4914 |
dst = dst[4:] |
| 4915 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.LockOwner)) |
| 4916 |
dst = dst[8:] |
| 4917 |
return dst |
| 4918 |
} |
| 4919 |
|
| 4920 |
|
| 4921 |
func (f *FUSEReleaseIn) UnmarshalBytes(src []byte) []byte { |
| 4922 |
f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 4923 |
src = src[8:] |
| 4924 |
f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4925 |
src = src[4:] |
| 4926 |
f.ReleaseFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 4927 |
src = src[4:] |
| 4928 |
f.LockOwner = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 4929 |
src = src[8:] |
| 4930 |
return src |
| 4931 |
} |
| 4932 |
|
| 4933 |
|
| 4934 |
|
| 4935 |
func (f *FUSEReleaseIn) Packed() bool { |
| 4936 |
return true |
| 4937 |
} |
| 4938 |
|
| 4939 |
|
| 4940 |
func (f *FUSEReleaseIn) MarshalUnsafe(dst []byte) []byte { |
| 4941 |
size := f.SizeBytes() |
| 4942 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 4943 |
return dst[size:] |
| 4944 |
} |
| 4945 |
|
| 4946 |
|
| 4947 |
func (f *FUSEReleaseIn) UnmarshalUnsafe(src []byte) []byte { |
| 4948 |
size := f.SizeBytes() |
| 4949 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 4950 |
return src[size:] |
| 4951 |
} |
| 4952 |
|
| 4953 |
|
| 4954 |
|
| 4955 |
func (f *FUSEReleaseIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 4956 |
|
| 4957 |
var buf []byte |
| 4958 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4959 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4960 |
hdr.Len = f.SizeBytes() |
| 4961 |
hdr.Cap = f.SizeBytes() |
| 4962 |
|
| 4963 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 4964 |
|
| 4965 |
|
| 4966 |
runtime.KeepAlive(f) |
| 4967 |
return length, err |
| 4968 |
} |
| 4969 |
|
| 4970 |
|
| 4971 |
|
| 4972 |
func (f *FUSEReleaseIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4973 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 4974 |
} |
| 4975 |
|
| 4976 |
|
| 4977 |
|
| 4978 |
func (f *FUSEReleaseIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 4979 |
|
| 4980 |
var buf []byte |
| 4981 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4982 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4983 |
hdr.Len = f.SizeBytes() |
| 4984 |
hdr.Cap = f.SizeBytes() |
| 4985 |
|
| 4986 |
length, err := cc.CopyInBytes(addr, buf) |
| 4987 |
|
| 4988 |
|
| 4989 |
runtime.KeepAlive(f) |
| 4990 |
return length, err |
| 4991 |
} |
| 4992 |
|
| 4993 |
|
| 4994 |
func (f *FUSEReleaseIn) WriteTo(writer io.Writer) (int64, error) { |
| 4995 |
|
| 4996 |
var buf []byte |
| 4997 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 4998 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 4999 |
hdr.Len = f.SizeBytes() |
| 5000 |
hdr.Cap = f.SizeBytes() |
| 5001 |
|
| 5002 |
length, err := writer.Write(buf) |
| 5003 |
|
| 5004 |
|
| 5005 |
runtime.KeepAlive(f) |
| 5006 |
return int64(length), err |
| 5007 |
} |
| 5008 |
|
| 5009 |
|
| 5010 |
|
| 5011 |
func (r *FUSERmDirIn) Packed() bool { |
| 5012 |
|
| 5013 |
return false |
| 5014 |
} |
| 5015 |
|
| 5016 |
|
| 5017 |
func (r *FUSERmDirIn) MarshalUnsafe(dst []byte) []byte { |
| 5018 |
|
| 5019 |
return r.MarshalBytes(dst) |
| 5020 |
} |
| 5021 |
|
| 5022 |
|
| 5023 |
func (r *FUSERmDirIn) UnmarshalUnsafe(src []byte) []byte { |
| 5024 |
|
| 5025 |
return r.UnmarshalBytes(src) |
| 5026 |
} |
| 5027 |
|
| 5028 |
|
| 5029 |
|
| 5030 |
func (r *FUSERmDirIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 5031 |
|
| 5032 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 5033 |
r.MarshalBytes(buf) |
| 5034 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 5035 |
} |
| 5036 |
|
| 5037 |
|
| 5038 |
|
| 5039 |
func (r *FUSERmDirIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5040 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 5041 |
} |
| 5042 |
|
| 5043 |
|
| 5044 |
|
| 5045 |
func (r *FUSERmDirIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5046 |
|
| 5047 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 5048 |
length, err := cc.CopyInBytes(addr, buf) |
| 5049 |
|
| 5050 |
|
| 5051 |
r.UnmarshalBytes(buf) |
| 5052 |
return length, err |
| 5053 |
} |
| 5054 |
|
| 5055 |
|
| 5056 |
func (r *FUSERmDirIn) WriteTo(writer io.Writer) (int64, error) { |
| 5057 |
|
| 5058 |
buf := make([]byte, r.SizeBytes()) |
| 5059 |
r.MarshalBytes(buf) |
| 5060 |
length, err := writer.Write(buf) |
| 5061 |
return int64(length), err |
| 5062 |
} |
| 5063 |
|
| 5064 |
|
| 5065 |
func (f *FUSESetAttrIn) SizeBytes() int { |
| 5066 |
return 88 |
| 5067 |
} |
| 5068 |
|
| 5069 |
|
| 5070 |
func (f *FUSESetAttrIn) MarshalBytes(dst []byte) []byte { |
| 5071 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Valid)) |
| 5072 |
dst = dst[4:] |
| 5073 |
|
| 5074 |
dst = dst[4:] |
| 5075 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) |
| 5076 |
dst = dst[8:] |
| 5077 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Size)) |
| 5078 |
dst = dst[8:] |
| 5079 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.LockOwner)) |
| 5080 |
dst = dst[8:] |
| 5081 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Atime)) |
| 5082 |
dst = dst[8:] |
| 5083 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Mtime)) |
| 5084 |
dst = dst[8:] |
| 5085 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Ctime)) |
| 5086 |
dst = dst[8:] |
| 5087 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.AtimeNsec)) |
| 5088 |
dst = dst[4:] |
| 5089 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.MtimeNsec)) |
| 5090 |
dst = dst[4:] |
| 5091 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.CtimeNsec)) |
| 5092 |
dst = dst[4:] |
| 5093 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mode)) |
| 5094 |
dst = dst[4:] |
| 5095 |
|
| 5096 |
dst = dst[4:] |
| 5097 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.UID)) |
| 5098 |
dst = dst[4:] |
| 5099 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.GID)) |
| 5100 |
dst = dst[4:] |
| 5101 |
|
| 5102 |
dst = dst[4:] |
| 5103 |
return dst |
| 5104 |
} |
| 5105 |
|
| 5106 |
|
| 5107 |
func (f *FUSESetAttrIn) UnmarshalBytes(src []byte) []byte { |
| 5108 |
f.Valid = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5109 |
src = src[4:] |
| 5110 |
|
| 5111 |
src = src[4:] |
| 5112 |
f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5113 |
src = src[8:] |
| 5114 |
f.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5115 |
src = src[8:] |
| 5116 |
f.LockOwner = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5117 |
src = src[8:] |
| 5118 |
f.Atime = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5119 |
src = src[8:] |
| 5120 |
f.Mtime = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5121 |
src = src[8:] |
| 5122 |
f.Ctime = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5123 |
src = src[8:] |
| 5124 |
f.AtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5125 |
src = src[4:] |
| 5126 |
f.MtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5127 |
src = src[4:] |
| 5128 |
f.CtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5129 |
src = src[4:] |
| 5130 |
f.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5131 |
src = src[4:] |
| 5132 |
|
| 5133 |
src = src[4:] |
| 5134 |
f.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5135 |
src = src[4:] |
| 5136 |
f.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5137 |
src = src[4:] |
| 5138 |
|
| 5139 |
src = src[4:] |
| 5140 |
return src |
| 5141 |
} |
| 5142 |
|
| 5143 |
|
| 5144 |
|
| 5145 |
func (f *FUSESetAttrIn) Packed() bool { |
| 5146 |
return true |
| 5147 |
} |
| 5148 |
|
| 5149 |
|
| 5150 |
func (f *FUSESetAttrIn) MarshalUnsafe(dst []byte) []byte { |
| 5151 |
size := f.SizeBytes() |
| 5152 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 5153 |
return dst[size:] |
| 5154 |
} |
| 5155 |
|
| 5156 |
|
| 5157 |
func (f *FUSESetAttrIn) UnmarshalUnsafe(src []byte) []byte { |
| 5158 |
size := f.SizeBytes() |
| 5159 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 5160 |
return src[size:] |
| 5161 |
} |
| 5162 |
|
| 5163 |
|
| 5164 |
|
| 5165 |
func (f *FUSESetAttrIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 5166 |
|
| 5167 |
var buf []byte |
| 5168 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5169 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 5170 |
hdr.Len = f.SizeBytes() |
| 5171 |
hdr.Cap = f.SizeBytes() |
| 5172 |
|
| 5173 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 5174 |
|
| 5175 |
|
| 5176 |
runtime.KeepAlive(f) |
| 5177 |
return length, err |
| 5178 |
} |
| 5179 |
|
| 5180 |
|
| 5181 |
|
| 5182 |
func (f *FUSESetAttrIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5183 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 5184 |
} |
| 5185 |
|
| 5186 |
|
| 5187 |
|
| 5188 |
func (f *FUSESetAttrIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5189 |
|
| 5190 |
var buf []byte |
| 5191 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5192 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 5193 |
hdr.Len = f.SizeBytes() |
| 5194 |
hdr.Cap = f.SizeBytes() |
| 5195 |
|
| 5196 |
length, err := cc.CopyInBytes(addr, buf) |
| 5197 |
|
| 5198 |
|
| 5199 |
runtime.KeepAlive(f) |
| 5200 |
return length, err |
| 5201 |
} |
| 5202 |
|
| 5203 |
|
| 5204 |
func (f *FUSESetAttrIn) WriteTo(writer io.Writer) (int64, error) { |
| 5205 |
|
| 5206 |
var buf []byte |
| 5207 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5208 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 5209 |
hdr.Len = f.SizeBytes() |
| 5210 |
hdr.Cap = f.SizeBytes() |
| 5211 |
|
| 5212 |
length, err := writer.Write(buf) |
| 5213 |
|
| 5214 |
|
| 5215 |
runtime.KeepAlive(f) |
| 5216 |
return int64(length), err |
| 5217 |
} |
| 5218 |
|
| 5219 |
|
| 5220 |
|
| 5221 |
func (r *FUSESymlinkIn) Packed() bool { |
| 5222 |
|
| 5223 |
return false |
| 5224 |
} |
| 5225 |
|
| 5226 |
|
| 5227 |
func (r *FUSESymlinkIn) MarshalUnsafe(dst []byte) []byte { |
| 5228 |
|
| 5229 |
return r.MarshalBytes(dst) |
| 5230 |
} |
| 5231 |
|
| 5232 |
|
| 5233 |
func (r *FUSESymlinkIn) UnmarshalUnsafe(src []byte) []byte { |
| 5234 |
|
| 5235 |
return r.UnmarshalBytes(src) |
| 5236 |
} |
| 5237 |
|
| 5238 |
|
| 5239 |
|
| 5240 |
func (r *FUSESymlinkIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 5241 |
|
| 5242 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 5243 |
r.MarshalBytes(buf) |
| 5244 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 5245 |
} |
| 5246 |
|
| 5247 |
|
| 5248 |
|
| 5249 |
func (r *FUSESymlinkIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5250 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 5251 |
} |
| 5252 |
|
| 5253 |
|
| 5254 |
|
| 5255 |
func (r *FUSESymlinkIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5256 |
|
| 5257 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 5258 |
length, err := cc.CopyInBytes(addr, buf) |
| 5259 |
|
| 5260 |
|
| 5261 |
r.UnmarshalBytes(buf) |
| 5262 |
return length, err |
| 5263 |
} |
| 5264 |
|
| 5265 |
|
| 5266 |
func (r *FUSESymlinkIn) WriteTo(writer io.Writer) (int64, error) { |
| 5267 |
|
| 5268 |
buf := make([]byte, r.SizeBytes()) |
| 5269 |
r.MarshalBytes(buf) |
| 5270 |
length, err := writer.Write(buf) |
| 5271 |
return int64(length), err |
| 5272 |
} |
| 5273 |
|
| 5274 |
|
| 5275 |
|
| 5276 |
func (r *FUSEUnlinkIn) Packed() bool { |
| 5277 |
|
| 5278 |
return false |
| 5279 |
} |
| 5280 |
|
| 5281 |
|
| 5282 |
func (r *FUSEUnlinkIn) MarshalUnsafe(dst []byte) []byte { |
| 5283 |
|
| 5284 |
return r.MarshalBytes(dst) |
| 5285 |
} |
| 5286 |
|
| 5287 |
|
| 5288 |
func (r *FUSEUnlinkIn) UnmarshalUnsafe(src []byte) []byte { |
| 5289 |
|
| 5290 |
return r.UnmarshalBytes(src) |
| 5291 |
} |
| 5292 |
|
| 5293 |
|
| 5294 |
|
| 5295 |
func (r *FUSEUnlinkIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 5296 |
|
| 5297 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 5298 |
r.MarshalBytes(buf) |
| 5299 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 5300 |
} |
| 5301 |
|
| 5302 |
|
| 5303 |
|
| 5304 |
func (r *FUSEUnlinkIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5305 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 5306 |
} |
| 5307 |
|
| 5308 |
|
| 5309 |
|
| 5310 |
func (r *FUSEUnlinkIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5311 |
|
| 5312 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 5313 |
length, err := cc.CopyInBytes(addr, buf) |
| 5314 |
|
| 5315 |
|
| 5316 |
r.UnmarshalBytes(buf) |
| 5317 |
return length, err |
| 5318 |
} |
| 5319 |
|
| 5320 |
|
| 5321 |
func (r *FUSEUnlinkIn) WriteTo(writer io.Writer) (int64, error) { |
| 5322 |
|
| 5323 |
buf := make([]byte, r.SizeBytes()) |
| 5324 |
r.MarshalBytes(buf) |
| 5325 |
length, err := writer.Write(buf) |
| 5326 |
return int64(length), err |
| 5327 |
} |
| 5328 |
|
| 5329 |
|
| 5330 |
func (f *FUSEWriteIn) SizeBytes() int { |
| 5331 |
return 40 |
| 5332 |
} |
| 5333 |
|
| 5334 |
|
| 5335 |
func (f *FUSEWriteIn) MarshalBytes(dst []byte) []byte { |
| 5336 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) |
| 5337 |
dst = dst[8:] |
| 5338 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Offset)) |
| 5339 |
dst = dst[8:] |
| 5340 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Size)) |
| 5341 |
dst = dst[4:] |
| 5342 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.WriteFlags)) |
| 5343 |
dst = dst[4:] |
| 5344 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.LockOwner)) |
| 5345 |
dst = dst[8:] |
| 5346 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) |
| 5347 |
dst = dst[4:] |
| 5348 |
|
| 5349 |
dst = dst[4:] |
| 5350 |
return dst |
| 5351 |
} |
| 5352 |
|
| 5353 |
|
| 5354 |
func (f *FUSEWriteIn) UnmarshalBytes(src []byte) []byte { |
| 5355 |
f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5356 |
src = src[8:] |
| 5357 |
f.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5358 |
src = src[8:] |
| 5359 |
f.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5360 |
src = src[4:] |
| 5361 |
f.WriteFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5362 |
src = src[4:] |
| 5363 |
f.LockOwner = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5364 |
src = src[8:] |
| 5365 |
f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5366 |
src = src[4:] |
| 5367 |
|
| 5368 |
src = src[4:] |
| 5369 |
return src |
| 5370 |
} |
| 5371 |
|
| 5372 |
|
| 5373 |
|
| 5374 |
func (f *FUSEWriteIn) Packed() bool { |
| 5375 |
return true |
| 5376 |
} |
| 5377 |
|
| 5378 |
|
| 5379 |
func (f *FUSEWriteIn) MarshalUnsafe(dst []byte) []byte { |
| 5380 |
size := f.SizeBytes() |
| 5381 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 5382 |
return dst[size:] |
| 5383 |
} |
| 5384 |
|
| 5385 |
|
| 5386 |
func (f *FUSEWriteIn) UnmarshalUnsafe(src []byte) []byte { |
| 5387 |
size := f.SizeBytes() |
| 5388 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 5389 |
return src[size:] |
| 5390 |
} |
| 5391 |
|
| 5392 |
|
| 5393 |
|
| 5394 |
func (f *FUSEWriteIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 5395 |
|
| 5396 |
var buf []byte |
| 5397 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5398 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 5399 |
hdr.Len = f.SizeBytes() |
| 5400 |
hdr.Cap = f.SizeBytes() |
| 5401 |
|
| 5402 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 5403 |
|
| 5404 |
|
| 5405 |
runtime.KeepAlive(f) |
| 5406 |
return length, err |
| 5407 |
} |
| 5408 |
|
| 5409 |
|
| 5410 |
|
| 5411 |
func (f *FUSEWriteIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5412 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 5413 |
} |
| 5414 |
|
| 5415 |
|
| 5416 |
|
| 5417 |
func (f *FUSEWriteIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5418 |
|
| 5419 |
var buf []byte |
| 5420 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5421 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 5422 |
hdr.Len = f.SizeBytes() |
| 5423 |
hdr.Cap = f.SizeBytes() |
| 5424 |
|
| 5425 |
length, err := cc.CopyInBytes(addr, buf) |
| 5426 |
|
| 5427 |
|
| 5428 |
runtime.KeepAlive(f) |
| 5429 |
return length, err |
| 5430 |
} |
| 5431 |
|
| 5432 |
|
| 5433 |
func (f *FUSEWriteIn) WriteTo(writer io.Writer) (int64, error) { |
| 5434 |
|
| 5435 |
var buf []byte |
| 5436 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5437 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 5438 |
hdr.Len = f.SizeBytes() |
| 5439 |
hdr.Cap = f.SizeBytes() |
| 5440 |
|
| 5441 |
length, err := writer.Write(buf) |
| 5442 |
|
| 5443 |
|
| 5444 |
runtime.KeepAlive(f) |
| 5445 |
return int64(length), err |
| 5446 |
} |
| 5447 |
|
| 5448 |
|
| 5449 |
func (f *FUSEWriteOut) SizeBytes() int { |
| 5450 |
return 8 |
| 5451 |
} |
| 5452 |
|
| 5453 |
|
| 5454 |
func (f *FUSEWriteOut) MarshalBytes(dst []byte) []byte { |
| 5455 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Size)) |
| 5456 |
dst = dst[4:] |
| 5457 |
|
| 5458 |
dst = dst[4:] |
| 5459 |
return dst |
| 5460 |
} |
| 5461 |
|
| 5462 |
|
| 5463 |
func (f *FUSEWriteOut) UnmarshalBytes(src []byte) []byte { |
| 5464 |
f.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5465 |
src = src[4:] |
| 5466 |
|
| 5467 |
src = src[4:] |
| 5468 |
return src |
| 5469 |
} |
| 5470 |
|
| 5471 |
|
| 5472 |
|
| 5473 |
func (f *FUSEWriteOut) Packed() bool { |
| 5474 |
return true |
| 5475 |
} |
| 5476 |
|
| 5477 |
|
| 5478 |
func (f *FUSEWriteOut) MarshalUnsafe(dst []byte) []byte { |
| 5479 |
size := f.SizeBytes() |
| 5480 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) |
| 5481 |
return dst[size:] |
| 5482 |
} |
| 5483 |
|
| 5484 |
|
| 5485 |
func (f *FUSEWriteOut) UnmarshalUnsafe(src []byte) []byte { |
| 5486 |
size := f.SizeBytes() |
| 5487 |
gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) |
| 5488 |
return src[size:] |
| 5489 |
} |
| 5490 |
|
| 5491 |
|
| 5492 |
|
| 5493 |
func (f *FUSEWriteOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 5494 |
|
| 5495 |
var buf []byte |
| 5496 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5497 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 5498 |
hdr.Len = f.SizeBytes() |
| 5499 |
hdr.Cap = f.SizeBytes() |
| 5500 |
|
| 5501 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 5502 |
|
| 5503 |
|
| 5504 |
runtime.KeepAlive(f) |
| 5505 |
return length, err |
| 5506 |
} |
| 5507 |
|
| 5508 |
|
| 5509 |
|
| 5510 |
func (f *FUSEWriteOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5511 |
return f.CopyOutN(cc, addr, f.SizeBytes()) |
| 5512 |
} |
| 5513 |
|
| 5514 |
|
| 5515 |
|
| 5516 |
func (f *FUSEWriteOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5517 |
|
| 5518 |
var buf []byte |
| 5519 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5520 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 5521 |
hdr.Len = f.SizeBytes() |
| 5522 |
hdr.Cap = f.SizeBytes() |
| 5523 |
|
| 5524 |
length, err := cc.CopyInBytes(addr, buf) |
| 5525 |
|
| 5526 |
|
| 5527 |
runtime.KeepAlive(f) |
| 5528 |
return length, err |
| 5529 |
} |
| 5530 |
|
| 5531 |
|
| 5532 |
func (f *FUSEWriteOut) WriteTo(writer io.Writer) (int64, error) { |
| 5533 |
|
| 5534 |
var buf []byte |
| 5535 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5536 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) |
| 5537 |
hdr.Len = f.SizeBytes() |
| 5538 |
hdr.Cap = f.SizeBytes() |
| 5539 |
|
| 5540 |
length, err := writer.Write(buf) |
| 5541 |
|
| 5542 |
|
| 5543 |
runtime.KeepAlive(f) |
| 5544 |
return int64(length), err |
| 5545 |
} |
| 5546 |
|
| 5547 |
|
| 5548 |
func (r *RobustListHead) SizeBytes() int { |
| 5549 |
return 24 |
| 5550 |
} |
| 5551 |
|
| 5552 |
|
| 5553 |
func (r *RobustListHead) MarshalBytes(dst []byte) []byte { |
| 5554 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.List)) |
| 5555 |
dst = dst[8:] |
| 5556 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.FutexOffset)) |
| 5557 |
dst = dst[8:] |
| 5558 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.ListOpPending)) |
| 5559 |
dst = dst[8:] |
| 5560 |
return dst |
| 5561 |
} |
| 5562 |
|
| 5563 |
|
| 5564 |
func (r *RobustListHead) UnmarshalBytes(src []byte) []byte { |
| 5565 |
r.List = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5566 |
src = src[8:] |
| 5567 |
r.FutexOffset = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5568 |
src = src[8:] |
| 5569 |
r.ListOpPending = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5570 |
src = src[8:] |
| 5571 |
return src |
| 5572 |
} |
| 5573 |
|
| 5574 |
|
| 5575 |
|
| 5576 |
func (r *RobustListHead) Packed() bool { |
| 5577 |
return true |
| 5578 |
} |
| 5579 |
|
| 5580 |
|
| 5581 |
func (r *RobustListHead) MarshalUnsafe(dst []byte) []byte { |
| 5582 |
size := r.SizeBytes() |
| 5583 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) |
| 5584 |
return dst[size:] |
| 5585 |
} |
| 5586 |
|
| 5587 |
|
| 5588 |
func (r *RobustListHead) UnmarshalUnsafe(src []byte) []byte { |
| 5589 |
size := r.SizeBytes() |
| 5590 |
gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) |
| 5591 |
return src[size:] |
| 5592 |
} |
| 5593 |
|
| 5594 |
|
| 5595 |
|
| 5596 |
func (r *RobustListHead) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 5597 |
|
| 5598 |
var buf []byte |
| 5599 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5600 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 5601 |
hdr.Len = r.SizeBytes() |
| 5602 |
hdr.Cap = r.SizeBytes() |
| 5603 |
|
| 5604 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 5605 |
|
| 5606 |
|
| 5607 |
runtime.KeepAlive(r) |
| 5608 |
return length, err |
| 5609 |
} |
| 5610 |
|
| 5611 |
|
| 5612 |
|
| 5613 |
func (r *RobustListHead) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5614 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 5615 |
} |
| 5616 |
|
| 5617 |
|
| 5618 |
|
| 5619 |
func (r *RobustListHead) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5620 |
|
| 5621 |
var buf []byte |
| 5622 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5623 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 5624 |
hdr.Len = r.SizeBytes() |
| 5625 |
hdr.Cap = r.SizeBytes() |
| 5626 |
|
| 5627 |
length, err := cc.CopyInBytes(addr, buf) |
| 5628 |
|
| 5629 |
|
| 5630 |
runtime.KeepAlive(r) |
| 5631 |
return length, err |
| 5632 |
} |
| 5633 |
|
| 5634 |
|
| 5635 |
func (r *RobustListHead) WriteTo(writer io.Writer) (int64, error) { |
| 5636 |
|
| 5637 |
var buf []byte |
| 5638 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5639 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 5640 |
hdr.Len = r.SizeBytes() |
| 5641 |
hdr.Cap = r.SizeBytes() |
| 5642 |
|
| 5643 |
length, err := writer.Write(buf) |
| 5644 |
|
| 5645 |
|
| 5646 |
runtime.KeepAlive(r) |
| 5647 |
return int64(length), err |
| 5648 |
} |
| 5649 |
|
| 5650 |
|
| 5651 |
func (d *DigestMetadata) SizeBytes() int { |
| 5652 |
return 4 |
| 5653 |
} |
| 5654 |
|
| 5655 |
|
| 5656 |
func (d *DigestMetadata) MarshalBytes(dst []byte) []byte { |
| 5657 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(d.DigestAlgorithm)) |
| 5658 |
dst = dst[2:] |
| 5659 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(d.DigestSize)) |
| 5660 |
dst = dst[2:] |
| 5661 |
return dst |
| 5662 |
} |
| 5663 |
|
| 5664 |
|
| 5665 |
func (d *DigestMetadata) UnmarshalBytes(src []byte) []byte { |
| 5666 |
d.DigestAlgorithm = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 5667 |
src = src[2:] |
| 5668 |
d.DigestSize = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 5669 |
src = src[2:] |
| 5670 |
return src |
| 5671 |
} |
| 5672 |
|
| 5673 |
|
| 5674 |
|
| 5675 |
func (d *DigestMetadata) Packed() bool { |
| 5676 |
return true |
| 5677 |
} |
| 5678 |
|
| 5679 |
|
| 5680 |
func (d *DigestMetadata) MarshalUnsafe(dst []byte) []byte { |
| 5681 |
size := d.SizeBytes() |
| 5682 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(d), uintptr(size)) |
| 5683 |
return dst[size:] |
| 5684 |
} |
| 5685 |
|
| 5686 |
|
| 5687 |
func (d *DigestMetadata) UnmarshalUnsafe(src []byte) []byte { |
| 5688 |
size := d.SizeBytes() |
| 5689 |
gohacks.Memmove(unsafe.Pointer(d), unsafe.Pointer(&src[0]), uintptr(size)) |
| 5690 |
return src[size:] |
| 5691 |
} |
| 5692 |
|
| 5693 |
|
| 5694 |
|
| 5695 |
func (d *DigestMetadata) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 5696 |
|
| 5697 |
var buf []byte |
| 5698 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5699 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(d))) |
| 5700 |
hdr.Len = d.SizeBytes() |
| 5701 |
hdr.Cap = d.SizeBytes() |
| 5702 |
|
| 5703 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 5704 |
|
| 5705 |
|
| 5706 |
runtime.KeepAlive(d) |
| 5707 |
return length, err |
| 5708 |
} |
| 5709 |
|
| 5710 |
|
| 5711 |
|
| 5712 |
func (d *DigestMetadata) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5713 |
return d.CopyOutN(cc, addr, d.SizeBytes()) |
| 5714 |
} |
| 5715 |
|
| 5716 |
|
| 5717 |
|
| 5718 |
func (d *DigestMetadata) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5719 |
|
| 5720 |
var buf []byte |
| 5721 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5722 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(d))) |
| 5723 |
hdr.Len = d.SizeBytes() |
| 5724 |
hdr.Cap = d.SizeBytes() |
| 5725 |
|
| 5726 |
length, err := cc.CopyInBytes(addr, buf) |
| 5727 |
|
| 5728 |
|
| 5729 |
runtime.KeepAlive(d) |
| 5730 |
return length, err |
| 5731 |
} |
| 5732 |
|
| 5733 |
|
| 5734 |
func (d *DigestMetadata) WriteTo(writer io.Writer) (int64, error) { |
| 5735 |
|
| 5736 |
var buf []byte |
| 5737 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5738 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(d))) |
| 5739 |
hdr.Len = d.SizeBytes() |
| 5740 |
hdr.Cap = d.SizeBytes() |
| 5741 |
|
| 5742 |
length, err := writer.Write(buf) |
| 5743 |
|
| 5744 |
|
| 5745 |
runtime.KeepAlive(d) |
| 5746 |
return int64(length), err |
| 5747 |
} |
| 5748 |
|
| 5749 |
|
| 5750 |
func (i *IPCPerm) SizeBytes() int { |
| 5751 |
return 48 |
| 5752 |
} |
| 5753 |
|
| 5754 |
|
| 5755 |
func (i *IPCPerm) MarshalBytes(dst []byte) []byte { |
| 5756 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Key)) |
| 5757 |
dst = dst[4:] |
| 5758 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.UID)) |
| 5759 |
dst = dst[4:] |
| 5760 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.GID)) |
| 5761 |
dst = dst[4:] |
| 5762 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CUID)) |
| 5763 |
dst = dst[4:] |
| 5764 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CGID)) |
| 5765 |
dst = dst[4:] |
| 5766 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.Mode)) |
| 5767 |
dst = dst[2:] |
| 5768 |
|
| 5769 |
dst = dst[2:] |
| 5770 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.Seq)) |
| 5771 |
dst = dst[2:] |
| 5772 |
|
| 5773 |
dst = dst[2:] |
| 5774 |
|
| 5775 |
dst = dst[4:] |
| 5776 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.unused1)) |
| 5777 |
dst = dst[8:] |
| 5778 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.unused2)) |
| 5779 |
dst = dst[8:] |
| 5780 |
return dst |
| 5781 |
} |
| 5782 |
|
| 5783 |
|
| 5784 |
func (i *IPCPerm) UnmarshalBytes(src []byte) []byte { |
| 5785 |
i.Key = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5786 |
src = src[4:] |
| 5787 |
i.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5788 |
src = src[4:] |
| 5789 |
i.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5790 |
src = src[4:] |
| 5791 |
i.CUID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5792 |
src = src[4:] |
| 5793 |
i.CGID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5794 |
src = src[4:] |
| 5795 |
i.Mode = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 5796 |
src = src[2:] |
| 5797 |
|
| 5798 |
src = src[2:] |
| 5799 |
i.Seq = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 5800 |
src = src[2:] |
| 5801 |
|
| 5802 |
src = src[2:] |
| 5803 |
|
| 5804 |
src = src[4:] |
| 5805 |
i.unused1 = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5806 |
src = src[8:] |
| 5807 |
i.unused2 = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5808 |
src = src[8:] |
| 5809 |
return src |
| 5810 |
} |
| 5811 |
|
| 5812 |
|
| 5813 |
|
| 5814 |
func (i *IPCPerm) Packed() bool { |
| 5815 |
return true |
| 5816 |
} |
| 5817 |
|
| 5818 |
|
| 5819 |
func (i *IPCPerm) MarshalUnsafe(dst []byte) []byte { |
| 5820 |
size := i.SizeBytes() |
| 5821 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 5822 |
return dst[size:] |
| 5823 |
} |
| 5824 |
|
| 5825 |
|
| 5826 |
func (i *IPCPerm) UnmarshalUnsafe(src []byte) []byte { |
| 5827 |
size := i.SizeBytes() |
| 5828 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 5829 |
return src[size:] |
| 5830 |
} |
| 5831 |
|
| 5832 |
|
| 5833 |
|
| 5834 |
func (i *IPCPerm) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 5835 |
|
| 5836 |
var buf []byte |
| 5837 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5838 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 5839 |
hdr.Len = i.SizeBytes() |
| 5840 |
hdr.Cap = i.SizeBytes() |
| 5841 |
|
| 5842 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 5843 |
|
| 5844 |
|
| 5845 |
runtime.KeepAlive(i) |
| 5846 |
return length, err |
| 5847 |
} |
| 5848 |
|
| 5849 |
|
| 5850 |
|
| 5851 |
func (i *IPCPerm) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5852 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 5853 |
} |
| 5854 |
|
| 5855 |
|
| 5856 |
|
| 5857 |
func (i *IPCPerm) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5858 |
|
| 5859 |
var buf []byte |
| 5860 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5861 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 5862 |
hdr.Len = i.SizeBytes() |
| 5863 |
hdr.Cap = i.SizeBytes() |
| 5864 |
|
| 5865 |
length, err := cc.CopyInBytes(addr, buf) |
| 5866 |
|
| 5867 |
|
| 5868 |
runtime.KeepAlive(i) |
| 5869 |
return length, err |
| 5870 |
} |
| 5871 |
|
| 5872 |
|
| 5873 |
func (i *IPCPerm) WriteTo(writer io.Writer) (int64, error) { |
| 5874 |
|
| 5875 |
var buf []byte |
| 5876 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 5877 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 5878 |
hdr.Len = i.SizeBytes() |
| 5879 |
hdr.Cap = i.SizeBytes() |
| 5880 |
|
| 5881 |
length, err := writer.Write(buf) |
| 5882 |
|
| 5883 |
|
| 5884 |
runtime.KeepAlive(i) |
| 5885 |
return int64(length), err |
| 5886 |
} |
| 5887 |
|
| 5888 |
|
| 5889 |
func (s *Sysinfo) SizeBytes() int { |
| 5890 |
return 78 + |
| 5891 |
8*3 + |
| 5892 |
1*6 |
| 5893 |
} |
| 5894 |
|
| 5895 |
|
| 5896 |
func (s *Sysinfo) MarshalBytes(dst []byte) []byte { |
| 5897 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Uptime)) |
| 5898 |
dst = dst[8:] |
| 5899 |
for idx := 0; idx < 3; idx++ { |
| 5900 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Loads[idx])) |
| 5901 |
dst = dst[8:] |
| 5902 |
} |
| 5903 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.TotalRAM)) |
| 5904 |
dst = dst[8:] |
| 5905 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.FreeRAM)) |
| 5906 |
dst = dst[8:] |
| 5907 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.SharedRAM)) |
| 5908 |
dst = dst[8:] |
| 5909 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.BufferRAM)) |
| 5910 |
dst = dst[8:] |
| 5911 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.TotalSwap)) |
| 5912 |
dst = dst[8:] |
| 5913 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.FreeSwap)) |
| 5914 |
dst = dst[8:] |
| 5915 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Procs)) |
| 5916 |
dst = dst[2:] |
| 5917 |
|
| 5918 |
dst = dst[1*(6):] |
| 5919 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.TotalHigh)) |
| 5920 |
dst = dst[8:] |
| 5921 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.FreeHigh)) |
| 5922 |
dst = dst[8:] |
| 5923 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Unit)) |
| 5924 |
dst = dst[4:] |
| 5925 |
return dst |
| 5926 |
} |
| 5927 |
|
| 5928 |
|
| 5929 |
func (s *Sysinfo) UnmarshalBytes(src []byte) []byte { |
| 5930 |
s.Uptime = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5931 |
src = src[8:] |
| 5932 |
for idx := 0; idx < 3; idx++ { |
| 5933 |
s.Loads[idx] = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5934 |
src = src[8:] |
| 5935 |
} |
| 5936 |
s.TotalRAM = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5937 |
src = src[8:] |
| 5938 |
s.FreeRAM = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5939 |
src = src[8:] |
| 5940 |
s.SharedRAM = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5941 |
src = src[8:] |
| 5942 |
s.BufferRAM = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5943 |
src = src[8:] |
| 5944 |
s.TotalSwap = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5945 |
src = src[8:] |
| 5946 |
s.FreeSwap = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5947 |
src = src[8:] |
| 5948 |
s.Procs = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 5949 |
src = src[2:] |
| 5950 |
|
| 5951 |
src = src[1*(6):] |
| 5952 |
s.TotalHigh = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5953 |
src = src[8:] |
| 5954 |
s.FreeHigh = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 5955 |
src = src[8:] |
| 5956 |
s.Unit = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 5957 |
src = src[4:] |
| 5958 |
return src |
| 5959 |
} |
| 5960 |
|
| 5961 |
|
| 5962 |
|
| 5963 |
func (s *Sysinfo) Packed() bool { |
| 5964 |
return false |
| 5965 |
} |
| 5966 |
|
| 5967 |
|
| 5968 |
func (s *Sysinfo) MarshalUnsafe(dst []byte) []byte { |
| 5969 |
|
| 5970 |
return s.MarshalBytes(dst) |
| 5971 |
} |
| 5972 |
|
| 5973 |
|
| 5974 |
func (s *Sysinfo) UnmarshalUnsafe(src []byte) []byte { |
| 5975 |
|
| 5976 |
return s.UnmarshalBytes(src) |
| 5977 |
} |
| 5978 |
|
| 5979 |
|
| 5980 |
|
| 5981 |
func (s *Sysinfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 5982 |
|
| 5983 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 5984 |
s.MarshalBytes(buf) |
| 5985 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 5986 |
} |
| 5987 |
|
| 5988 |
|
| 5989 |
|
| 5990 |
func (s *Sysinfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5991 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 5992 |
} |
| 5993 |
|
| 5994 |
|
| 5995 |
|
| 5996 |
func (s *Sysinfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 5997 |
|
| 5998 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 5999 |
length, err := cc.CopyInBytes(addr, buf) |
| 6000 |
|
| 6001 |
|
| 6002 |
s.UnmarshalBytes(buf) |
| 6003 |
return length, err |
| 6004 |
} |
| 6005 |
|
| 6006 |
|
| 6007 |
func (s *Sysinfo) WriteTo(writer io.Writer) (int64, error) { |
| 6008 |
|
| 6009 |
buf := make([]byte, s.SizeBytes()) |
| 6010 |
s.MarshalBytes(buf) |
| 6011 |
length, err := writer.Write(buf) |
| 6012 |
return int64(length), err |
| 6013 |
} |
| 6014 |
|
| 6015 |
|
| 6016 |
|
| 6017 |
func (n *NumaPolicy) SizeBytes() int { |
| 6018 |
return 4 |
| 6019 |
} |
| 6020 |
|
| 6021 |
|
| 6022 |
func (n *NumaPolicy) MarshalBytes(dst []byte) []byte { |
| 6023 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(*n)) |
| 6024 |
return dst[4:] |
| 6025 |
} |
| 6026 |
|
| 6027 |
|
| 6028 |
func (n *NumaPolicy) UnmarshalBytes(src []byte) []byte { |
| 6029 |
*n = NumaPolicy(int32(hostarch.ByteOrder.Uint32(src[:4]))) |
| 6030 |
return src[4:] |
| 6031 |
} |
| 6032 |
|
| 6033 |
|
| 6034 |
|
| 6035 |
func (n *NumaPolicy) Packed() bool { |
| 6036 |
|
| 6037 |
return true |
| 6038 |
} |
| 6039 |
|
| 6040 |
|
| 6041 |
func (n *NumaPolicy) MarshalUnsafe(dst []byte) []byte { |
| 6042 |
size := n.SizeBytes() |
| 6043 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) |
| 6044 |
return dst[size:] |
| 6045 |
} |
| 6046 |
|
| 6047 |
|
| 6048 |
func (n *NumaPolicy) UnmarshalUnsafe(src []byte) []byte { |
| 6049 |
size := n.SizeBytes() |
| 6050 |
gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) |
| 6051 |
return src[size:] |
| 6052 |
} |
| 6053 |
|
| 6054 |
|
| 6055 |
|
| 6056 |
func (n *NumaPolicy) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 6057 |
|
| 6058 |
var buf []byte |
| 6059 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6060 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 6061 |
hdr.Len = n.SizeBytes() |
| 6062 |
hdr.Cap = n.SizeBytes() |
| 6063 |
|
| 6064 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 6065 |
|
| 6066 |
|
| 6067 |
runtime.KeepAlive(n) |
| 6068 |
return length, err |
| 6069 |
} |
| 6070 |
|
| 6071 |
|
| 6072 |
|
| 6073 |
func (n *NumaPolicy) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6074 |
return n.CopyOutN(cc, addr, n.SizeBytes()) |
| 6075 |
} |
| 6076 |
|
| 6077 |
|
| 6078 |
|
| 6079 |
func (n *NumaPolicy) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6080 |
|
| 6081 |
var buf []byte |
| 6082 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6083 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 6084 |
hdr.Len = n.SizeBytes() |
| 6085 |
hdr.Cap = n.SizeBytes() |
| 6086 |
|
| 6087 |
length, err := cc.CopyInBytes(addr, buf) |
| 6088 |
|
| 6089 |
|
| 6090 |
runtime.KeepAlive(n) |
| 6091 |
return length, err |
| 6092 |
} |
| 6093 |
|
| 6094 |
|
| 6095 |
func (n *NumaPolicy) WriteTo(writer io.Writer) (int64, error) { |
| 6096 |
|
| 6097 |
var buf []byte |
| 6098 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6099 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 6100 |
hdr.Len = n.SizeBytes() |
| 6101 |
hdr.Cap = n.SizeBytes() |
| 6102 |
|
| 6103 |
length, err := writer.Write(buf) |
| 6104 |
|
| 6105 |
|
| 6106 |
runtime.KeepAlive(n) |
| 6107 |
return int64(length), err |
| 6108 |
} |
| 6109 |
|
| 6110 |
|
| 6111 |
func (m *MqAttr) SizeBytes() int { |
| 6112 |
return 32 + |
| 6113 |
8*4 |
| 6114 |
} |
| 6115 |
|
| 6116 |
|
| 6117 |
func (m *MqAttr) MarshalBytes(dst []byte) []byte { |
| 6118 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MqFlags)) |
| 6119 |
dst = dst[8:] |
| 6120 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MqMaxmsg)) |
| 6121 |
dst = dst[8:] |
| 6122 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MqMsgsize)) |
| 6123 |
dst = dst[8:] |
| 6124 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MqCurmsgs)) |
| 6125 |
dst = dst[8:] |
| 6126 |
|
| 6127 |
dst = dst[8*(4):] |
| 6128 |
return dst |
| 6129 |
} |
| 6130 |
|
| 6131 |
|
| 6132 |
func (m *MqAttr) UnmarshalBytes(src []byte) []byte { |
| 6133 |
m.MqFlags = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 6134 |
src = src[8:] |
| 6135 |
m.MqMaxmsg = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 6136 |
src = src[8:] |
| 6137 |
m.MqMsgsize = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 6138 |
src = src[8:] |
| 6139 |
m.MqCurmsgs = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 6140 |
src = src[8:] |
| 6141 |
|
| 6142 |
src = src[8*(4):] |
| 6143 |
return src |
| 6144 |
} |
| 6145 |
|
| 6146 |
|
| 6147 |
|
| 6148 |
func (m *MqAttr) Packed() bool { |
| 6149 |
return true |
| 6150 |
} |
| 6151 |
|
| 6152 |
|
| 6153 |
func (m *MqAttr) MarshalUnsafe(dst []byte) []byte { |
| 6154 |
size := m.SizeBytes() |
| 6155 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(size)) |
| 6156 |
return dst[size:] |
| 6157 |
} |
| 6158 |
|
| 6159 |
|
| 6160 |
func (m *MqAttr) UnmarshalUnsafe(src []byte) []byte { |
| 6161 |
size := m.SizeBytes() |
| 6162 |
gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(size)) |
| 6163 |
return src[size:] |
| 6164 |
} |
| 6165 |
|
| 6166 |
|
| 6167 |
|
| 6168 |
func (m *MqAttr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 6169 |
|
| 6170 |
var buf []byte |
| 6171 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6172 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) |
| 6173 |
hdr.Len = m.SizeBytes() |
| 6174 |
hdr.Cap = m.SizeBytes() |
| 6175 |
|
| 6176 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 6177 |
|
| 6178 |
|
| 6179 |
runtime.KeepAlive(m) |
| 6180 |
return length, err |
| 6181 |
} |
| 6182 |
|
| 6183 |
|
| 6184 |
|
| 6185 |
func (m *MqAttr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6186 |
return m.CopyOutN(cc, addr, m.SizeBytes()) |
| 6187 |
} |
| 6188 |
|
| 6189 |
|
| 6190 |
|
| 6191 |
func (m *MqAttr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6192 |
|
| 6193 |
var buf []byte |
| 6194 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6195 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) |
| 6196 |
hdr.Len = m.SizeBytes() |
| 6197 |
hdr.Cap = m.SizeBytes() |
| 6198 |
|
| 6199 |
length, err := cc.CopyInBytes(addr, buf) |
| 6200 |
|
| 6201 |
|
| 6202 |
runtime.KeepAlive(m) |
| 6203 |
return length, err |
| 6204 |
} |
| 6205 |
|
| 6206 |
|
| 6207 |
func (m *MqAttr) WriteTo(writer io.Writer) (int64, error) { |
| 6208 |
|
| 6209 |
var buf []byte |
| 6210 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6211 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) |
| 6212 |
hdr.Len = m.SizeBytes() |
| 6213 |
hdr.Cap = m.SizeBytes() |
| 6214 |
|
| 6215 |
length, err := writer.Write(buf) |
| 6216 |
|
| 6217 |
|
| 6218 |
runtime.KeepAlive(m) |
| 6219 |
return int64(length), err |
| 6220 |
} |
| 6221 |
|
| 6222 |
|
| 6223 |
|
| 6224 |
func (b *MsgBuf) Packed() bool { |
| 6225 |
|
| 6226 |
return false |
| 6227 |
} |
| 6228 |
|
| 6229 |
|
| 6230 |
func (b *MsgBuf) MarshalUnsafe(dst []byte) []byte { |
| 6231 |
|
| 6232 |
return b.MarshalBytes(dst) |
| 6233 |
} |
| 6234 |
|
| 6235 |
|
| 6236 |
func (b *MsgBuf) UnmarshalUnsafe(src []byte) []byte { |
| 6237 |
|
| 6238 |
return b.UnmarshalBytes(src) |
| 6239 |
} |
| 6240 |
|
| 6241 |
|
| 6242 |
|
| 6243 |
func (b *MsgBuf) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 6244 |
|
| 6245 |
buf := cc.CopyScratchBuffer(b.SizeBytes()) |
| 6246 |
b.MarshalBytes(buf) |
| 6247 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 6248 |
} |
| 6249 |
|
| 6250 |
|
| 6251 |
|
| 6252 |
func (b *MsgBuf) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6253 |
return b.CopyOutN(cc, addr, b.SizeBytes()) |
| 6254 |
} |
| 6255 |
|
| 6256 |
|
| 6257 |
|
| 6258 |
func (b *MsgBuf) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6259 |
|
| 6260 |
buf := cc.CopyScratchBuffer(b.SizeBytes()) |
| 6261 |
length, err := cc.CopyInBytes(addr, buf) |
| 6262 |
|
| 6263 |
|
| 6264 |
b.UnmarshalBytes(buf) |
| 6265 |
return length, err |
| 6266 |
} |
| 6267 |
|
| 6268 |
|
| 6269 |
func (b *MsgBuf) WriteTo(writer io.Writer) (int64, error) { |
| 6270 |
|
| 6271 |
buf := make([]byte, b.SizeBytes()) |
| 6272 |
b.MarshalBytes(buf) |
| 6273 |
length, err := writer.Write(buf) |
| 6274 |
return int64(length), err |
| 6275 |
} |
| 6276 |
|
| 6277 |
|
| 6278 |
func (m *MsgInfo) SizeBytes() int { |
| 6279 |
return 30 |
| 6280 |
} |
| 6281 |
|
| 6282 |
|
| 6283 |
func (m *MsgInfo) MarshalBytes(dst []byte) []byte { |
| 6284 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgPool)) |
| 6285 |
dst = dst[4:] |
| 6286 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgMap)) |
| 6287 |
dst = dst[4:] |
| 6288 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgMax)) |
| 6289 |
dst = dst[4:] |
| 6290 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgMnb)) |
| 6291 |
dst = dst[4:] |
| 6292 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgMni)) |
| 6293 |
dst = dst[4:] |
| 6294 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgSsz)) |
| 6295 |
dst = dst[4:] |
| 6296 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgTql)) |
| 6297 |
dst = dst[4:] |
| 6298 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(m.MsgSeg)) |
| 6299 |
dst = dst[2:] |
| 6300 |
return dst |
| 6301 |
} |
| 6302 |
|
| 6303 |
|
| 6304 |
func (m *MsgInfo) UnmarshalBytes(src []byte) []byte { |
| 6305 |
m.MsgPool = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6306 |
src = src[4:] |
| 6307 |
m.MsgMap = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6308 |
src = src[4:] |
| 6309 |
m.MsgMax = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6310 |
src = src[4:] |
| 6311 |
m.MsgMnb = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6312 |
src = src[4:] |
| 6313 |
m.MsgMni = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6314 |
src = src[4:] |
| 6315 |
m.MsgSsz = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6316 |
src = src[4:] |
| 6317 |
m.MsgTql = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6318 |
src = src[4:] |
| 6319 |
m.MsgSeg = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 6320 |
src = src[2:] |
| 6321 |
return src |
| 6322 |
} |
| 6323 |
|
| 6324 |
|
| 6325 |
|
| 6326 |
func (m *MsgInfo) Packed() bool { |
| 6327 |
return false |
| 6328 |
} |
| 6329 |
|
| 6330 |
|
| 6331 |
func (m *MsgInfo) MarshalUnsafe(dst []byte) []byte { |
| 6332 |
|
| 6333 |
return m.MarshalBytes(dst) |
| 6334 |
} |
| 6335 |
|
| 6336 |
|
| 6337 |
func (m *MsgInfo) UnmarshalUnsafe(src []byte) []byte { |
| 6338 |
|
| 6339 |
return m.UnmarshalBytes(src) |
| 6340 |
} |
| 6341 |
|
| 6342 |
|
| 6343 |
|
| 6344 |
func (m *MsgInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 6345 |
|
| 6346 |
buf := cc.CopyScratchBuffer(m.SizeBytes()) |
| 6347 |
m.MarshalBytes(buf) |
| 6348 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 6349 |
} |
| 6350 |
|
| 6351 |
|
| 6352 |
|
| 6353 |
func (m *MsgInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6354 |
return m.CopyOutN(cc, addr, m.SizeBytes()) |
| 6355 |
} |
| 6356 |
|
| 6357 |
|
| 6358 |
|
| 6359 |
func (m *MsgInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6360 |
|
| 6361 |
buf := cc.CopyScratchBuffer(m.SizeBytes()) |
| 6362 |
length, err := cc.CopyInBytes(addr, buf) |
| 6363 |
|
| 6364 |
|
| 6365 |
m.UnmarshalBytes(buf) |
| 6366 |
return length, err |
| 6367 |
} |
| 6368 |
|
| 6369 |
|
| 6370 |
func (m *MsgInfo) WriteTo(writer io.Writer) (int64, error) { |
| 6371 |
|
| 6372 |
buf := make([]byte, m.SizeBytes()) |
| 6373 |
m.MarshalBytes(buf) |
| 6374 |
length, err := writer.Write(buf) |
| 6375 |
return int64(length), err |
| 6376 |
} |
| 6377 |
|
| 6378 |
|
| 6379 |
func (m *MsqidDS) SizeBytes() int { |
| 6380 |
return 48 + |
| 6381 |
(*IPCPerm)(nil).SizeBytes() + |
| 6382 |
(*TimeT)(nil).SizeBytes() + |
| 6383 |
(*TimeT)(nil).SizeBytes() + |
| 6384 |
(*TimeT)(nil).SizeBytes() |
| 6385 |
} |
| 6386 |
|
| 6387 |
|
| 6388 |
func (m *MsqidDS) MarshalBytes(dst []byte) []byte { |
| 6389 |
dst = m.MsgPerm.MarshalUnsafe(dst) |
| 6390 |
dst = m.MsgStime.MarshalUnsafe(dst) |
| 6391 |
dst = m.MsgRtime.MarshalUnsafe(dst) |
| 6392 |
dst = m.MsgCtime.MarshalUnsafe(dst) |
| 6393 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MsgCbytes)) |
| 6394 |
dst = dst[8:] |
| 6395 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MsgQnum)) |
| 6396 |
dst = dst[8:] |
| 6397 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MsgQbytes)) |
| 6398 |
dst = dst[8:] |
| 6399 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgLspid)) |
| 6400 |
dst = dst[4:] |
| 6401 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgLrpid)) |
| 6402 |
dst = dst[4:] |
| 6403 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.unused4)) |
| 6404 |
dst = dst[8:] |
| 6405 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.unused5)) |
| 6406 |
dst = dst[8:] |
| 6407 |
return dst |
| 6408 |
} |
| 6409 |
|
| 6410 |
|
| 6411 |
func (m *MsqidDS) UnmarshalBytes(src []byte) []byte { |
| 6412 |
src = m.MsgPerm.UnmarshalUnsafe(src) |
| 6413 |
src = m.MsgStime.UnmarshalUnsafe(src) |
| 6414 |
src = m.MsgRtime.UnmarshalUnsafe(src) |
| 6415 |
src = m.MsgCtime.UnmarshalUnsafe(src) |
| 6416 |
m.MsgCbytes = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 6417 |
src = src[8:] |
| 6418 |
m.MsgQnum = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 6419 |
src = src[8:] |
| 6420 |
m.MsgQbytes = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 6421 |
src = src[8:] |
| 6422 |
m.MsgLspid = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6423 |
src = src[4:] |
| 6424 |
m.MsgLrpid = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6425 |
src = src[4:] |
| 6426 |
m.unused4 = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 6427 |
src = src[8:] |
| 6428 |
m.unused5 = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 6429 |
src = src[8:] |
| 6430 |
return src |
| 6431 |
} |
| 6432 |
|
| 6433 |
|
| 6434 |
|
| 6435 |
func (m *MsqidDS) Packed() bool { |
| 6436 |
return m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() |
| 6437 |
} |
| 6438 |
|
| 6439 |
|
| 6440 |
func (m *MsqidDS) MarshalUnsafe(dst []byte) []byte { |
| 6441 |
if m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() { |
| 6442 |
size := m.SizeBytes() |
| 6443 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(size)) |
| 6444 |
return dst[size:] |
| 6445 |
} |
| 6446 |
|
| 6447 |
return m.MarshalBytes(dst) |
| 6448 |
} |
| 6449 |
|
| 6450 |
|
| 6451 |
func (m *MsqidDS) UnmarshalUnsafe(src []byte) []byte { |
| 6452 |
if m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() { |
| 6453 |
size := m.SizeBytes() |
| 6454 |
gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(size)) |
| 6455 |
return src[size:] |
| 6456 |
} |
| 6457 |
|
| 6458 |
return m.UnmarshalBytes(src) |
| 6459 |
} |
| 6460 |
|
| 6461 |
|
| 6462 |
|
| 6463 |
func (m *MsqidDS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 6464 |
if !m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() { |
| 6465 |
|
| 6466 |
buf := cc.CopyScratchBuffer(m.SizeBytes()) |
| 6467 |
m.MarshalBytes(buf) |
| 6468 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 6469 |
} |
| 6470 |
|
| 6471 |
|
| 6472 |
var buf []byte |
| 6473 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6474 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) |
| 6475 |
hdr.Len = m.SizeBytes() |
| 6476 |
hdr.Cap = m.SizeBytes() |
| 6477 |
|
| 6478 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 6479 |
|
| 6480 |
|
| 6481 |
runtime.KeepAlive(m) |
| 6482 |
return length, err |
| 6483 |
} |
| 6484 |
|
| 6485 |
|
| 6486 |
|
| 6487 |
func (m *MsqidDS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6488 |
return m.CopyOutN(cc, addr, m.SizeBytes()) |
| 6489 |
} |
| 6490 |
|
| 6491 |
|
| 6492 |
|
| 6493 |
func (m *MsqidDS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6494 |
if !m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() { |
| 6495 |
|
| 6496 |
buf := cc.CopyScratchBuffer(m.SizeBytes()) |
| 6497 |
length, err := cc.CopyInBytes(addr, buf) |
| 6498 |
|
| 6499 |
|
| 6500 |
m.UnmarshalBytes(buf) |
| 6501 |
return length, err |
| 6502 |
} |
| 6503 |
|
| 6504 |
|
| 6505 |
var buf []byte |
| 6506 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6507 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) |
| 6508 |
hdr.Len = m.SizeBytes() |
| 6509 |
hdr.Cap = m.SizeBytes() |
| 6510 |
|
| 6511 |
length, err := cc.CopyInBytes(addr, buf) |
| 6512 |
|
| 6513 |
|
| 6514 |
runtime.KeepAlive(m) |
| 6515 |
return length, err |
| 6516 |
} |
| 6517 |
|
| 6518 |
|
| 6519 |
func (m *MsqidDS) WriteTo(writer io.Writer) (int64, error) { |
| 6520 |
if !m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() { |
| 6521 |
|
| 6522 |
buf := make([]byte, m.SizeBytes()) |
| 6523 |
m.MarshalBytes(buf) |
| 6524 |
length, err := writer.Write(buf) |
| 6525 |
return int64(length), err |
| 6526 |
} |
| 6527 |
|
| 6528 |
|
| 6529 |
var buf []byte |
| 6530 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6531 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) |
| 6532 |
hdr.Len = m.SizeBytes() |
| 6533 |
hdr.Cap = m.SizeBytes() |
| 6534 |
|
| 6535 |
length, err := writer.Write(buf) |
| 6536 |
|
| 6537 |
|
| 6538 |
runtime.KeepAlive(m) |
| 6539 |
return int64(length), err |
| 6540 |
} |
| 6541 |
|
| 6542 |
|
| 6543 |
func (i *IFConf) SizeBytes() int { |
| 6544 |
return 12 + |
| 6545 |
1*4 |
| 6546 |
} |
| 6547 |
|
| 6548 |
|
| 6549 |
func (i *IFConf) MarshalBytes(dst []byte) []byte { |
| 6550 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Len)) |
| 6551 |
dst = dst[4:] |
| 6552 |
|
| 6553 |
dst = dst[1*(4):] |
| 6554 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Ptr)) |
| 6555 |
dst = dst[8:] |
| 6556 |
return dst |
| 6557 |
} |
| 6558 |
|
| 6559 |
|
| 6560 |
func (i *IFConf) UnmarshalBytes(src []byte) []byte { |
| 6561 |
i.Len = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6562 |
src = src[4:] |
| 6563 |
|
| 6564 |
src = src[1*(4):] |
| 6565 |
i.Ptr = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 6566 |
src = src[8:] |
| 6567 |
return src |
| 6568 |
} |
| 6569 |
|
| 6570 |
|
| 6571 |
|
| 6572 |
func (i *IFConf) Packed() bool { |
| 6573 |
return true |
| 6574 |
} |
| 6575 |
|
| 6576 |
|
| 6577 |
func (i *IFConf) MarshalUnsafe(dst []byte) []byte { |
| 6578 |
size := i.SizeBytes() |
| 6579 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 6580 |
return dst[size:] |
| 6581 |
} |
| 6582 |
|
| 6583 |
|
| 6584 |
func (i *IFConf) UnmarshalUnsafe(src []byte) []byte { |
| 6585 |
size := i.SizeBytes() |
| 6586 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 6587 |
return src[size:] |
| 6588 |
} |
| 6589 |
|
| 6590 |
|
| 6591 |
|
| 6592 |
func (i *IFConf) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 6593 |
|
| 6594 |
var buf []byte |
| 6595 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6596 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 6597 |
hdr.Len = i.SizeBytes() |
| 6598 |
hdr.Cap = i.SizeBytes() |
| 6599 |
|
| 6600 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 6601 |
|
| 6602 |
|
| 6603 |
runtime.KeepAlive(i) |
| 6604 |
return length, err |
| 6605 |
} |
| 6606 |
|
| 6607 |
|
| 6608 |
|
| 6609 |
func (i *IFConf) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6610 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 6611 |
} |
| 6612 |
|
| 6613 |
|
| 6614 |
|
| 6615 |
func (i *IFConf) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6616 |
|
| 6617 |
var buf []byte |
| 6618 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6619 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 6620 |
hdr.Len = i.SizeBytes() |
| 6621 |
hdr.Cap = i.SizeBytes() |
| 6622 |
|
| 6623 |
length, err := cc.CopyInBytes(addr, buf) |
| 6624 |
|
| 6625 |
|
| 6626 |
runtime.KeepAlive(i) |
| 6627 |
return length, err |
| 6628 |
} |
| 6629 |
|
| 6630 |
|
| 6631 |
func (i *IFConf) WriteTo(writer io.Writer) (int64, error) { |
| 6632 |
|
| 6633 |
var buf []byte |
| 6634 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6635 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 6636 |
hdr.Len = i.SizeBytes() |
| 6637 |
hdr.Cap = i.SizeBytes() |
| 6638 |
|
| 6639 |
length, err := writer.Write(buf) |
| 6640 |
|
| 6641 |
|
| 6642 |
runtime.KeepAlive(i) |
| 6643 |
return int64(length), err |
| 6644 |
} |
| 6645 |
|
| 6646 |
|
| 6647 |
func (ifr *IFReq) SizeBytes() int { |
| 6648 |
return 0 + |
| 6649 |
1*IFNAMSIZ + |
| 6650 |
1*24 |
| 6651 |
} |
| 6652 |
|
| 6653 |
|
| 6654 |
func (ifr *IFReq) MarshalBytes(dst []byte) []byte { |
| 6655 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 6656 |
dst[0] = byte(ifr.IFName[idx]) |
| 6657 |
dst = dst[1:] |
| 6658 |
} |
| 6659 |
for idx := 0; idx < 24; idx++ { |
| 6660 |
dst[0] = byte(ifr.Data[idx]) |
| 6661 |
dst = dst[1:] |
| 6662 |
} |
| 6663 |
return dst |
| 6664 |
} |
| 6665 |
|
| 6666 |
|
| 6667 |
func (ifr *IFReq) UnmarshalBytes(src []byte) []byte { |
| 6668 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 6669 |
ifr.IFName[idx] = src[0] |
| 6670 |
src = src[1:] |
| 6671 |
} |
| 6672 |
for idx := 0; idx < 24; idx++ { |
| 6673 |
ifr.Data[idx] = src[0] |
| 6674 |
src = src[1:] |
| 6675 |
} |
| 6676 |
return src |
| 6677 |
} |
| 6678 |
|
| 6679 |
|
| 6680 |
|
| 6681 |
func (ifr *IFReq) Packed() bool { |
| 6682 |
return true |
| 6683 |
} |
| 6684 |
|
| 6685 |
|
| 6686 |
func (ifr *IFReq) MarshalUnsafe(dst []byte) []byte { |
| 6687 |
size := ifr.SizeBytes() |
| 6688 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(ifr), uintptr(size)) |
| 6689 |
return dst[size:] |
| 6690 |
} |
| 6691 |
|
| 6692 |
|
| 6693 |
func (ifr *IFReq) UnmarshalUnsafe(src []byte) []byte { |
| 6694 |
size := ifr.SizeBytes() |
| 6695 |
gohacks.Memmove(unsafe.Pointer(ifr), unsafe.Pointer(&src[0]), uintptr(size)) |
| 6696 |
return src[size:] |
| 6697 |
} |
| 6698 |
|
| 6699 |
|
| 6700 |
|
| 6701 |
func (ifr *IFReq) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 6702 |
|
| 6703 |
var buf []byte |
| 6704 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6705 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ifr))) |
| 6706 |
hdr.Len = ifr.SizeBytes() |
| 6707 |
hdr.Cap = ifr.SizeBytes() |
| 6708 |
|
| 6709 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 6710 |
|
| 6711 |
|
| 6712 |
runtime.KeepAlive(ifr) |
| 6713 |
return length, err |
| 6714 |
} |
| 6715 |
|
| 6716 |
|
| 6717 |
|
| 6718 |
func (ifr *IFReq) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6719 |
return ifr.CopyOutN(cc, addr, ifr.SizeBytes()) |
| 6720 |
} |
| 6721 |
|
| 6722 |
|
| 6723 |
|
| 6724 |
func (ifr *IFReq) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6725 |
|
| 6726 |
var buf []byte |
| 6727 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6728 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ifr))) |
| 6729 |
hdr.Len = ifr.SizeBytes() |
| 6730 |
hdr.Cap = ifr.SizeBytes() |
| 6731 |
|
| 6732 |
length, err := cc.CopyInBytes(addr, buf) |
| 6733 |
|
| 6734 |
|
| 6735 |
runtime.KeepAlive(ifr) |
| 6736 |
return length, err |
| 6737 |
} |
| 6738 |
|
| 6739 |
|
| 6740 |
func (ifr *IFReq) WriteTo(writer io.Writer) (int64, error) { |
| 6741 |
|
| 6742 |
var buf []byte |
| 6743 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6744 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ifr))) |
| 6745 |
hdr.Len = ifr.SizeBytes() |
| 6746 |
hdr.Cap = ifr.SizeBytes() |
| 6747 |
|
| 6748 |
length, err := writer.Write(buf) |
| 6749 |
|
| 6750 |
|
| 6751 |
runtime.KeepAlive(ifr) |
| 6752 |
return int64(length), err |
| 6753 |
} |
| 6754 |
|
| 6755 |
|
| 6756 |
|
| 6757 |
func (en *ErrorName) SizeBytes() int { |
| 6758 |
return 1 * XT_FUNCTION_MAXNAMELEN |
| 6759 |
} |
| 6760 |
|
| 6761 |
|
| 6762 |
func (en *ErrorName) MarshalBytes(dst []byte) []byte { |
| 6763 |
for idx := 0; idx < XT_FUNCTION_MAXNAMELEN; idx++ { |
| 6764 |
dst[0] = byte(en[idx]) |
| 6765 |
dst = dst[1:] |
| 6766 |
} |
| 6767 |
return dst |
| 6768 |
} |
| 6769 |
|
| 6770 |
|
| 6771 |
func (en *ErrorName) UnmarshalBytes(src []byte) []byte { |
| 6772 |
for idx := 0; idx < XT_FUNCTION_MAXNAMELEN; idx++ { |
| 6773 |
en[idx] = src[0] |
| 6774 |
src = src[1:] |
| 6775 |
} |
| 6776 |
return src |
| 6777 |
} |
| 6778 |
|
| 6779 |
|
| 6780 |
|
| 6781 |
func (en *ErrorName) Packed() bool { |
| 6782 |
|
| 6783 |
return true |
| 6784 |
} |
| 6785 |
|
| 6786 |
|
| 6787 |
func (en *ErrorName) MarshalUnsafe(dst []byte) []byte { |
| 6788 |
size := en.SizeBytes() |
| 6789 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&en[0]), uintptr(size)) |
| 6790 |
return dst[size:] |
| 6791 |
} |
| 6792 |
|
| 6793 |
|
| 6794 |
func (en *ErrorName) UnmarshalUnsafe(src []byte) []byte { |
| 6795 |
size := en.SizeBytes() |
| 6796 |
gohacks.Memmove(unsafe.Pointer(en), unsafe.Pointer(&src[0]), uintptr(size)) |
| 6797 |
return src[size:] |
| 6798 |
} |
| 6799 |
|
| 6800 |
|
| 6801 |
|
| 6802 |
func (en *ErrorName) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 6803 |
|
| 6804 |
var buf []byte |
| 6805 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6806 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) |
| 6807 |
hdr.Len = en.SizeBytes() |
| 6808 |
hdr.Cap = en.SizeBytes() |
| 6809 |
|
| 6810 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 6811 |
|
| 6812 |
|
| 6813 |
runtime.KeepAlive(en) |
| 6814 |
return length, err |
| 6815 |
} |
| 6816 |
|
| 6817 |
|
| 6818 |
|
| 6819 |
func (en *ErrorName) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6820 |
return en.CopyOutN(cc, addr, en.SizeBytes()) |
| 6821 |
} |
| 6822 |
|
| 6823 |
|
| 6824 |
|
| 6825 |
func (en *ErrorName) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6826 |
|
| 6827 |
var buf []byte |
| 6828 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6829 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) |
| 6830 |
hdr.Len = en.SizeBytes() |
| 6831 |
hdr.Cap = en.SizeBytes() |
| 6832 |
|
| 6833 |
length, err := cc.CopyInBytes(addr, buf) |
| 6834 |
|
| 6835 |
|
| 6836 |
runtime.KeepAlive(en) |
| 6837 |
return length, err |
| 6838 |
} |
| 6839 |
|
| 6840 |
|
| 6841 |
func (en *ErrorName) WriteTo(writer io.Writer) (int64, error) { |
| 6842 |
|
| 6843 |
var buf []byte |
| 6844 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6845 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) |
| 6846 |
hdr.Len = en.SizeBytes() |
| 6847 |
hdr.Cap = en.SizeBytes() |
| 6848 |
|
| 6849 |
length, err := writer.Write(buf) |
| 6850 |
|
| 6851 |
|
| 6852 |
runtime.KeepAlive(en) |
| 6853 |
return int64(length), err |
| 6854 |
} |
| 6855 |
|
| 6856 |
|
| 6857 |
|
| 6858 |
func (en *ExtensionName) SizeBytes() int { |
| 6859 |
return 1 * XT_EXTENSION_MAXNAMELEN |
| 6860 |
} |
| 6861 |
|
| 6862 |
|
| 6863 |
func (en *ExtensionName) MarshalBytes(dst []byte) []byte { |
| 6864 |
for idx := 0; idx < XT_EXTENSION_MAXNAMELEN; idx++ { |
| 6865 |
dst[0] = byte(en[idx]) |
| 6866 |
dst = dst[1:] |
| 6867 |
} |
| 6868 |
return dst |
| 6869 |
} |
| 6870 |
|
| 6871 |
|
| 6872 |
func (en *ExtensionName) UnmarshalBytes(src []byte) []byte { |
| 6873 |
for idx := 0; idx < XT_EXTENSION_MAXNAMELEN; idx++ { |
| 6874 |
en[idx] = src[0] |
| 6875 |
src = src[1:] |
| 6876 |
} |
| 6877 |
return src |
| 6878 |
} |
| 6879 |
|
| 6880 |
|
| 6881 |
|
| 6882 |
func (en *ExtensionName) Packed() bool { |
| 6883 |
|
| 6884 |
return true |
| 6885 |
} |
| 6886 |
|
| 6887 |
|
| 6888 |
func (en *ExtensionName) MarshalUnsafe(dst []byte) []byte { |
| 6889 |
size := en.SizeBytes() |
| 6890 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&en[0]), uintptr(size)) |
| 6891 |
return dst[size:] |
| 6892 |
} |
| 6893 |
|
| 6894 |
|
| 6895 |
func (en *ExtensionName) UnmarshalUnsafe(src []byte) []byte { |
| 6896 |
size := en.SizeBytes() |
| 6897 |
gohacks.Memmove(unsafe.Pointer(en), unsafe.Pointer(&src[0]), uintptr(size)) |
| 6898 |
return src[size:] |
| 6899 |
} |
| 6900 |
|
| 6901 |
|
| 6902 |
|
| 6903 |
func (en *ExtensionName) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 6904 |
|
| 6905 |
var buf []byte |
| 6906 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6907 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) |
| 6908 |
hdr.Len = en.SizeBytes() |
| 6909 |
hdr.Cap = en.SizeBytes() |
| 6910 |
|
| 6911 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 6912 |
|
| 6913 |
|
| 6914 |
runtime.KeepAlive(en) |
| 6915 |
return length, err |
| 6916 |
} |
| 6917 |
|
| 6918 |
|
| 6919 |
|
| 6920 |
func (en *ExtensionName) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6921 |
return en.CopyOutN(cc, addr, en.SizeBytes()) |
| 6922 |
} |
| 6923 |
|
| 6924 |
|
| 6925 |
|
| 6926 |
func (en *ExtensionName) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 6927 |
|
| 6928 |
var buf []byte |
| 6929 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6930 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) |
| 6931 |
hdr.Len = en.SizeBytes() |
| 6932 |
hdr.Cap = en.SizeBytes() |
| 6933 |
|
| 6934 |
length, err := cc.CopyInBytes(addr, buf) |
| 6935 |
|
| 6936 |
|
| 6937 |
runtime.KeepAlive(en) |
| 6938 |
return length, err |
| 6939 |
} |
| 6940 |
|
| 6941 |
|
| 6942 |
func (en *ExtensionName) WriteTo(writer io.Writer) (int64, error) { |
| 6943 |
|
| 6944 |
var buf []byte |
| 6945 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 6946 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) |
| 6947 |
hdr.Len = en.SizeBytes() |
| 6948 |
hdr.Cap = en.SizeBytes() |
| 6949 |
|
| 6950 |
length, err := writer.Write(buf) |
| 6951 |
|
| 6952 |
|
| 6953 |
runtime.KeepAlive(en) |
| 6954 |
return int64(length), err |
| 6955 |
} |
| 6956 |
|
| 6957 |
|
| 6958 |
func (i *IPTEntry) SizeBytes() int { |
| 6959 |
return 12 + |
| 6960 |
(*IPTIP)(nil).SizeBytes() + |
| 6961 |
(*XTCounters)(nil).SizeBytes() |
| 6962 |
} |
| 6963 |
|
| 6964 |
|
| 6965 |
func (i *IPTEntry) MarshalBytes(dst []byte) []byte { |
| 6966 |
dst = i.IP.MarshalUnsafe(dst) |
| 6967 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NFCache)) |
| 6968 |
dst = dst[4:] |
| 6969 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.TargetOffset)) |
| 6970 |
dst = dst[2:] |
| 6971 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.NextOffset)) |
| 6972 |
dst = dst[2:] |
| 6973 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Comeback)) |
| 6974 |
dst = dst[4:] |
| 6975 |
dst = i.Counters.MarshalUnsafe(dst) |
| 6976 |
return dst |
| 6977 |
} |
| 6978 |
|
| 6979 |
|
| 6980 |
func (i *IPTEntry) UnmarshalBytes(src []byte) []byte { |
| 6981 |
src = i.IP.UnmarshalUnsafe(src) |
| 6982 |
i.NFCache = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6983 |
src = src[4:] |
| 6984 |
i.TargetOffset = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 6985 |
src = src[2:] |
| 6986 |
i.NextOffset = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 6987 |
src = src[2:] |
| 6988 |
i.Comeback = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 6989 |
src = src[4:] |
| 6990 |
src = i.Counters.UnmarshalUnsafe(src) |
| 6991 |
return src |
| 6992 |
} |
| 6993 |
|
| 6994 |
|
| 6995 |
|
| 6996 |
func (i *IPTEntry) Packed() bool { |
| 6997 |
return i.Counters.Packed() && i.IP.Packed() |
| 6998 |
} |
| 6999 |
|
| 7000 |
|
| 7001 |
func (i *IPTEntry) MarshalUnsafe(dst []byte) []byte { |
| 7002 |
if i.Counters.Packed() && i.IP.Packed() { |
| 7003 |
size := i.SizeBytes() |
| 7004 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 7005 |
return dst[size:] |
| 7006 |
} |
| 7007 |
|
| 7008 |
return i.MarshalBytes(dst) |
| 7009 |
} |
| 7010 |
|
| 7011 |
|
| 7012 |
func (i *IPTEntry) UnmarshalUnsafe(src []byte) []byte { |
| 7013 |
if i.Counters.Packed() && i.IP.Packed() { |
| 7014 |
size := i.SizeBytes() |
| 7015 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 7016 |
return src[size:] |
| 7017 |
} |
| 7018 |
|
| 7019 |
return i.UnmarshalBytes(src) |
| 7020 |
} |
| 7021 |
|
| 7022 |
|
| 7023 |
|
| 7024 |
func (i *IPTEntry) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 7025 |
if !i.Counters.Packed() && i.IP.Packed() { |
| 7026 |
|
| 7027 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7028 |
i.MarshalBytes(buf) |
| 7029 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 7030 |
} |
| 7031 |
|
| 7032 |
|
| 7033 |
var buf []byte |
| 7034 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7035 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7036 |
hdr.Len = i.SizeBytes() |
| 7037 |
hdr.Cap = i.SizeBytes() |
| 7038 |
|
| 7039 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 7040 |
|
| 7041 |
|
| 7042 |
runtime.KeepAlive(i) |
| 7043 |
return length, err |
| 7044 |
} |
| 7045 |
|
| 7046 |
|
| 7047 |
|
| 7048 |
func (i *IPTEntry) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7049 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 7050 |
} |
| 7051 |
|
| 7052 |
|
| 7053 |
|
| 7054 |
func (i *IPTEntry) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7055 |
if !i.Counters.Packed() && i.IP.Packed() { |
| 7056 |
|
| 7057 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7058 |
length, err := cc.CopyInBytes(addr, buf) |
| 7059 |
|
| 7060 |
|
| 7061 |
i.UnmarshalBytes(buf) |
| 7062 |
return length, err |
| 7063 |
} |
| 7064 |
|
| 7065 |
|
| 7066 |
var buf []byte |
| 7067 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7068 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7069 |
hdr.Len = i.SizeBytes() |
| 7070 |
hdr.Cap = i.SizeBytes() |
| 7071 |
|
| 7072 |
length, err := cc.CopyInBytes(addr, buf) |
| 7073 |
|
| 7074 |
|
| 7075 |
runtime.KeepAlive(i) |
| 7076 |
return length, err |
| 7077 |
} |
| 7078 |
|
| 7079 |
|
| 7080 |
func (i *IPTEntry) WriteTo(writer io.Writer) (int64, error) { |
| 7081 |
if !i.Counters.Packed() && i.IP.Packed() { |
| 7082 |
|
| 7083 |
buf := make([]byte, i.SizeBytes()) |
| 7084 |
i.MarshalBytes(buf) |
| 7085 |
length, err := writer.Write(buf) |
| 7086 |
return int64(length), err |
| 7087 |
} |
| 7088 |
|
| 7089 |
|
| 7090 |
var buf []byte |
| 7091 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7092 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7093 |
hdr.Len = i.SizeBytes() |
| 7094 |
hdr.Cap = i.SizeBytes() |
| 7095 |
|
| 7096 |
length, err := writer.Write(buf) |
| 7097 |
|
| 7098 |
|
| 7099 |
runtime.KeepAlive(i) |
| 7100 |
return int64(length), err |
| 7101 |
} |
| 7102 |
|
| 7103 |
|
| 7104 |
func (i *IPTGetEntries) SizeBytes() int { |
| 7105 |
return 4 + |
| 7106 |
(*TableName)(nil).SizeBytes() + |
| 7107 |
1*4 |
| 7108 |
} |
| 7109 |
|
| 7110 |
|
| 7111 |
func (i *IPTGetEntries) MarshalBytes(dst []byte) []byte { |
| 7112 |
dst = i.Name.MarshalUnsafe(dst) |
| 7113 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Size)) |
| 7114 |
dst = dst[4:] |
| 7115 |
|
| 7116 |
dst = dst[1*(4):] |
| 7117 |
return dst |
| 7118 |
} |
| 7119 |
|
| 7120 |
|
| 7121 |
func (i *IPTGetEntries) UnmarshalBytes(src []byte) []byte { |
| 7122 |
src = i.Name.UnmarshalUnsafe(src) |
| 7123 |
i.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7124 |
src = src[4:] |
| 7125 |
|
| 7126 |
src = src[1*(4):] |
| 7127 |
return src |
| 7128 |
} |
| 7129 |
|
| 7130 |
|
| 7131 |
|
| 7132 |
func (i *IPTGetEntries) Packed() bool { |
| 7133 |
return i.Name.Packed() |
| 7134 |
} |
| 7135 |
|
| 7136 |
|
| 7137 |
func (i *IPTGetEntries) MarshalUnsafe(dst []byte) []byte { |
| 7138 |
if i.Name.Packed() { |
| 7139 |
size := i.SizeBytes() |
| 7140 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 7141 |
return dst[size:] |
| 7142 |
} |
| 7143 |
|
| 7144 |
return i.MarshalBytes(dst) |
| 7145 |
} |
| 7146 |
|
| 7147 |
|
| 7148 |
func (i *IPTGetEntries) UnmarshalUnsafe(src []byte) []byte { |
| 7149 |
if i.Name.Packed() { |
| 7150 |
size := i.SizeBytes() |
| 7151 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 7152 |
return src[size:] |
| 7153 |
} |
| 7154 |
|
| 7155 |
return i.UnmarshalBytes(src) |
| 7156 |
} |
| 7157 |
|
| 7158 |
|
| 7159 |
|
| 7160 |
func (i *IPTGetEntries) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 7161 |
if !i.Name.Packed() { |
| 7162 |
|
| 7163 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7164 |
i.MarshalBytes(buf) |
| 7165 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 7166 |
} |
| 7167 |
|
| 7168 |
|
| 7169 |
var buf []byte |
| 7170 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7171 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7172 |
hdr.Len = i.SizeBytes() |
| 7173 |
hdr.Cap = i.SizeBytes() |
| 7174 |
|
| 7175 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 7176 |
|
| 7177 |
|
| 7178 |
runtime.KeepAlive(i) |
| 7179 |
return length, err |
| 7180 |
} |
| 7181 |
|
| 7182 |
|
| 7183 |
|
| 7184 |
func (i *IPTGetEntries) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7185 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 7186 |
} |
| 7187 |
|
| 7188 |
|
| 7189 |
|
| 7190 |
func (i *IPTGetEntries) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7191 |
if !i.Name.Packed() { |
| 7192 |
|
| 7193 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7194 |
length, err := cc.CopyInBytes(addr, buf) |
| 7195 |
|
| 7196 |
|
| 7197 |
i.UnmarshalBytes(buf) |
| 7198 |
return length, err |
| 7199 |
} |
| 7200 |
|
| 7201 |
|
| 7202 |
var buf []byte |
| 7203 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7204 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7205 |
hdr.Len = i.SizeBytes() |
| 7206 |
hdr.Cap = i.SizeBytes() |
| 7207 |
|
| 7208 |
length, err := cc.CopyInBytes(addr, buf) |
| 7209 |
|
| 7210 |
|
| 7211 |
runtime.KeepAlive(i) |
| 7212 |
return length, err |
| 7213 |
} |
| 7214 |
|
| 7215 |
|
| 7216 |
func (i *IPTGetEntries) WriteTo(writer io.Writer) (int64, error) { |
| 7217 |
if !i.Name.Packed() { |
| 7218 |
|
| 7219 |
buf := make([]byte, i.SizeBytes()) |
| 7220 |
i.MarshalBytes(buf) |
| 7221 |
length, err := writer.Write(buf) |
| 7222 |
return int64(length), err |
| 7223 |
} |
| 7224 |
|
| 7225 |
|
| 7226 |
var buf []byte |
| 7227 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7228 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7229 |
hdr.Len = i.SizeBytes() |
| 7230 |
hdr.Cap = i.SizeBytes() |
| 7231 |
|
| 7232 |
length, err := writer.Write(buf) |
| 7233 |
|
| 7234 |
|
| 7235 |
runtime.KeepAlive(i) |
| 7236 |
return int64(length), err |
| 7237 |
} |
| 7238 |
|
| 7239 |
|
| 7240 |
func (i *IPTGetinfo) SizeBytes() int { |
| 7241 |
return 12 + |
| 7242 |
(*TableName)(nil).SizeBytes() + |
| 7243 |
4*NF_INET_NUMHOOKS + |
| 7244 |
4*NF_INET_NUMHOOKS |
| 7245 |
} |
| 7246 |
|
| 7247 |
|
| 7248 |
func (i *IPTGetinfo) MarshalBytes(dst []byte) []byte { |
| 7249 |
dst = i.Name.MarshalUnsafe(dst) |
| 7250 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.ValidHooks)) |
| 7251 |
dst = dst[4:] |
| 7252 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 7253 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.HookEntry[idx])) |
| 7254 |
dst = dst[4:] |
| 7255 |
} |
| 7256 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 7257 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Underflow[idx])) |
| 7258 |
dst = dst[4:] |
| 7259 |
} |
| 7260 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NumEntries)) |
| 7261 |
dst = dst[4:] |
| 7262 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Size)) |
| 7263 |
dst = dst[4:] |
| 7264 |
return dst |
| 7265 |
} |
| 7266 |
|
| 7267 |
|
| 7268 |
func (i *IPTGetinfo) UnmarshalBytes(src []byte) []byte { |
| 7269 |
src = i.Name.UnmarshalUnsafe(src) |
| 7270 |
i.ValidHooks = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7271 |
src = src[4:] |
| 7272 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 7273 |
i.HookEntry[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7274 |
src = src[4:] |
| 7275 |
} |
| 7276 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 7277 |
i.Underflow[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7278 |
src = src[4:] |
| 7279 |
} |
| 7280 |
i.NumEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7281 |
src = src[4:] |
| 7282 |
i.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7283 |
src = src[4:] |
| 7284 |
return src |
| 7285 |
} |
| 7286 |
|
| 7287 |
|
| 7288 |
|
| 7289 |
func (i *IPTGetinfo) Packed() bool { |
| 7290 |
return i.Name.Packed() |
| 7291 |
} |
| 7292 |
|
| 7293 |
|
| 7294 |
func (i *IPTGetinfo) MarshalUnsafe(dst []byte) []byte { |
| 7295 |
if i.Name.Packed() { |
| 7296 |
size := i.SizeBytes() |
| 7297 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 7298 |
return dst[size:] |
| 7299 |
} |
| 7300 |
|
| 7301 |
return i.MarshalBytes(dst) |
| 7302 |
} |
| 7303 |
|
| 7304 |
|
| 7305 |
func (i *IPTGetinfo) UnmarshalUnsafe(src []byte) []byte { |
| 7306 |
if i.Name.Packed() { |
| 7307 |
size := i.SizeBytes() |
| 7308 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 7309 |
return src[size:] |
| 7310 |
} |
| 7311 |
|
| 7312 |
return i.UnmarshalBytes(src) |
| 7313 |
} |
| 7314 |
|
| 7315 |
|
| 7316 |
|
| 7317 |
func (i *IPTGetinfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 7318 |
if !i.Name.Packed() { |
| 7319 |
|
| 7320 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7321 |
i.MarshalBytes(buf) |
| 7322 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 7323 |
} |
| 7324 |
|
| 7325 |
|
| 7326 |
var buf []byte |
| 7327 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7328 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7329 |
hdr.Len = i.SizeBytes() |
| 7330 |
hdr.Cap = i.SizeBytes() |
| 7331 |
|
| 7332 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 7333 |
|
| 7334 |
|
| 7335 |
runtime.KeepAlive(i) |
| 7336 |
return length, err |
| 7337 |
} |
| 7338 |
|
| 7339 |
|
| 7340 |
|
| 7341 |
func (i *IPTGetinfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7342 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 7343 |
} |
| 7344 |
|
| 7345 |
|
| 7346 |
|
| 7347 |
func (i *IPTGetinfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7348 |
if !i.Name.Packed() { |
| 7349 |
|
| 7350 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7351 |
length, err := cc.CopyInBytes(addr, buf) |
| 7352 |
|
| 7353 |
|
| 7354 |
i.UnmarshalBytes(buf) |
| 7355 |
return length, err |
| 7356 |
} |
| 7357 |
|
| 7358 |
|
| 7359 |
var buf []byte |
| 7360 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7361 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7362 |
hdr.Len = i.SizeBytes() |
| 7363 |
hdr.Cap = i.SizeBytes() |
| 7364 |
|
| 7365 |
length, err := cc.CopyInBytes(addr, buf) |
| 7366 |
|
| 7367 |
|
| 7368 |
runtime.KeepAlive(i) |
| 7369 |
return length, err |
| 7370 |
} |
| 7371 |
|
| 7372 |
|
| 7373 |
func (i *IPTGetinfo) WriteTo(writer io.Writer) (int64, error) { |
| 7374 |
if !i.Name.Packed() { |
| 7375 |
|
| 7376 |
buf := make([]byte, i.SizeBytes()) |
| 7377 |
i.MarshalBytes(buf) |
| 7378 |
length, err := writer.Write(buf) |
| 7379 |
return int64(length), err |
| 7380 |
} |
| 7381 |
|
| 7382 |
|
| 7383 |
var buf []byte |
| 7384 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7385 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7386 |
hdr.Len = i.SizeBytes() |
| 7387 |
hdr.Cap = i.SizeBytes() |
| 7388 |
|
| 7389 |
length, err := writer.Write(buf) |
| 7390 |
|
| 7391 |
|
| 7392 |
runtime.KeepAlive(i) |
| 7393 |
return int64(length), err |
| 7394 |
} |
| 7395 |
|
| 7396 |
|
| 7397 |
func (i *IPTIP) SizeBytes() int { |
| 7398 |
return 4 + |
| 7399 |
(*InetAddr)(nil).SizeBytes() + |
| 7400 |
(*InetAddr)(nil).SizeBytes() + |
| 7401 |
(*InetAddr)(nil).SizeBytes() + |
| 7402 |
(*InetAddr)(nil).SizeBytes() + |
| 7403 |
1*IFNAMSIZ + |
| 7404 |
1*IFNAMSIZ + |
| 7405 |
1*IFNAMSIZ + |
| 7406 |
1*IFNAMSIZ |
| 7407 |
} |
| 7408 |
|
| 7409 |
|
| 7410 |
func (i *IPTIP) MarshalBytes(dst []byte) []byte { |
| 7411 |
dst = i.Src.MarshalUnsafe(dst) |
| 7412 |
dst = i.Dst.MarshalUnsafe(dst) |
| 7413 |
dst = i.SrcMask.MarshalUnsafe(dst) |
| 7414 |
dst = i.DstMask.MarshalUnsafe(dst) |
| 7415 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 7416 |
dst[0] = byte(i.InputInterface[idx]) |
| 7417 |
dst = dst[1:] |
| 7418 |
} |
| 7419 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 7420 |
dst[0] = byte(i.OutputInterface[idx]) |
| 7421 |
dst = dst[1:] |
| 7422 |
} |
| 7423 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 7424 |
dst[0] = byte(i.InputInterfaceMask[idx]) |
| 7425 |
dst = dst[1:] |
| 7426 |
} |
| 7427 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 7428 |
dst[0] = byte(i.OutputInterfaceMask[idx]) |
| 7429 |
dst = dst[1:] |
| 7430 |
} |
| 7431 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.Protocol)) |
| 7432 |
dst = dst[2:] |
| 7433 |
dst[0] = byte(i.Flags) |
| 7434 |
dst = dst[1:] |
| 7435 |
dst[0] = byte(i.InverseFlags) |
| 7436 |
dst = dst[1:] |
| 7437 |
return dst |
| 7438 |
} |
| 7439 |
|
| 7440 |
|
| 7441 |
func (i *IPTIP) UnmarshalBytes(src []byte) []byte { |
| 7442 |
src = i.Src.UnmarshalUnsafe(src) |
| 7443 |
src = i.Dst.UnmarshalUnsafe(src) |
| 7444 |
src = i.SrcMask.UnmarshalUnsafe(src) |
| 7445 |
src = i.DstMask.UnmarshalUnsafe(src) |
| 7446 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 7447 |
i.InputInterface[idx] = src[0] |
| 7448 |
src = src[1:] |
| 7449 |
} |
| 7450 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 7451 |
i.OutputInterface[idx] = src[0] |
| 7452 |
src = src[1:] |
| 7453 |
} |
| 7454 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 7455 |
i.InputInterfaceMask[idx] = src[0] |
| 7456 |
src = src[1:] |
| 7457 |
} |
| 7458 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 7459 |
i.OutputInterfaceMask[idx] = src[0] |
| 7460 |
src = src[1:] |
| 7461 |
} |
| 7462 |
i.Protocol = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 7463 |
src = src[2:] |
| 7464 |
i.Flags = uint8(src[0]) |
| 7465 |
src = src[1:] |
| 7466 |
i.InverseFlags = uint8(src[0]) |
| 7467 |
src = src[1:] |
| 7468 |
return src |
| 7469 |
} |
| 7470 |
|
| 7471 |
|
| 7472 |
|
| 7473 |
func (i *IPTIP) Packed() bool { |
| 7474 |
return i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() |
| 7475 |
} |
| 7476 |
|
| 7477 |
|
| 7478 |
func (i *IPTIP) MarshalUnsafe(dst []byte) []byte { |
| 7479 |
if i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { |
| 7480 |
size := i.SizeBytes() |
| 7481 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 7482 |
return dst[size:] |
| 7483 |
} |
| 7484 |
|
| 7485 |
return i.MarshalBytes(dst) |
| 7486 |
} |
| 7487 |
|
| 7488 |
|
| 7489 |
func (i *IPTIP) UnmarshalUnsafe(src []byte) []byte { |
| 7490 |
if i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { |
| 7491 |
size := i.SizeBytes() |
| 7492 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 7493 |
return src[size:] |
| 7494 |
} |
| 7495 |
|
| 7496 |
return i.UnmarshalBytes(src) |
| 7497 |
} |
| 7498 |
|
| 7499 |
|
| 7500 |
|
| 7501 |
func (i *IPTIP) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 7502 |
if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { |
| 7503 |
|
| 7504 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7505 |
i.MarshalBytes(buf) |
| 7506 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 7507 |
} |
| 7508 |
|
| 7509 |
|
| 7510 |
var buf []byte |
| 7511 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7512 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7513 |
hdr.Len = i.SizeBytes() |
| 7514 |
hdr.Cap = i.SizeBytes() |
| 7515 |
|
| 7516 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 7517 |
|
| 7518 |
|
| 7519 |
runtime.KeepAlive(i) |
| 7520 |
return length, err |
| 7521 |
} |
| 7522 |
|
| 7523 |
|
| 7524 |
|
| 7525 |
func (i *IPTIP) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7526 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 7527 |
} |
| 7528 |
|
| 7529 |
|
| 7530 |
|
| 7531 |
func (i *IPTIP) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7532 |
if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { |
| 7533 |
|
| 7534 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7535 |
length, err := cc.CopyInBytes(addr, buf) |
| 7536 |
|
| 7537 |
|
| 7538 |
i.UnmarshalBytes(buf) |
| 7539 |
return length, err |
| 7540 |
} |
| 7541 |
|
| 7542 |
|
| 7543 |
var buf []byte |
| 7544 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7545 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7546 |
hdr.Len = i.SizeBytes() |
| 7547 |
hdr.Cap = i.SizeBytes() |
| 7548 |
|
| 7549 |
length, err := cc.CopyInBytes(addr, buf) |
| 7550 |
|
| 7551 |
|
| 7552 |
runtime.KeepAlive(i) |
| 7553 |
return length, err |
| 7554 |
} |
| 7555 |
|
| 7556 |
|
| 7557 |
func (i *IPTIP) WriteTo(writer io.Writer) (int64, error) { |
| 7558 |
if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { |
| 7559 |
|
| 7560 |
buf := make([]byte, i.SizeBytes()) |
| 7561 |
i.MarshalBytes(buf) |
| 7562 |
length, err := writer.Write(buf) |
| 7563 |
return int64(length), err |
| 7564 |
} |
| 7565 |
|
| 7566 |
|
| 7567 |
var buf []byte |
| 7568 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7569 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7570 |
hdr.Len = i.SizeBytes() |
| 7571 |
hdr.Cap = i.SizeBytes() |
| 7572 |
|
| 7573 |
length, err := writer.Write(buf) |
| 7574 |
|
| 7575 |
|
| 7576 |
runtime.KeepAlive(i) |
| 7577 |
return int64(length), err |
| 7578 |
} |
| 7579 |
|
| 7580 |
|
| 7581 |
func (i *IPTOwnerInfo) SizeBytes() int { |
| 7582 |
return 18 + |
| 7583 |
1*16 |
| 7584 |
} |
| 7585 |
|
| 7586 |
|
| 7587 |
func (i *IPTOwnerInfo) MarshalBytes(dst []byte) []byte { |
| 7588 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.UID)) |
| 7589 |
dst = dst[4:] |
| 7590 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.GID)) |
| 7591 |
dst = dst[4:] |
| 7592 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.PID)) |
| 7593 |
dst = dst[4:] |
| 7594 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.SID)) |
| 7595 |
dst = dst[4:] |
| 7596 |
for idx := 0; idx < 16; idx++ { |
| 7597 |
dst[0] = byte(i.Comm[idx]) |
| 7598 |
dst = dst[1:] |
| 7599 |
} |
| 7600 |
dst[0] = byte(i.Match) |
| 7601 |
dst = dst[1:] |
| 7602 |
dst[0] = byte(i.Invert) |
| 7603 |
dst = dst[1:] |
| 7604 |
return dst |
| 7605 |
} |
| 7606 |
|
| 7607 |
|
| 7608 |
func (i *IPTOwnerInfo) UnmarshalBytes(src []byte) []byte { |
| 7609 |
i.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7610 |
src = src[4:] |
| 7611 |
i.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7612 |
src = src[4:] |
| 7613 |
i.PID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7614 |
src = src[4:] |
| 7615 |
i.SID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7616 |
src = src[4:] |
| 7617 |
for idx := 0; idx < 16; idx++ { |
| 7618 |
i.Comm[idx] = src[0] |
| 7619 |
src = src[1:] |
| 7620 |
} |
| 7621 |
i.Match = uint8(src[0]) |
| 7622 |
src = src[1:] |
| 7623 |
i.Invert = uint8(src[0]) |
| 7624 |
src = src[1:] |
| 7625 |
return src |
| 7626 |
} |
| 7627 |
|
| 7628 |
|
| 7629 |
|
| 7630 |
func (i *IPTOwnerInfo) Packed() bool { |
| 7631 |
return false |
| 7632 |
} |
| 7633 |
|
| 7634 |
|
| 7635 |
func (i *IPTOwnerInfo) MarshalUnsafe(dst []byte) []byte { |
| 7636 |
|
| 7637 |
return i.MarshalBytes(dst) |
| 7638 |
} |
| 7639 |
|
| 7640 |
|
| 7641 |
func (i *IPTOwnerInfo) UnmarshalUnsafe(src []byte) []byte { |
| 7642 |
|
| 7643 |
return i.UnmarshalBytes(src) |
| 7644 |
} |
| 7645 |
|
| 7646 |
|
| 7647 |
|
| 7648 |
func (i *IPTOwnerInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 7649 |
|
| 7650 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7651 |
i.MarshalBytes(buf) |
| 7652 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 7653 |
} |
| 7654 |
|
| 7655 |
|
| 7656 |
|
| 7657 |
func (i *IPTOwnerInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7658 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 7659 |
} |
| 7660 |
|
| 7661 |
|
| 7662 |
|
| 7663 |
func (i *IPTOwnerInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7664 |
|
| 7665 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7666 |
length, err := cc.CopyInBytes(addr, buf) |
| 7667 |
|
| 7668 |
|
| 7669 |
i.UnmarshalBytes(buf) |
| 7670 |
return length, err |
| 7671 |
} |
| 7672 |
|
| 7673 |
|
| 7674 |
func (i *IPTOwnerInfo) WriteTo(writer io.Writer) (int64, error) { |
| 7675 |
|
| 7676 |
buf := make([]byte, i.SizeBytes()) |
| 7677 |
i.MarshalBytes(buf) |
| 7678 |
length, err := writer.Write(buf) |
| 7679 |
return int64(length), err |
| 7680 |
} |
| 7681 |
|
| 7682 |
|
| 7683 |
func (i *IPTReplace) SizeBytes() int { |
| 7684 |
return 24 + |
| 7685 |
(*TableName)(nil).SizeBytes() + |
| 7686 |
4*NF_INET_NUMHOOKS + |
| 7687 |
4*NF_INET_NUMHOOKS |
| 7688 |
} |
| 7689 |
|
| 7690 |
|
| 7691 |
func (i *IPTReplace) MarshalBytes(dst []byte) []byte { |
| 7692 |
dst = i.Name.MarshalUnsafe(dst) |
| 7693 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.ValidHooks)) |
| 7694 |
dst = dst[4:] |
| 7695 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NumEntries)) |
| 7696 |
dst = dst[4:] |
| 7697 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Size)) |
| 7698 |
dst = dst[4:] |
| 7699 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 7700 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.HookEntry[idx])) |
| 7701 |
dst = dst[4:] |
| 7702 |
} |
| 7703 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 7704 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Underflow[idx])) |
| 7705 |
dst = dst[4:] |
| 7706 |
} |
| 7707 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NumCounters)) |
| 7708 |
dst = dst[4:] |
| 7709 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Counters)) |
| 7710 |
dst = dst[8:] |
| 7711 |
return dst |
| 7712 |
} |
| 7713 |
|
| 7714 |
|
| 7715 |
func (i *IPTReplace) UnmarshalBytes(src []byte) []byte { |
| 7716 |
src = i.Name.UnmarshalUnsafe(src) |
| 7717 |
i.ValidHooks = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7718 |
src = src[4:] |
| 7719 |
i.NumEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7720 |
src = src[4:] |
| 7721 |
i.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7722 |
src = src[4:] |
| 7723 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 7724 |
i.HookEntry[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7725 |
src = src[4:] |
| 7726 |
} |
| 7727 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 7728 |
i.Underflow[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7729 |
src = src[4:] |
| 7730 |
} |
| 7731 |
i.NumCounters = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7732 |
src = src[4:] |
| 7733 |
i.Counters = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 7734 |
src = src[8:] |
| 7735 |
return src |
| 7736 |
} |
| 7737 |
|
| 7738 |
|
| 7739 |
|
| 7740 |
func (i *IPTReplace) Packed() bool { |
| 7741 |
return i.Name.Packed() |
| 7742 |
} |
| 7743 |
|
| 7744 |
|
| 7745 |
func (i *IPTReplace) MarshalUnsafe(dst []byte) []byte { |
| 7746 |
if i.Name.Packed() { |
| 7747 |
size := i.SizeBytes() |
| 7748 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 7749 |
return dst[size:] |
| 7750 |
} |
| 7751 |
|
| 7752 |
return i.MarshalBytes(dst) |
| 7753 |
} |
| 7754 |
|
| 7755 |
|
| 7756 |
func (i *IPTReplace) UnmarshalUnsafe(src []byte) []byte { |
| 7757 |
if i.Name.Packed() { |
| 7758 |
size := i.SizeBytes() |
| 7759 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 7760 |
return src[size:] |
| 7761 |
} |
| 7762 |
|
| 7763 |
return i.UnmarshalBytes(src) |
| 7764 |
} |
| 7765 |
|
| 7766 |
|
| 7767 |
|
| 7768 |
func (i *IPTReplace) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 7769 |
if !i.Name.Packed() { |
| 7770 |
|
| 7771 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7772 |
i.MarshalBytes(buf) |
| 7773 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 7774 |
} |
| 7775 |
|
| 7776 |
|
| 7777 |
var buf []byte |
| 7778 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7779 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7780 |
hdr.Len = i.SizeBytes() |
| 7781 |
hdr.Cap = i.SizeBytes() |
| 7782 |
|
| 7783 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 7784 |
|
| 7785 |
|
| 7786 |
runtime.KeepAlive(i) |
| 7787 |
return length, err |
| 7788 |
} |
| 7789 |
|
| 7790 |
|
| 7791 |
|
| 7792 |
func (i *IPTReplace) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7793 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 7794 |
} |
| 7795 |
|
| 7796 |
|
| 7797 |
|
| 7798 |
func (i *IPTReplace) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7799 |
if !i.Name.Packed() { |
| 7800 |
|
| 7801 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 7802 |
length, err := cc.CopyInBytes(addr, buf) |
| 7803 |
|
| 7804 |
|
| 7805 |
i.UnmarshalBytes(buf) |
| 7806 |
return length, err |
| 7807 |
} |
| 7808 |
|
| 7809 |
|
| 7810 |
var buf []byte |
| 7811 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7812 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7813 |
hdr.Len = i.SizeBytes() |
| 7814 |
hdr.Cap = i.SizeBytes() |
| 7815 |
|
| 7816 |
length, err := cc.CopyInBytes(addr, buf) |
| 7817 |
|
| 7818 |
|
| 7819 |
runtime.KeepAlive(i) |
| 7820 |
return length, err |
| 7821 |
} |
| 7822 |
|
| 7823 |
|
| 7824 |
func (i *IPTReplace) WriteTo(writer io.Writer) (int64, error) { |
| 7825 |
if !i.Name.Packed() { |
| 7826 |
|
| 7827 |
buf := make([]byte, i.SizeBytes()) |
| 7828 |
i.MarshalBytes(buf) |
| 7829 |
length, err := writer.Write(buf) |
| 7830 |
return int64(length), err |
| 7831 |
} |
| 7832 |
|
| 7833 |
|
| 7834 |
var buf []byte |
| 7835 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 7836 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 7837 |
hdr.Len = i.SizeBytes() |
| 7838 |
hdr.Cap = i.SizeBytes() |
| 7839 |
|
| 7840 |
length, err := writer.Write(buf) |
| 7841 |
|
| 7842 |
|
| 7843 |
runtime.KeepAlive(i) |
| 7844 |
return int64(length), err |
| 7845 |
} |
| 7846 |
|
| 7847 |
|
| 7848 |
|
| 7849 |
func (ke *KernelIPTEntry) Packed() bool { |
| 7850 |
|
| 7851 |
return false |
| 7852 |
} |
| 7853 |
|
| 7854 |
|
| 7855 |
func (ke *KernelIPTEntry) MarshalUnsafe(dst []byte) []byte { |
| 7856 |
|
| 7857 |
return ke.MarshalBytes(dst) |
| 7858 |
} |
| 7859 |
|
| 7860 |
|
| 7861 |
func (ke *KernelIPTEntry) UnmarshalUnsafe(src []byte) []byte { |
| 7862 |
|
| 7863 |
return ke.UnmarshalBytes(src) |
| 7864 |
} |
| 7865 |
|
| 7866 |
|
| 7867 |
|
| 7868 |
func (ke *KernelIPTEntry) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 7869 |
|
| 7870 |
buf := cc.CopyScratchBuffer(ke.SizeBytes()) |
| 7871 |
ke.MarshalBytes(buf) |
| 7872 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 7873 |
} |
| 7874 |
|
| 7875 |
|
| 7876 |
|
| 7877 |
func (ke *KernelIPTEntry) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7878 |
return ke.CopyOutN(cc, addr, ke.SizeBytes()) |
| 7879 |
} |
| 7880 |
|
| 7881 |
|
| 7882 |
|
| 7883 |
func (ke *KernelIPTEntry) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7884 |
|
| 7885 |
buf := cc.CopyScratchBuffer(ke.SizeBytes()) |
| 7886 |
length, err := cc.CopyInBytes(addr, buf) |
| 7887 |
|
| 7888 |
|
| 7889 |
ke.UnmarshalBytes(buf) |
| 7890 |
return length, err |
| 7891 |
} |
| 7892 |
|
| 7893 |
|
| 7894 |
func (ke *KernelIPTEntry) WriteTo(writer io.Writer) (int64, error) { |
| 7895 |
|
| 7896 |
buf := make([]byte, ke.SizeBytes()) |
| 7897 |
ke.MarshalBytes(buf) |
| 7898 |
length, err := writer.Write(buf) |
| 7899 |
return int64(length), err |
| 7900 |
} |
| 7901 |
|
| 7902 |
|
| 7903 |
|
| 7904 |
func (ke *KernelIPTGetEntries) Packed() bool { |
| 7905 |
|
| 7906 |
return false |
| 7907 |
} |
| 7908 |
|
| 7909 |
|
| 7910 |
func (ke *KernelIPTGetEntries) MarshalUnsafe(dst []byte) []byte { |
| 7911 |
|
| 7912 |
return ke.MarshalBytes(dst) |
| 7913 |
} |
| 7914 |
|
| 7915 |
|
| 7916 |
func (ke *KernelIPTGetEntries) UnmarshalUnsafe(src []byte) []byte { |
| 7917 |
|
| 7918 |
return ke.UnmarshalBytes(src) |
| 7919 |
} |
| 7920 |
|
| 7921 |
|
| 7922 |
|
| 7923 |
func (ke *KernelIPTGetEntries) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 7924 |
|
| 7925 |
buf := cc.CopyScratchBuffer(ke.SizeBytes()) |
| 7926 |
ke.MarshalBytes(buf) |
| 7927 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 7928 |
} |
| 7929 |
|
| 7930 |
|
| 7931 |
|
| 7932 |
func (ke *KernelIPTGetEntries) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7933 |
return ke.CopyOutN(cc, addr, ke.SizeBytes()) |
| 7934 |
} |
| 7935 |
|
| 7936 |
|
| 7937 |
|
| 7938 |
func (ke *KernelIPTGetEntries) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 7939 |
|
| 7940 |
buf := cc.CopyScratchBuffer(ke.SizeBytes()) |
| 7941 |
length, err := cc.CopyInBytes(addr, buf) |
| 7942 |
|
| 7943 |
|
| 7944 |
ke.UnmarshalBytes(buf) |
| 7945 |
return length, err |
| 7946 |
} |
| 7947 |
|
| 7948 |
|
| 7949 |
func (ke *KernelIPTGetEntries) WriteTo(writer io.Writer) (int64, error) { |
| 7950 |
|
| 7951 |
buf := make([]byte, ke.SizeBytes()) |
| 7952 |
ke.MarshalBytes(buf) |
| 7953 |
length, err := writer.Write(buf) |
| 7954 |
return int64(length), err |
| 7955 |
} |
| 7956 |
|
| 7957 |
|
| 7958 |
func (n *NfNATIPV4MultiRangeCompat) SizeBytes() int { |
| 7959 |
return 4 + |
| 7960 |
(*NfNATIPV4Range)(nil).SizeBytes() |
| 7961 |
} |
| 7962 |
|
| 7963 |
|
| 7964 |
func (n *NfNATIPV4MultiRangeCompat) MarshalBytes(dst []byte) []byte { |
| 7965 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.RangeSize)) |
| 7966 |
dst = dst[4:] |
| 7967 |
dst = n.RangeIPV4.MarshalUnsafe(dst) |
| 7968 |
return dst |
| 7969 |
} |
| 7970 |
|
| 7971 |
|
| 7972 |
func (n *NfNATIPV4MultiRangeCompat) UnmarshalBytes(src []byte) []byte { |
| 7973 |
n.RangeSize = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 7974 |
src = src[4:] |
| 7975 |
src = n.RangeIPV4.UnmarshalUnsafe(src) |
| 7976 |
return src |
| 7977 |
} |
| 7978 |
|
| 7979 |
|
| 7980 |
|
| 7981 |
func (n *NfNATIPV4MultiRangeCompat) Packed() bool { |
| 7982 |
return n.RangeIPV4.Packed() |
| 7983 |
} |
| 7984 |
|
| 7985 |
|
| 7986 |
func (n *NfNATIPV4MultiRangeCompat) MarshalUnsafe(dst []byte) []byte { |
| 7987 |
if n.RangeIPV4.Packed() { |
| 7988 |
size := n.SizeBytes() |
| 7989 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) |
| 7990 |
return dst[size:] |
| 7991 |
} |
| 7992 |
|
| 7993 |
return n.MarshalBytes(dst) |
| 7994 |
} |
| 7995 |
|
| 7996 |
|
| 7997 |
func (n *NfNATIPV4MultiRangeCompat) UnmarshalUnsafe(src []byte) []byte { |
| 7998 |
if n.RangeIPV4.Packed() { |
| 7999 |
size := n.SizeBytes() |
| 8000 |
gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) |
| 8001 |
return src[size:] |
| 8002 |
} |
| 8003 |
|
| 8004 |
return n.UnmarshalBytes(src) |
| 8005 |
} |
| 8006 |
|
| 8007 |
|
| 8008 |
|
| 8009 |
func (n *NfNATIPV4MultiRangeCompat) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 8010 |
if !n.RangeIPV4.Packed() { |
| 8011 |
|
| 8012 |
buf := cc.CopyScratchBuffer(n.SizeBytes()) |
| 8013 |
n.MarshalBytes(buf) |
| 8014 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 8015 |
} |
| 8016 |
|
| 8017 |
|
| 8018 |
var buf []byte |
| 8019 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8020 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 8021 |
hdr.Len = n.SizeBytes() |
| 8022 |
hdr.Cap = n.SizeBytes() |
| 8023 |
|
| 8024 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 8025 |
|
| 8026 |
|
| 8027 |
runtime.KeepAlive(n) |
| 8028 |
return length, err |
| 8029 |
} |
| 8030 |
|
| 8031 |
|
| 8032 |
|
| 8033 |
func (n *NfNATIPV4MultiRangeCompat) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8034 |
return n.CopyOutN(cc, addr, n.SizeBytes()) |
| 8035 |
} |
| 8036 |
|
| 8037 |
|
| 8038 |
|
| 8039 |
func (n *NfNATIPV4MultiRangeCompat) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8040 |
if !n.RangeIPV4.Packed() { |
| 8041 |
|
| 8042 |
buf := cc.CopyScratchBuffer(n.SizeBytes()) |
| 8043 |
length, err := cc.CopyInBytes(addr, buf) |
| 8044 |
|
| 8045 |
|
| 8046 |
n.UnmarshalBytes(buf) |
| 8047 |
return length, err |
| 8048 |
} |
| 8049 |
|
| 8050 |
|
| 8051 |
var buf []byte |
| 8052 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8053 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 8054 |
hdr.Len = n.SizeBytes() |
| 8055 |
hdr.Cap = n.SizeBytes() |
| 8056 |
|
| 8057 |
length, err := cc.CopyInBytes(addr, buf) |
| 8058 |
|
| 8059 |
|
| 8060 |
runtime.KeepAlive(n) |
| 8061 |
return length, err |
| 8062 |
} |
| 8063 |
|
| 8064 |
|
| 8065 |
func (n *NfNATIPV4MultiRangeCompat) WriteTo(writer io.Writer) (int64, error) { |
| 8066 |
if !n.RangeIPV4.Packed() { |
| 8067 |
|
| 8068 |
buf := make([]byte, n.SizeBytes()) |
| 8069 |
n.MarshalBytes(buf) |
| 8070 |
length, err := writer.Write(buf) |
| 8071 |
return int64(length), err |
| 8072 |
} |
| 8073 |
|
| 8074 |
|
| 8075 |
var buf []byte |
| 8076 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8077 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 8078 |
hdr.Len = n.SizeBytes() |
| 8079 |
hdr.Cap = n.SizeBytes() |
| 8080 |
|
| 8081 |
length, err := writer.Write(buf) |
| 8082 |
|
| 8083 |
|
| 8084 |
runtime.KeepAlive(n) |
| 8085 |
return int64(length), err |
| 8086 |
} |
| 8087 |
|
| 8088 |
|
| 8089 |
func (n *NfNATIPV4Range) SizeBytes() int { |
| 8090 |
return 8 + |
| 8091 |
1*4 + |
| 8092 |
1*4 |
| 8093 |
} |
| 8094 |
|
| 8095 |
|
| 8096 |
func (n *NfNATIPV4Range) MarshalBytes(dst []byte) []byte { |
| 8097 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) |
| 8098 |
dst = dst[4:] |
| 8099 |
for idx := 0; idx < 4; idx++ { |
| 8100 |
dst[0] = byte(n.MinIP[idx]) |
| 8101 |
dst = dst[1:] |
| 8102 |
} |
| 8103 |
for idx := 0; idx < 4; idx++ { |
| 8104 |
dst[0] = byte(n.MaxIP[idx]) |
| 8105 |
dst = dst[1:] |
| 8106 |
} |
| 8107 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.MinPort)) |
| 8108 |
dst = dst[2:] |
| 8109 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.MaxPort)) |
| 8110 |
dst = dst[2:] |
| 8111 |
return dst |
| 8112 |
} |
| 8113 |
|
| 8114 |
|
| 8115 |
func (n *NfNATIPV4Range) UnmarshalBytes(src []byte) []byte { |
| 8116 |
n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 8117 |
src = src[4:] |
| 8118 |
for idx := 0; idx < 4; idx++ { |
| 8119 |
n.MinIP[idx] = src[0] |
| 8120 |
src = src[1:] |
| 8121 |
} |
| 8122 |
for idx := 0; idx < 4; idx++ { |
| 8123 |
n.MaxIP[idx] = src[0] |
| 8124 |
src = src[1:] |
| 8125 |
} |
| 8126 |
n.MinPort = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 8127 |
src = src[2:] |
| 8128 |
n.MaxPort = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 8129 |
src = src[2:] |
| 8130 |
return src |
| 8131 |
} |
| 8132 |
|
| 8133 |
|
| 8134 |
|
| 8135 |
func (n *NfNATIPV4Range) Packed() bool { |
| 8136 |
return true |
| 8137 |
} |
| 8138 |
|
| 8139 |
|
| 8140 |
func (n *NfNATIPV4Range) MarshalUnsafe(dst []byte) []byte { |
| 8141 |
size := n.SizeBytes() |
| 8142 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) |
| 8143 |
return dst[size:] |
| 8144 |
} |
| 8145 |
|
| 8146 |
|
| 8147 |
func (n *NfNATIPV4Range) UnmarshalUnsafe(src []byte) []byte { |
| 8148 |
size := n.SizeBytes() |
| 8149 |
gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) |
| 8150 |
return src[size:] |
| 8151 |
} |
| 8152 |
|
| 8153 |
|
| 8154 |
|
| 8155 |
func (n *NfNATIPV4Range) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 8156 |
|
| 8157 |
var buf []byte |
| 8158 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8159 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 8160 |
hdr.Len = n.SizeBytes() |
| 8161 |
hdr.Cap = n.SizeBytes() |
| 8162 |
|
| 8163 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 8164 |
|
| 8165 |
|
| 8166 |
runtime.KeepAlive(n) |
| 8167 |
return length, err |
| 8168 |
} |
| 8169 |
|
| 8170 |
|
| 8171 |
|
| 8172 |
func (n *NfNATIPV4Range) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8173 |
return n.CopyOutN(cc, addr, n.SizeBytes()) |
| 8174 |
} |
| 8175 |
|
| 8176 |
|
| 8177 |
|
| 8178 |
func (n *NfNATIPV4Range) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8179 |
|
| 8180 |
var buf []byte |
| 8181 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8182 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 8183 |
hdr.Len = n.SizeBytes() |
| 8184 |
hdr.Cap = n.SizeBytes() |
| 8185 |
|
| 8186 |
length, err := cc.CopyInBytes(addr, buf) |
| 8187 |
|
| 8188 |
|
| 8189 |
runtime.KeepAlive(n) |
| 8190 |
return length, err |
| 8191 |
} |
| 8192 |
|
| 8193 |
|
| 8194 |
func (n *NfNATIPV4Range) WriteTo(writer io.Writer) (int64, error) { |
| 8195 |
|
| 8196 |
var buf []byte |
| 8197 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8198 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 8199 |
hdr.Len = n.SizeBytes() |
| 8200 |
hdr.Cap = n.SizeBytes() |
| 8201 |
|
| 8202 |
length, err := writer.Write(buf) |
| 8203 |
|
| 8204 |
|
| 8205 |
runtime.KeepAlive(n) |
| 8206 |
return int64(length), err |
| 8207 |
} |
| 8208 |
|
| 8209 |
|
| 8210 |
|
| 8211 |
func (tn *TableName) SizeBytes() int { |
| 8212 |
return 1 * XT_TABLE_MAXNAMELEN |
| 8213 |
} |
| 8214 |
|
| 8215 |
|
| 8216 |
func (tn *TableName) MarshalBytes(dst []byte) []byte { |
| 8217 |
for idx := 0; idx < XT_TABLE_MAXNAMELEN; idx++ { |
| 8218 |
dst[0] = byte(tn[idx]) |
| 8219 |
dst = dst[1:] |
| 8220 |
} |
| 8221 |
return dst |
| 8222 |
} |
| 8223 |
|
| 8224 |
|
| 8225 |
func (tn *TableName) UnmarshalBytes(src []byte) []byte { |
| 8226 |
for idx := 0; idx < XT_TABLE_MAXNAMELEN; idx++ { |
| 8227 |
tn[idx] = src[0] |
| 8228 |
src = src[1:] |
| 8229 |
} |
| 8230 |
return src |
| 8231 |
} |
| 8232 |
|
| 8233 |
|
| 8234 |
|
| 8235 |
func (tn *TableName) Packed() bool { |
| 8236 |
|
| 8237 |
return true |
| 8238 |
} |
| 8239 |
|
| 8240 |
|
| 8241 |
func (tn *TableName) MarshalUnsafe(dst []byte) []byte { |
| 8242 |
size := tn.SizeBytes() |
| 8243 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&tn[0]), uintptr(size)) |
| 8244 |
return dst[size:] |
| 8245 |
} |
| 8246 |
|
| 8247 |
|
| 8248 |
func (tn *TableName) UnmarshalUnsafe(src []byte) []byte { |
| 8249 |
size := tn.SizeBytes() |
| 8250 |
gohacks.Memmove(unsafe.Pointer(tn), unsafe.Pointer(&src[0]), uintptr(size)) |
| 8251 |
return src[size:] |
| 8252 |
} |
| 8253 |
|
| 8254 |
|
| 8255 |
|
| 8256 |
func (tn *TableName) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 8257 |
|
| 8258 |
var buf []byte |
| 8259 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8260 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tn))) |
| 8261 |
hdr.Len = tn.SizeBytes() |
| 8262 |
hdr.Cap = tn.SizeBytes() |
| 8263 |
|
| 8264 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 8265 |
|
| 8266 |
|
| 8267 |
runtime.KeepAlive(tn) |
| 8268 |
return length, err |
| 8269 |
} |
| 8270 |
|
| 8271 |
|
| 8272 |
|
| 8273 |
func (tn *TableName) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8274 |
return tn.CopyOutN(cc, addr, tn.SizeBytes()) |
| 8275 |
} |
| 8276 |
|
| 8277 |
|
| 8278 |
|
| 8279 |
func (tn *TableName) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8280 |
|
| 8281 |
var buf []byte |
| 8282 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8283 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tn))) |
| 8284 |
hdr.Len = tn.SizeBytes() |
| 8285 |
hdr.Cap = tn.SizeBytes() |
| 8286 |
|
| 8287 |
length, err := cc.CopyInBytes(addr, buf) |
| 8288 |
|
| 8289 |
|
| 8290 |
runtime.KeepAlive(tn) |
| 8291 |
return length, err |
| 8292 |
} |
| 8293 |
|
| 8294 |
|
| 8295 |
func (tn *TableName) WriteTo(writer io.Writer) (int64, error) { |
| 8296 |
|
| 8297 |
var buf []byte |
| 8298 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8299 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tn))) |
| 8300 |
hdr.Len = tn.SizeBytes() |
| 8301 |
hdr.Cap = tn.SizeBytes() |
| 8302 |
|
| 8303 |
length, err := writer.Write(buf) |
| 8304 |
|
| 8305 |
|
| 8306 |
runtime.KeepAlive(tn) |
| 8307 |
return int64(length), err |
| 8308 |
} |
| 8309 |
|
| 8310 |
|
| 8311 |
func (x *XTCounters) SizeBytes() int { |
| 8312 |
return 16 |
| 8313 |
} |
| 8314 |
|
| 8315 |
|
| 8316 |
func (x *XTCounters) MarshalBytes(dst []byte) []byte { |
| 8317 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(x.Pcnt)) |
| 8318 |
dst = dst[8:] |
| 8319 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(x.Bcnt)) |
| 8320 |
dst = dst[8:] |
| 8321 |
return dst |
| 8322 |
} |
| 8323 |
|
| 8324 |
|
| 8325 |
func (x *XTCounters) UnmarshalBytes(src []byte) []byte { |
| 8326 |
x.Pcnt = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 8327 |
src = src[8:] |
| 8328 |
x.Bcnt = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 8329 |
src = src[8:] |
| 8330 |
return src |
| 8331 |
} |
| 8332 |
|
| 8333 |
|
| 8334 |
|
| 8335 |
func (x *XTCounters) Packed() bool { |
| 8336 |
return true |
| 8337 |
} |
| 8338 |
|
| 8339 |
|
| 8340 |
func (x *XTCounters) MarshalUnsafe(dst []byte) []byte { |
| 8341 |
size := x.SizeBytes() |
| 8342 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) |
| 8343 |
return dst[size:] |
| 8344 |
} |
| 8345 |
|
| 8346 |
|
| 8347 |
func (x *XTCounters) UnmarshalUnsafe(src []byte) []byte { |
| 8348 |
size := x.SizeBytes() |
| 8349 |
gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) |
| 8350 |
return src[size:] |
| 8351 |
} |
| 8352 |
|
| 8353 |
|
| 8354 |
|
| 8355 |
func (x *XTCounters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 8356 |
|
| 8357 |
var buf []byte |
| 8358 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8359 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8360 |
hdr.Len = x.SizeBytes() |
| 8361 |
hdr.Cap = x.SizeBytes() |
| 8362 |
|
| 8363 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 8364 |
|
| 8365 |
|
| 8366 |
runtime.KeepAlive(x) |
| 8367 |
return length, err |
| 8368 |
} |
| 8369 |
|
| 8370 |
|
| 8371 |
|
| 8372 |
func (x *XTCounters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8373 |
return x.CopyOutN(cc, addr, x.SizeBytes()) |
| 8374 |
} |
| 8375 |
|
| 8376 |
|
| 8377 |
|
| 8378 |
func (x *XTCounters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8379 |
|
| 8380 |
var buf []byte |
| 8381 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8382 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8383 |
hdr.Len = x.SizeBytes() |
| 8384 |
hdr.Cap = x.SizeBytes() |
| 8385 |
|
| 8386 |
length, err := cc.CopyInBytes(addr, buf) |
| 8387 |
|
| 8388 |
|
| 8389 |
runtime.KeepAlive(x) |
| 8390 |
return length, err |
| 8391 |
} |
| 8392 |
|
| 8393 |
|
| 8394 |
func (x *XTCounters) WriteTo(writer io.Writer) (int64, error) { |
| 8395 |
|
| 8396 |
var buf []byte |
| 8397 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8398 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8399 |
hdr.Len = x.SizeBytes() |
| 8400 |
hdr.Cap = x.SizeBytes() |
| 8401 |
|
| 8402 |
length, err := writer.Write(buf) |
| 8403 |
|
| 8404 |
|
| 8405 |
runtime.KeepAlive(x) |
| 8406 |
return int64(length), err |
| 8407 |
} |
| 8408 |
|
| 8409 |
|
| 8410 |
func (x *XTEntryMatch) SizeBytes() int { |
| 8411 |
return 3 + |
| 8412 |
(*ExtensionName)(nil).SizeBytes() |
| 8413 |
} |
| 8414 |
|
| 8415 |
|
| 8416 |
func (x *XTEntryMatch) MarshalBytes(dst []byte) []byte { |
| 8417 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.MatchSize)) |
| 8418 |
dst = dst[2:] |
| 8419 |
dst = x.Name.MarshalUnsafe(dst) |
| 8420 |
dst[0] = byte(x.Revision) |
| 8421 |
dst = dst[1:] |
| 8422 |
return dst |
| 8423 |
} |
| 8424 |
|
| 8425 |
|
| 8426 |
func (x *XTEntryMatch) UnmarshalBytes(src []byte) []byte { |
| 8427 |
x.MatchSize = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 8428 |
src = src[2:] |
| 8429 |
src = x.Name.UnmarshalUnsafe(src) |
| 8430 |
x.Revision = uint8(src[0]) |
| 8431 |
src = src[1:] |
| 8432 |
return src |
| 8433 |
} |
| 8434 |
|
| 8435 |
|
| 8436 |
|
| 8437 |
func (x *XTEntryMatch) Packed() bool { |
| 8438 |
return x.Name.Packed() |
| 8439 |
} |
| 8440 |
|
| 8441 |
|
| 8442 |
func (x *XTEntryMatch) MarshalUnsafe(dst []byte) []byte { |
| 8443 |
if x.Name.Packed() { |
| 8444 |
size := x.SizeBytes() |
| 8445 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) |
| 8446 |
return dst[size:] |
| 8447 |
} |
| 8448 |
|
| 8449 |
return x.MarshalBytes(dst) |
| 8450 |
} |
| 8451 |
|
| 8452 |
|
| 8453 |
func (x *XTEntryMatch) UnmarshalUnsafe(src []byte) []byte { |
| 8454 |
if x.Name.Packed() { |
| 8455 |
size := x.SizeBytes() |
| 8456 |
gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) |
| 8457 |
return src[size:] |
| 8458 |
} |
| 8459 |
|
| 8460 |
return x.UnmarshalBytes(src) |
| 8461 |
} |
| 8462 |
|
| 8463 |
|
| 8464 |
|
| 8465 |
func (x *XTEntryMatch) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 8466 |
if !x.Name.Packed() { |
| 8467 |
|
| 8468 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 8469 |
x.MarshalBytes(buf) |
| 8470 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 8471 |
} |
| 8472 |
|
| 8473 |
|
| 8474 |
var buf []byte |
| 8475 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8476 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8477 |
hdr.Len = x.SizeBytes() |
| 8478 |
hdr.Cap = x.SizeBytes() |
| 8479 |
|
| 8480 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 8481 |
|
| 8482 |
|
| 8483 |
runtime.KeepAlive(x) |
| 8484 |
return length, err |
| 8485 |
} |
| 8486 |
|
| 8487 |
|
| 8488 |
|
| 8489 |
func (x *XTEntryMatch) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8490 |
return x.CopyOutN(cc, addr, x.SizeBytes()) |
| 8491 |
} |
| 8492 |
|
| 8493 |
|
| 8494 |
|
| 8495 |
func (x *XTEntryMatch) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8496 |
if !x.Name.Packed() { |
| 8497 |
|
| 8498 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 8499 |
length, err := cc.CopyInBytes(addr, buf) |
| 8500 |
|
| 8501 |
|
| 8502 |
x.UnmarshalBytes(buf) |
| 8503 |
return length, err |
| 8504 |
} |
| 8505 |
|
| 8506 |
|
| 8507 |
var buf []byte |
| 8508 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8509 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8510 |
hdr.Len = x.SizeBytes() |
| 8511 |
hdr.Cap = x.SizeBytes() |
| 8512 |
|
| 8513 |
length, err := cc.CopyInBytes(addr, buf) |
| 8514 |
|
| 8515 |
|
| 8516 |
runtime.KeepAlive(x) |
| 8517 |
return length, err |
| 8518 |
} |
| 8519 |
|
| 8520 |
|
| 8521 |
func (x *XTEntryMatch) WriteTo(writer io.Writer) (int64, error) { |
| 8522 |
if !x.Name.Packed() { |
| 8523 |
|
| 8524 |
buf := make([]byte, x.SizeBytes()) |
| 8525 |
x.MarshalBytes(buf) |
| 8526 |
length, err := writer.Write(buf) |
| 8527 |
return int64(length), err |
| 8528 |
} |
| 8529 |
|
| 8530 |
|
| 8531 |
var buf []byte |
| 8532 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8533 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8534 |
hdr.Len = x.SizeBytes() |
| 8535 |
hdr.Cap = x.SizeBytes() |
| 8536 |
|
| 8537 |
length, err := writer.Write(buf) |
| 8538 |
|
| 8539 |
|
| 8540 |
runtime.KeepAlive(x) |
| 8541 |
return int64(length), err |
| 8542 |
} |
| 8543 |
|
| 8544 |
|
| 8545 |
func (x *XTEntryTarget) SizeBytes() int { |
| 8546 |
return 3 + |
| 8547 |
(*ExtensionName)(nil).SizeBytes() |
| 8548 |
} |
| 8549 |
|
| 8550 |
|
| 8551 |
func (x *XTEntryTarget) MarshalBytes(dst []byte) []byte { |
| 8552 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.TargetSize)) |
| 8553 |
dst = dst[2:] |
| 8554 |
dst = x.Name.MarshalUnsafe(dst) |
| 8555 |
dst[0] = byte(x.Revision) |
| 8556 |
dst = dst[1:] |
| 8557 |
return dst |
| 8558 |
} |
| 8559 |
|
| 8560 |
|
| 8561 |
func (x *XTEntryTarget) UnmarshalBytes(src []byte) []byte { |
| 8562 |
x.TargetSize = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 8563 |
src = src[2:] |
| 8564 |
src = x.Name.UnmarshalUnsafe(src) |
| 8565 |
x.Revision = uint8(src[0]) |
| 8566 |
src = src[1:] |
| 8567 |
return src |
| 8568 |
} |
| 8569 |
|
| 8570 |
|
| 8571 |
|
| 8572 |
func (x *XTEntryTarget) Packed() bool { |
| 8573 |
return x.Name.Packed() |
| 8574 |
} |
| 8575 |
|
| 8576 |
|
| 8577 |
func (x *XTEntryTarget) MarshalUnsafe(dst []byte) []byte { |
| 8578 |
if x.Name.Packed() { |
| 8579 |
size := x.SizeBytes() |
| 8580 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) |
| 8581 |
return dst[size:] |
| 8582 |
} |
| 8583 |
|
| 8584 |
return x.MarshalBytes(dst) |
| 8585 |
} |
| 8586 |
|
| 8587 |
|
| 8588 |
func (x *XTEntryTarget) UnmarshalUnsafe(src []byte) []byte { |
| 8589 |
if x.Name.Packed() { |
| 8590 |
size := x.SizeBytes() |
| 8591 |
gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) |
| 8592 |
return src[size:] |
| 8593 |
} |
| 8594 |
|
| 8595 |
return x.UnmarshalBytes(src) |
| 8596 |
} |
| 8597 |
|
| 8598 |
|
| 8599 |
|
| 8600 |
func (x *XTEntryTarget) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 8601 |
if !x.Name.Packed() { |
| 8602 |
|
| 8603 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 8604 |
x.MarshalBytes(buf) |
| 8605 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 8606 |
} |
| 8607 |
|
| 8608 |
|
| 8609 |
var buf []byte |
| 8610 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8611 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8612 |
hdr.Len = x.SizeBytes() |
| 8613 |
hdr.Cap = x.SizeBytes() |
| 8614 |
|
| 8615 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 8616 |
|
| 8617 |
|
| 8618 |
runtime.KeepAlive(x) |
| 8619 |
return length, err |
| 8620 |
} |
| 8621 |
|
| 8622 |
|
| 8623 |
|
| 8624 |
func (x *XTEntryTarget) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8625 |
return x.CopyOutN(cc, addr, x.SizeBytes()) |
| 8626 |
} |
| 8627 |
|
| 8628 |
|
| 8629 |
|
| 8630 |
func (x *XTEntryTarget) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8631 |
if !x.Name.Packed() { |
| 8632 |
|
| 8633 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 8634 |
length, err := cc.CopyInBytes(addr, buf) |
| 8635 |
|
| 8636 |
|
| 8637 |
x.UnmarshalBytes(buf) |
| 8638 |
return length, err |
| 8639 |
} |
| 8640 |
|
| 8641 |
|
| 8642 |
var buf []byte |
| 8643 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8644 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8645 |
hdr.Len = x.SizeBytes() |
| 8646 |
hdr.Cap = x.SizeBytes() |
| 8647 |
|
| 8648 |
length, err := cc.CopyInBytes(addr, buf) |
| 8649 |
|
| 8650 |
|
| 8651 |
runtime.KeepAlive(x) |
| 8652 |
return length, err |
| 8653 |
} |
| 8654 |
|
| 8655 |
|
| 8656 |
func (x *XTEntryTarget) WriteTo(writer io.Writer) (int64, error) { |
| 8657 |
if !x.Name.Packed() { |
| 8658 |
|
| 8659 |
buf := make([]byte, x.SizeBytes()) |
| 8660 |
x.MarshalBytes(buf) |
| 8661 |
length, err := writer.Write(buf) |
| 8662 |
return int64(length), err |
| 8663 |
} |
| 8664 |
|
| 8665 |
|
| 8666 |
var buf []byte |
| 8667 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8668 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8669 |
hdr.Len = x.SizeBytes() |
| 8670 |
hdr.Cap = x.SizeBytes() |
| 8671 |
|
| 8672 |
length, err := writer.Write(buf) |
| 8673 |
|
| 8674 |
|
| 8675 |
runtime.KeepAlive(x) |
| 8676 |
return int64(length), err |
| 8677 |
} |
| 8678 |
|
| 8679 |
|
| 8680 |
func (x *XTErrorTarget) SizeBytes() int { |
| 8681 |
return 0 + |
| 8682 |
(*XTEntryTarget)(nil).SizeBytes() + |
| 8683 |
(*ErrorName)(nil).SizeBytes() + |
| 8684 |
1*2 |
| 8685 |
} |
| 8686 |
|
| 8687 |
|
| 8688 |
func (x *XTErrorTarget) MarshalBytes(dst []byte) []byte { |
| 8689 |
dst = x.Target.MarshalUnsafe(dst) |
| 8690 |
dst = x.Name.MarshalUnsafe(dst) |
| 8691 |
|
| 8692 |
dst = dst[1*(2):] |
| 8693 |
return dst |
| 8694 |
} |
| 8695 |
|
| 8696 |
|
| 8697 |
func (x *XTErrorTarget) UnmarshalBytes(src []byte) []byte { |
| 8698 |
src = x.Target.UnmarshalUnsafe(src) |
| 8699 |
src = x.Name.UnmarshalUnsafe(src) |
| 8700 |
|
| 8701 |
src = src[1*(2):] |
| 8702 |
return src |
| 8703 |
} |
| 8704 |
|
| 8705 |
|
| 8706 |
|
| 8707 |
func (x *XTErrorTarget) Packed() bool { |
| 8708 |
return x.Name.Packed() && x.Target.Packed() |
| 8709 |
} |
| 8710 |
|
| 8711 |
|
| 8712 |
func (x *XTErrorTarget) MarshalUnsafe(dst []byte) []byte { |
| 8713 |
if x.Name.Packed() && x.Target.Packed() { |
| 8714 |
size := x.SizeBytes() |
| 8715 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) |
| 8716 |
return dst[size:] |
| 8717 |
} |
| 8718 |
|
| 8719 |
return x.MarshalBytes(dst) |
| 8720 |
} |
| 8721 |
|
| 8722 |
|
| 8723 |
func (x *XTErrorTarget) UnmarshalUnsafe(src []byte) []byte { |
| 8724 |
if x.Name.Packed() && x.Target.Packed() { |
| 8725 |
size := x.SizeBytes() |
| 8726 |
gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) |
| 8727 |
return src[size:] |
| 8728 |
} |
| 8729 |
|
| 8730 |
return x.UnmarshalBytes(src) |
| 8731 |
} |
| 8732 |
|
| 8733 |
|
| 8734 |
|
| 8735 |
func (x *XTErrorTarget) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 8736 |
if !x.Name.Packed() && x.Target.Packed() { |
| 8737 |
|
| 8738 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 8739 |
x.MarshalBytes(buf) |
| 8740 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 8741 |
} |
| 8742 |
|
| 8743 |
|
| 8744 |
var buf []byte |
| 8745 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8746 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8747 |
hdr.Len = x.SizeBytes() |
| 8748 |
hdr.Cap = x.SizeBytes() |
| 8749 |
|
| 8750 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 8751 |
|
| 8752 |
|
| 8753 |
runtime.KeepAlive(x) |
| 8754 |
return length, err |
| 8755 |
} |
| 8756 |
|
| 8757 |
|
| 8758 |
|
| 8759 |
func (x *XTErrorTarget) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8760 |
return x.CopyOutN(cc, addr, x.SizeBytes()) |
| 8761 |
} |
| 8762 |
|
| 8763 |
|
| 8764 |
|
| 8765 |
func (x *XTErrorTarget) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8766 |
if !x.Name.Packed() && x.Target.Packed() { |
| 8767 |
|
| 8768 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 8769 |
length, err := cc.CopyInBytes(addr, buf) |
| 8770 |
|
| 8771 |
|
| 8772 |
x.UnmarshalBytes(buf) |
| 8773 |
return length, err |
| 8774 |
} |
| 8775 |
|
| 8776 |
|
| 8777 |
var buf []byte |
| 8778 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8779 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8780 |
hdr.Len = x.SizeBytes() |
| 8781 |
hdr.Cap = x.SizeBytes() |
| 8782 |
|
| 8783 |
length, err := cc.CopyInBytes(addr, buf) |
| 8784 |
|
| 8785 |
|
| 8786 |
runtime.KeepAlive(x) |
| 8787 |
return length, err |
| 8788 |
} |
| 8789 |
|
| 8790 |
|
| 8791 |
func (x *XTErrorTarget) WriteTo(writer io.Writer) (int64, error) { |
| 8792 |
if !x.Name.Packed() && x.Target.Packed() { |
| 8793 |
|
| 8794 |
buf := make([]byte, x.SizeBytes()) |
| 8795 |
x.MarshalBytes(buf) |
| 8796 |
length, err := writer.Write(buf) |
| 8797 |
return int64(length), err |
| 8798 |
} |
| 8799 |
|
| 8800 |
|
| 8801 |
var buf []byte |
| 8802 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8803 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8804 |
hdr.Len = x.SizeBytes() |
| 8805 |
hdr.Cap = x.SizeBytes() |
| 8806 |
|
| 8807 |
length, err := writer.Write(buf) |
| 8808 |
|
| 8809 |
|
| 8810 |
runtime.KeepAlive(x) |
| 8811 |
return int64(length), err |
| 8812 |
} |
| 8813 |
|
| 8814 |
|
| 8815 |
func (x *XTGetRevision) SizeBytes() int { |
| 8816 |
return 1 + |
| 8817 |
(*ExtensionName)(nil).SizeBytes() |
| 8818 |
} |
| 8819 |
|
| 8820 |
|
| 8821 |
func (x *XTGetRevision) MarshalBytes(dst []byte) []byte { |
| 8822 |
dst = x.Name.MarshalUnsafe(dst) |
| 8823 |
dst[0] = byte(x.Revision) |
| 8824 |
dst = dst[1:] |
| 8825 |
return dst |
| 8826 |
} |
| 8827 |
|
| 8828 |
|
| 8829 |
func (x *XTGetRevision) UnmarshalBytes(src []byte) []byte { |
| 8830 |
src = x.Name.UnmarshalUnsafe(src) |
| 8831 |
x.Revision = uint8(src[0]) |
| 8832 |
src = src[1:] |
| 8833 |
return src |
| 8834 |
} |
| 8835 |
|
| 8836 |
|
| 8837 |
|
| 8838 |
func (x *XTGetRevision) Packed() bool { |
| 8839 |
return x.Name.Packed() |
| 8840 |
} |
| 8841 |
|
| 8842 |
|
| 8843 |
func (x *XTGetRevision) MarshalUnsafe(dst []byte) []byte { |
| 8844 |
if x.Name.Packed() { |
| 8845 |
size := x.SizeBytes() |
| 8846 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) |
| 8847 |
return dst[size:] |
| 8848 |
} |
| 8849 |
|
| 8850 |
return x.MarshalBytes(dst) |
| 8851 |
} |
| 8852 |
|
| 8853 |
|
| 8854 |
func (x *XTGetRevision) UnmarshalUnsafe(src []byte) []byte { |
| 8855 |
if x.Name.Packed() { |
| 8856 |
size := x.SizeBytes() |
| 8857 |
gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) |
| 8858 |
return src[size:] |
| 8859 |
} |
| 8860 |
|
| 8861 |
return x.UnmarshalBytes(src) |
| 8862 |
} |
| 8863 |
|
| 8864 |
|
| 8865 |
|
| 8866 |
func (x *XTGetRevision) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 8867 |
if !x.Name.Packed() { |
| 8868 |
|
| 8869 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 8870 |
x.MarshalBytes(buf) |
| 8871 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 8872 |
} |
| 8873 |
|
| 8874 |
|
| 8875 |
var buf []byte |
| 8876 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8877 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8878 |
hdr.Len = x.SizeBytes() |
| 8879 |
hdr.Cap = x.SizeBytes() |
| 8880 |
|
| 8881 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 8882 |
|
| 8883 |
|
| 8884 |
runtime.KeepAlive(x) |
| 8885 |
return length, err |
| 8886 |
} |
| 8887 |
|
| 8888 |
|
| 8889 |
|
| 8890 |
func (x *XTGetRevision) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8891 |
return x.CopyOutN(cc, addr, x.SizeBytes()) |
| 8892 |
} |
| 8893 |
|
| 8894 |
|
| 8895 |
|
| 8896 |
func (x *XTGetRevision) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 8897 |
if !x.Name.Packed() { |
| 8898 |
|
| 8899 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 8900 |
length, err := cc.CopyInBytes(addr, buf) |
| 8901 |
|
| 8902 |
|
| 8903 |
x.UnmarshalBytes(buf) |
| 8904 |
return length, err |
| 8905 |
} |
| 8906 |
|
| 8907 |
|
| 8908 |
var buf []byte |
| 8909 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8910 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8911 |
hdr.Len = x.SizeBytes() |
| 8912 |
hdr.Cap = x.SizeBytes() |
| 8913 |
|
| 8914 |
length, err := cc.CopyInBytes(addr, buf) |
| 8915 |
|
| 8916 |
|
| 8917 |
runtime.KeepAlive(x) |
| 8918 |
return length, err |
| 8919 |
} |
| 8920 |
|
| 8921 |
|
| 8922 |
func (x *XTGetRevision) WriteTo(writer io.Writer) (int64, error) { |
| 8923 |
if !x.Name.Packed() { |
| 8924 |
|
| 8925 |
buf := make([]byte, x.SizeBytes()) |
| 8926 |
x.MarshalBytes(buf) |
| 8927 |
length, err := writer.Write(buf) |
| 8928 |
return int64(length), err |
| 8929 |
} |
| 8930 |
|
| 8931 |
|
| 8932 |
var buf []byte |
| 8933 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 8934 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 8935 |
hdr.Len = x.SizeBytes() |
| 8936 |
hdr.Cap = x.SizeBytes() |
| 8937 |
|
| 8938 |
length, err := writer.Write(buf) |
| 8939 |
|
| 8940 |
|
| 8941 |
runtime.KeepAlive(x) |
| 8942 |
return int64(length), err |
| 8943 |
} |
| 8944 |
|
| 8945 |
|
| 8946 |
func (x *XTRedirectTarget) SizeBytes() int { |
| 8947 |
return 0 + |
| 8948 |
(*XTEntryTarget)(nil).SizeBytes() + |
| 8949 |
(*NfNATIPV4MultiRangeCompat)(nil).SizeBytes() + |
| 8950 |
1*4 |
| 8951 |
} |
| 8952 |
|
| 8953 |
|
| 8954 |
func (x *XTRedirectTarget) MarshalBytes(dst []byte) []byte { |
| 8955 |
dst = x.Target.MarshalUnsafe(dst) |
| 8956 |
dst = x.NfRange.MarshalUnsafe(dst) |
| 8957 |
|
| 8958 |
dst = dst[1*(4):] |
| 8959 |
return dst |
| 8960 |
} |
| 8961 |
|
| 8962 |
|
| 8963 |
func (x *XTRedirectTarget) UnmarshalBytes(src []byte) []byte { |
| 8964 |
src = x.Target.UnmarshalUnsafe(src) |
| 8965 |
src = x.NfRange.UnmarshalUnsafe(src) |
| 8966 |
|
| 8967 |
src = src[1*(4):] |
| 8968 |
return src |
| 8969 |
} |
| 8970 |
|
| 8971 |
|
| 8972 |
|
| 8973 |
func (x *XTRedirectTarget) Packed() bool { |
| 8974 |
return x.NfRange.Packed() && x.Target.Packed() |
| 8975 |
} |
| 8976 |
|
| 8977 |
|
| 8978 |
func (x *XTRedirectTarget) MarshalUnsafe(dst []byte) []byte { |
| 8979 |
if x.NfRange.Packed() && x.Target.Packed() { |
| 8980 |
size := x.SizeBytes() |
| 8981 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) |
| 8982 |
return dst[size:] |
| 8983 |
} |
| 8984 |
|
| 8985 |
return x.MarshalBytes(dst) |
| 8986 |
} |
| 8987 |
|
| 8988 |
|
| 8989 |
func (x *XTRedirectTarget) UnmarshalUnsafe(src []byte) []byte { |
| 8990 |
if x.NfRange.Packed() && x.Target.Packed() { |
| 8991 |
size := x.SizeBytes() |
| 8992 |
gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) |
| 8993 |
return src[size:] |
| 8994 |
} |
| 8995 |
|
| 8996 |
return x.UnmarshalBytes(src) |
| 8997 |
} |
| 8998 |
|
| 8999 |
|
| 9000 |
|
| 9001 |
func (x *XTRedirectTarget) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 9002 |
if !x.NfRange.Packed() && x.Target.Packed() { |
| 9003 |
|
| 9004 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 9005 |
x.MarshalBytes(buf) |
| 9006 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 9007 |
} |
| 9008 |
|
| 9009 |
|
| 9010 |
var buf []byte |
| 9011 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9012 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9013 |
hdr.Len = x.SizeBytes() |
| 9014 |
hdr.Cap = x.SizeBytes() |
| 9015 |
|
| 9016 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 9017 |
|
| 9018 |
|
| 9019 |
runtime.KeepAlive(x) |
| 9020 |
return length, err |
| 9021 |
} |
| 9022 |
|
| 9023 |
|
| 9024 |
|
| 9025 |
func (x *XTRedirectTarget) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9026 |
return x.CopyOutN(cc, addr, x.SizeBytes()) |
| 9027 |
} |
| 9028 |
|
| 9029 |
|
| 9030 |
|
| 9031 |
func (x *XTRedirectTarget) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9032 |
if !x.NfRange.Packed() && x.Target.Packed() { |
| 9033 |
|
| 9034 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 9035 |
length, err := cc.CopyInBytes(addr, buf) |
| 9036 |
|
| 9037 |
|
| 9038 |
x.UnmarshalBytes(buf) |
| 9039 |
return length, err |
| 9040 |
} |
| 9041 |
|
| 9042 |
|
| 9043 |
var buf []byte |
| 9044 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9045 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9046 |
hdr.Len = x.SizeBytes() |
| 9047 |
hdr.Cap = x.SizeBytes() |
| 9048 |
|
| 9049 |
length, err := cc.CopyInBytes(addr, buf) |
| 9050 |
|
| 9051 |
|
| 9052 |
runtime.KeepAlive(x) |
| 9053 |
return length, err |
| 9054 |
} |
| 9055 |
|
| 9056 |
|
| 9057 |
func (x *XTRedirectTarget) WriteTo(writer io.Writer) (int64, error) { |
| 9058 |
if !x.NfRange.Packed() && x.Target.Packed() { |
| 9059 |
|
| 9060 |
buf := make([]byte, x.SizeBytes()) |
| 9061 |
x.MarshalBytes(buf) |
| 9062 |
length, err := writer.Write(buf) |
| 9063 |
return int64(length), err |
| 9064 |
} |
| 9065 |
|
| 9066 |
|
| 9067 |
var buf []byte |
| 9068 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9069 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9070 |
hdr.Len = x.SizeBytes() |
| 9071 |
hdr.Cap = x.SizeBytes() |
| 9072 |
|
| 9073 |
length, err := writer.Write(buf) |
| 9074 |
|
| 9075 |
|
| 9076 |
runtime.KeepAlive(x) |
| 9077 |
return int64(length), err |
| 9078 |
} |
| 9079 |
|
| 9080 |
|
| 9081 |
func (x *XTSNATTarget) SizeBytes() int { |
| 9082 |
return 0 + |
| 9083 |
(*XTEntryTarget)(nil).SizeBytes() + |
| 9084 |
(*NfNATIPV4MultiRangeCompat)(nil).SizeBytes() + |
| 9085 |
1*4 |
| 9086 |
} |
| 9087 |
|
| 9088 |
|
| 9089 |
func (x *XTSNATTarget) MarshalBytes(dst []byte) []byte { |
| 9090 |
dst = x.Target.MarshalUnsafe(dst) |
| 9091 |
dst = x.NfRange.MarshalUnsafe(dst) |
| 9092 |
|
| 9093 |
dst = dst[1*(4):] |
| 9094 |
return dst |
| 9095 |
} |
| 9096 |
|
| 9097 |
|
| 9098 |
func (x *XTSNATTarget) UnmarshalBytes(src []byte) []byte { |
| 9099 |
src = x.Target.UnmarshalUnsafe(src) |
| 9100 |
src = x.NfRange.UnmarshalUnsafe(src) |
| 9101 |
|
| 9102 |
src = src[1*(4):] |
| 9103 |
return src |
| 9104 |
} |
| 9105 |
|
| 9106 |
|
| 9107 |
|
| 9108 |
func (x *XTSNATTarget) Packed() bool { |
| 9109 |
return x.NfRange.Packed() && x.Target.Packed() |
| 9110 |
} |
| 9111 |
|
| 9112 |
|
| 9113 |
func (x *XTSNATTarget) MarshalUnsafe(dst []byte) []byte { |
| 9114 |
if x.NfRange.Packed() && x.Target.Packed() { |
| 9115 |
size := x.SizeBytes() |
| 9116 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) |
| 9117 |
return dst[size:] |
| 9118 |
} |
| 9119 |
|
| 9120 |
return x.MarshalBytes(dst) |
| 9121 |
} |
| 9122 |
|
| 9123 |
|
| 9124 |
func (x *XTSNATTarget) UnmarshalUnsafe(src []byte) []byte { |
| 9125 |
if x.NfRange.Packed() && x.Target.Packed() { |
| 9126 |
size := x.SizeBytes() |
| 9127 |
gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) |
| 9128 |
return src[size:] |
| 9129 |
} |
| 9130 |
|
| 9131 |
return x.UnmarshalBytes(src) |
| 9132 |
} |
| 9133 |
|
| 9134 |
|
| 9135 |
|
| 9136 |
func (x *XTSNATTarget) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 9137 |
if !x.NfRange.Packed() && x.Target.Packed() { |
| 9138 |
|
| 9139 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 9140 |
x.MarshalBytes(buf) |
| 9141 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 9142 |
} |
| 9143 |
|
| 9144 |
|
| 9145 |
var buf []byte |
| 9146 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9147 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9148 |
hdr.Len = x.SizeBytes() |
| 9149 |
hdr.Cap = x.SizeBytes() |
| 9150 |
|
| 9151 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 9152 |
|
| 9153 |
|
| 9154 |
runtime.KeepAlive(x) |
| 9155 |
return length, err |
| 9156 |
} |
| 9157 |
|
| 9158 |
|
| 9159 |
|
| 9160 |
func (x *XTSNATTarget) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9161 |
return x.CopyOutN(cc, addr, x.SizeBytes()) |
| 9162 |
} |
| 9163 |
|
| 9164 |
|
| 9165 |
|
| 9166 |
func (x *XTSNATTarget) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9167 |
if !x.NfRange.Packed() && x.Target.Packed() { |
| 9168 |
|
| 9169 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 9170 |
length, err := cc.CopyInBytes(addr, buf) |
| 9171 |
|
| 9172 |
|
| 9173 |
x.UnmarshalBytes(buf) |
| 9174 |
return length, err |
| 9175 |
} |
| 9176 |
|
| 9177 |
|
| 9178 |
var buf []byte |
| 9179 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9180 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9181 |
hdr.Len = x.SizeBytes() |
| 9182 |
hdr.Cap = x.SizeBytes() |
| 9183 |
|
| 9184 |
length, err := cc.CopyInBytes(addr, buf) |
| 9185 |
|
| 9186 |
|
| 9187 |
runtime.KeepAlive(x) |
| 9188 |
return length, err |
| 9189 |
} |
| 9190 |
|
| 9191 |
|
| 9192 |
func (x *XTSNATTarget) WriteTo(writer io.Writer) (int64, error) { |
| 9193 |
if !x.NfRange.Packed() && x.Target.Packed() { |
| 9194 |
|
| 9195 |
buf := make([]byte, x.SizeBytes()) |
| 9196 |
x.MarshalBytes(buf) |
| 9197 |
length, err := writer.Write(buf) |
| 9198 |
return int64(length), err |
| 9199 |
} |
| 9200 |
|
| 9201 |
|
| 9202 |
var buf []byte |
| 9203 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9204 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9205 |
hdr.Len = x.SizeBytes() |
| 9206 |
hdr.Cap = x.SizeBytes() |
| 9207 |
|
| 9208 |
length, err := writer.Write(buf) |
| 9209 |
|
| 9210 |
|
| 9211 |
runtime.KeepAlive(x) |
| 9212 |
return int64(length), err |
| 9213 |
} |
| 9214 |
|
| 9215 |
|
| 9216 |
func (x *XTStandardTarget) SizeBytes() int { |
| 9217 |
return 4 + |
| 9218 |
(*XTEntryTarget)(nil).SizeBytes() + |
| 9219 |
1*4 |
| 9220 |
} |
| 9221 |
|
| 9222 |
|
| 9223 |
func (x *XTStandardTarget) MarshalBytes(dst []byte) []byte { |
| 9224 |
dst = x.Target.MarshalUnsafe(dst) |
| 9225 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(x.Verdict)) |
| 9226 |
dst = dst[4:] |
| 9227 |
|
| 9228 |
dst = dst[1*(4):] |
| 9229 |
return dst |
| 9230 |
} |
| 9231 |
|
| 9232 |
|
| 9233 |
func (x *XTStandardTarget) UnmarshalBytes(src []byte) []byte { |
| 9234 |
src = x.Target.UnmarshalUnsafe(src) |
| 9235 |
x.Verdict = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 9236 |
src = src[4:] |
| 9237 |
|
| 9238 |
src = src[1*(4):] |
| 9239 |
return src |
| 9240 |
} |
| 9241 |
|
| 9242 |
|
| 9243 |
|
| 9244 |
func (x *XTStandardTarget) Packed() bool { |
| 9245 |
return x.Target.Packed() |
| 9246 |
} |
| 9247 |
|
| 9248 |
|
| 9249 |
func (x *XTStandardTarget) MarshalUnsafe(dst []byte) []byte { |
| 9250 |
if x.Target.Packed() { |
| 9251 |
size := x.SizeBytes() |
| 9252 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) |
| 9253 |
return dst[size:] |
| 9254 |
} |
| 9255 |
|
| 9256 |
return x.MarshalBytes(dst) |
| 9257 |
} |
| 9258 |
|
| 9259 |
|
| 9260 |
func (x *XTStandardTarget) UnmarshalUnsafe(src []byte) []byte { |
| 9261 |
if x.Target.Packed() { |
| 9262 |
size := x.SizeBytes() |
| 9263 |
gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) |
| 9264 |
return src[size:] |
| 9265 |
} |
| 9266 |
|
| 9267 |
return x.UnmarshalBytes(src) |
| 9268 |
} |
| 9269 |
|
| 9270 |
|
| 9271 |
|
| 9272 |
func (x *XTStandardTarget) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 9273 |
if !x.Target.Packed() { |
| 9274 |
|
| 9275 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 9276 |
x.MarshalBytes(buf) |
| 9277 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 9278 |
} |
| 9279 |
|
| 9280 |
|
| 9281 |
var buf []byte |
| 9282 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9283 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9284 |
hdr.Len = x.SizeBytes() |
| 9285 |
hdr.Cap = x.SizeBytes() |
| 9286 |
|
| 9287 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 9288 |
|
| 9289 |
|
| 9290 |
runtime.KeepAlive(x) |
| 9291 |
return length, err |
| 9292 |
} |
| 9293 |
|
| 9294 |
|
| 9295 |
|
| 9296 |
func (x *XTStandardTarget) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9297 |
return x.CopyOutN(cc, addr, x.SizeBytes()) |
| 9298 |
} |
| 9299 |
|
| 9300 |
|
| 9301 |
|
| 9302 |
func (x *XTStandardTarget) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9303 |
if !x.Target.Packed() { |
| 9304 |
|
| 9305 |
buf := cc.CopyScratchBuffer(x.SizeBytes()) |
| 9306 |
length, err := cc.CopyInBytes(addr, buf) |
| 9307 |
|
| 9308 |
|
| 9309 |
x.UnmarshalBytes(buf) |
| 9310 |
return length, err |
| 9311 |
} |
| 9312 |
|
| 9313 |
|
| 9314 |
var buf []byte |
| 9315 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9316 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9317 |
hdr.Len = x.SizeBytes() |
| 9318 |
hdr.Cap = x.SizeBytes() |
| 9319 |
|
| 9320 |
length, err := cc.CopyInBytes(addr, buf) |
| 9321 |
|
| 9322 |
|
| 9323 |
runtime.KeepAlive(x) |
| 9324 |
return length, err |
| 9325 |
} |
| 9326 |
|
| 9327 |
|
| 9328 |
func (x *XTStandardTarget) WriteTo(writer io.Writer) (int64, error) { |
| 9329 |
if !x.Target.Packed() { |
| 9330 |
|
| 9331 |
buf := make([]byte, x.SizeBytes()) |
| 9332 |
x.MarshalBytes(buf) |
| 9333 |
length, err := writer.Write(buf) |
| 9334 |
return int64(length), err |
| 9335 |
} |
| 9336 |
|
| 9337 |
|
| 9338 |
var buf []byte |
| 9339 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9340 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9341 |
hdr.Len = x.SizeBytes() |
| 9342 |
hdr.Cap = x.SizeBytes() |
| 9343 |
|
| 9344 |
length, err := writer.Write(buf) |
| 9345 |
|
| 9346 |
|
| 9347 |
runtime.KeepAlive(x) |
| 9348 |
return int64(length), err |
| 9349 |
} |
| 9350 |
|
| 9351 |
|
| 9352 |
func (x *XTTCP) SizeBytes() int { |
| 9353 |
return 12 |
| 9354 |
} |
| 9355 |
|
| 9356 |
|
| 9357 |
func (x *XTTCP) MarshalBytes(dst []byte) []byte { |
| 9358 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.SourcePortStart)) |
| 9359 |
dst = dst[2:] |
| 9360 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.SourcePortEnd)) |
| 9361 |
dst = dst[2:] |
| 9362 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.DestinationPortStart)) |
| 9363 |
dst = dst[2:] |
| 9364 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.DestinationPortEnd)) |
| 9365 |
dst = dst[2:] |
| 9366 |
dst[0] = byte(x.Option) |
| 9367 |
dst = dst[1:] |
| 9368 |
dst[0] = byte(x.FlagMask) |
| 9369 |
dst = dst[1:] |
| 9370 |
dst[0] = byte(x.FlagCompare) |
| 9371 |
dst = dst[1:] |
| 9372 |
dst[0] = byte(x.InverseFlags) |
| 9373 |
dst = dst[1:] |
| 9374 |
return dst |
| 9375 |
} |
| 9376 |
|
| 9377 |
|
| 9378 |
func (x *XTTCP) UnmarshalBytes(src []byte) []byte { |
| 9379 |
x.SourcePortStart = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9380 |
src = src[2:] |
| 9381 |
x.SourcePortEnd = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9382 |
src = src[2:] |
| 9383 |
x.DestinationPortStart = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9384 |
src = src[2:] |
| 9385 |
x.DestinationPortEnd = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9386 |
src = src[2:] |
| 9387 |
x.Option = uint8(src[0]) |
| 9388 |
src = src[1:] |
| 9389 |
x.FlagMask = uint8(src[0]) |
| 9390 |
src = src[1:] |
| 9391 |
x.FlagCompare = uint8(src[0]) |
| 9392 |
src = src[1:] |
| 9393 |
x.InverseFlags = uint8(src[0]) |
| 9394 |
src = src[1:] |
| 9395 |
return src |
| 9396 |
} |
| 9397 |
|
| 9398 |
|
| 9399 |
|
| 9400 |
func (x *XTTCP) Packed() bool { |
| 9401 |
return true |
| 9402 |
} |
| 9403 |
|
| 9404 |
|
| 9405 |
func (x *XTTCP) MarshalUnsafe(dst []byte) []byte { |
| 9406 |
size := x.SizeBytes() |
| 9407 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) |
| 9408 |
return dst[size:] |
| 9409 |
} |
| 9410 |
|
| 9411 |
|
| 9412 |
func (x *XTTCP) UnmarshalUnsafe(src []byte) []byte { |
| 9413 |
size := x.SizeBytes() |
| 9414 |
gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) |
| 9415 |
return src[size:] |
| 9416 |
} |
| 9417 |
|
| 9418 |
|
| 9419 |
|
| 9420 |
func (x *XTTCP) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 9421 |
|
| 9422 |
var buf []byte |
| 9423 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9424 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9425 |
hdr.Len = x.SizeBytes() |
| 9426 |
hdr.Cap = x.SizeBytes() |
| 9427 |
|
| 9428 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 9429 |
|
| 9430 |
|
| 9431 |
runtime.KeepAlive(x) |
| 9432 |
return length, err |
| 9433 |
} |
| 9434 |
|
| 9435 |
|
| 9436 |
|
| 9437 |
func (x *XTTCP) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9438 |
return x.CopyOutN(cc, addr, x.SizeBytes()) |
| 9439 |
} |
| 9440 |
|
| 9441 |
|
| 9442 |
|
| 9443 |
func (x *XTTCP) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9444 |
|
| 9445 |
var buf []byte |
| 9446 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9447 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9448 |
hdr.Len = x.SizeBytes() |
| 9449 |
hdr.Cap = x.SizeBytes() |
| 9450 |
|
| 9451 |
length, err := cc.CopyInBytes(addr, buf) |
| 9452 |
|
| 9453 |
|
| 9454 |
runtime.KeepAlive(x) |
| 9455 |
return length, err |
| 9456 |
} |
| 9457 |
|
| 9458 |
|
| 9459 |
func (x *XTTCP) WriteTo(writer io.Writer) (int64, error) { |
| 9460 |
|
| 9461 |
var buf []byte |
| 9462 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9463 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9464 |
hdr.Len = x.SizeBytes() |
| 9465 |
hdr.Cap = x.SizeBytes() |
| 9466 |
|
| 9467 |
length, err := writer.Write(buf) |
| 9468 |
|
| 9469 |
|
| 9470 |
runtime.KeepAlive(x) |
| 9471 |
return int64(length), err |
| 9472 |
} |
| 9473 |
|
| 9474 |
|
| 9475 |
func (x *XTUDP) SizeBytes() int { |
| 9476 |
return 10 |
| 9477 |
} |
| 9478 |
|
| 9479 |
|
| 9480 |
func (x *XTUDP) MarshalBytes(dst []byte) []byte { |
| 9481 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.SourcePortStart)) |
| 9482 |
dst = dst[2:] |
| 9483 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.SourcePortEnd)) |
| 9484 |
dst = dst[2:] |
| 9485 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.DestinationPortStart)) |
| 9486 |
dst = dst[2:] |
| 9487 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.DestinationPortEnd)) |
| 9488 |
dst = dst[2:] |
| 9489 |
dst[0] = byte(x.InverseFlags) |
| 9490 |
dst = dst[1:] |
| 9491 |
|
| 9492 |
dst = dst[1:] |
| 9493 |
return dst |
| 9494 |
} |
| 9495 |
|
| 9496 |
|
| 9497 |
func (x *XTUDP) UnmarshalBytes(src []byte) []byte { |
| 9498 |
x.SourcePortStart = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9499 |
src = src[2:] |
| 9500 |
x.SourcePortEnd = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9501 |
src = src[2:] |
| 9502 |
x.DestinationPortStart = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9503 |
src = src[2:] |
| 9504 |
x.DestinationPortEnd = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9505 |
src = src[2:] |
| 9506 |
x.InverseFlags = uint8(src[0]) |
| 9507 |
src = src[1:] |
| 9508 |
|
| 9509 |
src = src[1:] |
| 9510 |
return src |
| 9511 |
} |
| 9512 |
|
| 9513 |
|
| 9514 |
|
| 9515 |
func (x *XTUDP) Packed() bool { |
| 9516 |
return true |
| 9517 |
} |
| 9518 |
|
| 9519 |
|
| 9520 |
func (x *XTUDP) MarshalUnsafe(dst []byte) []byte { |
| 9521 |
size := x.SizeBytes() |
| 9522 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) |
| 9523 |
return dst[size:] |
| 9524 |
} |
| 9525 |
|
| 9526 |
|
| 9527 |
func (x *XTUDP) UnmarshalUnsafe(src []byte) []byte { |
| 9528 |
size := x.SizeBytes() |
| 9529 |
gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) |
| 9530 |
return src[size:] |
| 9531 |
} |
| 9532 |
|
| 9533 |
|
| 9534 |
|
| 9535 |
func (x *XTUDP) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 9536 |
|
| 9537 |
var buf []byte |
| 9538 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9539 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9540 |
hdr.Len = x.SizeBytes() |
| 9541 |
hdr.Cap = x.SizeBytes() |
| 9542 |
|
| 9543 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 9544 |
|
| 9545 |
|
| 9546 |
runtime.KeepAlive(x) |
| 9547 |
return length, err |
| 9548 |
} |
| 9549 |
|
| 9550 |
|
| 9551 |
|
| 9552 |
func (x *XTUDP) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9553 |
return x.CopyOutN(cc, addr, x.SizeBytes()) |
| 9554 |
} |
| 9555 |
|
| 9556 |
|
| 9557 |
|
| 9558 |
func (x *XTUDP) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9559 |
|
| 9560 |
var buf []byte |
| 9561 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9562 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9563 |
hdr.Len = x.SizeBytes() |
| 9564 |
hdr.Cap = x.SizeBytes() |
| 9565 |
|
| 9566 |
length, err := cc.CopyInBytes(addr, buf) |
| 9567 |
|
| 9568 |
|
| 9569 |
runtime.KeepAlive(x) |
| 9570 |
return length, err |
| 9571 |
} |
| 9572 |
|
| 9573 |
|
| 9574 |
func (x *XTUDP) WriteTo(writer io.Writer) (int64, error) { |
| 9575 |
|
| 9576 |
var buf []byte |
| 9577 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9578 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) |
| 9579 |
hdr.Len = x.SizeBytes() |
| 9580 |
hdr.Cap = x.SizeBytes() |
| 9581 |
|
| 9582 |
length, err := writer.Write(buf) |
| 9583 |
|
| 9584 |
|
| 9585 |
runtime.KeepAlive(x) |
| 9586 |
return int64(length), err |
| 9587 |
} |
| 9588 |
|
| 9589 |
|
| 9590 |
func (i *IP6TEntry) SizeBytes() int { |
| 9591 |
return 12 + |
| 9592 |
(*IP6TIP)(nil).SizeBytes() + |
| 9593 |
1*4 + |
| 9594 |
(*XTCounters)(nil).SizeBytes() |
| 9595 |
} |
| 9596 |
|
| 9597 |
|
| 9598 |
func (i *IP6TEntry) MarshalBytes(dst []byte) []byte { |
| 9599 |
dst = i.IPv6.MarshalUnsafe(dst) |
| 9600 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NFCache)) |
| 9601 |
dst = dst[4:] |
| 9602 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.TargetOffset)) |
| 9603 |
dst = dst[2:] |
| 9604 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.NextOffset)) |
| 9605 |
dst = dst[2:] |
| 9606 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Comeback)) |
| 9607 |
dst = dst[4:] |
| 9608 |
|
| 9609 |
dst = dst[1*(4):] |
| 9610 |
dst = i.Counters.MarshalUnsafe(dst) |
| 9611 |
return dst |
| 9612 |
} |
| 9613 |
|
| 9614 |
|
| 9615 |
func (i *IP6TEntry) UnmarshalBytes(src []byte) []byte { |
| 9616 |
src = i.IPv6.UnmarshalUnsafe(src) |
| 9617 |
i.NFCache = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 9618 |
src = src[4:] |
| 9619 |
i.TargetOffset = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9620 |
src = src[2:] |
| 9621 |
i.NextOffset = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9622 |
src = src[2:] |
| 9623 |
i.Comeback = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 9624 |
src = src[4:] |
| 9625 |
|
| 9626 |
src = src[1*(4):] |
| 9627 |
src = i.Counters.UnmarshalUnsafe(src) |
| 9628 |
return src |
| 9629 |
} |
| 9630 |
|
| 9631 |
|
| 9632 |
|
| 9633 |
func (i *IP6TEntry) Packed() bool { |
| 9634 |
return i.Counters.Packed() && i.IPv6.Packed() |
| 9635 |
} |
| 9636 |
|
| 9637 |
|
| 9638 |
func (i *IP6TEntry) MarshalUnsafe(dst []byte) []byte { |
| 9639 |
if i.Counters.Packed() && i.IPv6.Packed() { |
| 9640 |
size := i.SizeBytes() |
| 9641 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 9642 |
return dst[size:] |
| 9643 |
} |
| 9644 |
|
| 9645 |
return i.MarshalBytes(dst) |
| 9646 |
} |
| 9647 |
|
| 9648 |
|
| 9649 |
func (i *IP6TEntry) UnmarshalUnsafe(src []byte) []byte { |
| 9650 |
if i.Counters.Packed() && i.IPv6.Packed() { |
| 9651 |
size := i.SizeBytes() |
| 9652 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 9653 |
return src[size:] |
| 9654 |
} |
| 9655 |
|
| 9656 |
return i.UnmarshalBytes(src) |
| 9657 |
} |
| 9658 |
|
| 9659 |
|
| 9660 |
|
| 9661 |
func (i *IP6TEntry) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 9662 |
if !i.Counters.Packed() && i.IPv6.Packed() { |
| 9663 |
|
| 9664 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 9665 |
i.MarshalBytes(buf) |
| 9666 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 9667 |
} |
| 9668 |
|
| 9669 |
|
| 9670 |
var buf []byte |
| 9671 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9672 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 9673 |
hdr.Len = i.SizeBytes() |
| 9674 |
hdr.Cap = i.SizeBytes() |
| 9675 |
|
| 9676 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 9677 |
|
| 9678 |
|
| 9679 |
runtime.KeepAlive(i) |
| 9680 |
return length, err |
| 9681 |
} |
| 9682 |
|
| 9683 |
|
| 9684 |
|
| 9685 |
func (i *IP6TEntry) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9686 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 9687 |
} |
| 9688 |
|
| 9689 |
|
| 9690 |
|
| 9691 |
func (i *IP6TEntry) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9692 |
if !i.Counters.Packed() && i.IPv6.Packed() { |
| 9693 |
|
| 9694 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 9695 |
length, err := cc.CopyInBytes(addr, buf) |
| 9696 |
|
| 9697 |
|
| 9698 |
i.UnmarshalBytes(buf) |
| 9699 |
return length, err |
| 9700 |
} |
| 9701 |
|
| 9702 |
|
| 9703 |
var buf []byte |
| 9704 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9705 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 9706 |
hdr.Len = i.SizeBytes() |
| 9707 |
hdr.Cap = i.SizeBytes() |
| 9708 |
|
| 9709 |
length, err := cc.CopyInBytes(addr, buf) |
| 9710 |
|
| 9711 |
|
| 9712 |
runtime.KeepAlive(i) |
| 9713 |
return length, err |
| 9714 |
} |
| 9715 |
|
| 9716 |
|
| 9717 |
func (i *IP6TEntry) WriteTo(writer io.Writer) (int64, error) { |
| 9718 |
if !i.Counters.Packed() && i.IPv6.Packed() { |
| 9719 |
|
| 9720 |
buf := make([]byte, i.SizeBytes()) |
| 9721 |
i.MarshalBytes(buf) |
| 9722 |
length, err := writer.Write(buf) |
| 9723 |
return int64(length), err |
| 9724 |
} |
| 9725 |
|
| 9726 |
|
| 9727 |
var buf []byte |
| 9728 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9729 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 9730 |
hdr.Len = i.SizeBytes() |
| 9731 |
hdr.Cap = i.SizeBytes() |
| 9732 |
|
| 9733 |
length, err := writer.Write(buf) |
| 9734 |
|
| 9735 |
|
| 9736 |
runtime.KeepAlive(i) |
| 9737 |
return int64(length), err |
| 9738 |
} |
| 9739 |
|
| 9740 |
|
| 9741 |
func (i *IP6TIP) SizeBytes() int { |
| 9742 |
return 5 + |
| 9743 |
(*Inet6Addr)(nil).SizeBytes() + |
| 9744 |
(*Inet6Addr)(nil).SizeBytes() + |
| 9745 |
(*Inet6Addr)(nil).SizeBytes() + |
| 9746 |
(*Inet6Addr)(nil).SizeBytes() + |
| 9747 |
1*IFNAMSIZ + |
| 9748 |
1*IFNAMSIZ + |
| 9749 |
1*IFNAMSIZ + |
| 9750 |
1*IFNAMSIZ + |
| 9751 |
1*3 |
| 9752 |
} |
| 9753 |
|
| 9754 |
|
| 9755 |
func (i *IP6TIP) MarshalBytes(dst []byte) []byte { |
| 9756 |
dst = i.Src.MarshalUnsafe(dst) |
| 9757 |
dst = i.Dst.MarshalUnsafe(dst) |
| 9758 |
dst = i.SrcMask.MarshalUnsafe(dst) |
| 9759 |
dst = i.DstMask.MarshalUnsafe(dst) |
| 9760 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 9761 |
dst[0] = byte(i.InputInterface[idx]) |
| 9762 |
dst = dst[1:] |
| 9763 |
} |
| 9764 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 9765 |
dst[0] = byte(i.OutputInterface[idx]) |
| 9766 |
dst = dst[1:] |
| 9767 |
} |
| 9768 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 9769 |
dst[0] = byte(i.InputInterfaceMask[idx]) |
| 9770 |
dst = dst[1:] |
| 9771 |
} |
| 9772 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 9773 |
dst[0] = byte(i.OutputInterfaceMask[idx]) |
| 9774 |
dst = dst[1:] |
| 9775 |
} |
| 9776 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.Protocol)) |
| 9777 |
dst = dst[2:] |
| 9778 |
dst[0] = byte(i.TOS) |
| 9779 |
dst = dst[1:] |
| 9780 |
dst[0] = byte(i.Flags) |
| 9781 |
dst = dst[1:] |
| 9782 |
dst[0] = byte(i.InverseFlags) |
| 9783 |
dst = dst[1:] |
| 9784 |
|
| 9785 |
dst = dst[1*(3):] |
| 9786 |
return dst |
| 9787 |
} |
| 9788 |
|
| 9789 |
|
| 9790 |
func (i *IP6TIP) UnmarshalBytes(src []byte) []byte { |
| 9791 |
src = i.Src.UnmarshalUnsafe(src) |
| 9792 |
src = i.Dst.UnmarshalUnsafe(src) |
| 9793 |
src = i.SrcMask.UnmarshalUnsafe(src) |
| 9794 |
src = i.DstMask.UnmarshalUnsafe(src) |
| 9795 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 9796 |
i.InputInterface[idx] = src[0] |
| 9797 |
src = src[1:] |
| 9798 |
} |
| 9799 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 9800 |
i.OutputInterface[idx] = src[0] |
| 9801 |
src = src[1:] |
| 9802 |
} |
| 9803 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 9804 |
i.InputInterfaceMask[idx] = src[0] |
| 9805 |
src = src[1:] |
| 9806 |
} |
| 9807 |
for idx := 0; idx < IFNAMSIZ; idx++ { |
| 9808 |
i.OutputInterfaceMask[idx] = src[0] |
| 9809 |
src = src[1:] |
| 9810 |
} |
| 9811 |
i.Protocol = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 9812 |
src = src[2:] |
| 9813 |
i.TOS = uint8(src[0]) |
| 9814 |
src = src[1:] |
| 9815 |
i.Flags = uint8(src[0]) |
| 9816 |
src = src[1:] |
| 9817 |
i.InverseFlags = uint8(src[0]) |
| 9818 |
src = src[1:] |
| 9819 |
|
| 9820 |
src = src[1*(3):] |
| 9821 |
return src |
| 9822 |
} |
| 9823 |
|
| 9824 |
|
| 9825 |
|
| 9826 |
func (i *IP6TIP) Packed() bool { |
| 9827 |
return i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() |
| 9828 |
} |
| 9829 |
|
| 9830 |
|
| 9831 |
func (i *IP6TIP) MarshalUnsafe(dst []byte) []byte { |
| 9832 |
if i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { |
| 9833 |
size := i.SizeBytes() |
| 9834 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 9835 |
return dst[size:] |
| 9836 |
} |
| 9837 |
|
| 9838 |
return i.MarshalBytes(dst) |
| 9839 |
} |
| 9840 |
|
| 9841 |
|
| 9842 |
func (i *IP6TIP) UnmarshalUnsafe(src []byte) []byte { |
| 9843 |
if i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { |
| 9844 |
size := i.SizeBytes() |
| 9845 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 9846 |
return src[size:] |
| 9847 |
} |
| 9848 |
|
| 9849 |
return i.UnmarshalBytes(src) |
| 9850 |
} |
| 9851 |
|
| 9852 |
|
| 9853 |
|
| 9854 |
func (i *IP6TIP) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 9855 |
if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { |
| 9856 |
|
| 9857 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 9858 |
i.MarshalBytes(buf) |
| 9859 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 9860 |
} |
| 9861 |
|
| 9862 |
|
| 9863 |
var buf []byte |
| 9864 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9865 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 9866 |
hdr.Len = i.SizeBytes() |
| 9867 |
hdr.Cap = i.SizeBytes() |
| 9868 |
|
| 9869 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 9870 |
|
| 9871 |
|
| 9872 |
runtime.KeepAlive(i) |
| 9873 |
return length, err |
| 9874 |
} |
| 9875 |
|
| 9876 |
|
| 9877 |
|
| 9878 |
func (i *IP6TIP) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9879 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 9880 |
} |
| 9881 |
|
| 9882 |
|
| 9883 |
|
| 9884 |
func (i *IP6TIP) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 9885 |
if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { |
| 9886 |
|
| 9887 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 9888 |
length, err := cc.CopyInBytes(addr, buf) |
| 9889 |
|
| 9890 |
|
| 9891 |
i.UnmarshalBytes(buf) |
| 9892 |
return length, err |
| 9893 |
} |
| 9894 |
|
| 9895 |
|
| 9896 |
var buf []byte |
| 9897 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9898 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 9899 |
hdr.Len = i.SizeBytes() |
| 9900 |
hdr.Cap = i.SizeBytes() |
| 9901 |
|
| 9902 |
length, err := cc.CopyInBytes(addr, buf) |
| 9903 |
|
| 9904 |
|
| 9905 |
runtime.KeepAlive(i) |
| 9906 |
return length, err |
| 9907 |
} |
| 9908 |
|
| 9909 |
|
| 9910 |
func (i *IP6TIP) WriteTo(writer io.Writer) (int64, error) { |
| 9911 |
if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { |
| 9912 |
|
| 9913 |
buf := make([]byte, i.SizeBytes()) |
| 9914 |
i.MarshalBytes(buf) |
| 9915 |
length, err := writer.Write(buf) |
| 9916 |
return int64(length), err |
| 9917 |
} |
| 9918 |
|
| 9919 |
|
| 9920 |
var buf []byte |
| 9921 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 9922 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 9923 |
hdr.Len = i.SizeBytes() |
| 9924 |
hdr.Cap = i.SizeBytes() |
| 9925 |
|
| 9926 |
length, err := writer.Write(buf) |
| 9927 |
|
| 9928 |
|
| 9929 |
runtime.KeepAlive(i) |
| 9930 |
return int64(length), err |
| 9931 |
} |
| 9932 |
|
| 9933 |
|
| 9934 |
func (i *IP6TReplace) SizeBytes() int { |
| 9935 |
return 24 + |
| 9936 |
(*TableName)(nil).SizeBytes() + |
| 9937 |
4*NF_INET_NUMHOOKS + |
| 9938 |
4*NF_INET_NUMHOOKS |
| 9939 |
} |
| 9940 |
|
| 9941 |
|
| 9942 |
func (i *IP6TReplace) MarshalBytes(dst []byte) []byte { |
| 9943 |
dst = i.Name.MarshalUnsafe(dst) |
| 9944 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.ValidHooks)) |
| 9945 |
dst = dst[4:] |
| 9946 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NumEntries)) |
| 9947 |
dst = dst[4:] |
| 9948 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Size)) |
| 9949 |
dst = dst[4:] |
| 9950 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 9951 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.HookEntry[idx])) |
| 9952 |
dst = dst[4:] |
| 9953 |
} |
| 9954 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 9955 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Underflow[idx])) |
| 9956 |
dst = dst[4:] |
| 9957 |
} |
| 9958 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NumCounters)) |
| 9959 |
dst = dst[4:] |
| 9960 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Counters)) |
| 9961 |
dst = dst[8:] |
| 9962 |
return dst |
| 9963 |
} |
| 9964 |
|
| 9965 |
|
| 9966 |
func (i *IP6TReplace) UnmarshalBytes(src []byte) []byte { |
| 9967 |
src = i.Name.UnmarshalUnsafe(src) |
| 9968 |
i.ValidHooks = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 9969 |
src = src[4:] |
| 9970 |
i.NumEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 9971 |
src = src[4:] |
| 9972 |
i.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 9973 |
src = src[4:] |
| 9974 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 9975 |
i.HookEntry[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 9976 |
src = src[4:] |
| 9977 |
} |
| 9978 |
for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { |
| 9979 |
i.Underflow[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 9980 |
src = src[4:] |
| 9981 |
} |
| 9982 |
i.NumCounters = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 9983 |
src = src[4:] |
| 9984 |
i.Counters = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 9985 |
src = src[8:] |
| 9986 |
return src |
| 9987 |
} |
| 9988 |
|
| 9989 |
|
| 9990 |
|
| 9991 |
func (i *IP6TReplace) Packed() bool { |
| 9992 |
return i.Name.Packed() |
| 9993 |
} |
| 9994 |
|
| 9995 |
|
| 9996 |
func (i *IP6TReplace) MarshalUnsafe(dst []byte) []byte { |
| 9997 |
if i.Name.Packed() { |
| 9998 |
size := i.SizeBytes() |
| 9999 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 10000 |
return dst[size:] |
| 10001 |
} |
| 10002 |
|
| 10003 |
return i.MarshalBytes(dst) |
| 10004 |
} |
| 10005 |
|
| 10006 |
|
| 10007 |
func (i *IP6TReplace) UnmarshalUnsafe(src []byte) []byte { |
| 10008 |
if i.Name.Packed() { |
| 10009 |
size := i.SizeBytes() |
| 10010 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 10011 |
return src[size:] |
| 10012 |
} |
| 10013 |
|
| 10014 |
return i.UnmarshalBytes(src) |
| 10015 |
} |
| 10016 |
|
| 10017 |
|
| 10018 |
|
| 10019 |
func (i *IP6TReplace) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 10020 |
if !i.Name.Packed() { |
| 10021 |
|
| 10022 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 10023 |
i.MarshalBytes(buf) |
| 10024 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 10025 |
} |
| 10026 |
|
| 10027 |
|
| 10028 |
var buf []byte |
| 10029 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10030 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 10031 |
hdr.Len = i.SizeBytes() |
| 10032 |
hdr.Cap = i.SizeBytes() |
| 10033 |
|
| 10034 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 10035 |
|
| 10036 |
|
| 10037 |
runtime.KeepAlive(i) |
| 10038 |
return length, err |
| 10039 |
} |
| 10040 |
|
| 10041 |
|
| 10042 |
|
| 10043 |
func (i *IP6TReplace) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10044 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 10045 |
} |
| 10046 |
|
| 10047 |
|
| 10048 |
|
| 10049 |
func (i *IP6TReplace) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10050 |
if !i.Name.Packed() { |
| 10051 |
|
| 10052 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 10053 |
length, err := cc.CopyInBytes(addr, buf) |
| 10054 |
|
| 10055 |
|
| 10056 |
i.UnmarshalBytes(buf) |
| 10057 |
return length, err |
| 10058 |
} |
| 10059 |
|
| 10060 |
|
| 10061 |
var buf []byte |
| 10062 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10063 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 10064 |
hdr.Len = i.SizeBytes() |
| 10065 |
hdr.Cap = i.SizeBytes() |
| 10066 |
|
| 10067 |
length, err := cc.CopyInBytes(addr, buf) |
| 10068 |
|
| 10069 |
|
| 10070 |
runtime.KeepAlive(i) |
| 10071 |
return length, err |
| 10072 |
} |
| 10073 |
|
| 10074 |
|
| 10075 |
func (i *IP6TReplace) WriteTo(writer io.Writer) (int64, error) { |
| 10076 |
if !i.Name.Packed() { |
| 10077 |
|
| 10078 |
buf := make([]byte, i.SizeBytes()) |
| 10079 |
i.MarshalBytes(buf) |
| 10080 |
length, err := writer.Write(buf) |
| 10081 |
return int64(length), err |
| 10082 |
} |
| 10083 |
|
| 10084 |
|
| 10085 |
var buf []byte |
| 10086 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10087 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 10088 |
hdr.Len = i.SizeBytes() |
| 10089 |
hdr.Cap = i.SizeBytes() |
| 10090 |
|
| 10091 |
length, err := writer.Write(buf) |
| 10092 |
|
| 10093 |
|
| 10094 |
runtime.KeepAlive(i) |
| 10095 |
return int64(length), err |
| 10096 |
} |
| 10097 |
|
| 10098 |
|
| 10099 |
|
| 10100 |
func (ke *KernelIP6TEntry) Packed() bool { |
| 10101 |
|
| 10102 |
return false |
| 10103 |
} |
| 10104 |
|
| 10105 |
|
| 10106 |
func (ke *KernelIP6TEntry) MarshalUnsafe(dst []byte) []byte { |
| 10107 |
|
| 10108 |
return ke.MarshalBytes(dst) |
| 10109 |
} |
| 10110 |
|
| 10111 |
|
| 10112 |
func (ke *KernelIP6TEntry) UnmarshalUnsafe(src []byte) []byte { |
| 10113 |
|
| 10114 |
return ke.UnmarshalBytes(src) |
| 10115 |
} |
| 10116 |
|
| 10117 |
|
| 10118 |
|
| 10119 |
func (ke *KernelIP6TEntry) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 10120 |
|
| 10121 |
buf := cc.CopyScratchBuffer(ke.SizeBytes()) |
| 10122 |
ke.MarshalBytes(buf) |
| 10123 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 10124 |
} |
| 10125 |
|
| 10126 |
|
| 10127 |
|
| 10128 |
func (ke *KernelIP6TEntry) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10129 |
return ke.CopyOutN(cc, addr, ke.SizeBytes()) |
| 10130 |
} |
| 10131 |
|
| 10132 |
|
| 10133 |
|
| 10134 |
func (ke *KernelIP6TEntry) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10135 |
|
| 10136 |
buf := cc.CopyScratchBuffer(ke.SizeBytes()) |
| 10137 |
length, err := cc.CopyInBytes(addr, buf) |
| 10138 |
|
| 10139 |
|
| 10140 |
ke.UnmarshalBytes(buf) |
| 10141 |
return length, err |
| 10142 |
} |
| 10143 |
|
| 10144 |
|
| 10145 |
func (ke *KernelIP6TEntry) WriteTo(writer io.Writer) (int64, error) { |
| 10146 |
|
| 10147 |
buf := make([]byte, ke.SizeBytes()) |
| 10148 |
ke.MarshalBytes(buf) |
| 10149 |
length, err := writer.Write(buf) |
| 10150 |
return int64(length), err |
| 10151 |
} |
| 10152 |
|
| 10153 |
|
| 10154 |
|
| 10155 |
func (ke *KernelIP6TGetEntries) Packed() bool { |
| 10156 |
|
| 10157 |
return false |
| 10158 |
} |
| 10159 |
|
| 10160 |
|
| 10161 |
func (ke *KernelIP6TGetEntries) MarshalUnsafe(dst []byte) []byte { |
| 10162 |
|
| 10163 |
return ke.MarshalBytes(dst) |
| 10164 |
} |
| 10165 |
|
| 10166 |
|
| 10167 |
func (ke *KernelIP6TGetEntries) UnmarshalUnsafe(src []byte) []byte { |
| 10168 |
|
| 10169 |
return ke.UnmarshalBytes(src) |
| 10170 |
} |
| 10171 |
|
| 10172 |
|
| 10173 |
|
| 10174 |
func (ke *KernelIP6TGetEntries) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 10175 |
|
| 10176 |
buf := cc.CopyScratchBuffer(ke.SizeBytes()) |
| 10177 |
ke.MarshalBytes(buf) |
| 10178 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 10179 |
} |
| 10180 |
|
| 10181 |
|
| 10182 |
|
| 10183 |
func (ke *KernelIP6TGetEntries) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10184 |
return ke.CopyOutN(cc, addr, ke.SizeBytes()) |
| 10185 |
} |
| 10186 |
|
| 10187 |
|
| 10188 |
|
| 10189 |
func (ke *KernelIP6TGetEntries) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10190 |
|
| 10191 |
buf := cc.CopyScratchBuffer(ke.SizeBytes()) |
| 10192 |
length, err := cc.CopyInBytes(addr, buf) |
| 10193 |
|
| 10194 |
|
| 10195 |
ke.UnmarshalBytes(buf) |
| 10196 |
return length, err |
| 10197 |
} |
| 10198 |
|
| 10199 |
|
| 10200 |
func (ke *KernelIP6TGetEntries) WriteTo(writer io.Writer) (int64, error) { |
| 10201 |
|
| 10202 |
buf := make([]byte, ke.SizeBytes()) |
| 10203 |
ke.MarshalBytes(buf) |
| 10204 |
length, err := writer.Write(buf) |
| 10205 |
return int64(length), err |
| 10206 |
} |
| 10207 |
|
| 10208 |
|
| 10209 |
func (n *NFNATRange) SizeBytes() int { |
| 10210 |
return 8 + |
| 10211 |
(*Inet6Addr)(nil).SizeBytes() + |
| 10212 |
(*Inet6Addr)(nil).SizeBytes() |
| 10213 |
} |
| 10214 |
|
| 10215 |
|
| 10216 |
func (n *NFNATRange) MarshalBytes(dst []byte) []byte { |
| 10217 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) |
| 10218 |
dst = dst[4:] |
| 10219 |
dst = n.MinAddr.MarshalUnsafe(dst) |
| 10220 |
dst = n.MaxAddr.MarshalUnsafe(dst) |
| 10221 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.MinProto)) |
| 10222 |
dst = dst[2:] |
| 10223 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.MaxProto)) |
| 10224 |
dst = dst[2:] |
| 10225 |
return dst |
| 10226 |
} |
| 10227 |
|
| 10228 |
|
| 10229 |
func (n *NFNATRange) UnmarshalBytes(src []byte) []byte { |
| 10230 |
n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10231 |
src = src[4:] |
| 10232 |
src = n.MinAddr.UnmarshalUnsafe(src) |
| 10233 |
src = n.MaxAddr.UnmarshalUnsafe(src) |
| 10234 |
n.MinProto = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 10235 |
src = src[2:] |
| 10236 |
n.MaxProto = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 10237 |
src = src[2:] |
| 10238 |
return src |
| 10239 |
} |
| 10240 |
|
| 10241 |
|
| 10242 |
|
| 10243 |
func (n *NFNATRange) Packed() bool { |
| 10244 |
return n.MaxAddr.Packed() && n.MinAddr.Packed() |
| 10245 |
} |
| 10246 |
|
| 10247 |
|
| 10248 |
func (n *NFNATRange) MarshalUnsafe(dst []byte) []byte { |
| 10249 |
if n.MaxAddr.Packed() && n.MinAddr.Packed() { |
| 10250 |
size := n.SizeBytes() |
| 10251 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) |
| 10252 |
return dst[size:] |
| 10253 |
} |
| 10254 |
|
| 10255 |
return n.MarshalBytes(dst) |
| 10256 |
} |
| 10257 |
|
| 10258 |
|
| 10259 |
func (n *NFNATRange) UnmarshalUnsafe(src []byte) []byte { |
| 10260 |
if n.MaxAddr.Packed() && n.MinAddr.Packed() { |
| 10261 |
size := n.SizeBytes() |
| 10262 |
gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) |
| 10263 |
return src[size:] |
| 10264 |
} |
| 10265 |
|
| 10266 |
return n.UnmarshalBytes(src) |
| 10267 |
} |
| 10268 |
|
| 10269 |
|
| 10270 |
|
| 10271 |
func (n *NFNATRange) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 10272 |
if !n.MaxAddr.Packed() && n.MinAddr.Packed() { |
| 10273 |
|
| 10274 |
buf := cc.CopyScratchBuffer(n.SizeBytes()) |
| 10275 |
n.MarshalBytes(buf) |
| 10276 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 10277 |
} |
| 10278 |
|
| 10279 |
|
| 10280 |
var buf []byte |
| 10281 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10282 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10283 |
hdr.Len = n.SizeBytes() |
| 10284 |
hdr.Cap = n.SizeBytes() |
| 10285 |
|
| 10286 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 10287 |
|
| 10288 |
|
| 10289 |
runtime.KeepAlive(n) |
| 10290 |
return length, err |
| 10291 |
} |
| 10292 |
|
| 10293 |
|
| 10294 |
|
| 10295 |
func (n *NFNATRange) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10296 |
return n.CopyOutN(cc, addr, n.SizeBytes()) |
| 10297 |
} |
| 10298 |
|
| 10299 |
|
| 10300 |
|
| 10301 |
func (n *NFNATRange) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10302 |
if !n.MaxAddr.Packed() && n.MinAddr.Packed() { |
| 10303 |
|
| 10304 |
buf := cc.CopyScratchBuffer(n.SizeBytes()) |
| 10305 |
length, err := cc.CopyInBytes(addr, buf) |
| 10306 |
|
| 10307 |
|
| 10308 |
n.UnmarshalBytes(buf) |
| 10309 |
return length, err |
| 10310 |
} |
| 10311 |
|
| 10312 |
|
| 10313 |
var buf []byte |
| 10314 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10315 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10316 |
hdr.Len = n.SizeBytes() |
| 10317 |
hdr.Cap = n.SizeBytes() |
| 10318 |
|
| 10319 |
length, err := cc.CopyInBytes(addr, buf) |
| 10320 |
|
| 10321 |
|
| 10322 |
runtime.KeepAlive(n) |
| 10323 |
return length, err |
| 10324 |
} |
| 10325 |
|
| 10326 |
|
| 10327 |
func (n *NFNATRange) WriteTo(writer io.Writer) (int64, error) { |
| 10328 |
if !n.MaxAddr.Packed() && n.MinAddr.Packed() { |
| 10329 |
|
| 10330 |
buf := make([]byte, n.SizeBytes()) |
| 10331 |
n.MarshalBytes(buf) |
| 10332 |
length, err := writer.Write(buf) |
| 10333 |
return int64(length), err |
| 10334 |
} |
| 10335 |
|
| 10336 |
|
| 10337 |
var buf []byte |
| 10338 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10339 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10340 |
hdr.Len = n.SizeBytes() |
| 10341 |
hdr.Cap = n.SizeBytes() |
| 10342 |
|
| 10343 |
length, err := writer.Write(buf) |
| 10344 |
|
| 10345 |
|
| 10346 |
runtime.KeepAlive(n) |
| 10347 |
return int64(length), err |
| 10348 |
} |
| 10349 |
|
| 10350 |
|
| 10351 |
func (n *NetlinkAttrHeader) SizeBytes() int { |
| 10352 |
return 4 |
| 10353 |
} |
| 10354 |
|
| 10355 |
|
| 10356 |
func (n *NetlinkAttrHeader) MarshalBytes(dst []byte) []byte { |
| 10357 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.Length)) |
| 10358 |
dst = dst[2:] |
| 10359 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.Type)) |
| 10360 |
dst = dst[2:] |
| 10361 |
return dst |
| 10362 |
} |
| 10363 |
|
| 10364 |
|
| 10365 |
func (n *NetlinkAttrHeader) UnmarshalBytes(src []byte) []byte { |
| 10366 |
n.Length = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 10367 |
src = src[2:] |
| 10368 |
n.Type = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 10369 |
src = src[2:] |
| 10370 |
return src |
| 10371 |
} |
| 10372 |
|
| 10373 |
|
| 10374 |
|
| 10375 |
func (n *NetlinkAttrHeader) Packed() bool { |
| 10376 |
return true |
| 10377 |
} |
| 10378 |
|
| 10379 |
|
| 10380 |
func (n *NetlinkAttrHeader) MarshalUnsafe(dst []byte) []byte { |
| 10381 |
size := n.SizeBytes() |
| 10382 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) |
| 10383 |
return dst[size:] |
| 10384 |
} |
| 10385 |
|
| 10386 |
|
| 10387 |
func (n *NetlinkAttrHeader) UnmarshalUnsafe(src []byte) []byte { |
| 10388 |
size := n.SizeBytes() |
| 10389 |
gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) |
| 10390 |
return src[size:] |
| 10391 |
} |
| 10392 |
|
| 10393 |
|
| 10394 |
|
| 10395 |
func (n *NetlinkAttrHeader) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 10396 |
|
| 10397 |
var buf []byte |
| 10398 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10399 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10400 |
hdr.Len = n.SizeBytes() |
| 10401 |
hdr.Cap = n.SizeBytes() |
| 10402 |
|
| 10403 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 10404 |
|
| 10405 |
|
| 10406 |
runtime.KeepAlive(n) |
| 10407 |
return length, err |
| 10408 |
} |
| 10409 |
|
| 10410 |
|
| 10411 |
|
| 10412 |
func (n *NetlinkAttrHeader) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10413 |
return n.CopyOutN(cc, addr, n.SizeBytes()) |
| 10414 |
} |
| 10415 |
|
| 10416 |
|
| 10417 |
|
| 10418 |
func (n *NetlinkAttrHeader) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10419 |
|
| 10420 |
var buf []byte |
| 10421 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10422 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10423 |
hdr.Len = n.SizeBytes() |
| 10424 |
hdr.Cap = n.SizeBytes() |
| 10425 |
|
| 10426 |
length, err := cc.CopyInBytes(addr, buf) |
| 10427 |
|
| 10428 |
|
| 10429 |
runtime.KeepAlive(n) |
| 10430 |
return length, err |
| 10431 |
} |
| 10432 |
|
| 10433 |
|
| 10434 |
func (n *NetlinkAttrHeader) WriteTo(writer io.Writer) (int64, error) { |
| 10435 |
|
| 10436 |
var buf []byte |
| 10437 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10438 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10439 |
hdr.Len = n.SizeBytes() |
| 10440 |
hdr.Cap = n.SizeBytes() |
| 10441 |
|
| 10442 |
length, err := writer.Write(buf) |
| 10443 |
|
| 10444 |
|
| 10445 |
runtime.KeepAlive(n) |
| 10446 |
return int64(length), err |
| 10447 |
} |
| 10448 |
|
| 10449 |
|
| 10450 |
func (n *NetlinkErrorMessage) SizeBytes() int { |
| 10451 |
return 4 + |
| 10452 |
(*NetlinkMessageHeader)(nil).SizeBytes() |
| 10453 |
} |
| 10454 |
|
| 10455 |
|
| 10456 |
func (n *NetlinkErrorMessage) MarshalBytes(dst []byte) []byte { |
| 10457 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Error)) |
| 10458 |
dst = dst[4:] |
| 10459 |
dst = n.Header.MarshalUnsafe(dst) |
| 10460 |
return dst |
| 10461 |
} |
| 10462 |
|
| 10463 |
|
| 10464 |
func (n *NetlinkErrorMessage) UnmarshalBytes(src []byte) []byte { |
| 10465 |
n.Error = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10466 |
src = src[4:] |
| 10467 |
src = n.Header.UnmarshalUnsafe(src) |
| 10468 |
return src |
| 10469 |
} |
| 10470 |
|
| 10471 |
|
| 10472 |
|
| 10473 |
func (n *NetlinkErrorMessage) Packed() bool { |
| 10474 |
return n.Header.Packed() |
| 10475 |
} |
| 10476 |
|
| 10477 |
|
| 10478 |
func (n *NetlinkErrorMessage) MarshalUnsafe(dst []byte) []byte { |
| 10479 |
if n.Header.Packed() { |
| 10480 |
size := n.SizeBytes() |
| 10481 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) |
| 10482 |
return dst[size:] |
| 10483 |
} |
| 10484 |
|
| 10485 |
return n.MarshalBytes(dst) |
| 10486 |
} |
| 10487 |
|
| 10488 |
|
| 10489 |
func (n *NetlinkErrorMessage) UnmarshalUnsafe(src []byte) []byte { |
| 10490 |
if n.Header.Packed() { |
| 10491 |
size := n.SizeBytes() |
| 10492 |
gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) |
| 10493 |
return src[size:] |
| 10494 |
} |
| 10495 |
|
| 10496 |
return n.UnmarshalBytes(src) |
| 10497 |
} |
| 10498 |
|
| 10499 |
|
| 10500 |
|
| 10501 |
func (n *NetlinkErrorMessage) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 10502 |
if !n.Header.Packed() { |
| 10503 |
|
| 10504 |
buf := cc.CopyScratchBuffer(n.SizeBytes()) |
| 10505 |
n.MarshalBytes(buf) |
| 10506 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 10507 |
} |
| 10508 |
|
| 10509 |
|
| 10510 |
var buf []byte |
| 10511 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10512 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10513 |
hdr.Len = n.SizeBytes() |
| 10514 |
hdr.Cap = n.SizeBytes() |
| 10515 |
|
| 10516 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 10517 |
|
| 10518 |
|
| 10519 |
runtime.KeepAlive(n) |
| 10520 |
return length, err |
| 10521 |
} |
| 10522 |
|
| 10523 |
|
| 10524 |
|
| 10525 |
func (n *NetlinkErrorMessage) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10526 |
return n.CopyOutN(cc, addr, n.SizeBytes()) |
| 10527 |
} |
| 10528 |
|
| 10529 |
|
| 10530 |
|
| 10531 |
func (n *NetlinkErrorMessage) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10532 |
if !n.Header.Packed() { |
| 10533 |
|
| 10534 |
buf := cc.CopyScratchBuffer(n.SizeBytes()) |
| 10535 |
length, err := cc.CopyInBytes(addr, buf) |
| 10536 |
|
| 10537 |
|
| 10538 |
n.UnmarshalBytes(buf) |
| 10539 |
return length, err |
| 10540 |
} |
| 10541 |
|
| 10542 |
|
| 10543 |
var buf []byte |
| 10544 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10545 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10546 |
hdr.Len = n.SizeBytes() |
| 10547 |
hdr.Cap = n.SizeBytes() |
| 10548 |
|
| 10549 |
length, err := cc.CopyInBytes(addr, buf) |
| 10550 |
|
| 10551 |
|
| 10552 |
runtime.KeepAlive(n) |
| 10553 |
return length, err |
| 10554 |
} |
| 10555 |
|
| 10556 |
|
| 10557 |
func (n *NetlinkErrorMessage) WriteTo(writer io.Writer) (int64, error) { |
| 10558 |
if !n.Header.Packed() { |
| 10559 |
|
| 10560 |
buf := make([]byte, n.SizeBytes()) |
| 10561 |
n.MarshalBytes(buf) |
| 10562 |
length, err := writer.Write(buf) |
| 10563 |
return int64(length), err |
| 10564 |
} |
| 10565 |
|
| 10566 |
|
| 10567 |
var buf []byte |
| 10568 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10569 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10570 |
hdr.Len = n.SizeBytes() |
| 10571 |
hdr.Cap = n.SizeBytes() |
| 10572 |
|
| 10573 |
length, err := writer.Write(buf) |
| 10574 |
|
| 10575 |
|
| 10576 |
runtime.KeepAlive(n) |
| 10577 |
return int64(length), err |
| 10578 |
} |
| 10579 |
|
| 10580 |
|
| 10581 |
func (n *NetlinkMessageHeader) SizeBytes() int { |
| 10582 |
return 16 |
| 10583 |
} |
| 10584 |
|
| 10585 |
|
| 10586 |
func (n *NetlinkMessageHeader) MarshalBytes(dst []byte) []byte { |
| 10587 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Length)) |
| 10588 |
dst = dst[4:] |
| 10589 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.Type)) |
| 10590 |
dst = dst[2:] |
| 10591 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.Flags)) |
| 10592 |
dst = dst[2:] |
| 10593 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Seq)) |
| 10594 |
dst = dst[4:] |
| 10595 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.PortID)) |
| 10596 |
dst = dst[4:] |
| 10597 |
return dst |
| 10598 |
} |
| 10599 |
|
| 10600 |
|
| 10601 |
func (n *NetlinkMessageHeader) UnmarshalBytes(src []byte) []byte { |
| 10602 |
n.Length = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10603 |
src = src[4:] |
| 10604 |
n.Type = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 10605 |
src = src[2:] |
| 10606 |
n.Flags = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 10607 |
src = src[2:] |
| 10608 |
n.Seq = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10609 |
src = src[4:] |
| 10610 |
n.PortID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10611 |
src = src[4:] |
| 10612 |
return src |
| 10613 |
} |
| 10614 |
|
| 10615 |
|
| 10616 |
|
| 10617 |
func (n *NetlinkMessageHeader) Packed() bool { |
| 10618 |
return true |
| 10619 |
} |
| 10620 |
|
| 10621 |
|
| 10622 |
func (n *NetlinkMessageHeader) MarshalUnsafe(dst []byte) []byte { |
| 10623 |
size := n.SizeBytes() |
| 10624 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) |
| 10625 |
return dst[size:] |
| 10626 |
} |
| 10627 |
|
| 10628 |
|
| 10629 |
func (n *NetlinkMessageHeader) UnmarshalUnsafe(src []byte) []byte { |
| 10630 |
size := n.SizeBytes() |
| 10631 |
gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) |
| 10632 |
return src[size:] |
| 10633 |
} |
| 10634 |
|
| 10635 |
|
| 10636 |
|
| 10637 |
func (n *NetlinkMessageHeader) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 10638 |
|
| 10639 |
var buf []byte |
| 10640 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10641 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10642 |
hdr.Len = n.SizeBytes() |
| 10643 |
hdr.Cap = n.SizeBytes() |
| 10644 |
|
| 10645 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 10646 |
|
| 10647 |
|
| 10648 |
runtime.KeepAlive(n) |
| 10649 |
return length, err |
| 10650 |
} |
| 10651 |
|
| 10652 |
|
| 10653 |
|
| 10654 |
func (n *NetlinkMessageHeader) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10655 |
return n.CopyOutN(cc, addr, n.SizeBytes()) |
| 10656 |
} |
| 10657 |
|
| 10658 |
|
| 10659 |
|
| 10660 |
func (n *NetlinkMessageHeader) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10661 |
|
| 10662 |
var buf []byte |
| 10663 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10664 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10665 |
hdr.Len = n.SizeBytes() |
| 10666 |
hdr.Cap = n.SizeBytes() |
| 10667 |
|
| 10668 |
length, err := cc.CopyInBytes(addr, buf) |
| 10669 |
|
| 10670 |
|
| 10671 |
runtime.KeepAlive(n) |
| 10672 |
return length, err |
| 10673 |
} |
| 10674 |
|
| 10675 |
|
| 10676 |
func (n *NetlinkMessageHeader) WriteTo(writer io.Writer) (int64, error) { |
| 10677 |
|
| 10678 |
var buf []byte |
| 10679 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10680 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) |
| 10681 |
hdr.Len = n.SizeBytes() |
| 10682 |
hdr.Cap = n.SizeBytes() |
| 10683 |
|
| 10684 |
length, err := writer.Write(buf) |
| 10685 |
|
| 10686 |
|
| 10687 |
runtime.KeepAlive(n) |
| 10688 |
return int64(length), err |
| 10689 |
} |
| 10690 |
|
| 10691 |
|
| 10692 |
func (s *SockAddrNetlink) SizeBytes() int { |
| 10693 |
return 12 |
| 10694 |
} |
| 10695 |
|
| 10696 |
|
| 10697 |
func (s *SockAddrNetlink) MarshalBytes(dst []byte) []byte { |
| 10698 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Family)) |
| 10699 |
dst = dst[2:] |
| 10700 |
|
| 10701 |
dst = dst[2:] |
| 10702 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.PortID)) |
| 10703 |
dst = dst[4:] |
| 10704 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Groups)) |
| 10705 |
dst = dst[4:] |
| 10706 |
return dst |
| 10707 |
} |
| 10708 |
|
| 10709 |
|
| 10710 |
func (s *SockAddrNetlink) UnmarshalBytes(src []byte) []byte { |
| 10711 |
s.Family = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 10712 |
src = src[2:] |
| 10713 |
|
| 10714 |
src = src[2:] |
| 10715 |
s.PortID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10716 |
src = src[4:] |
| 10717 |
s.Groups = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10718 |
src = src[4:] |
| 10719 |
return src |
| 10720 |
} |
| 10721 |
|
| 10722 |
|
| 10723 |
|
| 10724 |
func (s *SockAddrNetlink) Packed() bool { |
| 10725 |
return true |
| 10726 |
} |
| 10727 |
|
| 10728 |
|
| 10729 |
func (s *SockAddrNetlink) MarshalUnsafe(dst []byte) []byte { |
| 10730 |
size := s.SizeBytes() |
| 10731 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 10732 |
return dst[size:] |
| 10733 |
} |
| 10734 |
|
| 10735 |
|
| 10736 |
func (s *SockAddrNetlink) UnmarshalUnsafe(src []byte) []byte { |
| 10737 |
size := s.SizeBytes() |
| 10738 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 10739 |
return src[size:] |
| 10740 |
} |
| 10741 |
|
| 10742 |
|
| 10743 |
|
| 10744 |
func (s *SockAddrNetlink) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 10745 |
|
| 10746 |
var buf []byte |
| 10747 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10748 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 10749 |
hdr.Len = s.SizeBytes() |
| 10750 |
hdr.Cap = s.SizeBytes() |
| 10751 |
|
| 10752 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 10753 |
|
| 10754 |
|
| 10755 |
runtime.KeepAlive(s) |
| 10756 |
return length, err |
| 10757 |
} |
| 10758 |
|
| 10759 |
|
| 10760 |
|
| 10761 |
func (s *SockAddrNetlink) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10762 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 10763 |
} |
| 10764 |
|
| 10765 |
|
| 10766 |
|
| 10767 |
func (s *SockAddrNetlink) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10768 |
|
| 10769 |
var buf []byte |
| 10770 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10771 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 10772 |
hdr.Len = s.SizeBytes() |
| 10773 |
hdr.Cap = s.SizeBytes() |
| 10774 |
|
| 10775 |
length, err := cc.CopyInBytes(addr, buf) |
| 10776 |
|
| 10777 |
|
| 10778 |
runtime.KeepAlive(s) |
| 10779 |
return length, err |
| 10780 |
} |
| 10781 |
|
| 10782 |
|
| 10783 |
func (s *SockAddrNetlink) WriteTo(writer io.Writer) (int64, error) { |
| 10784 |
|
| 10785 |
var buf []byte |
| 10786 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10787 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 10788 |
hdr.Len = s.SizeBytes() |
| 10789 |
hdr.Cap = s.SizeBytes() |
| 10790 |
|
| 10791 |
length, err := writer.Write(buf) |
| 10792 |
|
| 10793 |
|
| 10794 |
runtime.KeepAlive(s) |
| 10795 |
return int64(length), err |
| 10796 |
} |
| 10797 |
|
| 10798 |
|
| 10799 |
func (i *InterfaceAddrMessage) SizeBytes() int { |
| 10800 |
return 8 |
| 10801 |
} |
| 10802 |
|
| 10803 |
|
| 10804 |
func (i *InterfaceAddrMessage) MarshalBytes(dst []byte) []byte { |
| 10805 |
dst[0] = byte(i.Family) |
| 10806 |
dst = dst[1:] |
| 10807 |
dst[0] = byte(i.PrefixLen) |
| 10808 |
dst = dst[1:] |
| 10809 |
dst[0] = byte(i.Flags) |
| 10810 |
dst = dst[1:] |
| 10811 |
dst[0] = byte(i.Scope) |
| 10812 |
dst = dst[1:] |
| 10813 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Index)) |
| 10814 |
dst = dst[4:] |
| 10815 |
return dst |
| 10816 |
} |
| 10817 |
|
| 10818 |
|
| 10819 |
func (i *InterfaceAddrMessage) UnmarshalBytes(src []byte) []byte { |
| 10820 |
i.Family = uint8(src[0]) |
| 10821 |
src = src[1:] |
| 10822 |
i.PrefixLen = uint8(src[0]) |
| 10823 |
src = src[1:] |
| 10824 |
i.Flags = uint8(src[0]) |
| 10825 |
src = src[1:] |
| 10826 |
i.Scope = uint8(src[0]) |
| 10827 |
src = src[1:] |
| 10828 |
i.Index = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10829 |
src = src[4:] |
| 10830 |
return src |
| 10831 |
} |
| 10832 |
|
| 10833 |
|
| 10834 |
|
| 10835 |
func (i *InterfaceAddrMessage) Packed() bool { |
| 10836 |
return true |
| 10837 |
} |
| 10838 |
|
| 10839 |
|
| 10840 |
func (i *InterfaceAddrMessage) MarshalUnsafe(dst []byte) []byte { |
| 10841 |
size := i.SizeBytes() |
| 10842 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 10843 |
return dst[size:] |
| 10844 |
} |
| 10845 |
|
| 10846 |
|
| 10847 |
func (i *InterfaceAddrMessage) UnmarshalUnsafe(src []byte) []byte { |
| 10848 |
size := i.SizeBytes() |
| 10849 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 10850 |
return src[size:] |
| 10851 |
} |
| 10852 |
|
| 10853 |
|
| 10854 |
|
| 10855 |
func (i *InterfaceAddrMessage) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 10856 |
|
| 10857 |
var buf []byte |
| 10858 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10859 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 10860 |
hdr.Len = i.SizeBytes() |
| 10861 |
hdr.Cap = i.SizeBytes() |
| 10862 |
|
| 10863 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 10864 |
|
| 10865 |
|
| 10866 |
runtime.KeepAlive(i) |
| 10867 |
return length, err |
| 10868 |
} |
| 10869 |
|
| 10870 |
|
| 10871 |
|
| 10872 |
func (i *InterfaceAddrMessage) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10873 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 10874 |
} |
| 10875 |
|
| 10876 |
|
| 10877 |
|
| 10878 |
func (i *InterfaceAddrMessage) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10879 |
|
| 10880 |
var buf []byte |
| 10881 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10882 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 10883 |
hdr.Len = i.SizeBytes() |
| 10884 |
hdr.Cap = i.SizeBytes() |
| 10885 |
|
| 10886 |
length, err := cc.CopyInBytes(addr, buf) |
| 10887 |
|
| 10888 |
|
| 10889 |
runtime.KeepAlive(i) |
| 10890 |
return length, err |
| 10891 |
} |
| 10892 |
|
| 10893 |
|
| 10894 |
func (i *InterfaceAddrMessage) WriteTo(writer io.Writer) (int64, error) { |
| 10895 |
|
| 10896 |
var buf []byte |
| 10897 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10898 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 10899 |
hdr.Len = i.SizeBytes() |
| 10900 |
hdr.Cap = i.SizeBytes() |
| 10901 |
|
| 10902 |
length, err := writer.Write(buf) |
| 10903 |
|
| 10904 |
|
| 10905 |
runtime.KeepAlive(i) |
| 10906 |
return int64(length), err |
| 10907 |
} |
| 10908 |
|
| 10909 |
|
| 10910 |
func (i *InterfaceInfoMessage) SizeBytes() int { |
| 10911 |
return 16 |
| 10912 |
} |
| 10913 |
|
| 10914 |
|
| 10915 |
func (i *InterfaceInfoMessage) MarshalBytes(dst []byte) []byte { |
| 10916 |
dst[0] = byte(i.Family) |
| 10917 |
dst = dst[1:] |
| 10918 |
|
| 10919 |
dst = dst[1:] |
| 10920 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.Type)) |
| 10921 |
dst = dst[2:] |
| 10922 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Index)) |
| 10923 |
dst = dst[4:] |
| 10924 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Flags)) |
| 10925 |
dst = dst[4:] |
| 10926 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Change)) |
| 10927 |
dst = dst[4:] |
| 10928 |
return dst |
| 10929 |
} |
| 10930 |
|
| 10931 |
|
| 10932 |
func (i *InterfaceInfoMessage) UnmarshalBytes(src []byte) []byte { |
| 10933 |
i.Family = uint8(src[0]) |
| 10934 |
src = src[1:] |
| 10935 |
|
| 10936 |
src = src[1:] |
| 10937 |
i.Type = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 10938 |
src = src[2:] |
| 10939 |
i.Index = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10940 |
src = src[4:] |
| 10941 |
i.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10942 |
src = src[4:] |
| 10943 |
i.Change = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 10944 |
src = src[4:] |
| 10945 |
return src |
| 10946 |
} |
| 10947 |
|
| 10948 |
|
| 10949 |
|
| 10950 |
func (i *InterfaceInfoMessage) Packed() bool { |
| 10951 |
return true |
| 10952 |
} |
| 10953 |
|
| 10954 |
|
| 10955 |
func (i *InterfaceInfoMessage) MarshalUnsafe(dst []byte) []byte { |
| 10956 |
size := i.SizeBytes() |
| 10957 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 10958 |
return dst[size:] |
| 10959 |
} |
| 10960 |
|
| 10961 |
|
| 10962 |
func (i *InterfaceInfoMessage) UnmarshalUnsafe(src []byte) []byte { |
| 10963 |
size := i.SizeBytes() |
| 10964 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 10965 |
return src[size:] |
| 10966 |
} |
| 10967 |
|
| 10968 |
|
| 10969 |
|
| 10970 |
func (i *InterfaceInfoMessage) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 10971 |
|
| 10972 |
var buf []byte |
| 10973 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10974 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 10975 |
hdr.Len = i.SizeBytes() |
| 10976 |
hdr.Cap = i.SizeBytes() |
| 10977 |
|
| 10978 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 10979 |
|
| 10980 |
|
| 10981 |
runtime.KeepAlive(i) |
| 10982 |
return length, err |
| 10983 |
} |
| 10984 |
|
| 10985 |
|
| 10986 |
|
| 10987 |
func (i *InterfaceInfoMessage) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10988 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 10989 |
} |
| 10990 |
|
| 10991 |
|
| 10992 |
|
| 10993 |
func (i *InterfaceInfoMessage) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 10994 |
|
| 10995 |
var buf []byte |
| 10996 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 10997 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 10998 |
hdr.Len = i.SizeBytes() |
| 10999 |
hdr.Cap = i.SizeBytes() |
| 11000 |
|
| 11001 |
length, err := cc.CopyInBytes(addr, buf) |
| 11002 |
|
| 11003 |
|
| 11004 |
runtime.KeepAlive(i) |
| 11005 |
return length, err |
| 11006 |
} |
| 11007 |
|
| 11008 |
|
| 11009 |
func (i *InterfaceInfoMessage) WriteTo(writer io.Writer) (int64, error) { |
| 11010 |
|
| 11011 |
var buf []byte |
| 11012 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11013 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 11014 |
hdr.Len = i.SizeBytes() |
| 11015 |
hdr.Cap = i.SizeBytes() |
| 11016 |
|
| 11017 |
length, err := writer.Write(buf) |
| 11018 |
|
| 11019 |
|
| 11020 |
runtime.KeepAlive(i) |
| 11021 |
return int64(length), err |
| 11022 |
} |
| 11023 |
|
| 11024 |
|
| 11025 |
func (r *RouteMessage) SizeBytes() int { |
| 11026 |
return 12 |
| 11027 |
} |
| 11028 |
|
| 11029 |
|
| 11030 |
func (r *RouteMessage) MarshalBytes(dst []byte) []byte { |
| 11031 |
dst[0] = byte(r.Family) |
| 11032 |
dst = dst[1:] |
| 11033 |
dst[0] = byte(r.DstLen) |
| 11034 |
dst = dst[1:] |
| 11035 |
dst[0] = byte(r.SrcLen) |
| 11036 |
dst = dst[1:] |
| 11037 |
dst[0] = byte(r.TOS) |
| 11038 |
dst = dst[1:] |
| 11039 |
dst[0] = byte(r.Table) |
| 11040 |
dst = dst[1:] |
| 11041 |
dst[0] = byte(r.Protocol) |
| 11042 |
dst = dst[1:] |
| 11043 |
dst[0] = byte(r.Scope) |
| 11044 |
dst = dst[1:] |
| 11045 |
dst[0] = byte(r.Type) |
| 11046 |
dst = dst[1:] |
| 11047 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Flags)) |
| 11048 |
dst = dst[4:] |
| 11049 |
return dst |
| 11050 |
} |
| 11051 |
|
| 11052 |
|
| 11053 |
func (r *RouteMessage) UnmarshalBytes(src []byte) []byte { |
| 11054 |
r.Family = uint8(src[0]) |
| 11055 |
src = src[1:] |
| 11056 |
r.DstLen = uint8(src[0]) |
| 11057 |
src = src[1:] |
| 11058 |
r.SrcLen = uint8(src[0]) |
| 11059 |
src = src[1:] |
| 11060 |
r.TOS = uint8(src[0]) |
| 11061 |
src = src[1:] |
| 11062 |
r.Table = uint8(src[0]) |
| 11063 |
src = src[1:] |
| 11064 |
r.Protocol = uint8(src[0]) |
| 11065 |
src = src[1:] |
| 11066 |
r.Scope = uint8(src[0]) |
| 11067 |
src = src[1:] |
| 11068 |
r.Type = uint8(src[0]) |
| 11069 |
src = src[1:] |
| 11070 |
r.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11071 |
src = src[4:] |
| 11072 |
return src |
| 11073 |
} |
| 11074 |
|
| 11075 |
|
| 11076 |
|
| 11077 |
func (r *RouteMessage) Packed() bool { |
| 11078 |
return true |
| 11079 |
} |
| 11080 |
|
| 11081 |
|
| 11082 |
func (r *RouteMessage) MarshalUnsafe(dst []byte) []byte { |
| 11083 |
size := r.SizeBytes() |
| 11084 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) |
| 11085 |
return dst[size:] |
| 11086 |
} |
| 11087 |
|
| 11088 |
|
| 11089 |
func (r *RouteMessage) UnmarshalUnsafe(src []byte) []byte { |
| 11090 |
size := r.SizeBytes() |
| 11091 |
gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) |
| 11092 |
return src[size:] |
| 11093 |
} |
| 11094 |
|
| 11095 |
|
| 11096 |
|
| 11097 |
func (r *RouteMessage) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 11098 |
|
| 11099 |
var buf []byte |
| 11100 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11101 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 11102 |
hdr.Len = r.SizeBytes() |
| 11103 |
hdr.Cap = r.SizeBytes() |
| 11104 |
|
| 11105 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 11106 |
|
| 11107 |
|
| 11108 |
runtime.KeepAlive(r) |
| 11109 |
return length, err |
| 11110 |
} |
| 11111 |
|
| 11112 |
|
| 11113 |
|
| 11114 |
func (r *RouteMessage) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11115 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 11116 |
} |
| 11117 |
|
| 11118 |
|
| 11119 |
|
| 11120 |
func (r *RouteMessage) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11121 |
|
| 11122 |
var buf []byte |
| 11123 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11124 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 11125 |
hdr.Len = r.SizeBytes() |
| 11126 |
hdr.Cap = r.SizeBytes() |
| 11127 |
|
| 11128 |
length, err := cc.CopyInBytes(addr, buf) |
| 11129 |
|
| 11130 |
|
| 11131 |
runtime.KeepAlive(r) |
| 11132 |
return length, err |
| 11133 |
} |
| 11134 |
|
| 11135 |
|
| 11136 |
func (r *RouteMessage) WriteTo(writer io.Writer) (int64, error) { |
| 11137 |
|
| 11138 |
var buf []byte |
| 11139 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11140 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 11141 |
hdr.Len = r.SizeBytes() |
| 11142 |
hdr.Cap = r.SizeBytes() |
| 11143 |
|
| 11144 |
length, err := writer.Write(buf) |
| 11145 |
|
| 11146 |
|
| 11147 |
runtime.KeepAlive(r) |
| 11148 |
return int64(length), err |
| 11149 |
} |
| 11150 |
|
| 11151 |
|
| 11152 |
func (p *PollFD) SizeBytes() int { |
| 11153 |
return 8 |
| 11154 |
} |
| 11155 |
|
| 11156 |
|
| 11157 |
func (p *PollFD) MarshalBytes(dst []byte) []byte { |
| 11158 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.FD)) |
| 11159 |
dst = dst[4:] |
| 11160 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(p.Events)) |
| 11161 |
dst = dst[2:] |
| 11162 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(p.REvents)) |
| 11163 |
dst = dst[2:] |
| 11164 |
return dst |
| 11165 |
} |
| 11166 |
|
| 11167 |
|
| 11168 |
func (p *PollFD) UnmarshalBytes(src []byte) []byte { |
| 11169 |
p.FD = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11170 |
src = src[4:] |
| 11171 |
p.Events = int16(hostarch.ByteOrder.Uint16(src[:2])) |
| 11172 |
src = src[2:] |
| 11173 |
p.REvents = int16(hostarch.ByteOrder.Uint16(src[:2])) |
| 11174 |
src = src[2:] |
| 11175 |
return src |
| 11176 |
} |
| 11177 |
|
| 11178 |
|
| 11179 |
|
| 11180 |
func (p *PollFD) Packed() bool { |
| 11181 |
return true |
| 11182 |
} |
| 11183 |
|
| 11184 |
|
| 11185 |
func (p *PollFD) MarshalUnsafe(dst []byte) []byte { |
| 11186 |
size := p.SizeBytes() |
| 11187 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size)) |
| 11188 |
return dst[size:] |
| 11189 |
} |
| 11190 |
|
| 11191 |
|
| 11192 |
func (p *PollFD) UnmarshalUnsafe(src []byte) []byte { |
| 11193 |
size := p.SizeBytes() |
| 11194 |
gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size)) |
| 11195 |
return src[size:] |
| 11196 |
} |
| 11197 |
|
| 11198 |
|
| 11199 |
|
| 11200 |
func (p *PollFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 11201 |
|
| 11202 |
var buf []byte |
| 11203 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11204 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) |
| 11205 |
hdr.Len = p.SizeBytes() |
| 11206 |
hdr.Cap = p.SizeBytes() |
| 11207 |
|
| 11208 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 11209 |
|
| 11210 |
|
| 11211 |
runtime.KeepAlive(p) |
| 11212 |
return length, err |
| 11213 |
} |
| 11214 |
|
| 11215 |
|
| 11216 |
|
| 11217 |
func (p *PollFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11218 |
return p.CopyOutN(cc, addr, p.SizeBytes()) |
| 11219 |
} |
| 11220 |
|
| 11221 |
|
| 11222 |
|
| 11223 |
func (p *PollFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11224 |
|
| 11225 |
var buf []byte |
| 11226 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11227 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) |
| 11228 |
hdr.Len = p.SizeBytes() |
| 11229 |
hdr.Cap = p.SizeBytes() |
| 11230 |
|
| 11231 |
length, err := cc.CopyInBytes(addr, buf) |
| 11232 |
|
| 11233 |
|
| 11234 |
runtime.KeepAlive(p) |
| 11235 |
return length, err |
| 11236 |
} |
| 11237 |
|
| 11238 |
|
| 11239 |
func (p *PollFD) WriteTo(writer io.Writer) (int64, error) { |
| 11240 |
|
| 11241 |
var buf []byte |
| 11242 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11243 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) |
| 11244 |
hdr.Len = p.SizeBytes() |
| 11245 |
hdr.Cap = p.SizeBytes() |
| 11246 |
|
| 11247 |
length, err := writer.Write(buf) |
| 11248 |
|
| 11249 |
|
| 11250 |
runtime.KeepAlive(p) |
| 11251 |
return int64(length), err |
| 11252 |
} |
| 11253 |
|
| 11254 |
|
| 11255 |
func CopyPollFDSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []PollFD) (int, error) { |
| 11256 |
count := len(dst) |
| 11257 |
if count == 0 { |
| 11258 |
return 0, nil |
| 11259 |
} |
| 11260 |
size := (*PollFD)(nil).SizeBytes() |
| 11261 |
|
| 11262 |
ptr := unsafe.Pointer(&dst) |
| 11263 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 11264 |
|
| 11265 |
|
| 11266 |
var buf []byte |
| 11267 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11268 |
hdr.Data = uintptr(val) |
| 11269 |
hdr.Len = size * count |
| 11270 |
hdr.Cap = size * count |
| 11271 |
|
| 11272 |
length, err := cc.CopyInBytes(addr, buf) |
| 11273 |
|
| 11274 |
|
| 11275 |
runtime.KeepAlive(dst) |
| 11276 |
return length, err |
| 11277 |
} |
| 11278 |
|
| 11279 |
|
| 11280 |
func CopyPollFDSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []PollFD) (int, error) { |
| 11281 |
count := len(src) |
| 11282 |
if count == 0 { |
| 11283 |
return 0, nil |
| 11284 |
} |
| 11285 |
size := (*PollFD)(nil).SizeBytes() |
| 11286 |
|
| 11287 |
ptr := unsafe.Pointer(&src) |
| 11288 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 11289 |
|
| 11290 |
|
| 11291 |
var buf []byte |
| 11292 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11293 |
hdr.Data = uintptr(val) |
| 11294 |
hdr.Len = size * count |
| 11295 |
hdr.Cap = size * count |
| 11296 |
|
| 11297 |
length, err := cc.CopyOutBytes(addr, buf) |
| 11298 |
|
| 11299 |
|
| 11300 |
runtime.KeepAlive(src) |
| 11301 |
return length, err |
| 11302 |
} |
| 11303 |
|
| 11304 |
|
| 11305 |
func MarshalUnsafePollFDSlice(src []PollFD, dst []byte) []byte { |
| 11306 |
count := len(src) |
| 11307 |
if count == 0 { |
| 11308 |
return dst |
| 11309 |
} |
| 11310 |
|
| 11311 |
size := (*PollFD)(nil).SizeBytes() |
| 11312 |
buf := dst[:size*count] |
| 11313 |
gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) |
| 11314 |
return dst[size*count:] |
| 11315 |
} |
| 11316 |
|
| 11317 |
|
| 11318 |
func UnmarshalUnsafePollFDSlice(dst []PollFD, src []byte) []byte { |
| 11319 |
count := len(dst) |
| 11320 |
if count == 0 { |
| 11321 |
return src |
| 11322 |
} |
| 11323 |
|
| 11324 |
size := (*PollFD)(nil).SizeBytes() |
| 11325 |
buf := src[:size*count] |
| 11326 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) |
| 11327 |
return src[size*count:] |
| 11328 |
} |
| 11329 |
|
| 11330 |
|
| 11331 |
func (r *RSeqCriticalSection) SizeBytes() int { |
| 11332 |
return 32 |
| 11333 |
} |
| 11334 |
|
| 11335 |
|
| 11336 |
func (r *RSeqCriticalSection) MarshalBytes(dst []byte) []byte { |
| 11337 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Version)) |
| 11338 |
dst = dst[4:] |
| 11339 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Flags)) |
| 11340 |
dst = dst[4:] |
| 11341 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.Start)) |
| 11342 |
dst = dst[8:] |
| 11343 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.PostCommitOffset)) |
| 11344 |
dst = dst[8:] |
| 11345 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.Abort)) |
| 11346 |
dst = dst[8:] |
| 11347 |
return dst |
| 11348 |
} |
| 11349 |
|
| 11350 |
|
| 11351 |
func (r *RSeqCriticalSection) UnmarshalBytes(src []byte) []byte { |
| 11352 |
r.Version = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11353 |
src = src[4:] |
| 11354 |
r.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11355 |
src = src[4:] |
| 11356 |
r.Start = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11357 |
src = src[8:] |
| 11358 |
r.PostCommitOffset = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11359 |
src = src[8:] |
| 11360 |
r.Abort = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11361 |
src = src[8:] |
| 11362 |
return src |
| 11363 |
} |
| 11364 |
|
| 11365 |
|
| 11366 |
|
| 11367 |
func (r *RSeqCriticalSection) Packed() bool { |
| 11368 |
return true |
| 11369 |
} |
| 11370 |
|
| 11371 |
|
| 11372 |
func (r *RSeqCriticalSection) MarshalUnsafe(dst []byte) []byte { |
| 11373 |
size := r.SizeBytes() |
| 11374 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) |
| 11375 |
return dst[size:] |
| 11376 |
} |
| 11377 |
|
| 11378 |
|
| 11379 |
func (r *RSeqCriticalSection) UnmarshalUnsafe(src []byte) []byte { |
| 11380 |
size := r.SizeBytes() |
| 11381 |
gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) |
| 11382 |
return src[size:] |
| 11383 |
} |
| 11384 |
|
| 11385 |
|
| 11386 |
|
| 11387 |
func (r *RSeqCriticalSection) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 11388 |
|
| 11389 |
var buf []byte |
| 11390 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11391 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 11392 |
hdr.Len = r.SizeBytes() |
| 11393 |
hdr.Cap = r.SizeBytes() |
| 11394 |
|
| 11395 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 11396 |
|
| 11397 |
|
| 11398 |
runtime.KeepAlive(r) |
| 11399 |
return length, err |
| 11400 |
} |
| 11401 |
|
| 11402 |
|
| 11403 |
|
| 11404 |
func (r *RSeqCriticalSection) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11405 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 11406 |
} |
| 11407 |
|
| 11408 |
|
| 11409 |
|
| 11410 |
func (r *RSeqCriticalSection) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11411 |
|
| 11412 |
var buf []byte |
| 11413 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11414 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 11415 |
hdr.Len = r.SizeBytes() |
| 11416 |
hdr.Cap = r.SizeBytes() |
| 11417 |
|
| 11418 |
length, err := cc.CopyInBytes(addr, buf) |
| 11419 |
|
| 11420 |
|
| 11421 |
runtime.KeepAlive(r) |
| 11422 |
return length, err |
| 11423 |
} |
| 11424 |
|
| 11425 |
|
| 11426 |
func (r *RSeqCriticalSection) WriteTo(writer io.Writer) (int64, error) { |
| 11427 |
|
| 11428 |
var buf []byte |
| 11429 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11430 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 11431 |
hdr.Len = r.SizeBytes() |
| 11432 |
hdr.Cap = r.SizeBytes() |
| 11433 |
|
| 11434 |
length, err := writer.Write(buf) |
| 11435 |
|
| 11436 |
|
| 11437 |
runtime.KeepAlive(r) |
| 11438 |
return int64(length), err |
| 11439 |
} |
| 11440 |
|
| 11441 |
|
| 11442 |
func (r *Rusage) SizeBytes() int { |
| 11443 |
return 112 + |
| 11444 |
(*Timeval)(nil).SizeBytes() + |
| 11445 |
(*Timeval)(nil).SizeBytes() |
| 11446 |
} |
| 11447 |
|
| 11448 |
|
| 11449 |
func (r *Rusage) MarshalBytes(dst []byte) []byte { |
| 11450 |
dst = r.UTime.MarshalUnsafe(dst) |
| 11451 |
dst = r.STime.MarshalUnsafe(dst) |
| 11452 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.MaxRSS)) |
| 11453 |
dst = dst[8:] |
| 11454 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.IXRSS)) |
| 11455 |
dst = dst[8:] |
| 11456 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.IDRSS)) |
| 11457 |
dst = dst[8:] |
| 11458 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.ISRSS)) |
| 11459 |
dst = dst[8:] |
| 11460 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.MinFlt)) |
| 11461 |
dst = dst[8:] |
| 11462 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.MajFlt)) |
| 11463 |
dst = dst[8:] |
| 11464 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.NSwap)) |
| 11465 |
dst = dst[8:] |
| 11466 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.InBlock)) |
| 11467 |
dst = dst[8:] |
| 11468 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.OuBlock)) |
| 11469 |
dst = dst[8:] |
| 11470 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.MsgSnd)) |
| 11471 |
dst = dst[8:] |
| 11472 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.MsgRcv)) |
| 11473 |
dst = dst[8:] |
| 11474 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.NSignals)) |
| 11475 |
dst = dst[8:] |
| 11476 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.NVCSw)) |
| 11477 |
dst = dst[8:] |
| 11478 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.NIvCSw)) |
| 11479 |
dst = dst[8:] |
| 11480 |
return dst |
| 11481 |
} |
| 11482 |
|
| 11483 |
|
| 11484 |
func (r *Rusage) UnmarshalBytes(src []byte) []byte { |
| 11485 |
src = r.UTime.UnmarshalUnsafe(src) |
| 11486 |
src = r.STime.UnmarshalUnsafe(src) |
| 11487 |
r.MaxRSS = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11488 |
src = src[8:] |
| 11489 |
r.IXRSS = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11490 |
src = src[8:] |
| 11491 |
r.IDRSS = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11492 |
src = src[8:] |
| 11493 |
r.ISRSS = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11494 |
src = src[8:] |
| 11495 |
r.MinFlt = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11496 |
src = src[8:] |
| 11497 |
r.MajFlt = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11498 |
src = src[8:] |
| 11499 |
r.NSwap = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11500 |
src = src[8:] |
| 11501 |
r.InBlock = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11502 |
src = src[8:] |
| 11503 |
r.OuBlock = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11504 |
src = src[8:] |
| 11505 |
r.MsgSnd = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11506 |
src = src[8:] |
| 11507 |
r.MsgRcv = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11508 |
src = src[8:] |
| 11509 |
r.NSignals = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11510 |
src = src[8:] |
| 11511 |
r.NVCSw = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11512 |
src = src[8:] |
| 11513 |
r.NIvCSw = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11514 |
src = src[8:] |
| 11515 |
return src |
| 11516 |
} |
| 11517 |
|
| 11518 |
|
| 11519 |
|
| 11520 |
func (r *Rusage) Packed() bool { |
| 11521 |
return r.STime.Packed() && r.UTime.Packed() |
| 11522 |
} |
| 11523 |
|
| 11524 |
|
| 11525 |
func (r *Rusage) MarshalUnsafe(dst []byte) []byte { |
| 11526 |
if r.STime.Packed() && r.UTime.Packed() { |
| 11527 |
size := r.SizeBytes() |
| 11528 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) |
| 11529 |
return dst[size:] |
| 11530 |
} |
| 11531 |
|
| 11532 |
return r.MarshalBytes(dst) |
| 11533 |
} |
| 11534 |
|
| 11535 |
|
| 11536 |
func (r *Rusage) UnmarshalUnsafe(src []byte) []byte { |
| 11537 |
if r.STime.Packed() && r.UTime.Packed() { |
| 11538 |
size := r.SizeBytes() |
| 11539 |
gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) |
| 11540 |
return src[size:] |
| 11541 |
} |
| 11542 |
|
| 11543 |
return r.UnmarshalBytes(src) |
| 11544 |
} |
| 11545 |
|
| 11546 |
|
| 11547 |
|
| 11548 |
func (r *Rusage) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 11549 |
if !r.STime.Packed() && r.UTime.Packed() { |
| 11550 |
|
| 11551 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 11552 |
r.MarshalBytes(buf) |
| 11553 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 11554 |
} |
| 11555 |
|
| 11556 |
|
| 11557 |
var buf []byte |
| 11558 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11559 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 11560 |
hdr.Len = r.SizeBytes() |
| 11561 |
hdr.Cap = r.SizeBytes() |
| 11562 |
|
| 11563 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 11564 |
|
| 11565 |
|
| 11566 |
runtime.KeepAlive(r) |
| 11567 |
return length, err |
| 11568 |
} |
| 11569 |
|
| 11570 |
|
| 11571 |
|
| 11572 |
func (r *Rusage) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11573 |
return r.CopyOutN(cc, addr, r.SizeBytes()) |
| 11574 |
} |
| 11575 |
|
| 11576 |
|
| 11577 |
|
| 11578 |
func (r *Rusage) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11579 |
if !r.STime.Packed() && r.UTime.Packed() { |
| 11580 |
|
| 11581 |
buf := cc.CopyScratchBuffer(r.SizeBytes()) |
| 11582 |
length, err := cc.CopyInBytes(addr, buf) |
| 11583 |
|
| 11584 |
|
| 11585 |
r.UnmarshalBytes(buf) |
| 11586 |
return length, err |
| 11587 |
} |
| 11588 |
|
| 11589 |
|
| 11590 |
var buf []byte |
| 11591 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11592 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 11593 |
hdr.Len = r.SizeBytes() |
| 11594 |
hdr.Cap = r.SizeBytes() |
| 11595 |
|
| 11596 |
length, err := cc.CopyInBytes(addr, buf) |
| 11597 |
|
| 11598 |
|
| 11599 |
runtime.KeepAlive(r) |
| 11600 |
return length, err |
| 11601 |
} |
| 11602 |
|
| 11603 |
|
| 11604 |
func (r *Rusage) WriteTo(writer io.Writer) (int64, error) { |
| 11605 |
if !r.STime.Packed() && r.UTime.Packed() { |
| 11606 |
|
| 11607 |
buf := make([]byte, r.SizeBytes()) |
| 11608 |
r.MarshalBytes(buf) |
| 11609 |
length, err := writer.Write(buf) |
| 11610 |
return int64(length), err |
| 11611 |
} |
| 11612 |
|
| 11613 |
|
| 11614 |
var buf []byte |
| 11615 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11616 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) |
| 11617 |
hdr.Len = r.SizeBytes() |
| 11618 |
hdr.Cap = r.SizeBytes() |
| 11619 |
|
| 11620 |
length, err := writer.Write(buf) |
| 11621 |
|
| 11622 |
|
| 11623 |
runtime.KeepAlive(r) |
| 11624 |
return int64(length), err |
| 11625 |
} |
| 11626 |
|
| 11627 |
|
| 11628 |
func (s *SeccompData) SizeBytes() int { |
| 11629 |
return 16 + |
| 11630 |
8*6 |
| 11631 |
} |
| 11632 |
|
| 11633 |
|
| 11634 |
func (s *SeccompData) MarshalBytes(dst []byte) []byte { |
| 11635 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Nr)) |
| 11636 |
dst = dst[4:] |
| 11637 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Arch)) |
| 11638 |
dst = dst[4:] |
| 11639 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.InstructionPointer)) |
| 11640 |
dst = dst[8:] |
| 11641 |
for idx := 0; idx < 6; idx++ { |
| 11642 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Args[idx])) |
| 11643 |
dst = dst[8:] |
| 11644 |
} |
| 11645 |
return dst |
| 11646 |
} |
| 11647 |
|
| 11648 |
|
| 11649 |
func (s *SeccompData) UnmarshalBytes(src []byte) []byte { |
| 11650 |
s.Nr = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11651 |
src = src[4:] |
| 11652 |
s.Arch = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11653 |
src = src[4:] |
| 11654 |
s.InstructionPointer = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11655 |
src = src[8:] |
| 11656 |
for idx := 0; idx < 6; idx++ { |
| 11657 |
s.Args[idx] = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 11658 |
src = src[8:] |
| 11659 |
} |
| 11660 |
return src |
| 11661 |
} |
| 11662 |
|
| 11663 |
|
| 11664 |
|
| 11665 |
func (s *SeccompData) Packed() bool { |
| 11666 |
return true |
| 11667 |
} |
| 11668 |
|
| 11669 |
|
| 11670 |
func (s *SeccompData) MarshalUnsafe(dst []byte) []byte { |
| 11671 |
size := s.SizeBytes() |
| 11672 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 11673 |
return dst[size:] |
| 11674 |
} |
| 11675 |
|
| 11676 |
|
| 11677 |
func (s *SeccompData) UnmarshalUnsafe(src []byte) []byte { |
| 11678 |
size := s.SizeBytes() |
| 11679 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 11680 |
return src[size:] |
| 11681 |
} |
| 11682 |
|
| 11683 |
|
| 11684 |
|
| 11685 |
func (s *SeccompData) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 11686 |
|
| 11687 |
var buf []byte |
| 11688 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11689 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 11690 |
hdr.Len = s.SizeBytes() |
| 11691 |
hdr.Cap = s.SizeBytes() |
| 11692 |
|
| 11693 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 11694 |
|
| 11695 |
|
| 11696 |
runtime.KeepAlive(s) |
| 11697 |
return length, err |
| 11698 |
} |
| 11699 |
|
| 11700 |
|
| 11701 |
|
| 11702 |
func (s *SeccompData) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11703 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 11704 |
} |
| 11705 |
|
| 11706 |
|
| 11707 |
|
| 11708 |
func (s *SeccompData) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11709 |
|
| 11710 |
var buf []byte |
| 11711 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11712 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 11713 |
hdr.Len = s.SizeBytes() |
| 11714 |
hdr.Cap = s.SizeBytes() |
| 11715 |
|
| 11716 |
length, err := cc.CopyInBytes(addr, buf) |
| 11717 |
|
| 11718 |
|
| 11719 |
runtime.KeepAlive(s) |
| 11720 |
return length, err |
| 11721 |
} |
| 11722 |
|
| 11723 |
|
| 11724 |
func (s *SeccompData) WriteTo(writer io.Writer) (int64, error) { |
| 11725 |
|
| 11726 |
var buf []byte |
| 11727 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11728 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 11729 |
hdr.Len = s.SizeBytes() |
| 11730 |
hdr.Cap = s.SizeBytes() |
| 11731 |
|
| 11732 |
length, err := writer.Write(buf) |
| 11733 |
|
| 11734 |
|
| 11735 |
runtime.KeepAlive(s) |
| 11736 |
return int64(length), err |
| 11737 |
} |
| 11738 |
|
| 11739 |
|
| 11740 |
func (s *SemInfo) SizeBytes() int { |
| 11741 |
return 40 |
| 11742 |
} |
| 11743 |
|
| 11744 |
|
| 11745 |
func (s *SemInfo) MarshalBytes(dst []byte) []byte { |
| 11746 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemMap)) |
| 11747 |
dst = dst[4:] |
| 11748 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemMni)) |
| 11749 |
dst = dst[4:] |
| 11750 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemMns)) |
| 11751 |
dst = dst[4:] |
| 11752 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemMnu)) |
| 11753 |
dst = dst[4:] |
| 11754 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemMsl)) |
| 11755 |
dst = dst[4:] |
| 11756 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemOpm)) |
| 11757 |
dst = dst[4:] |
| 11758 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemUme)) |
| 11759 |
dst = dst[4:] |
| 11760 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemUsz)) |
| 11761 |
dst = dst[4:] |
| 11762 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemVmx)) |
| 11763 |
dst = dst[4:] |
| 11764 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemAem)) |
| 11765 |
dst = dst[4:] |
| 11766 |
return dst |
| 11767 |
} |
| 11768 |
|
| 11769 |
|
| 11770 |
func (s *SemInfo) UnmarshalBytes(src []byte) []byte { |
| 11771 |
s.SemMap = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11772 |
src = src[4:] |
| 11773 |
s.SemMni = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11774 |
src = src[4:] |
| 11775 |
s.SemMns = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11776 |
src = src[4:] |
| 11777 |
s.SemMnu = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11778 |
src = src[4:] |
| 11779 |
s.SemMsl = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11780 |
src = src[4:] |
| 11781 |
s.SemOpm = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11782 |
src = src[4:] |
| 11783 |
s.SemUme = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11784 |
src = src[4:] |
| 11785 |
s.SemUsz = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11786 |
src = src[4:] |
| 11787 |
s.SemVmx = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11788 |
src = src[4:] |
| 11789 |
s.SemAem = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 11790 |
src = src[4:] |
| 11791 |
return src |
| 11792 |
} |
| 11793 |
|
| 11794 |
|
| 11795 |
|
| 11796 |
func (s *SemInfo) Packed() bool { |
| 11797 |
return true |
| 11798 |
} |
| 11799 |
|
| 11800 |
|
| 11801 |
func (s *SemInfo) MarshalUnsafe(dst []byte) []byte { |
| 11802 |
size := s.SizeBytes() |
| 11803 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 11804 |
return dst[size:] |
| 11805 |
} |
| 11806 |
|
| 11807 |
|
| 11808 |
func (s *SemInfo) UnmarshalUnsafe(src []byte) []byte { |
| 11809 |
size := s.SizeBytes() |
| 11810 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 11811 |
return src[size:] |
| 11812 |
} |
| 11813 |
|
| 11814 |
|
| 11815 |
|
| 11816 |
func (s *SemInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 11817 |
|
| 11818 |
var buf []byte |
| 11819 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11820 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 11821 |
hdr.Len = s.SizeBytes() |
| 11822 |
hdr.Cap = s.SizeBytes() |
| 11823 |
|
| 11824 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 11825 |
|
| 11826 |
|
| 11827 |
runtime.KeepAlive(s) |
| 11828 |
return length, err |
| 11829 |
} |
| 11830 |
|
| 11831 |
|
| 11832 |
|
| 11833 |
func (s *SemInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11834 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 11835 |
} |
| 11836 |
|
| 11837 |
|
| 11838 |
|
| 11839 |
func (s *SemInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11840 |
|
| 11841 |
var buf []byte |
| 11842 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11843 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 11844 |
hdr.Len = s.SizeBytes() |
| 11845 |
hdr.Cap = s.SizeBytes() |
| 11846 |
|
| 11847 |
length, err := cc.CopyInBytes(addr, buf) |
| 11848 |
|
| 11849 |
|
| 11850 |
runtime.KeepAlive(s) |
| 11851 |
return length, err |
| 11852 |
} |
| 11853 |
|
| 11854 |
|
| 11855 |
func (s *SemInfo) WriteTo(writer io.Writer) (int64, error) { |
| 11856 |
|
| 11857 |
var buf []byte |
| 11858 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11859 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 11860 |
hdr.Len = s.SizeBytes() |
| 11861 |
hdr.Cap = s.SizeBytes() |
| 11862 |
|
| 11863 |
length, err := writer.Write(buf) |
| 11864 |
|
| 11865 |
|
| 11866 |
runtime.KeepAlive(s) |
| 11867 |
return int64(length), err |
| 11868 |
} |
| 11869 |
|
| 11870 |
|
| 11871 |
func (s *Sembuf) SizeBytes() int { |
| 11872 |
return 6 |
| 11873 |
} |
| 11874 |
|
| 11875 |
|
| 11876 |
func (s *Sembuf) MarshalBytes(dst []byte) []byte { |
| 11877 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.SemNum)) |
| 11878 |
dst = dst[2:] |
| 11879 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.SemOp)) |
| 11880 |
dst = dst[2:] |
| 11881 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.SemFlg)) |
| 11882 |
dst = dst[2:] |
| 11883 |
return dst |
| 11884 |
} |
| 11885 |
|
| 11886 |
|
| 11887 |
func (s *Sembuf) UnmarshalBytes(src []byte) []byte { |
| 11888 |
s.SemNum = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 11889 |
src = src[2:] |
| 11890 |
s.SemOp = int16(hostarch.ByteOrder.Uint16(src[:2])) |
| 11891 |
src = src[2:] |
| 11892 |
s.SemFlg = int16(hostarch.ByteOrder.Uint16(src[:2])) |
| 11893 |
src = src[2:] |
| 11894 |
return src |
| 11895 |
} |
| 11896 |
|
| 11897 |
|
| 11898 |
|
| 11899 |
func (s *Sembuf) Packed() bool { |
| 11900 |
return true |
| 11901 |
} |
| 11902 |
|
| 11903 |
|
| 11904 |
func (s *Sembuf) MarshalUnsafe(dst []byte) []byte { |
| 11905 |
size := s.SizeBytes() |
| 11906 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 11907 |
return dst[size:] |
| 11908 |
} |
| 11909 |
|
| 11910 |
|
| 11911 |
func (s *Sembuf) UnmarshalUnsafe(src []byte) []byte { |
| 11912 |
size := s.SizeBytes() |
| 11913 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 11914 |
return src[size:] |
| 11915 |
} |
| 11916 |
|
| 11917 |
|
| 11918 |
|
| 11919 |
func (s *Sembuf) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 11920 |
|
| 11921 |
var buf []byte |
| 11922 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11923 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 11924 |
hdr.Len = s.SizeBytes() |
| 11925 |
hdr.Cap = s.SizeBytes() |
| 11926 |
|
| 11927 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 11928 |
|
| 11929 |
|
| 11930 |
runtime.KeepAlive(s) |
| 11931 |
return length, err |
| 11932 |
} |
| 11933 |
|
| 11934 |
|
| 11935 |
|
| 11936 |
func (s *Sembuf) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11937 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 11938 |
} |
| 11939 |
|
| 11940 |
|
| 11941 |
|
| 11942 |
func (s *Sembuf) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 11943 |
|
| 11944 |
var buf []byte |
| 11945 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11946 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 11947 |
hdr.Len = s.SizeBytes() |
| 11948 |
hdr.Cap = s.SizeBytes() |
| 11949 |
|
| 11950 |
length, err := cc.CopyInBytes(addr, buf) |
| 11951 |
|
| 11952 |
|
| 11953 |
runtime.KeepAlive(s) |
| 11954 |
return length, err |
| 11955 |
} |
| 11956 |
|
| 11957 |
|
| 11958 |
func (s *Sembuf) WriteTo(writer io.Writer) (int64, error) { |
| 11959 |
|
| 11960 |
var buf []byte |
| 11961 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11962 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 11963 |
hdr.Len = s.SizeBytes() |
| 11964 |
hdr.Cap = s.SizeBytes() |
| 11965 |
|
| 11966 |
length, err := writer.Write(buf) |
| 11967 |
|
| 11968 |
|
| 11969 |
runtime.KeepAlive(s) |
| 11970 |
return int64(length), err |
| 11971 |
} |
| 11972 |
|
| 11973 |
|
| 11974 |
func CopySembufSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []Sembuf) (int, error) { |
| 11975 |
count := len(dst) |
| 11976 |
if count == 0 { |
| 11977 |
return 0, nil |
| 11978 |
} |
| 11979 |
size := (*Sembuf)(nil).SizeBytes() |
| 11980 |
|
| 11981 |
ptr := unsafe.Pointer(&dst) |
| 11982 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 11983 |
|
| 11984 |
|
| 11985 |
var buf []byte |
| 11986 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 11987 |
hdr.Data = uintptr(val) |
| 11988 |
hdr.Len = size * count |
| 11989 |
hdr.Cap = size * count |
| 11990 |
|
| 11991 |
length, err := cc.CopyInBytes(addr, buf) |
| 11992 |
|
| 11993 |
|
| 11994 |
runtime.KeepAlive(dst) |
| 11995 |
return length, err |
| 11996 |
} |
| 11997 |
|
| 11998 |
|
| 11999 |
func CopySembufSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []Sembuf) (int, error) { |
| 12000 |
count := len(src) |
| 12001 |
if count == 0 { |
| 12002 |
return 0, nil |
| 12003 |
} |
| 12004 |
size := (*Sembuf)(nil).SizeBytes() |
| 12005 |
|
| 12006 |
ptr := unsafe.Pointer(&src) |
| 12007 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 12008 |
|
| 12009 |
|
| 12010 |
var buf []byte |
| 12011 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12012 |
hdr.Data = uintptr(val) |
| 12013 |
hdr.Len = size * count |
| 12014 |
hdr.Cap = size * count |
| 12015 |
|
| 12016 |
length, err := cc.CopyOutBytes(addr, buf) |
| 12017 |
|
| 12018 |
|
| 12019 |
runtime.KeepAlive(src) |
| 12020 |
return length, err |
| 12021 |
} |
| 12022 |
|
| 12023 |
|
| 12024 |
func MarshalUnsafeSembufSlice(src []Sembuf, dst []byte) []byte { |
| 12025 |
count := len(src) |
| 12026 |
if count == 0 { |
| 12027 |
return dst |
| 12028 |
} |
| 12029 |
|
| 12030 |
size := (*Sembuf)(nil).SizeBytes() |
| 12031 |
buf := dst[:size*count] |
| 12032 |
gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) |
| 12033 |
return dst[size*count:] |
| 12034 |
} |
| 12035 |
|
| 12036 |
|
| 12037 |
func UnmarshalUnsafeSembufSlice(dst []Sembuf, src []byte) []byte { |
| 12038 |
count := len(dst) |
| 12039 |
if count == 0 { |
| 12040 |
return src |
| 12041 |
} |
| 12042 |
|
| 12043 |
size := (*Sembuf)(nil).SizeBytes() |
| 12044 |
buf := src[:size*count] |
| 12045 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) |
| 12046 |
return src[size*count:] |
| 12047 |
} |
| 12048 |
|
| 12049 |
|
| 12050 |
func (s *ShmInfo) SizeBytes() int { |
| 12051 |
return 44 + |
| 12052 |
1*4 |
| 12053 |
} |
| 12054 |
|
| 12055 |
|
| 12056 |
func (s *ShmInfo) MarshalBytes(dst []byte) []byte { |
| 12057 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.UsedIDs)) |
| 12058 |
dst = dst[4:] |
| 12059 |
|
| 12060 |
dst = dst[1*(4):] |
| 12061 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmTot)) |
| 12062 |
dst = dst[8:] |
| 12063 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmRss)) |
| 12064 |
dst = dst[8:] |
| 12065 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmSwp)) |
| 12066 |
dst = dst[8:] |
| 12067 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.SwapAttempts)) |
| 12068 |
dst = dst[8:] |
| 12069 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.SwapSuccesses)) |
| 12070 |
dst = dst[8:] |
| 12071 |
return dst |
| 12072 |
} |
| 12073 |
|
| 12074 |
|
| 12075 |
func (s *ShmInfo) UnmarshalBytes(src []byte) []byte { |
| 12076 |
s.UsedIDs = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 12077 |
src = src[4:] |
| 12078 |
|
| 12079 |
src = src[1*(4):] |
| 12080 |
s.ShmTot = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12081 |
src = src[8:] |
| 12082 |
s.ShmRss = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12083 |
src = src[8:] |
| 12084 |
s.ShmSwp = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12085 |
src = src[8:] |
| 12086 |
s.SwapAttempts = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12087 |
src = src[8:] |
| 12088 |
s.SwapSuccesses = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12089 |
src = src[8:] |
| 12090 |
return src |
| 12091 |
} |
| 12092 |
|
| 12093 |
|
| 12094 |
|
| 12095 |
func (s *ShmInfo) Packed() bool { |
| 12096 |
return true |
| 12097 |
} |
| 12098 |
|
| 12099 |
|
| 12100 |
func (s *ShmInfo) MarshalUnsafe(dst []byte) []byte { |
| 12101 |
size := s.SizeBytes() |
| 12102 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 12103 |
return dst[size:] |
| 12104 |
} |
| 12105 |
|
| 12106 |
|
| 12107 |
func (s *ShmInfo) UnmarshalUnsafe(src []byte) []byte { |
| 12108 |
size := s.SizeBytes() |
| 12109 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 12110 |
return src[size:] |
| 12111 |
} |
| 12112 |
|
| 12113 |
|
| 12114 |
|
| 12115 |
func (s *ShmInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 12116 |
|
| 12117 |
var buf []byte |
| 12118 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12119 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12120 |
hdr.Len = s.SizeBytes() |
| 12121 |
hdr.Cap = s.SizeBytes() |
| 12122 |
|
| 12123 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 12124 |
|
| 12125 |
|
| 12126 |
runtime.KeepAlive(s) |
| 12127 |
return length, err |
| 12128 |
} |
| 12129 |
|
| 12130 |
|
| 12131 |
|
| 12132 |
func (s *ShmInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12133 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 12134 |
} |
| 12135 |
|
| 12136 |
|
| 12137 |
|
| 12138 |
func (s *ShmInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12139 |
|
| 12140 |
var buf []byte |
| 12141 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12142 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12143 |
hdr.Len = s.SizeBytes() |
| 12144 |
hdr.Cap = s.SizeBytes() |
| 12145 |
|
| 12146 |
length, err := cc.CopyInBytes(addr, buf) |
| 12147 |
|
| 12148 |
|
| 12149 |
runtime.KeepAlive(s) |
| 12150 |
return length, err |
| 12151 |
} |
| 12152 |
|
| 12153 |
|
| 12154 |
func (s *ShmInfo) WriteTo(writer io.Writer) (int64, error) { |
| 12155 |
|
| 12156 |
var buf []byte |
| 12157 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12158 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12159 |
hdr.Len = s.SizeBytes() |
| 12160 |
hdr.Cap = s.SizeBytes() |
| 12161 |
|
| 12162 |
length, err := writer.Write(buf) |
| 12163 |
|
| 12164 |
|
| 12165 |
runtime.KeepAlive(s) |
| 12166 |
return int64(length), err |
| 12167 |
} |
| 12168 |
|
| 12169 |
|
| 12170 |
func (s *ShmParams) SizeBytes() int { |
| 12171 |
return 40 |
| 12172 |
} |
| 12173 |
|
| 12174 |
|
| 12175 |
func (s *ShmParams) MarshalBytes(dst []byte) []byte { |
| 12176 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmMax)) |
| 12177 |
dst = dst[8:] |
| 12178 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmMin)) |
| 12179 |
dst = dst[8:] |
| 12180 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmMni)) |
| 12181 |
dst = dst[8:] |
| 12182 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmSeg)) |
| 12183 |
dst = dst[8:] |
| 12184 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmAll)) |
| 12185 |
dst = dst[8:] |
| 12186 |
return dst |
| 12187 |
} |
| 12188 |
|
| 12189 |
|
| 12190 |
func (s *ShmParams) UnmarshalBytes(src []byte) []byte { |
| 12191 |
s.ShmMax = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12192 |
src = src[8:] |
| 12193 |
s.ShmMin = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12194 |
src = src[8:] |
| 12195 |
s.ShmMni = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12196 |
src = src[8:] |
| 12197 |
s.ShmSeg = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12198 |
src = src[8:] |
| 12199 |
s.ShmAll = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12200 |
src = src[8:] |
| 12201 |
return src |
| 12202 |
} |
| 12203 |
|
| 12204 |
|
| 12205 |
|
| 12206 |
func (s *ShmParams) Packed() bool { |
| 12207 |
return true |
| 12208 |
} |
| 12209 |
|
| 12210 |
|
| 12211 |
func (s *ShmParams) MarshalUnsafe(dst []byte) []byte { |
| 12212 |
size := s.SizeBytes() |
| 12213 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 12214 |
return dst[size:] |
| 12215 |
} |
| 12216 |
|
| 12217 |
|
| 12218 |
func (s *ShmParams) UnmarshalUnsafe(src []byte) []byte { |
| 12219 |
size := s.SizeBytes() |
| 12220 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 12221 |
return src[size:] |
| 12222 |
} |
| 12223 |
|
| 12224 |
|
| 12225 |
|
| 12226 |
func (s *ShmParams) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 12227 |
|
| 12228 |
var buf []byte |
| 12229 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12230 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12231 |
hdr.Len = s.SizeBytes() |
| 12232 |
hdr.Cap = s.SizeBytes() |
| 12233 |
|
| 12234 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 12235 |
|
| 12236 |
|
| 12237 |
runtime.KeepAlive(s) |
| 12238 |
return length, err |
| 12239 |
} |
| 12240 |
|
| 12241 |
|
| 12242 |
|
| 12243 |
func (s *ShmParams) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12244 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 12245 |
} |
| 12246 |
|
| 12247 |
|
| 12248 |
|
| 12249 |
func (s *ShmParams) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12250 |
|
| 12251 |
var buf []byte |
| 12252 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12253 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12254 |
hdr.Len = s.SizeBytes() |
| 12255 |
hdr.Cap = s.SizeBytes() |
| 12256 |
|
| 12257 |
length, err := cc.CopyInBytes(addr, buf) |
| 12258 |
|
| 12259 |
|
| 12260 |
runtime.KeepAlive(s) |
| 12261 |
return length, err |
| 12262 |
} |
| 12263 |
|
| 12264 |
|
| 12265 |
func (s *ShmParams) WriteTo(writer io.Writer) (int64, error) { |
| 12266 |
|
| 12267 |
var buf []byte |
| 12268 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12269 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12270 |
hdr.Len = s.SizeBytes() |
| 12271 |
hdr.Cap = s.SizeBytes() |
| 12272 |
|
| 12273 |
length, err := writer.Write(buf) |
| 12274 |
|
| 12275 |
|
| 12276 |
runtime.KeepAlive(s) |
| 12277 |
return int64(length), err |
| 12278 |
} |
| 12279 |
|
| 12280 |
|
| 12281 |
func (s *ShmidDS) SizeBytes() int { |
| 12282 |
return 40 + |
| 12283 |
(*IPCPerm)(nil).SizeBytes() + |
| 12284 |
(*TimeT)(nil).SizeBytes() + |
| 12285 |
(*TimeT)(nil).SizeBytes() + |
| 12286 |
(*TimeT)(nil).SizeBytes() |
| 12287 |
} |
| 12288 |
|
| 12289 |
|
| 12290 |
func (s *ShmidDS) MarshalBytes(dst []byte) []byte { |
| 12291 |
dst = s.ShmPerm.MarshalUnsafe(dst) |
| 12292 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmSegsz)) |
| 12293 |
dst = dst[8:] |
| 12294 |
dst = s.ShmAtime.MarshalUnsafe(dst) |
| 12295 |
dst = s.ShmDtime.MarshalUnsafe(dst) |
| 12296 |
dst = s.ShmCtime.MarshalUnsafe(dst) |
| 12297 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.ShmCpid)) |
| 12298 |
dst = dst[4:] |
| 12299 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.ShmLpid)) |
| 12300 |
dst = dst[4:] |
| 12301 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmNattach)) |
| 12302 |
dst = dst[8:] |
| 12303 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Unused4)) |
| 12304 |
dst = dst[8:] |
| 12305 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Unused5)) |
| 12306 |
dst = dst[8:] |
| 12307 |
return dst |
| 12308 |
} |
| 12309 |
|
| 12310 |
|
| 12311 |
func (s *ShmidDS) UnmarshalBytes(src []byte) []byte { |
| 12312 |
src = s.ShmPerm.UnmarshalUnsafe(src) |
| 12313 |
s.ShmSegsz = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12314 |
src = src[8:] |
| 12315 |
src = s.ShmAtime.UnmarshalUnsafe(src) |
| 12316 |
src = s.ShmDtime.UnmarshalUnsafe(src) |
| 12317 |
src = s.ShmCtime.UnmarshalUnsafe(src) |
| 12318 |
s.ShmCpid = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 12319 |
src = src[4:] |
| 12320 |
s.ShmLpid = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 12321 |
src = src[4:] |
| 12322 |
s.ShmNattach = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12323 |
src = src[8:] |
| 12324 |
s.Unused4 = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12325 |
src = src[8:] |
| 12326 |
s.Unused5 = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12327 |
src = src[8:] |
| 12328 |
return src |
| 12329 |
} |
| 12330 |
|
| 12331 |
|
| 12332 |
|
| 12333 |
func (s *ShmidDS) Packed() bool { |
| 12334 |
return s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() |
| 12335 |
} |
| 12336 |
|
| 12337 |
|
| 12338 |
func (s *ShmidDS) MarshalUnsafe(dst []byte) []byte { |
| 12339 |
if s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() { |
| 12340 |
size := s.SizeBytes() |
| 12341 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 12342 |
return dst[size:] |
| 12343 |
} |
| 12344 |
|
| 12345 |
return s.MarshalBytes(dst) |
| 12346 |
} |
| 12347 |
|
| 12348 |
|
| 12349 |
func (s *ShmidDS) UnmarshalUnsafe(src []byte) []byte { |
| 12350 |
if s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() { |
| 12351 |
size := s.SizeBytes() |
| 12352 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 12353 |
return src[size:] |
| 12354 |
} |
| 12355 |
|
| 12356 |
return s.UnmarshalBytes(src) |
| 12357 |
} |
| 12358 |
|
| 12359 |
|
| 12360 |
|
| 12361 |
func (s *ShmidDS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 12362 |
if !s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() { |
| 12363 |
|
| 12364 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 12365 |
s.MarshalBytes(buf) |
| 12366 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 12367 |
} |
| 12368 |
|
| 12369 |
|
| 12370 |
var buf []byte |
| 12371 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12372 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12373 |
hdr.Len = s.SizeBytes() |
| 12374 |
hdr.Cap = s.SizeBytes() |
| 12375 |
|
| 12376 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 12377 |
|
| 12378 |
|
| 12379 |
runtime.KeepAlive(s) |
| 12380 |
return length, err |
| 12381 |
} |
| 12382 |
|
| 12383 |
|
| 12384 |
|
| 12385 |
func (s *ShmidDS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12386 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 12387 |
} |
| 12388 |
|
| 12389 |
|
| 12390 |
|
| 12391 |
func (s *ShmidDS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12392 |
if !s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() { |
| 12393 |
|
| 12394 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 12395 |
length, err := cc.CopyInBytes(addr, buf) |
| 12396 |
|
| 12397 |
|
| 12398 |
s.UnmarshalBytes(buf) |
| 12399 |
return length, err |
| 12400 |
} |
| 12401 |
|
| 12402 |
|
| 12403 |
var buf []byte |
| 12404 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12405 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12406 |
hdr.Len = s.SizeBytes() |
| 12407 |
hdr.Cap = s.SizeBytes() |
| 12408 |
|
| 12409 |
length, err := cc.CopyInBytes(addr, buf) |
| 12410 |
|
| 12411 |
|
| 12412 |
runtime.KeepAlive(s) |
| 12413 |
return length, err |
| 12414 |
} |
| 12415 |
|
| 12416 |
|
| 12417 |
func (s *ShmidDS) WriteTo(writer io.Writer) (int64, error) { |
| 12418 |
if !s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() { |
| 12419 |
|
| 12420 |
buf := make([]byte, s.SizeBytes()) |
| 12421 |
s.MarshalBytes(buf) |
| 12422 |
length, err := writer.Write(buf) |
| 12423 |
return int64(length), err |
| 12424 |
} |
| 12425 |
|
| 12426 |
|
| 12427 |
var buf []byte |
| 12428 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12429 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12430 |
hdr.Len = s.SizeBytes() |
| 12431 |
hdr.Cap = s.SizeBytes() |
| 12432 |
|
| 12433 |
length, err := writer.Write(buf) |
| 12434 |
|
| 12435 |
|
| 12436 |
runtime.KeepAlive(s) |
| 12437 |
return int64(length), err |
| 12438 |
} |
| 12439 |
|
| 12440 |
|
| 12441 |
func (s *SigAction) SizeBytes() int { |
| 12442 |
return 24 + |
| 12443 |
(*SignalSet)(nil).SizeBytes() |
| 12444 |
} |
| 12445 |
|
| 12446 |
|
| 12447 |
func (s *SigAction) MarshalBytes(dst []byte) []byte { |
| 12448 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Handler)) |
| 12449 |
dst = dst[8:] |
| 12450 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Flags)) |
| 12451 |
dst = dst[8:] |
| 12452 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Restorer)) |
| 12453 |
dst = dst[8:] |
| 12454 |
dst = s.Mask.MarshalUnsafe(dst) |
| 12455 |
return dst |
| 12456 |
} |
| 12457 |
|
| 12458 |
|
| 12459 |
func (s *SigAction) UnmarshalBytes(src []byte) []byte { |
| 12460 |
s.Handler = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12461 |
src = src[8:] |
| 12462 |
s.Flags = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12463 |
src = src[8:] |
| 12464 |
s.Restorer = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12465 |
src = src[8:] |
| 12466 |
src = s.Mask.UnmarshalUnsafe(src) |
| 12467 |
return src |
| 12468 |
} |
| 12469 |
|
| 12470 |
|
| 12471 |
|
| 12472 |
func (s *SigAction) Packed() bool { |
| 12473 |
return s.Mask.Packed() |
| 12474 |
} |
| 12475 |
|
| 12476 |
|
| 12477 |
func (s *SigAction) MarshalUnsafe(dst []byte) []byte { |
| 12478 |
if s.Mask.Packed() { |
| 12479 |
size := s.SizeBytes() |
| 12480 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 12481 |
return dst[size:] |
| 12482 |
} |
| 12483 |
|
| 12484 |
return s.MarshalBytes(dst) |
| 12485 |
} |
| 12486 |
|
| 12487 |
|
| 12488 |
func (s *SigAction) UnmarshalUnsafe(src []byte) []byte { |
| 12489 |
if s.Mask.Packed() { |
| 12490 |
size := s.SizeBytes() |
| 12491 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 12492 |
return src[size:] |
| 12493 |
} |
| 12494 |
|
| 12495 |
return s.UnmarshalBytes(src) |
| 12496 |
} |
| 12497 |
|
| 12498 |
|
| 12499 |
|
| 12500 |
func (s *SigAction) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 12501 |
if !s.Mask.Packed() { |
| 12502 |
|
| 12503 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 12504 |
s.MarshalBytes(buf) |
| 12505 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 12506 |
} |
| 12507 |
|
| 12508 |
|
| 12509 |
var buf []byte |
| 12510 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12511 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12512 |
hdr.Len = s.SizeBytes() |
| 12513 |
hdr.Cap = s.SizeBytes() |
| 12514 |
|
| 12515 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 12516 |
|
| 12517 |
|
| 12518 |
runtime.KeepAlive(s) |
| 12519 |
return length, err |
| 12520 |
} |
| 12521 |
|
| 12522 |
|
| 12523 |
|
| 12524 |
func (s *SigAction) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12525 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 12526 |
} |
| 12527 |
|
| 12528 |
|
| 12529 |
|
| 12530 |
func (s *SigAction) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12531 |
if !s.Mask.Packed() { |
| 12532 |
|
| 12533 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 12534 |
length, err := cc.CopyInBytes(addr, buf) |
| 12535 |
|
| 12536 |
|
| 12537 |
s.UnmarshalBytes(buf) |
| 12538 |
return length, err |
| 12539 |
} |
| 12540 |
|
| 12541 |
|
| 12542 |
var buf []byte |
| 12543 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12544 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12545 |
hdr.Len = s.SizeBytes() |
| 12546 |
hdr.Cap = s.SizeBytes() |
| 12547 |
|
| 12548 |
length, err := cc.CopyInBytes(addr, buf) |
| 12549 |
|
| 12550 |
|
| 12551 |
runtime.KeepAlive(s) |
| 12552 |
return length, err |
| 12553 |
} |
| 12554 |
|
| 12555 |
|
| 12556 |
func (s *SigAction) WriteTo(writer io.Writer) (int64, error) { |
| 12557 |
if !s.Mask.Packed() { |
| 12558 |
|
| 12559 |
buf := make([]byte, s.SizeBytes()) |
| 12560 |
s.MarshalBytes(buf) |
| 12561 |
length, err := writer.Write(buf) |
| 12562 |
return int64(length), err |
| 12563 |
} |
| 12564 |
|
| 12565 |
|
| 12566 |
var buf []byte |
| 12567 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12568 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12569 |
hdr.Len = s.SizeBytes() |
| 12570 |
hdr.Cap = s.SizeBytes() |
| 12571 |
|
| 12572 |
length, err := writer.Write(buf) |
| 12573 |
|
| 12574 |
|
| 12575 |
runtime.KeepAlive(s) |
| 12576 |
return int64(length), err |
| 12577 |
} |
| 12578 |
|
| 12579 |
|
| 12580 |
func (s *Sigevent) SizeBytes() int { |
| 12581 |
return 20 + |
| 12582 |
1*44 |
| 12583 |
} |
| 12584 |
|
| 12585 |
|
| 12586 |
func (s *Sigevent) MarshalBytes(dst []byte) []byte { |
| 12587 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Value)) |
| 12588 |
dst = dst[8:] |
| 12589 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Signo)) |
| 12590 |
dst = dst[4:] |
| 12591 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Notify)) |
| 12592 |
dst = dst[4:] |
| 12593 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Tid)) |
| 12594 |
dst = dst[4:] |
| 12595 |
for idx := 0; idx < 44; idx++ { |
| 12596 |
dst[0] = byte(s.UnRemainder[idx]) |
| 12597 |
dst = dst[1:] |
| 12598 |
} |
| 12599 |
return dst |
| 12600 |
} |
| 12601 |
|
| 12602 |
|
| 12603 |
func (s *Sigevent) UnmarshalBytes(src []byte) []byte { |
| 12604 |
s.Value = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12605 |
src = src[8:] |
| 12606 |
s.Signo = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 12607 |
src = src[4:] |
| 12608 |
s.Notify = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 12609 |
src = src[4:] |
| 12610 |
s.Tid = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 12611 |
src = src[4:] |
| 12612 |
for idx := 0; idx < 44; idx++ { |
| 12613 |
s.UnRemainder[idx] = src[0] |
| 12614 |
src = src[1:] |
| 12615 |
} |
| 12616 |
return src |
| 12617 |
} |
| 12618 |
|
| 12619 |
|
| 12620 |
|
| 12621 |
func (s *Sigevent) Packed() bool { |
| 12622 |
return true |
| 12623 |
} |
| 12624 |
|
| 12625 |
|
| 12626 |
func (s *Sigevent) MarshalUnsafe(dst []byte) []byte { |
| 12627 |
size := s.SizeBytes() |
| 12628 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 12629 |
return dst[size:] |
| 12630 |
} |
| 12631 |
|
| 12632 |
|
| 12633 |
func (s *Sigevent) UnmarshalUnsafe(src []byte) []byte { |
| 12634 |
size := s.SizeBytes() |
| 12635 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 12636 |
return src[size:] |
| 12637 |
} |
| 12638 |
|
| 12639 |
|
| 12640 |
|
| 12641 |
func (s *Sigevent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 12642 |
|
| 12643 |
var buf []byte |
| 12644 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12645 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12646 |
hdr.Len = s.SizeBytes() |
| 12647 |
hdr.Cap = s.SizeBytes() |
| 12648 |
|
| 12649 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 12650 |
|
| 12651 |
|
| 12652 |
runtime.KeepAlive(s) |
| 12653 |
return length, err |
| 12654 |
} |
| 12655 |
|
| 12656 |
|
| 12657 |
|
| 12658 |
func (s *Sigevent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12659 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 12660 |
} |
| 12661 |
|
| 12662 |
|
| 12663 |
|
| 12664 |
func (s *Sigevent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12665 |
|
| 12666 |
var buf []byte |
| 12667 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12668 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12669 |
hdr.Len = s.SizeBytes() |
| 12670 |
hdr.Cap = s.SizeBytes() |
| 12671 |
|
| 12672 |
length, err := cc.CopyInBytes(addr, buf) |
| 12673 |
|
| 12674 |
|
| 12675 |
runtime.KeepAlive(s) |
| 12676 |
return length, err |
| 12677 |
} |
| 12678 |
|
| 12679 |
|
| 12680 |
func (s *Sigevent) WriteTo(writer io.Writer) (int64, error) { |
| 12681 |
|
| 12682 |
var buf []byte |
| 12683 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12684 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12685 |
hdr.Len = s.SizeBytes() |
| 12686 |
hdr.Cap = s.SizeBytes() |
| 12687 |
|
| 12688 |
length, err := writer.Write(buf) |
| 12689 |
|
| 12690 |
|
| 12691 |
runtime.KeepAlive(s) |
| 12692 |
return int64(length), err |
| 12693 |
} |
| 12694 |
|
| 12695 |
|
| 12696 |
func (s *SignalInfo) SizeBytes() int { |
| 12697 |
return 16 + |
| 12698 |
1*(128-16) |
| 12699 |
} |
| 12700 |
|
| 12701 |
|
| 12702 |
func (s *SignalInfo) MarshalBytes(dst []byte) []byte { |
| 12703 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Signo)) |
| 12704 |
dst = dst[4:] |
| 12705 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Errno)) |
| 12706 |
dst = dst[4:] |
| 12707 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Code)) |
| 12708 |
dst = dst[4:] |
| 12709 |
|
| 12710 |
dst = dst[4:] |
| 12711 |
for idx := 0; idx < (128-16); idx++ { |
| 12712 |
dst[0] = byte(s.Fields[idx]) |
| 12713 |
dst = dst[1:] |
| 12714 |
} |
| 12715 |
return dst |
| 12716 |
} |
| 12717 |
|
| 12718 |
|
| 12719 |
func (s *SignalInfo) UnmarshalBytes(src []byte) []byte { |
| 12720 |
s.Signo = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 12721 |
src = src[4:] |
| 12722 |
s.Errno = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 12723 |
src = src[4:] |
| 12724 |
s.Code = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 12725 |
src = src[4:] |
| 12726 |
|
| 12727 |
src = src[4:] |
| 12728 |
for idx := 0; idx < (128-16); idx++ { |
| 12729 |
s.Fields[idx] = src[0] |
| 12730 |
src = src[1:] |
| 12731 |
} |
| 12732 |
return src |
| 12733 |
} |
| 12734 |
|
| 12735 |
|
| 12736 |
|
| 12737 |
func (s *SignalInfo) Packed() bool { |
| 12738 |
return true |
| 12739 |
} |
| 12740 |
|
| 12741 |
|
| 12742 |
func (s *SignalInfo) MarshalUnsafe(dst []byte) []byte { |
| 12743 |
size := s.SizeBytes() |
| 12744 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 12745 |
return dst[size:] |
| 12746 |
} |
| 12747 |
|
| 12748 |
|
| 12749 |
func (s *SignalInfo) UnmarshalUnsafe(src []byte) []byte { |
| 12750 |
size := s.SizeBytes() |
| 12751 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 12752 |
return src[size:] |
| 12753 |
} |
| 12754 |
|
| 12755 |
|
| 12756 |
|
| 12757 |
func (s *SignalInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 12758 |
|
| 12759 |
var buf []byte |
| 12760 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12761 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12762 |
hdr.Len = s.SizeBytes() |
| 12763 |
hdr.Cap = s.SizeBytes() |
| 12764 |
|
| 12765 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 12766 |
|
| 12767 |
|
| 12768 |
runtime.KeepAlive(s) |
| 12769 |
return length, err |
| 12770 |
} |
| 12771 |
|
| 12772 |
|
| 12773 |
|
| 12774 |
func (s *SignalInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12775 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 12776 |
} |
| 12777 |
|
| 12778 |
|
| 12779 |
|
| 12780 |
func (s *SignalInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12781 |
|
| 12782 |
var buf []byte |
| 12783 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12784 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12785 |
hdr.Len = s.SizeBytes() |
| 12786 |
hdr.Cap = s.SizeBytes() |
| 12787 |
|
| 12788 |
length, err := cc.CopyInBytes(addr, buf) |
| 12789 |
|
| 12790 |
|
| 12791 |
runtime.KeepAlive(s) |
| 12792 |
return length, err |
| 12793 |
} |
| 12794 |
|
| 12795 |
|
| 12796 |
func (s *SignalInfo) WriteTo(writer io.Writer) (int64, error) { |
| 12797 |
|
| 12798 |
var buf []byte |
| 12799 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12800 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12801 |
hdr.Len = s.SizeBytes() |
| 12802 |
hdr.Cap = s.SizeBytes() |
| 12803 |
|
| 12804 |
length, err := writer.Write(buf) |
| 12805 |
|
| 12806 |
|
| 12807 |
runtime.KeepAlive(s) |
| 12808 |
return int64(length), err |
| 12809 |
} |
| 12810 |
|
| 12811 |
|
| 12812 |
|
| 12813 |
func (s *SignalSet) SizeBytes() int { |
| 12814 |
return 8 |
| 12815 |
} |
| 12816 |
|
| 12817 |
|
| 12818 |
func (s *SignalSet) MarshalBytes(dst []byte) []byte { |
| 12819 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(*s)) |
| 12820 |
return dst[8:] |
| 12821 |
} |
| 12822 |
|
| 12823 |
|
| 12824 |
func (s *SignalSet) UnmarshalBytes(src []byte) []byte { |
| 12825 |
*s = SignalSet(uint64(hostarch.ByteOrder.Uint64(src[:8]))) |
| 12826 |
return src[8:] |
| 12827 |
} |
| 12828 |
|
| 12829 |
|
| 12830 |
|
| 12831 |
func (s *SignalSet) Packed() bool { |
| 12832 |
|
| 12833 |
return true |
| 12834 |
} |
| 12835 |
|
| 12836 |
|
| 12837 |
func (s *SignalSet) MarshalUnsafe(dst []byte) []byte { |
| 12838 |
size := s.SizeBytes() |
| 12839 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 12840 |
return dst[size:] |
| 12841 |
} |
| 12842 |
|
| 12843 |
|
| 12844 |
func (s *SignalSet) UnmarshalUnsafe(src []byte) []byte { |
| 12845 |
size := s.SizeBytes() |
| 12846 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 12847 |
return src[size:] |
| 12848 |
} |
| 12849 |
|
| 12850 |
|
| 12851 |
|
| 12852 |
func (s *SignalSet) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 12853 |
|
| 12854 |
var buf []byte |
| 12855 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12856 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12857 |
hdr.Len = s.SizeBytes() |
| 12858 |
hdr.Cap = s.SizeBytes() |
| 12859 |
|
| 12860 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 12861 |
|
| 12862 |
|
| 12863 |
runtime.KeepAlive(s) |
| 12864 |
return length, err |
| 12865 |
} |
| 12866 |
|
| 12867 |
|
| 12868 |
|
| 12869 |
func (s *SignalSet) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12870 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 12871 |
} |
| 12872 |
|
| 12873 |
|
| 12874 |
|
| 12875 |
func (s *SignalSet) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12876 |
|
| 12877 |
var buf []byte |
| 12878 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12879 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12880 |
hdr.Len = s.SizeBytes() |
| 12881 |
hdr.Cap = s.SizeBytes() |
| 12882 |
|
| 12883 |
length, err := cc.CopyInBytes(addr, buf) |
| 12884 |
|
| 12885 |
|
| 12886 |
runtime.KeepAlive(s) |
| 12887 |
return length, err |
| 12888 |
} |
| 12889 |
|
| 12890 |
|
| 12891 |
func (s *SignalSet) WriteTo(writer io.Writer) (int64, error) { |
| 12892 |
|
| 12893 |
var buf []byte |
| 12894 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12895 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12896 |
hdr.Len = s.SizeBytes() |
| 12897 |
hdr.Cap = s.SizeBytes() |
| 12898 |
|
| 12899 |
length, err := writer.Write(buf) |
| 12900 |
|
| 12901 |
|
| 12902 |
runtime.KeepAlive(s) |
| 12903 |
return int64(length), err |
| 12904 |
} |
| 12905 |
|
| 12906 |
|
| 12907 |
func (s *SignalStack) SizeBytes() int { |
| 12908 |
return 24 |
| 12909 |
} |
| 12910 |
|
| 12911 |
|
| 12912 |
func (s *SignalStack) MarshalBytes(dst []byte) []byte { |
| 12913 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Addr)) |
| 12914 |
dst = dst[8:] |
| 12915 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Flags)) |
| 12916 |
dst = dst[4:] |
| 12917 |
|
| 12918 |
dst = dst[4:] |
| 12919 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Size)) |
| 12920 |
dst = dst[8:] |
| 12921 |
return dst |
| 12922 |
} |
| 12923 |
|
| 12924 |
|
| 12925 |
func (s *SignalStack) UnmarshalBytes(src []byte) []byte { |
| 12926 |
s.Addr = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12927 |
src = src[8:] |
| 12928 |
s.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 12929 |
src = src[4:] |
| 12930 |
|
| 12931 |
src = src[4:] |
| 12932 |
s.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 12933 |
src = src[8:] |
| 12934 |
return src |
| 12935 |
} |
| 12936 |
|
| 12937 |
|
| 12938 |
|
| 12939 |
func (s *SignalStack) Packed() bool { |
| 12940 |
return true |
| 12941 |
} |
| 12942 |
|
| 12943 |
|
| 12944 |
func (s *SignalStack) MarshalUnsafe(dst []byte) []byte { |
| 12945 |
size := s.SizeBytes() |
| 12946 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 12947 |
return dst[size:] |
| 12948 |
} |
| 12949 |
|
| 12950 |
|
| 12951 |
func (s *SignalStack) UnmarshalUnsafe(src []byte) []byte { |
| 12952 |
size := s.SizeBytes() |
| 12953 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 12954 |
return src[size:] |
| 12955 |
} |
| 12956 |
|
| 12957 |
|
| 12958 |
|
| 12959 |
func (s *SignalStack) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 12960 |
|
| 12961 |
var buf []byte |
| 12962 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12963 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12964 |
hdr.Len = s.SizeBytes() |
| 12965 |
hdr.Cap = s.SizeBytes() |
| 12966 |
|
| 12967 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 12968 |
|
| 12969 |
|
| 12970 |
runtime.KeepAlive(s) |
| 12971 |
return length, err |
| 12972 |
} |
| 12973 |
|
| 12974 |
|
| 12975 |
|
| 12976 |
func (s *SignalStack) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12977 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 12978 |
} |
| 12979 |
|
| 12980 |
|
| 12981 |
|
| 12982 |
func (s *SignalStack) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 12983 |
|
| 12984 |
var buf []byte |
| 12985 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 12986 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 12987 |
hdr.Len = s.SizeBytes() |
| 12988 |
hdr.Cap = s.SizeBytes() |
| 12989 |
|
| 12990 |
length, err := cc.CopyInBytes(addr, buf) |
| 12991 |
|
| 12992 |
|
| 12993 |
runtime.KeepAlive(s) |
| 12994 |
return length, err |
| 12995 |
} |
| 12996 |
|
| 12997 |
|
| 12998 |
func (s *SignalStack) WriteTo(writer io.Writer) (int64, error) { |
| 12999 |
|
| 13000 |
var buf []byte |
| 13001 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13002 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 13003 |
hdr.Len = s.SizeBytes() |
| 13004 |
hdr.Cap = s.SizeBytes() |
| 13005 |
|
| 13006 |
length, err := writer.Write(buf) |
| 13007 |
|
| 13008 |
|
| 13009 |
runtime.KeepAlive(s) |
| 13010 |
return int64(length), err |
| 13011 |
} |
| 13012 |
|
| 13013 |
|
| 13014 |
func (s *SignalfdSiginfo) SizeBytes() int { |
| 13015 |
return 82 + |
| 13016 |
1*48 |
| 13017 |
} |
| 13018 |
|
| 13019 |
|
| 13020 |
func (s *SignalfdSiginfo) MarshalBytes(dst []byte) []byte { |
| 13021 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Signo)) |
| 13022 |
dst = dst[4:] |
| 13023 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Errno)) |
| 13024 |
dst = dst[4:] |
| 13025 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Code)) |
| 13026 |
dst = dst[4:] |
| 13027 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.PID)) |
| 13028 |
dst = dst[4:] |
| 13029 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.UID)) |
| 13030 |
dst = dst[4:] |
| 13031 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.FD)) |
| 13032 |
dst = dst[4:] |
| 13033 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.TID)) |
| 13034 |
dst = dst[4:] |
| 13035 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Band)) |
| 13036 |
dst = dst[4:] |
| 13037 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Overrun)) |
| 13038 |
dst = dst[4:] |
| 13039 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.TrapNo)) |
| 13040 |
dst = dst[4:] |
| 13041 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Status)) |
| 13042 |
dst = dst[4:] |
| 13043 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Int)) |
| 13044 |
dst = dst[4:] |
| 13045 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Ptr)) |
| 13046 |
dst = dst[8:] |
| 13047 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.UTime)) |
| 13048 |
dst = dst[8:] |
| 13049 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.STime)) |
| 13050 |
dst = dst[8:] |
| 13051 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Addr)) |
| 13052 |
dst = dst[8:] |
| 13053 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.AddrLSB)) |
| 13054 |
dst = dst[2:] |
| 13055 |
|
| 13056 |
dst = dst[1*(48):] |
| 13057 |
return dst |
| 13058 |
} |
| 13059 |
|
| 13060 |
|
| 13061 |
func (s *SignalfdSiginfo) UnmarshalBytes(src []byte) []byte { |
| 13062 |
s.Signo = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13063 |
src = src[4:] |
| 13064 |
s.Errno = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13065 |
src = src[4:] |
| 13066 |
s.Code = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13067 |
src = src[4:] |
| 13068 |
s.PID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13069 |
src = src[4:] |
| 13070 |
s.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13071 |
src = src[4:] |
| 13072 |
s.FD = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13073 |
src = src[4:] |
| 13074 |
s.TID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13075 |
src = src[4:] |
| 13076 |
s.Band = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13077 |
src = src[4:] |
| 13078 |
s.Overrun = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13079 |
src = src[4:] |
| 13080 |
s.TrapNo = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13081 |
src = src[4:] |
| 13082 |
s.Status = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13083 |
src = src[4:] |
| 13084 |
s.Int = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13085 |
src = src[4:] |
| 13086 |
s.Ptr = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 13087 |
src = src[8:] |
| 13088 |
s.UTime = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 13089 |
src = src[8:] |
| 13090 |
s.STime = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 13091 |
src = src[8:] |
| 13092 |
s.Addr = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 13093 |
src = src[8:] |
| 13094 |
s.AddrLSB = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 13095 |
src = src[2:] |
| 13096 |
|
| 13097 |
src = src[1*(48):] |
| 13098 |
return src |
| 13099 |
} |
| 13100 |
|
| 13101 |
|
| 13102 |
|
| 13103 |
func (s *SignalfdSiginfo) Packed() bool { |
| 13104 |
return false |
| 13105 |
} |
| 13106 |
|
| 13107 |
|
| 13108 |
func (s *SignalfdSiginfo) MarshalUnsafe(dst []byte) []byte { |
| 13109 |
|
| 13110 |
return s.MarshalBytes(dst) |
| 13111 |
} |
| 13112 |
|
| 13113 |
|
| 13114 |
func (s *SignalfdSiginfo) UnmarshalUnsafe(src []byte) []byte { |
| 13115 |
|
| 13116 |
return s.UnmarshalBytes(src) |
| 13117 |
} |
| 13118 |
|
| 13119 |
|
| 13120 |
|
| 13121 |
func (s *SignalfdSiginfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 13122 |
|
| 13123 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 13124 |
s.MarshalBytes(buf) |
| 13125 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 13126 |
} |
| 13127 |
|
| 13128 |
|
| 13129 |
|
| 13130 |
func (s *SignalfdSiginfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13131 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 13132 |
} |
| 13133 |
|
| 13134 |
|
| 13135 |
|
| 13136 |
func (s *SignalfdSiginfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13137 |
|
| 13138 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 13139 |
length, err := cc.CopyInBytes(addr, buf) |
| 13140 |
|
| 13141 |
|
| 13142 |
s.UnmarshalBytes(buf) |
| 13143 |
return length, err |
| 13144 |
} |
| 13145 |
|
| 13146 |
|
| 13147 |
func (s *SignalfdSiginfo) WriteTo(writer io.Writer) (int64, error) { |
| 13148 |
|
| 13149 |
buf := make([]byte, s.SizeBytes()) |
| 13150 |
s.MarshalBytes(buf) |
| 13151 |
length, err := writer.Write(buf) |
| 13152 |
return int64(length), err |
| 13153 |
} |
| 13154 |
|
| 13155 |
|
| 13156 |
func (c *ControlMessageCredentials) SizeBytes() int { |
| 13157 |
return 12 |
| 13158 |
} |
| 13159 |
|
| 13160 |
|
| 13161 |
func (c *ControlMessageCredentials) MarshalBytes(dst []byte) []byte { |
| 13162 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.PID)) |
| 13163 |
dst = dst[4:] |
| 13164 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.UID)) |
| 13165 |
dst = dst[4:] |
| 13166 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.GID)) |
| 13167 |
dst = dst[4:] |
| 13168 |
return dst |
| 13169 |
} |
| 13170 |
|
| 13171 |
|
| 13172 |
func (c *ControlMessageCredentials) UnmarshalBytes(src []byte) []byte { |
| 13173 |
c.PID = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13174 |
src = src[4:] |
| 13175 |
c.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13176 |
src = src[4:] |
| 13177 |
c.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13178 |
src = src[4:] |
| 13179 |
return src |
| 13180 |
} |
| 13181 |
|
| 13182 |
|
| 13183 |
|
| 13184 |
func (c *ControlMessageCredentials) Packed() bool { |
| 13185 |
return true |
| 13186 |
} |
| 13187 |
|
| 13188 |
|
| 13189 |
func (c *ControlMessageCredentials) MarshalUnsafe(dst []byte) []byte { |
| 13190 |
size := c.SizeBytes() |
| 13191 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) |
| 13192 |
return dst[size:] |
| 13193 |
} |
| 13194 |
|
| 13195 |
|
| 13196 |
func (c *ControlMessageCredentials) UnmarshalUnsafe(src []byte) []byte { |
| 13197 |
size := c.SizeBytes() |
| 13198 |
gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) |
| 13199 |
return src[size:] |
| 13200 |
} |
| 13201 |
|
| 13202 |
|
| 13203 |
|
| 13204 |
func (c *ControlMessageCredentials) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 13205 |
|
| 13206 |
var buf []byte |
| 13207 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13208 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13209 |
hdr.Len = c.SizeBytes() |
| 13210 |
hdr.Cap = c.SizeBytes() |
| 13211 |
|
| 13212 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 13213 |
|
| 13214 |
|
| 13215 |
runtime.KeepAlive(c) |
| 13216 |
return length, err |
| 13217 |
} |
| 13218 |
|
| 13219 |
|
| 13220 |
|
| 13221 |
func (c *ControlMessageCredentials) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13222 |
return c.CopyOutN(cc, addr, c.SizeBytes()) |
| 13223 |
} |
| 13224 |
|
| 13225 |
|
| 13226 |
|
| 13227 |
func (c *ControlMessageCredentials) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13228 |
|
| 13229 |
var buf []byte |
| 13230 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13231 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13232 |
hdr.Len = c.SizeBytes() |
| 13233 |
hdr.Cap = c.SizeBytes() |
| 13234 |
|
| 13235 |
length, err := cc.CopyInBytes(addr, buf) |
| 13236 |
|
| 13237 |
|
| 13238 |
runtime.KeepAlive(c) |
| 13239 |
return length, err |
| 13240 |
} |
| 13241 |
|
| 13242 |
|
| 13243 |
func (c *ControlMessageCredentials) WriteTo(writer io.Writer) (int64, error) { |
| 13244 |
|
| 13245 |
var buf []byte |
| 13246 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13247 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13248 |
hdr.Len = c.SizeBytes() |
| 13249 |
hdr.Cap = c.SizeBytes() |
| 13250 |
|
| 13251 |
length, err := writer.Write(buf) |
| 13252 |
|
| 13253 |
|
| 13254 |
runtime.KeepAlive(c) |
| 13255 |
return int64(length), err |
| 13256 |
} |
| 13257 |
|
| 13258 |
|
| 13259 |
func (c *ControlMessageHeader) SizeBytes() int { |
| 13260 |
return 16 |
| 13261 |
} |
| 13262 |
|
| 13263 |
|
| 13264 |
func (c *ControlMessageHeader) MarshalBytes(dst []byte) []byte { |
| 13265 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.Length)) |
| 13266 |
dst = dst[8:] |
| 13267 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Level)) |
| 13268 |
dst = dst[4:] |
| 13269 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Type)) |
| 13270 |
dst = dst[4:] |
| 13271 |
return dst |
| 13272 |
} |
| 13273 |
|
| 13274 |
|
| 13275 |
func (c *ControlMessageHeader) UnmarshalBytes(src []byte) []byte { |
| 13276 |
c.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 13277 |
src = src[8:] |
| 13278 |
c.Level = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13279 |
src = src[4:] |
| 13280 |
c.Type = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13281 |
src = src[4:] |
| 13282 |
return src |
| 13283 |
} |
| 13284 |
|
| 13285 |
|
| 13286 |
|
| 13287 |
func (c *ControlMessageHeader) Packed() bool { |
| 13288 |
return true |
| 13289 |
} |
| 13290 |
|
| 13291 |
|
| 13292 |
func (c *ControlMessageHeader) MarshalUnsafe(dst []byte) []byte { |
| 13293 |
size := c.SizeBytes() |
| 13294 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) |
| 13295 |
return dst[size:] |
| 13296 |
} |
| 13297 |
|
| 13298 |
|
| 13299 |
func (c *ControlMessageHeader) UnmarshalUnsafe(src []byte) []byte { |
| 13300 |
size := c.SizeBytes() |
| 13301 |
gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) |
| 13302 |
return src[size:] |
| 13303 |
} |
| 13304 |
|
| 13305 |
|
| 13306 |
|
| 13307 |
func (c *ControlMessageHeader) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 13308 |
|
| 13309 |
var buf []byte |
| 13310 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13311 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13312 |
hdr.Len = c.SizeBytes() |
| 13313 |
hdr.Cap = c.SizeBytes() |
| 13314 |
|
| 13315 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 13316 |
|
| 13317 |
|
| 13318 |
runtime.KeepAlive(c) |
| 13319 |
return length, err |
| 13320 |
} |
| 13321 |
|
| 13322 |
|
| 13323 |
|
| 13324 |
func (c *ControlMessageHeader) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13325 |
return c.CopyOutN(cc, addr, c.SizeBytes()) |
| 13326 |
} |
| 13327 |
|
| 13328 |
|
| 13329 |
|
| 13330 |
func (c *ControlMessageHeader) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13331 |
|
| 13332 |
var buf []byte |
| 13333 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13334 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13335 |
hdr.Len = c.SizeBytes() |
| 13336 |
hdr.Cap = c.SizeBytes() |
| 13337 |
|
| 13338 |
length, err := cc.CopyInBytes(addr, buf) |
| 13339 |
|
| 13340 |
|
| 13341 |
runtime.KeepAlive(c) |
| 13342 |
return length, err |
| 13343 |
} |
| 13344 |
|
| 13345 |
|
| 13346 |
func (c *ControlMessageHeader) WriteTo(writer io.Writer) (int64, error) { |
| 13347 |
|
| 13348 |
var buf []byte |
| 13349 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13350 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13351 |
hdr.Len = c.SizeBytes() |
| 13352 |
hdr.Cap = c.SizeBytes() |
| 13353 |
|
| 13354 |
length, err := writer.Write(buf) |
| 13355 |
|
| 13356 |
|
| 13357 |
runtime.KeepAlive(c) |
| 13358 |
return int64(length), err |
| 13359 |
} |
| 13360 |
|
| 13361 |
|
| 13362 |
func (c *ControlMessageIPPacketInfo) SizeBytes() int { |
| 13363 |
return 4 + |
| 13364 |
(*InetAddr)(nil).SizeBytes() + |
| 13365 |
(*InetAddr)(nil).SizeBytes() |
| 13366 |
} |
| 13367 |
|
| 13368 |
|
| 13369 |
func (c *ControlMessageIPPacketInfo) MarshalBytes(dst []byte) []byte { |
| 13370 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.NIC)) |
| 13371 |
dst = dst[4:] |
| 13372 |
dst = c.LocalAddr.MarshalUnsafe(dst) |
| 13373 |
dst = c.DestinationAddr.MarshalUnsafe(dst) |
| 13374 |
return dst |
| 13375 |
} |
| 13376 |
|
| 13377 |
|
| 13378 |
func (c *ControlMessageIPPacketInfo) UnmarshalBytes(src []byte) []byte { |
| 13379 |
c.NIC = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13380 |
src = src[4:] |
| 13381 |
src = c.LocalAddr.UnmarshalUnsafe(src) |
| 13382 |
src = c.DestinationAddr.UnmarshalUnsafe(src) |
| 13383 |
return src |
| 13384 |
} |
| 13385 |
|
| 13386 |
|
| 13387 |
|
| 13388 |
func (c *ControlMessageIPPacketInfo) Packed() bool { |
| 13389 |
return c.DestinationAddr.Packed() && c.LocalAddr.Packed() |
| 13390 |
} |
| 13391 |
|
| 13392 |
|
| 13393 |
func (c *ControlMessageIPPacketInfo) MarshalUnsafe(dst []byte) []byte { |
| 13394 |
if c.DestinationAddr.Packed() && c.LocalAddr.Packed() { |
| 13395 |
size := c.SizeBytes() |
| 13396 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) |
| 13397 |
return dst[size:] |
| 13398 |
} |
| 13399 |
|
| 13400 |
return c.MarshalBytes(dst) |
| 13401 |
} |
| 13402 |
|
| 13403 |
|
| 13404 |
func (c *ControlMessageIPPacketInfo) UnmarshalUnsafe(src []byte) []byte { |
| 13405 |
if c.DestinationAddr.Packed() && c.LocalAddr.Packed() { |
| 13406 |
size := c.SizeBytes() |
| 13407 |
gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) |
| 13408 |
return src[size:] |
| 13409 |
} |
| 13410 |
|
| 13411 |
return c.UnmarshalBytes(src) |
| 13412 |
} |
| 13413 |
|
| 13414 |
|
| 13415 |
|
| 13416 |
func (c *ControlMessageIPPacketInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 13417 |
if !c.DestinationAddr.Packed() && c.LocalAddr.Packed() { |
| 13418 |
|
| 13419 |
buf := cc.CopyScratchBuffer(c.SizeBytes()) |
| 13420 |
c.MarshalBytes(buf) |
| 13421 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 13422 |
} |
| 13423 |
|
| 13424 |
|
| 13425 |
var buf []byte |
| 13426 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13427 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13428 |
hdr.Len = c.SizeBytes() |
| 13429 |
hdr.Cap = c.SizeBytes() |
| 13430 |
|
| 13431 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 13432 |
|
| 13433 |
|
| 13434 |
runtime.KeepAlive(c) |
| 13435 |
return length, err |
| 13436 |
} |
| 13437 |
|
| 13438 |
|
| 13439 |
|
| 13440 |
func (c *ControlMessageIPPacketInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13441 |
return c.CopyOutN(cc, addr, c.SizeBytes()) |
| 13442 |
} |
| 13443 |
|
| 13444 |
|
| 13445 |
|
| 13446 |
func (c *ControlMessageIPPacketInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13447 |
if !c.DestinationAddr.Packed() && c.LocalAddr.Packed() { |
| 13448 |
|
| 13449 |
buf := cc.CopyScratchBuffer(c.SizeBytes()) |
| 13450 |
length, err := cc.CopyInBytes(addr, buf) |
| 13451 |
|
| 13452 |
|
| 13453 |
c.UnmarshalBytes(buf) |
| 13454 |
return length, err |
| 13455 |
} |
| 13456 |
|
| 13457 |
|
| 13458 |
var buf []byte |
| 13459 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13460 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13461 |
hdr.Len = c.SizeBytes() |
| 13462 |
hdr.Cap = c.SizeBytes() |
| 13463 |
|
| 13464 |
length, err := cc.CopyInBytes(addr, buf) |
| 13465 |
|
| 13466 |
|
| 13467 |
runtime.KeepAlive(c) |
| 13468 |
return length, err |
| 13469 |
} |
| 13470 |
|
| 13471 |
|
| 13472 |
func (c *ControlMessageIPPacketInfo) WriteTo(writer io.Writer) (int64, error) { |
| 13473 |
if !c.DestinationAddr.Packed() && c.LocalAddr.Packed() { |
| 13474 |
|
| 13475 |
buf := make([]byte, c.SizeBytes()) |
| 13476 |
c.MarshalBytes(buf) |
| 13477 |
length, err := writer.Write(buf) |
| 13478 |
return int64(length), err |
| 13479 |
} |
| 13480 |
|
| 13481 |
|
| 13482 |
var buf []byte |
| 13483 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13484 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13485 |
hdr.Len = c.SizeBytes() |
| 13486 |
hdr.Cap = c.SizeBytes() |
| 13487 |
|
| 13488 |
length, err := writer.Write(buf) |
| 13489 |
|
| 13490 |
|
| 13491 |
runtime.KeepAlive(c) |
| 13492 |
return int64(length), err |
| 13493 |
} |
| 13494 |
|
| 13495 |
|
| 13496 |
func (c *ControlMessageIPv6PacketInfo) SizeBytes() int { |
| 13497 |
return 4 + |
| 13498 |
(*Inet6Addr)(nil).SizeBytes() |
| 13499 |
} |
| 13500 |
|
| 13501 |
|
| 13502 |
func (c *ControlMessageIPv6PacketInfo) MarshalBytes(dst []byte) []byte { |
| 13503 |
dst = c.Addr.MarshalUnsafe(dst) |
| 13504 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.NIC)) |
| 13505 |
dst = dst[4:] |
| 13506 |
return dst |
| 13507 |
} |
| 13508 |
|
| 13509 |
|
| 13510 |
func (c *ControlMessageIPv6PacketInfo) UnmarshalBytes(src []byte) []byte { |
| 13511 |
src = c.Addr.UnmarshalUnsafe(src) |
| 13512 |
c.NIC = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13513 |
src = src[4:] |
| 13514 |
return src |
| 13515 |
} |
| 13516 |
|
| 13517 |
|
| 13518 |
|
| 13519 |
func (c *ControlMessageIPv6PacketInfo) Packed() bool { |
| 13520 |
return c.Addr.Packed() |
| 13521 |
} |
| 13522 |
|
| 13523 |
|
| 13524 |
func (c *ControlMessageIPv6PacketInfo) MarshalUnsafe(dst []byte) []byte { |
| 13525 |
if c.Addr.Packed() { |
| 13526 |
size := c.SizeBytes() |
| 13527 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) |
| 13528 |
return dst[size:] |
| 13529 |
} |
| 13530 |
|
| 13531 |
return c.MarshalBytes(dst) |
| 13532 |
} |
| 13533 |
|
| 13534 |
|
| 13535 |
func (c *ControlMessageIPv6PacketInfo) UnmarshalUnsafe(src []byte) []byte { |
| 13536 |
if c.Addr.Packed() { |
| 13537 |
size := c.SizeBytes() |
| 13538 |
gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) |
| 13539 |
return src[size:] |
| 13540 |
} |
| 13541 |
|
| 13542 |
return c.UnmarshalBytes(src) |
| 13543 |
} |
| 13544 |
|
| 13545 |
|
| 13546 |
|
| 13547 |
func (c *ControlMessageIPv6PacketInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 13548 |
if !c.Addr.Packed() { |
| 13549 |
|
| 13550 |
buf := cc.CopyScratchBuffer(c.SizeBytes()) |
| 13551 |
c.MarshalBytes(buf) |
| 13552 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 13553 |
} |
| 13554 |
|
| 13555 |
|
| 13556 |
var buf []byte |
| 13557 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13558 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13559 |
hdr.Len = c.SizeBytes() |
| 13560 |
hdr.Cap = c.SizeBytes() |
| 13561 |
|
| 13562 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 13563 |
|
| 13564 |
|
| 13565 |
runtime.KeepAlive(c) |
| 13566 |
return length, err |
| 13567 |
} |
| 13568 |
|
| 13569 |
|
| 13570 |
|
| 13571 |
func (c *ControlMessageIPv6PacketInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13572 |
return c.CopyOutN(cc, addr, c.SizeBytes()) |
| 13573 |
} |
| 13574 |
|
| 13575 |
|
| 13576 |
|
| 13577 |
func (c *ControlMessageIPv6PacketInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13578 |
if !c.Addr.Packed() { |
| 13579 |
|
| 13580 |
buf := cc.CopyScratchBuffer(c.SizeBytes()) |
| 13581 |
length, err := cc.CopyInBytes(addr, buf) |
| 13582 |
|
| 13583 |
|
| 13584 |
c.UnmarshalBytes(buf) |
| 13585 |
return length, err |
| 13586 |
} |
| 13587 |
|
| 13588 |
|
| 13589 |
var buf []byte |
| 13590 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13591 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13592 |
hdr.Len = c.SizeBytes() |
| 13593 |
hdr.Cap = c.SizeBytes() |
| 13594 |
|
| 13595 |
length, err := cc.CopyInBytes(addr, buf) |
| 13596 |
|
| 13597 |
|
| 13598 |
runtime.KeepAlive(c) |
| 13599 |
return length, err |
| 13600 |
} |
| 13601 |
|
| 13602 |
|
| 13603 |
func (c *ControlMessageIPv6PacketInfo) WriteTo(writer io.Writer) (int64, error) { |
| 13604 |
if !c.Addr.Packed() { |
| 13605 |
|
| 13606 |
buf := make([]byte, c.SizeBytes()) |
| 13607 |
c.MarshalBytes(buf) |
| 13608 |
length, err := writer.Write(buf) |
| 13609 |
return int64(length), err |
| 13610 |
} |
| 13611 |
|
| 13612 |
|
| 13613 |
var buf []byte |
| 13614 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13615 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 13616 |
hdr.Len = c.SizeBytes() |
| 13617 |
hdr.Cap = c.SizeBytes() |
| 13618 |
|
| 13619 |
length, err := writer.Write(buf) |
| 13620 |
|
| 13621 |
|
| 13622 |
runtime.KeepAlive(c) |
| 13623 |
return int64(length), err |
| 13624 |
} |
| 13625 |
|
| 13626 |
|
| 13627 |
|
| 13628 |
func (i *Inet6Addr) SizeBytes() int { |
| 13629 |
return 1 * 16 |
| 13630 |
} |
| 13631 |
|
| 13632 |
|
| 13633 |
func (i *Inet6Addr) MarshalBytes(dst []byte) []byte { |
| 13634 |
for idx := 0; idx < 16; idx++ { |
| 13635 |
dst[0] = byte(i[idx]) |
| 13636 |
dst = dst[1:] |
| 13637 |
} |
| 13638 |
return dst |
| 13639 |
} |
| 13640 |
|
| 13641 |
|
| 13642 |
func (i *Inet6Addr) UnmarshalBytes(src []byte) []byte { |
| 13643 |
for idx := 0; idx < 16; idx++ { |
| 13644 |
i[idx] = src[0] |
| 13645 |
src = src[1:] |
| 13646 |
} |
| 13647 |
return src |
| 13648 |
} |
| 13649 |
|
| 13650 |
|
| 13651 |
|
| 13652 |
func (i *Inet6Addr) Packed() bool { |
| 13653 |
|
| 13654 |
return true |
| 13655 |
} |
| 13656 |
|
| 13657 |
|
| 13658 |
func (i *Inet6Addr) MarshalUnsafe(dst []byte) []byte { |
| 13659 |
size := i.SizeBytes() |
| 13660 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&i[0]), uintptr(size)) |
| 13661 |
return dst[size:] |
| 13662 |
} |
| 13663 |
|
| 13664 |
|
| 13665 |
func (i *Inet6Addr) UnmarshalUnsafe(src []byte) []byte { |
| 13666 |
size := i.SizeBytes() |
| 13667 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 13668 |
return src[size:] |
| 13669 |
} |
| 13670 |
|
| 13671 |
|
| 13672 |
|
| 13673 |
func (i *Inet6Addr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 13674 |
|
| 13675 |
var buf []byte |
| 13676 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13677 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 13678 |
hdr.Len = i.SizeBytes() |
| 13679 |
hdr.Cap = i.SizeBytes() |
| 13680 |
|
| 13681 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 13682 |
|
| 13683 |
|
| 13684 |
runtime.KeepAlive(i) |
| 13685 |
return length, err |
| 13686 |
} |
| 13687 |
|
| 13688 |
|
| 13689 |
|
| 13690 |
func (i *Inet6Addr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13691 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 13692 |
} |
| 13693 |
|
| 13694 |
|
| 13695 |
|
| 13696 |
func (i *Inet6Addr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13697 |
|
| 13698 |
var buf []byte |
| 13699 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13700 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 13701 |
hdr.Len = i.SizeBytes() |
| 13702 |
hdr.Cap = i.SizeBytes() |
| 13703 |
|
| 13704 |
length, err := cc.CopyInBytes(addr, buf) |
| 13705 |
|
| 13706 |
|
| 13707 |
runtime.KeepAlive(i) |
| 13708 |
return length, err |
| 13709 |
} |
| 13710 |
|
| 13711 |
|
| 13712 |
func (i *Inet6Addr) WriteTo(writer io.Writer) (int64, error) { |
| 13713 |
|
| 13714 |
var buf []byte |
| 13715 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13716 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 13717 |
hdr.Len = i.SizeBytes() |
| 13718 |
hdr.Cap = i.SizeBytes() |
| 13719 |
|
| 13720 |
length, err := writer.Write(buf) |
| 13721 |
|
| 13722 |
|
| 13723 |
runtime.KeepAlive(i) |
| 13724 |
return int64(length), err |
| 13725 |
} |
| 13726 |
|
| 13727 |
|
| 13728 |
func (i *Inet6MulticastRequest) SizeBytes() int { |
| 13729 |
return 4 + |
| 13730 |
(*Inet6Addr)(nil).SizeBytes() |
| 13731 |
} |
| 13732 |
|
| 13733 |
|
| 13734 |
func (i *Inet6MulticastRequest) MarshalBytes(dst []byte) []byte { |
| 13735 |
dst = i.MulticastAddr.MarshalUnsafe(dst) |
| 13736 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.InterfaceIndex)) |
| 13737 |
dst = dst[4:] |
| 13738 |
return dst |
| 13739 |
} |
| 13740 |
|
| 13741 |
|
| 13742 |
func (i *Inet6MulticastRequest) UnmarshalBytes(src []byte) []byte { |
| 13743 |
src = i.MulticastAddr.UnmarshalUnsafe(src) |
| 13744 |
i.InterfaceIndex = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 13745 |
src = src[4:] |
| 13746 |
return src |
| 13747 |
} |
| 13748 |
|
| 13749 |
|
| 13750 |
|
| 13751 |
func (i *Inet6MulticastRequest) Packed() bool { |
| 13752 |
return i.MulticastAddr.Packed() |
| 13753 |
} |
| 13754 |
|
| 13755 |
|
| 13756 |
func (i *Inet6MulticastRequest) MarshalUnsafe(dst []byte) []byte { |
| 13757 |
if i.MulticastAddr.Packed() { |
| 13758 |
size := i.SizeBytes() |
| 13759 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 13760 |
return dst[size:] |
| 13761 |
} |
| 13762 |
|
| 13763 |
return i.MarshalBytes(dst) |
| 13764 |
} |
| 13765 |
|
| 13766 |
|
| 13767 |
func (i *Inet6MulticastRequest) UnmarshalUnsafe(src []byte) []byte { |
| 13768 |
if i.MulticastAddr.Packed() { |
| 13769 |
size := i.SizeBytes() |
| 13770 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 13771 |
return src[size:] |
| 13772 |
} |
| 13773 |
|
| 13774 |
return i.UnmarshalBytes(src) |
| 13775 |
} |
| 13776 |
|
| 13777 |
|
| 13778 |
|
| 13779 |
func (i *Inet6MulticastRequest) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 13780 |
if !i.MulticastAddr.Packed() { |
| 13781 |
|
| 13782 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 13783 |
i.MarshalBytes(buf) |
| 13784 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 13785 |
} |
| 13786 |
|
| 13787 |
|
| 13788 |
var buf []byte |
| 13789 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13790 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 13791 |
hdr.Len = i.SizeBytes() |
| 13792 |
hdr.Cap = i.SizeBytes() |
| 13793 |
|
| 13794 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 13795 |
|
| 13796 |
|
| 13797 |
runtime.KeepAlive(i) |
| 13798 |
return length, err |
| 13799 |
} |
| 13800 |
|
| 13801 |
|
| 13802 |
|
| 13803 |
func (i *Inet6MulticastRequest) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13804 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 13805 |
} |
| 13806 |
|
| 13807 |
|
| 13808 |
|
| 13809 |
func (i *Inet6MulticastRequest) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13810 |
if !i.MulticastAddr.Packed() { |
| 13811 |
|
| 13812 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 13813 |
length, err := cc.CopyInBytes(addr, buf) |
| 13814 |
|
| 13815 |
|
| 13816 |
i.UnmarshalBytes(buf) |
| 13817 |
return length, err |
| 13818 |
} |
| 13819 |
|
| 13820 |
|
| 13821 |
var buf []byte |
| 13822 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13823 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 13824 |
hdr.Len = i.SizeBytes() |
| 13825 |
hdr.Cap = i.SizeBytes() |
| 13826 |
|
| 13827 |
length, err := cc.CopyInBytes(addr, buf) |
| 13828 |
|
| 13829 |
|
| 13830 |
runtime.KeepAlive(i) |
| 13831 |
return length, err |
| 13832 |
} |
| 13833 |
|
| 13834 |
|
| 13835 |
func (i *Inet6MulticastRequest) WriteTo(writer io.Writer) (int64, error) { |
| 13836 |
if !i.MulticastAddr.Packed() { |
| 13837 |
|
| 13838 |
buf := make([]byte, i.SizeBytes()) |
| 13839 |
i.MarshalBytes(buf) |
| 13840 |
length, err := writer.Write(buf) |
| 13841 |
return int64(length), err |
| 13842 |
} |
| 13843 |
|
| 13844 |
|
| 13845 |
var buf []byte |
| 13846 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13847 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 13848 |
hdr.Len = i.SizeBytes() |
| 13849 |
hdr.Cap = i.SizeBytes() |
| 13850 |
|
| 13851 |
length, err := writer.Write(buf) |
| 13852 |
|
| 13853 |
|
| 13854 |
runtime.KeepAlive(i) |
| 13855 |
return int64(length), err |
| 13856 |
} |
| 13857 |
|
| 13858 |
|
| 13859 |
|
| 13860 |
func (i *InetAddr) SizeBytes() int { |
| 13861 |
return 1 * 4 |
| 13862 |
} |
| 13863 |
|
| 13864 |
|
| 13865 |
func (i *InetAddr) MarshalBytes(dst []byte) []byte { |
| 13866 |
for idx := 0; idx < 4; idx++ { |
| 13867 |
dst[0] = byte(i[idx]) |
| 13868 |
dst = dst[1:] |
| 13869 |
} |
| 13870 |
return dst |
| 13871 |
} |
| 13872 |
|
| 13873 |
|
| 13874 |
func (i *InetAddr) UnmarshalBytes(src []byte) []byte { |
| 13875 |
for idx := 0; idx < 4; idx++ { |
| 13876 |
i[idx] = src[0] |
| 13877 |
src = src[1:] |
| 13878 |
} |
| 13879 |
return src |
| 13880 |
} |
| 13881 |
|
| 13882 |
|
| 13883 |
|
| 13884 |
func (i *InetAddr) Packed() bool { |
| 13885 |
|
| 13886 |
return true |
| 13887 |
} |
| 13888 |
|
| 13889 |
|
| 13890 |
func (i *InetAddr) MarshalUnsafe(dst []byte) []byte { |
| 13891 |
size := i.SizeBytes() |
| 13892 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&i[0]), uintptr(size)) |
| 13893 |
return dst[size:] |
| 13894 |
} |
| 13895 |
|
| 13896 |
|
| 13897 |
func (i *InetAddr) UnmarshalUnsafe(src []byte) []byte { |
| 13898 |
size := i.SizeBytes() |
| 13899 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 13900 |
return src[size:] |
| 13901 |
} |
| 13902 |
|
| 13903 |
|
| 13904 |
|
| 13905 |
func (i *InetAddr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 13906 |
|
| 13907 |
var buf []byte |
| 13908 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13909 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 13910 |
hdr.Len = i.SizeBytes() |
| 13911 |
hdr.Cap = i.SizeBytes() |
| 13912 |
|
| 13913 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 13914 |
|
| 13915 |
|
| 13916 |
runtime.KeepAlive(i) |
| 13917 |
return length, err |
| 13918 |
} |
| 13919 |
|
| 13920 |
|
| 13921 |
|
| 13922 |
func (i *InetAddr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13923 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 13924 |
} |
| 13925 |
|
| 13926 |
|
| 13927 |
|
| 13928 |
func (i *InetAddr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 13929 |
|
| 13930 |
var buf []byte |
| 13931 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13932 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 13933 |
hdr.Len = i.SizeBytes() |
| 13934 |
hdr.Cap = i.SizeBytes() |
| 13935 |
|
| 13936 |
length, err := cc.CopyInBytes(addr, buf) |
| 13937 |
|
| 13938 |
|
| 13939 |
runtime.KeepAlive(i) |
| 13940 |
return length, err |
| 13941 |
} |
| 13942 |
|
| 13943 |
|
| 13944 |
func (i *InetAddr) WriteTo(writer io.Writer) (int64, error) { |
| 13945 |
|
| 13946 |
var buf []byte |
| 13947 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 13948 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 13949 |
hdr.Len = i.SizeBytes() |
| 13950 |
hdr.Cap = i.SizeBytes() |
| 13951 |
|
| 13952 |
length, err := writer.Write(buf) |
| 13953 |
|
| 13954 |
|
| 13955 |
runtime.KeepAlive(i) |
| 13956 |
return int64(length), err |
| 13957 |
} |
| 13958 |
|
| 13959 |
|
| 13960 |
func (i *InetMulticastRequest) SizeBytes() int { |
| 13961 |
return 0 + |
| 13962 |
(*InetAddr)(nil).SizeBytes() + |
| 13963 |
(*InetAddr)(nil).SizeBytes() |
| 13964 |
} |
| 13965 |
|
| 13966 |
|
| 13967 |
func (i *InetMulticastRequest) MarshalBytes(dst []byte) []byte { |
| 13968 |
dst = i.MulticastAddr.MarshalUnsafe(dst) |
| 13969 |
dst = i.InterfaceAddr.MarshalUnsafe(dst) |
| 13970 |
return dst |
| 13971 |
} |
| 13972 |
|
| 13973 |
|
| 13974 |
func (i *InetMulticastRequest) UnmarshalBytes(src []byte) []byte { |
| 13975 |
src = i.MulticastAddr.UnmarshalUnsafe(src) |
| 13976 |
src = i.InterfaceAddr.UnmarshalUnsafe(src) |
| 13977 |
return src |
| 13978 |
} |
| 13979 |
|
| 13980 |
|
| 13981 |
|
| 13982 |
func (i *InetMulticastRequest) Packed() bool { |
| 13983 |
return i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() |
| 13984 |
} |
| 13985 |
|
| 13986 |
|
| 13987 |
func (i *InetMulticastRequest) MarshalUnsafe(dst []byte) []byte { |
| 13988 |
if i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() { |
| 13989 |
size := i.SizeBytes() |
| 13990 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 13991 |
return dst[size:] |
| 13992 |
} |
| 13993 |
|
| 13994 |
return i.MarshalBytes(dst) |
| 13995 |
} |
| 13996 |
|
| 13997 |
|
| 13998 |
func (i *InetMulticastRequest) UnmarshalUnsafe(src []byte) []byte { |
| 13999 |
if i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() { |
| 14000 |
size := i.SizeBytes() |
| 14001 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 14002 |
return src[size:] |
| 14003 |
} |
| 14004 |
|
| 14005 |
return i.UnmarshalBytes(src) |
| 14006 |
} |
| 14007 |
|
| 14008 |
|
| 14009 |
|
| 14010 |
func (i *InetMulticastRequest) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 14011 |
if !i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() { |
| 14012 |
|
| 14013 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 14014 |
i.MarshalBytes(buf) |
| 14015 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 14016 |
} |
| 14017 |
|
| 14018 |
|
| 14019 |
var buf []byte |
| 14020 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14021 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 14022 |
hdr.Len = i.SizeBytes() |
| 14023 |
hdr.Cap = i.SizeBytes() |
| 14024 |
|
| 14025 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 14026 |
|
| 14027 |
|
| 14028 |
runtime.KeepAlive(i) |
| 14029 |
return length, err |
| 14030 |
} |
| 14031 |
|
| 14032 |
|
| 14033 |
|
| 14034 |
func (i *InetMulticastRequest) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14035 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 14036 |
} |
| 14037 |
|
| 14038 |
|
| 14039 |
|
| 14040 |
func (i *InetMulticastRequest) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14041 |
if !i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() { |
| 14042 |
|
| 14043 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 14044 |
length, err := cc.CopyInBytes(addr, buf) |
| 14045 |
|
| 14046 |
|
| 14047 |
i.UnmarshalBytes(buf) |
| 14048 |
return length, err |
| 14049 |
} |
| 14050 |
|
| 14051 |
|
| 14052 |
var buf []byte |
| 14053 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14054 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 14055 |
hdr.Len = i.SizeBytes() |
| 14056 |
hdr.Cap = i.SizeBytes() |
| 14057 |
|
| 14058 |
length, err := cc.CopyInBytes(addr, buf) |
| 14059 |
|
| 14060 |
|
| 14061 |
runtime.KeepAlive(i) |
| 14062 |
return length, err |
| 14063 |
} |
| 14064 |
|
| 14065 |
|
| 14066 |
func (i *InetMulticastRequest) WriteTo(writer io.Writer) (int64, error) { |
| 14067 |
if !i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() { |
| 14068 |
|
| 14069 |
buf := make([]byte, i.SizeBytes()) |
| 14070 |
i.MarshalBytes(buf) |
| 14071 |
length, err := writer.Write(buf) |
| 14072 |
return int64(length), err |
| 14073 |
} |
| 14074 |
|
| 14075 |
|
| 14076 |
var buf []byte |
| 14077 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14078 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 14079 |
hdr.Len = i.SizeBytes() |
| 14080 |
hdr.Cap = i.SizeBytes() |
| 14081 |
|
| 14082 |
length, err := writer.Write(buf) |
| 14083 |
|
| 14084 |
|
| 14085 |
runtime.KeepAlive(i) |
| 14086 |
return int64(length), err |
| 14087 |
} |
| 14088 |
|
| 14089 |
|
| 14090 |
func (i *InetMulticastRequestWithNIC) SizeBytes() int { |
| 14091 |
return 4 + |
| 14092 |
(*InetMulticastRequest)(nil).SizeBytes() |
| 14093 |
} |
| 14094 |
|
| 14095 |
|
| 14096 |
func (i *InetMulticastRequestWithNIC) MarshalBytes(dst []byte) []byte { |
| 14097 |
dst = i.InetMulticastRequest.MarshalUnsafe(dst) |
| 14098 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.InterfaceIndex)) |
| 14099 |
dst = dst[4:] |
| 14100 |
return dst |
| 14101 |
} |
| 14102 |
|
| 14103 |
|
| 14104 |
func (i *InetMulticastRequestWithNIC) UnmarshalBytes(src []byte) []byte { |
| 14105 |
src = i.InetMulticastRequest.UnmarshalUnsafe(src) |
| 14106 |
i.InterfaceIndex = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14107 |
src = src[4:] |
| 14108 |
return src |
| 14109 |
} |
| 14110 |
|
| 14111 |
|
| 14112 |
|
| 14113 |
func (i *InetMulticastRequestWithNIC) Packed() bool { |
| 14114 |
return i.InetMulticastRequest.Packed() |
| 14115 |
} |
| 14116 |
|
| 14117 |
|
| 14118 |
func (i *InetMulticastRequestWithNIC) MarshalUnsafe(dst []byte) []byte { |
| 14119 |
if i.InetMulticastRequest.Packed() { |
| 14120 |
size := i.SizeBytes() |
| 14121 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 14122 |
return dst[size:] |
| 14123 |
} |
| 14124 |
|
| 14125 |
return i.MarshalBytes(dst) |
| 14126 |
} |
| 14127 |
|
| 14128 |
|
| 14129 |
func (i *InetMulticastRequestWithNIC) UnmarshalUnsafe(src []byte) []byte { |
| 14130 |
if i.InetMulticastRequest.Packed() { |
| 14131 |
size := i.SizeBytes() |
| 14132 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 14133 |
return src[size:] |
| 14134 |
} |
| 14135 |
|
| 14136 |
return i.UnmarshalBytes(src) |
| 14137 |
} |
| 14138 |
|
| 14139 |
|
| 14140 |
|
| 14141 |
func (i *InetMulticastRequestWithNIC) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 14142 |
if !i.InetMulticastRequest.Packed() { |
| 14143 |
|
| 14144 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 14145 |
i.MarshalBytes(buf) |
| 14146 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 14147 |
} |
| 14148 |
|
| 14149 |
|
| 14150 |
var buf []byte |
| 14151 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14152 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 14153 |
hdr.Len = i.SizeBytes() |
| 14154 |
hdr.Cap = i.SizeBytes() |
| 14155 |
|
| 14156 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 14157 |
|
| 14158 |
|
| 14159 |
runtime.KeepAlive(i) |
| 14160 |
return length, err |
| 14161 |
} |
| 14162 |
|
| 14163 |
|
| 14164 |
|
| 14165 |
func (i *InetMulticastRequestWithNIC) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14166 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 14167 |
} |
| 14168 |
|
| 14169 |
|
| 14170 |
|
| 14171 |
func (i *InetMulticastRequestWithNIC) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14172 |
if !i.InetMulticastRequest.Packed() { |
| 14173 |
|
| 14174 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 14175 |
length, err := cc.CopyInBytes(addr, buf) |
| 14176 |
|
| 14177 |
|
| 14178 |
i.UnmarshalBytes(buf) |
| 14179 |
return length, err |
| 14180 |
} |
| 14181 |
|
| 14182 |
|
| 14183 |
var buf []byte |
| 14184 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14185 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 14186 |
hdr.Len = i.SizeBytes() |
| 14187 |
hdr.Cap = i.SizeBytes() |
| 14188 |
|
| 14189 |
length, err := cc.CopyInBytes(addr, buf) |
| 14190 |
|
| 14191 |
|
| 14192 |
runtime.KeepAlive(i) |
| 14193 |
return length, err |
| 14194 |
} |
| 14195 |
|
| 14196 |
|
| 14197 |
func (i *InetMulticastRequestWithNIC) WriteTo(writer io.Writer) (int64, error) { |
| 14198 |
if !i.InetMulticastRequest.Packed() { |
| 14199 |
|
| 14200 |
buf := make([]byte, i.SizeBytes()) |
| 14201 |
i.MarshalBytes(buf) |
| 14202 |
length, err := writer.Write(buf) |
| 14203 |
return int64(length), err |
| 14204 |
} |
| 14205 |
|
| 14206 |
|
| 14207 |
var buf []byte |
| 14208 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14209 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 14210 |
hdr.Len = i.SizeBytes() |
| 14211 |
hdr.Cap = i.SizeBytes() |
| 14212 |
|
| 14213 |
length, err := writer.Write(buf) |
| 14214 |
|
| 14215 |
|
| 14216 |
runtime.KeepAlive(i) |
| 14217 |
return int64(length), err |
| 14218 |
} |
| 14219 |
|
| 14220 |
|
| 14221 |
func (l *Linger) SizeBytes() int { |
| 14222 |
return 8 |
| 14223 |
} |
| 14224 |
|
| 14225 |
|
| 14226 |
func (l *Linger) MarshalBytes(dst []byte) []byte { |
| 14227 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(l.OnOff)) |
| 14228 |
dst = dst[4:] |
| 14229 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(l.Linger)) |
| 14230 |
dst = dst[4:] |
| 14231 |
return dst |
| 14232 |
} |
| 14233 |
|
| 14234 |
|
| 14235 |
func (l *Linger) UnmarshalBytes(src []byte) []byte { |
| 14236 |
l.OnOff = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14237 |
src = src[4:] |
| 14238 |
l.Linger = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14239 |
src = src[4:] |
| 14240 |
return src |
| 14241 |
} |
| 14242 |
|
| 14243 |
|
| 14244 |
|
| 14245 |
func (l *Linger) Packed() bool { |
| 14246 |
return true |
| 14247 |
} |
| 14248 |
|
| 14249 |
|
| 14250 |
func (l *Linger) MarshalUnsafe(dst []byte) []byte { |
| 14251 |
size := l.SizeBytes() |
| 14252 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(l), uintptr(size)) |
| 14253 |
return dst[size:] |
| 14254 |
} |
| 14255 |
|
| 14256 |
|
| 14257 |
func (l *Linger) UnmarshalUnsafe(src []byte) []byte { |
| 14258 |
size := l.SizeBytes() |
| 14259 |
gohacks.Memmove(unsafe.Pointer(l), unsafe.Pointer(&src[0]), uintptr(size)) |
| 14260 |
return src[size:] |
| 14261 |
} |
| 14262 |
|
| 14263 |
|
| 14264 |
|
| 14265 |
func (l *Linger) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 14266 |
|
| 14267 |
var buf []byte |
| 14268 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14269 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(l))) |
| 14270 |
hdr.Len = l.SizeBytes() |
| 14271 |
hdr.Cap = l.SizeBytes() |
| 14272 |
|
| 14273 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 14274 |
|
| 14275 |
|
| 14276 |
runtime.KeepAlive(l) |
| 14277 |
return length, err |
| 14278 |
} |
| 14279 |
|
| 14280 |
|
| 14281 |
|
| 14282 |
func (l *Linger) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14283 |
return l.CopyOutN(cc, addr, l.SizeBytes()) |
| 14284 |
} |
| 14285 |
|
| 14286 |
|
| 14287 |
|
| 14288 |
func (l *Linger) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14289 |
|
| 14290 |
var buf []byte |
| 14291 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14292 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(l))) |
| 14293 |
hdr.Len = l.SizeBytes() |
| 14294 |
hdr.Cap = l.SizeBytes() |
| 14295 |
|
| 14296 |
length, err := cc.CopyInBytes(addr, buf) |
| 14297 |
|
| 14298 |
|
| 14299 |
runtime.KeepAlive(l) |
| 14300 |
return length, err |
| 14301 |
} |
| 14302 |
|
| 14303 |
|
| 14304 |
func (l *Linger) WriteTo(writer io.Writer) (int64, error) { |
| 14305 |
|
| 14306 |
var buf []byte |
| 14307 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14308 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(l))) |
| 14309 |
hdr.Len = l.SizeBytes() |
| 14310 |
hdr.Cap = l.SizeBytes() |
| 14311 |
|
| 14312 |
length, err := writer.Write(buf) |
| 14313 |
|
| 14314 |
|
| 14315 |
runtime.KeepAlive(l) |
| 14316 |
return int64(length), err |
| 14317 |
} |
| 14318 |
|
| 14319 |
|
| 14320 |
func (s *SockAddrInet) SizeBytes() int { |
| 14321 |
return 4 + |
| 14322 |
(*InetAddr)(nil).SizeBytes() + |
| 14323 |
1*8 |
| 14324 |
} |
| 14325 |
|
| 14326 |
|
| 14327 |
func (s *SockAddrInet) MarshalBytes(dst []byte) []byte { |
| 14328 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Family)) |
| 14329 |
dst = dst[2:] |
| 14330 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Port)) |
| 14331 |
dst = dst[2:] |
| 14332 |
dst = s.Addr.MarshalUnsafe(dst) |
| 14333 |
|
| 14334 |
dst = dst[1*(8):] |
| 14335 |
return dst |
| 14336 |
} |
| 14337 |
|
| 14338 |
|
| 14339 |
func (s *SockAddrInet) UnmarshalBytes(src []byte) []byte { |
| 14340 |
s.Family = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 14341 |
src = src[2:] |
| 14342 |
s.Port = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 14343 |
src = src[2:] |
| 14344 |
src = s.Addr.UnmarshalUnsafe(src) |
| 14345 |
|
| 14346 |
src = src[1*(8):] |
| 14347 |
return src |
| 14348 |
} |
| 14349 |
|
| 14350 |
|
| 14351 |
|
| 14352 |
func (s *SockAddrInet) Packed() bool { |
| 14353 |
return s.Addr.Packed() |
| 14354 |
} |
| 14355 |
|
| 14356 |
|
| 14357 |
func (s *SockAddrInet) MarshalUnsafe(dst []byte) []byte { |
| 14358 |
if s.Addr.Packed() { |
| 14359 |
size := s.SizeBytes() |
| 14360 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 14361 |
return dst[size:] |
| 14362 |
} |
| 14363 |
|
| 14364 |
return s.MarshalBytes(dst) |
| 14365 |
} |
| 14366 |
|
| 14367 |
|
| 14368 |
func (s *SockAddrInet) UnmarshalUnsafe(src []byte) []byte { |
| 14369 |
if s.Addr.Packed() { |
| 14370 |
size := s.SizeBytes() |
| 14371 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 14372 |
return src[size:] |
| 14373 |
} |
| 14374 |
|
| 14375 |
return s.UnmarshalBytes(src) |
| 14376 |
} |
| 14377 |
|
| 14378 |
|
| 14379 |
|
| 14380 |
func (s *SockAddrInet) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 14381 |
if !s.Addr.Packed() { |
| 14382 |
|
| 14383 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 14384 |
s.MarshalBytes(buf) |
| 14385 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 14386 |
} |
| 14387 |
|
| 14388 |
|
| 14389 |
var buf []byte |
| 14390 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14391 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14392 |
hdr.Len = s.SizeBytes() |
| 14393 |
hdr.Cap = s.SizeBytes() |
| 14394 |
|
| 14395 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 14396 |
|
| 14397 |
|
| 14398 |
runtime.KeepAlive(s) |
| 14399 |
return length, err |
| 14400 |
} |
| 14401 |
|
| 14402 |
|
| 14403 |
|
| 14404 |
func (s *SockAddrInet) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14405 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 14406 |
} |
| 14407 |
|
| 14408 |
|
| 14409 |
|
| 14410 |
func (s *SockAddrInet) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14411 |
if !s.Addr.Packed() { |
| 14412 |
|
| 14413 |
buf := cc.CopyScratchBuffer(s.SizeBytes()) |
| 14414 |
length, err := cc.CopyInBytes(addr, buf) |
| 14415 |
|
| 14416 |
|
| 14417 |
s.UnmarshalBytes(buf) |
| 14418 |
return length, err |
| 14419 |
} |
| 14420 |
|
| 14421 |
|
| 14422 |
var buf []byte |
| 14423 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14424 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14425 |
hdr.Len = s.SizeBytes() |
| 14426 |
hdr.Cap = s.SizeBytes() |
| 14427 |
|
| 14428 |
length, err := cc.CopyInBytes(addr, buf) |
| 14429 |
|
| 14430 |
|
| 14431 |
runtime.KeepAlive(s) |
| 14432 |
return length, err |
| 14433 |
} |
| 14434 |
|
| 14435 |
|
| 14436 |
func (s *SockAddrInet) WriteTo(writer io.Writer) (int64, error) { |
| 14437 |
if !s.Addr.Packed() { |
| 14438 |
|
| 14439 |
buf := make([]byte, s.SizeBytes()) |
| 14440 |
s.MarshalBytes(buf) |
| 14441 |
length, err := writer.Write(buf) |
| 14442 |
return int64(length), err |
| 14443 |
} |
| 14444 |
|
| 14445 |
|
| 14446 |
var buf []byte |
| 14447 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14448 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14449 |
hdr.Len = s.SizeBytes() |
| 14450 |
hdr.Cap = s.SizeBytes() |
| 14451 |
|
| 14452 |
length, err := writer.Write(buf) |
| 14453 |
|
| 14454 |
|
| 14455 |
runtime.KeepAlive(s) |
| 14456 |
return int64(length), err |
| 14457 |
} |
| 14458 |
|
| 14459 |
|
| 14460 |
func (s *SockAddrInet6) SizeBytes() int { |
| 14461 |
return 12 + |
| 14462 |
1*16 |
| 14463 |
} |
| 14464 |
|
| 14465 |
|
| 14466 |
func (s *SockAddrInet6) MarshalBytes(dst []byte) []byte { |
| 14467 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Family)) |
| 14468 |
dst = dst[2:] |
| 14469 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Port)) |
| 14470 |
dst = dst[2:] |
| 14471 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Flowinfo)) |
| 14472 |
dst = dst[4:] |
| 14473 |
for idx := 0; idx < 16; idx++ { |
| 14474 |
dst[0] = byte(s.Addr[idx]) |
| 14475 |
dst = dst[1:] |
| 14476 |
} |
| 14477 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Scope_id)) |
| 14478 |
dst = dst[4:] |
| 14479 |
return dst |
| 14480 |
} |
| 14481 |
|
| 14482 |
|
| 14483 |
func (s *SockAddrInet6) UnmarshalBytes(src []byte) []byte { |
| 14484 |
s.Family = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 14485 |
src = src[2:] |
| 14486 |
s.Port = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 14487 |
src = src[2:] |
| 14488 |
s.Flowinfo = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14489 |
src = src[4:] |
| 14490 |
for idx := 0; idx < 16; idx++ { |
| 14491 |
s.Addr[idx] = src[0] |
| 14492 |
src = src[1:] |
| 14493 |
} |
| 14494 |
s.Scope_id = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14495 |
src = src[4:] |
| 14496 |
return src |
| 14497 |
} |
| 14498 |
|
| 14499 |
|
| 14500 |
|
| 14501 |
func (s *SockAddrInet6) Packed() bool { |
| 14502 |
return true |
| 14503 |
} |
| 14504 |
|
| 14505 |
|
| 14506 |
func (s *SockAddrInet6) MarshalUnsafe(dst []byte) []byte { |
| 14507 |
size := s.SizeBytes() |
| 14508 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 14509 |
return dst[size:] |
| 14510 |
} |
| 14511 |
|
| 14512 |
|
| 14513 |
func (s *SockAddrInet6) UnmarshalUnsafe(src []byte) []byte { |
| 14514 |
size := s.SizeBytes() |
| 14515 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 14516 |
return src[size:] |
| 14517 |
} |
| 14518 |
|
| 14519 |
|
| 14520 |
|
| 14521 |
func (s *SockAddrInet6) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 14522 |
|
| 14523 |
var buf []byte |
| 14524 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14525 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14526 |
hdr.Len = s.SizeBytes() |
| 14527 |
hdr.Cap = s.SizeBytes() |
| 14528 |
|
| 14529 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 14530 |
|
| 14531 |
|
| 14532 |
runtime.KeepAlive(s) |
| 14533 |
return length, err |
| 14534 |
} |
| 14535 |
|
| 14536 |
|
| 14537 |
|
| 14538 |
func (s *SockAddrInet6) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14539 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 14540 |
} |
| 14541 |
|
| 14542 |
|
| 14543 |
|
| 14544 |
func (s *SockAddrInet6) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14545 |
|
| 14546 |
var buf []byte |
| 14547 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14548 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14549 |
hdr.Len = s.SizeBytes() |
| 14550 |
hdr.Cap = s.SizeBytes() |
| 14551 |
|
| 14552 |
length, err := cc.CopyInBytes(addr, buf) |
| 14553 |
|
| 14554 |
|
| 14555 |
runtime.KeepAlive(s) |
| 14556 |
return length, err |
| 14557 |
} |
| 14558 |
|
| 14559 |
|
| 14560 |
func (s *SockAddrInet6) WriteTo(writer io.Writer) (int64, error) { |
| 14561 |
|
| 14562 |
var buf []byte |
| 14563 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14564 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14565 |
hdr.Len = s.SizeBytes() |
| 14566 |
hdr.Cap = s.SizeBytes() |
| 14567 |
|
| 14568 |
length, err := writer.Write(buf) |
| 14569 |
|
| 14570 |
|
| 14571 |
runtime.KeepAlive(s) |
| 14572 |
return int64(length), err |
| 14573 |
} |
| 14574 |
|
| 14575 |
|
| 14576 |
func (s *SockAddrLink) SizeBytes() int { |
| 14577 |
return 12 + |
| 14578 |
1*8 |
| 14579 |
} |
| 14580 |
|
| 14581 |
|
| 14582 |
func (s *SockAddrLink) MarshalBytes(dst []byte) []byte { |
| 14583 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Family)) |
| 14584 |
dst = dst[2:] |
| 14585 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Protocol)) |
| 14586 |
dst = dst[2:] |
| 14587 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.InterfaceIndex)) |
| 14588 |
dst = dst[4:] |
| 14589 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.ARPHardwareType)) |
| 14590 |
dst = dst[2:] |
| 14591 |
dst[0] = byte(s.PacketType) |
| 14592 |
dst = dst[1:] |
| 14593 |
dst[0] = byte(s.HardwareAddrLen) |
| 14594 |
dst = dst[1:] |
| 14595 |
for idx := 0; idx < 8; idx++ { |
| 14596 |
dst[0] = byte(s.HardwareAddr[idx]) |
| 14597 |
dst = dst[1:] |
| 14598 |
} |
| 14599 |
return dst |
| 14600 |
} |
| 14601 |
|
| 14602 |
|
| 14603 |
func (s *SockAddrLink) UnmarshalBytes(src []byte) []byte { |
| 14604 |
s.Family = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 14605 |
src = src[2:] |
| 14606 |
s.Protocol = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 14607 |
src = src[2:] |
| 14608 |
s.InterfaceIndex = int32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14609 |
src = src[4:] |
| 14610 |
s.ARPHardwareType = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 14611 |
src = src[2:] |
| 14612 |
s.PacketType = src[0] |
| 14613 |
src = src[1:] |
| 14614 |
s.HardwareAddrLen = src[0] |
| 14615 |
src = src[1:] |
| 14616 |
for idx := 0; idx < 8; idx++ { |
| 14617 |
s.HardwareAddr[idx] = src[0] |
| 14618 |
src = src[1:] |
| 14619 |
} |
| 14620 |
return src |
| 14621 |
} |
| 14622 |
|
| 14623 |
|
| 14624 |
|
| 14625 |
func (s *SockAddrLink) Packed() bool { |
| 14626 |
return true |
| 14627 |
} |
| 14628 |
|
| 14629 |
|
| 14630 |
func (s *SockAddrLink) MarshalUnsafe(dst []byte) []byte { |
| 14631 |
size := s.SizeBytes() |
| 14632 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 14633 |
return dst[size:] |
| 14634 |
} |
| 14635 |
|
| 14636 |
|
| 14637 |
func (s *SockAddrLink) UnmarshalUnsafe(src []byte) []byte { |
| 14638 |
size := s.SizeBytes() |
| 14639 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 14640 |
return src[size:] |
| 14641 |
} |
| 14642 |
|
| 14643 |
|
| 14644 |
|
| 14645 |
func (s *SockAddrLink) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 14646 |
|
| 14647 |
var buf []byte |
| 14648 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14649 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14650 |
hdr.Len = s.SizeBytes() |
| 14651 |
hdr.Cap = s.SizeBytes() |
| 14652 |
|
| 14653 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 14654 |
|
| 14655 |
|
| 14656 |
runtime.KeepAlive(s) |
| 14657 |
return length, err |
| 14658 |
} |
| 14659 |
|
| 14660 |
|
| 14661 |
|
| 14662 |
func (s *SockAddrLink) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14663 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 14664 |
} |
| 14665 |
|
| 14666 |
|
| 14667 |
|
| 14668 |
func (s *SockAddrLink) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14669 |
|
| 14670 |
var buf []byte |
| 14671 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14672 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14673 |
hdr.Len = s.SizeBytes() |
| 14674 |
hdr.Cap = s.SizeBytes() |
| 14675 |
|
| 14676 |
length, err := cc.CopyInBytes(addr, buf) |
| 14677 |
|
| 14678 |
|
| 14679 |
runtime.KeepAlive(s) |
| 14680 |
return length, err |
| 14681 |
} |
| 14682 |
|
| 14683 |
|
| 14684 |
func (s *SockAddrLink) WriteTo(writer io.Writer) (int64, error) { |
| 14685 |
|
| 14686 |
var buf []byte |
| 14687 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14688 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14689 |
hdr.Len = s.SizeBytes() |
| 14690 |
hdr.Cap = s.SizeBytes() |
| 14691 |
|
| 14692 |
length, err := writer.Write(buf) |
| 14693 |
|
| 14694 |
|
| 14695 |
runtime.KeepAlive(s) |
| 14696 |
return int64(length), err |
| 14697 |
} |
| 14698 |
|
| 14699 |
|
| 14700 |
func (s *SockAddrUnix) SizeBytes() int { |
| 14701 |
return 2 + |
| 14702 |
1*UnixPathMax |
| 14703 |
} |
| 14704 |
|
| 14705 |
|
| 14706 |
func (s *SockAddrUnix) MarshalBytes(dst []byte) []byte { |
| 14707 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Family)) |
| 14708 |
dst = dst[2:] |
| 14709 |
for idx := 0; idx < UnixPathMax; idx++ { |
| 14710 |
dst[0] = byte(s.Path[idx]) |
| 14711 |
dst = dst[1:] |
| 14712 |
} |
| 14713 |
return dst |
| 14714 |
} |
| 14715 |
|
| 14716 |
|
| 14717 |
func (s *SockAddrUnix) UnmarshalBytes(src []byte) []byte { |
| 14718 |
s.Family = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 14719 |
src = src[2:] |
| 14720 |
for idx := 0; idx < UnixPathMax; idx++ { |
| 14721 |
s.Path[idx] = int8(src[0]) |
| 14722 |
src = src[1:] |
| 14723 |
} |
| 14724 |
return src |
| 14725 |
} |
| 14726 |
|
| 14727 |
|
| 14728 |
|
| 14729 |
func (s *SockAddrUnix) Packed() bool { |
| 14730 |
return true |
| 14731 |
} |
| 14732 |
|
| 14733 |
|
| 14734 |
func (s *SockAddrUnix) MarshalUnsafe(dst []byte) []byte { |
| 14735 |
size := s.SizeBytes() |
| 14736 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) |
| 14737 |
return dst[size:] |
| 14738 |
} |
| 14739 |
|
| 14740 |
|
| 14741 |
func (s *SockAddrUnix) UnmarshalUnsafe(src []byte) []byte { |
| 14742 |
size := s.SizeBytes() |
| 14743 |
gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) |
| 14744 |
return src[size:] |
| 14745 |
} |
| 14746 |
|
| 14747 |
|
| 14748 |
|
| 14749 |
func (s *SockAddrUnix) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 14750 |
|
| 14751 |
var buf []byte |
| 14752 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14753 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14754 |
hdr.Len = s.SizeBytes() |
| 14755 |
hdr.Cap = s.SizeBytes() |
| 14756 |
|
| 14757 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 14758 |
|
| 14759 |
|
| 14760 |
runtime.KeepAlive(s) |
| 14761 |
return length, err |
| 14762 |
} |
| 14763 |
|
| 14764 |
|
| 14765 |
|
| 14766 |
func (s *SockAddrUnix) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14767 |
return s.CopyOutN(cc, addr, s.SizeBytes()) |
| 14768 |
} |
| 14769 |
|
| 14770 |
|
| 14771 |
|
| 14772 |
func (s *SockAddrUnix) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 14773 |
|
| 14774 |
var buf []byte |
| 14775 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14776 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14777 |
hdr.Len = s.SizeBytes() |
| 14778 |
hdr.Cap = s.SizeBytes() |
| 14779 |
|
| 14780 |
length, err := cc.CopyInBytes(addr, buf) |
| 14781 |
|
| 14782 |
|
| 14783 |
runtime.KeepAlive(s) |
| 14784 |
return length, err |
| 14785 |
} |
| 14786 |
|
| 14787 |
|
| 14788 |
func (s *SockAddrUnix) WriteTo(writer io.Writer) (int64, error) { |
| 14789 |
|
| 14790 |
var buf []byte |
| 14791 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 14792 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) |
| 14793 |
hdr.Len = s.SizeBytes() |
| 14794 |
hdr.Cap = s.SizeBytes() |
| 14795 |
|
| 14796 |
length, err := writer.Write(buf) |
| 14797 |
|
| 14798 |
|
| 14799 |
runtime.KeepAlive(s) |
| 14800 |
return int64(length), err |
| 14801 |
} |
| 14802 |
|
| 14803 |
|
| 14804 |
func (t *TCPInfo) SizeBytes() int { |
| 14805 |
return 224 |
| 14806 |
} |
| 14807 |
|
| 14808 |
|
| 14809 |
func (t *TCPInfo) MarshalBytes(dst []byte) []byte { |
| 14810 |
dst[0] = byte(t.State) |
| 14811 |
dst = dst[1:] |
| 14812 |
dst[0] = byte(t.CaState) |
| 14813 |
dst = dst[1:] |
| 14814 |
dst[0] = byte(t.Retransmits) |
| 14815 |
dst = dst[1:] |
| 14816 |
dst[0] = byte(t.Probes) |
| 14817 |
dst = dst[1:] |
| 14818 |
dst[0] = byte(t.Backoff) |
| 14819 |
dst = dst[1:] |
| 14820 |
dst[0] = byte(t.Options) |
| 14821 |
dst = dst[1:] |
| 14822 |
dst[0] = byte(t.WindowScale) |
| 14823 |
dst = dst[1:] |
| 14824 |
dst[0] = byte(t.DeliveryRateAppLimited) |
| 14825 |
dst = dst[1:] |
| 14826 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RTO)) |
| 14827 |
dst = dst[4:] |
| 14828 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.ATO)) |
| 14829 |
dst = dst[4:] |
| 14830 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.SndMss)) |
| 14831 |
dst = dst[4:] |
| 14832 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RcvMss)) |
| 14833 |
dst = dst[4:] |
| 14834 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Unacked)) |
| 14835 |
dst = dst[4:] |
| 14836 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Sacked)) |
| 14837 |
dst = dst[4:] |
| 14838 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Lost)) |
| 14839 |
dst = dst[4:] |
| 14840 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Retrans)) |
| 14841 |
dst = dst[4:] |
| 14842 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Fackets)) |
| 14843 |
dst = dst[4:] |
| 14844 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.LastDataSent)) |
| 14845 |
dst = dst[4:] |
| 14846 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.LastAckSent)) |
| 14847 |
dst = dst[4:] |
| 14848 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.LastDataRecv)) |
| 14849 |
dst = dst[4:] |
| 14850 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.LastAckRecv)) |
| 14851 |
dst = dst[4:] |
| 14852 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.PMTU)) |
| 14853 |
dst = dst[4:] |
| 14854 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RcvSsthresh)) |
| 14855 |
dst = dst[4:] |
| 14856 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RTT)) |
| 14857 |
dst = dst[4:] |
| 14858 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RTTVar)) |
| 14859 |
dst = dst[4:] |
| 14860 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.SndSsthresh)) |
| 14861 |
dst = dst[4:] |
| 14862 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.SndCwnd)) |
| 14863 |
dst = dst[4:] |
| 14864 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Advmss)) |
| 14865 |
dst = dst[4:] |
| 14866 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Reordering)) |
| 14867 |
dst = dst[4:] |
| 14868 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RcvRTT)) |
| 14869 |
dst = dst[4:] |
| 14870 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RcvSpace)) |
| 14871 |
dst = dst[4:] |
| 14872 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.TotalRetrans)) |
| 14873 |
dst = dst[4:] |
| 14874 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.PacingRate)) |
| 14875 |
dst = dst[8:] |
| 14876 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.MaxPacingRate)) |
| 14877 |
dst = dst[8:] |
| 14878 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.BytesAcked)) |
| 14879 |
dst = dst[8:] |
| 14880 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.BytesReceived)) |
| 14881 |
dst = dst[8:] |
| 14882 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.SegsOut)) |
| 14883 |
dst = dst[4:] |
| 14884 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.SegsIn)) |
| 14885 |
dst = dst[4:] |
| 14886 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.NotSentBytes)) |
| 14887 |
dst = dst[4:] |
| 14888 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.MinRTT)) |
| 14889 |
dst = dst[4:] |
| 14890 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.DataSegsIn)) |
| 14891 |
dst = dst[4:] |
| 14892 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.DataSegsOut)) |
| 14893 |
dst = dst[4:] |
| 14894 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.DeliveryRate)) |
| 14895 |
dst = dst[8:] |
| 14896 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.BusyTime)) |
| 14897 |
dst = dst[8:] |
| 14898 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.RwndLimited)) |
| 14899 |
dst = dst[8:] |
| 14900 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.SndBufLimited)) |
| 14901 |
dst = dst[8:] |
| 14902 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Delivered)) |
| 14903 |
dst = dst[4:] |
| 14904 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.DeliveredCE)) |
| 14905 |
dst = dst[4:] |
| 14906 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.BytesSent)) |
| 14907 |
dst = dst[8:] |
| 14908 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.BytesRetrans)) |
| 14909 |
dst = dst[8:] |
| 14910 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.DSACKDups)) |
| 14911 |
dst = dst[4:] |
| 14912 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.ReordSeen)) |
| 14913 |
dst = dst[4:] |
| 14914 |
return dst |
| 14915 |
} |
| 14916 |
|
| 14917 |
|
| 14918 |
func (t *TCPInfo) UnmarshalBytes(src []byte) []byte { |
| 14919 |
t.State = uint8(src[0]) |
| 14920 |
src = src[1:] |
| 14921 |
t.CaState = uint8(src[0]) |
| 14922 |
src = src[1:] |
| 14923 |
t.Retransmits = uint8(src[0]) |
| 14924 |
src = src[1:] |
| 14925 |
t.Probes = uint8(src[0]) |
| 14926 |
src = src[1:] |
| 14927 |
t.Backoff = uint8(src[0]) |
| 14928 |
src = src[1:] |
| 14929 |
t.Options = uint8(src[0]) |
| 14930 |
src = src[1:] |
| 14931 |
t.WindowScale = uint8(src[0]) |
| 14932 |
src = src[1:] |
| 14933 |
t.DeliveryRateAppLimited = uint8(src[0]) |
| 14934 |
src = src[1:] |
| 14935 |
t.RTO = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14936 |
src = src[4:] |
| 14937 |
t.ATO = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14938 |
src = src[4:] |
| 14939 |
t.SndMss = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14940 |
src = src[4:] |
| 14941 |
t.RcvMss = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14942 |
src = src[4:] |
| 14943 |
t.Unacked = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14944 |
src = src[4:] |
| 14945 |
t.Sacked = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14946 |
src = src[4:] |
| 14947 |
t.Lost = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14948 |
src = src[4:] |
| 14949 |
t.Retrans = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14950 |
src = src[4:] |
| 14951 |
t.Fackets = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14952 |
src = src[4:] |
| 14953 |
t.LastDataSent = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14954 |
src = src[4:] |
| 14955 |
t.LastAckSent = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14956 |
src = src[4:] |
| 14957 |
t.LastDataRecv = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14958 |
src = src[4:] |
| 14959 |
t.LastAckRecv = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14960 |
src = src[4:] |
| 14961 |
t.PMTU = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14962 |
src = src[4:] |
| 14963 |
t.RcvSsthresh = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14964 |
src = src[4:] |
| 14965 |
t.RTT = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14966 |
src = src[4:] |
| 14967 |
t.RTTVar = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14968 |
src = src[4:] |
| 14969 |
t.SndSsthresh = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14970 |
src = src[4:] |
| 14971 |
t.SndCwnd = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14972 |
src = src[4:] |
| 14973 |
t.Advmss = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14974 |
src = src[4:] |
| 14975 |
t.Reordering = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14976 |
src = src[4:] |
| 14977 |
t.RcvRTT = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14978 |
src = src[4:] |
| 14979 |
t.RcvSpace = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14980 |
src = src[4:] |
| 14981 |
t.TotalRetrans = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14982 |
src = src[4:] |
| 14983 |
t.PacingRate = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 14984 |
src = src[8:] |
| 14985 |
t.MaxPacingRate = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 14986 |
src = src[8:] |
| 14987 |
t.BytesAcked = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 14988 |
src = src[8:] |
| 14989 |
t.BytesReceived = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 14990 |
src = src[8:] |
| 14991 |
t.SegsOut = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14992 |
src = src[4:] |
| 14993 |
t.SegsIn = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14994 |
src = src[4:] |
| 14995 |
t.NotSentBytes = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14996 |
src = src[4:] |
| 14997 |
t.MinRTT = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 14998 |
src = src[4:] |
| 14999 |
t.DataSegsIn = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 15000 |
src = src[4:] |
| 15001 |
t.DataSegsOut = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 15002 |
src = src[4:] |
| 15003 |
t.DeliveryRate = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15004 |
src = src[8:] |
| 15005 |
t.BusyTime = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15006 |
src = src[8:] |
| 15007 |
t.RwndLimited = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15008 |
src = src[8:] |
| 15009 |
t.SndBufLimited = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15010 |
src = src[8:] |
| 15011 |
t.Delivered = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 15012 |
src = src[4:] |
| 15013 |
t.DeliveredCE = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 15014 |
src = src[4:] |
| 15015 |
t.BytesSent = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15016 |
src = src[8:] |
| 15017 |
t.BytesRetrans = uint64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15018 |
src = src[8:] |
| 15019 |
t.DSACKDups = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 15020 |
src = src[4:] |
| 15021 |
t.ReordSeen = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 15022 |
src = src[4:] |
| 15023 |
return src |
| 15024 |
} |
| 15025 |
|
| 15026 |
|
| 15027 |
|
| 15028 |
func (t *TCPInfo) Packed() bool { |
| 15029 |
return true |
| 15030 |
} |
| 15031 |
|
| 15032 |
|
| 15033 |
func (t *TCPInfo) MarshalUnsafe(dst []byte) []byte { |
| 15034 |
size := t.SizeBytes() |
| 15035 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(t), uintptr(size)) |
| 15036 |
return dst[size:] |
| 15037 |
} |
| 15038 |
|
| 15039 |
|
| 15040 |
func (t *TCPInfo) UnmarshalUnsafe(src []byte) []byte { |
| 15041 |
size := t.SizeBytes() |
| 15042 |
gohacks.Memmove(unsafe.Pointer(t), unsafe.Pointer(&src[0]), uintptr(size)) |
| 15043 |
return src[size:] |
| 15044 |
} |
| 15045 |
|
| 15046 |
|
| 15047 |
|
| 15048 |
func (t *TCPInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 15049 |
|
| 15050 |
var buf []byte |
| 15051 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15052 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 15053 |
hdr.Len = t.SizeBytes() |
| 15054 |
hdr.Cap = t.SizeBytes() |
| 15055 |
|
| 15056 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 15057 |
|
| 15058 |
|
| 15059 |
runtime.KeepAlive(t) |
| 15060 |
return length, err |
| 15061 |
} |
| 15062 |
|
| 15063 |
|
| 15064 |
|
| 15065 |
func (t *TCPInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15066 |
return t.CopyOutN(cc, addr, t.SizeBytes()) |
| 15067 |
} |
| 15068 |
|
| 15069 |
|
| 15070 |
|
| 15071 |
func (t *TCPInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15072 |
|
| 15073 |
var buf []byte |
| 15074 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15075 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 15076 |
hdr.Len = t.SizeBytes() |
| 15077 |
hdr.Cap = t.SizeBytes() |
| 15078 |
|
| 15079 |
length, err := cc.CopyInBytes(addr, buf) |
| 15080 |
|
| 15081 |
|
| 15082 |
runtime.KeepAlive(t) |
| 15083 |
return length, err |
| 15084 |
} |
| 15085 |
|
| 15086 |
|
| 15087 |
func (t *TCPInfo) WriteTo(writer io.Writer) (int64, error) { |
| 15088 |
|
| 15089 |
var buf []byte |
| 15090 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15091 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 15092 |
hdr.Len = t.SizeBytes() |
| 15093 |
hdr.Cap = t.SizeBytes() |
| 15094 |
|
| 15095 |
length, err := writer.Write(buf) |
| 15096 |
|
| 15097 |
|
| 15098 |
runtime.KeepAlive(t) |
| 15099 |
return int64(length), err |
| 15100 |
} |
| 15101 |
|
| 15102 |
|
| 15103 |
|
| 15104 |
func (c *ClockT) SizeBytes() int { |
| 15105 |
return 8 |
| 15106 |
} |
| 15107 |
|
| 15108 |
|
| 15109 |
func (c *ClockT) MarshalBytes(dst []byte) []byte { |
| 15110 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(*c)) |
| 15111 |
return dst[8:] |
| 15112 |
} |
| 15113 |
|
| 15114 |
|
| 15115 |
func (c *ClockT) UnmarshalBytes(src []byte) []byte { |
| 15116 |
*c = ClockT(int64(hostarch.ByteOrder.Uint64(src[:8]))) |
| 15117 |
return src[8:] |
| 15118 |
} |
| 15119 |
|
| 15120 |
|
| 15121 |
|
| 15122 |
func (c *ClockT) Packed() bool { |
| 15123 |
|
| 15124 |
return true |
| 15125 |
} |
| 15126 |
|
| 15127 |
|
| 15128 |
func (c *ClockT) MarshalUnsafe(dst []byte) []byte { |
| 15129 |
size := c.SizeBytes() |
| 15130 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) |
| 15131 |
return dst[size:] |
| 15132 |
} |
| 15133 |
|
| 15134 |
|
| 15135 |
func (c *ClockT) UnmarshalUnsafe(src []byte) []byte { |
| 15136 |
size := c.SizeBytes() |
| 15137 |
gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) |
| 15138 |
return src[size:] |
| 15139 |
} |
| 15140 |
|
| 15141 |
|
| 15142 |
|
| 15143 |
func (c *ClockT) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 15144 |
|
| 15145 |
var buf []byte |
| 15146 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15147 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 15148 |
hdr.Len = c.SizeBytes() |
| 15149 |
hdr.Cap = c.SizeBytes() |
| 15150 |
|
| 15151 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 15152 |
|
| 15153 |
|
| 15154 |
runtime.KeepAlive(c) |
| 15155 |
return length, err |
| 15156 |
} |
| 15157 |
|
| 15158 |
|
| 15159 |
|
| 15160 |
func (c *ClockT) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15161 |
return c.CopyOutN(cc, addr, c.SizeBytes()) |
| 15162 |
} |
| 15163 |
|
| 15164 |
|
| 15165 |
|
| 15166 |
func (c *ClockT) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15167 |
|
| 15168 |
var buf []byte |
| 15169 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15170 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 15171 |
hdr.Len = c.SizeBytes() |
| 15172 |
hdr.Cap = c.SizeBytes() |
| 15173 |
|
| 15174 |
length, err := cc.CopyInBytes(addr, buf) |
| 15175 |
|
| 15176 |
|
| 15177 |
runtime.KeepAlive(c) |
| 15178 |
return length, err |
| 15179 |
} |
| 15180 |
|
| 15181 |
|
| 15182 |
func (c *ClockT) WriteTo(writer io.Writer) (int64, error) { |
| 15183 |
|
| 15184 |
var buf []byte |
| 15185 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15186 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) |
| 15187 |
hdr.Len = c.SizeBytes() |
| 15188 |
hdr.Cap = c.SizeBytes() |
| 15189 |
|
| 15190 |
length, err := writer.Write(buf) |
| 15191 |
|
| 15192 |
|
| 15193 |
runtime.KeepAlive(c) |
| 15194 |
return int64(length), err |
| 15195 |
} |
| 15196 |
|
| 15197 |
|
| 15198 |
func (i *ItimerVal) SizeBytes() int { |
| 15199 |
return 0 + |
| 15200 |
(*Timeval)(nil).SizeBytes() + |
| 15201 |
(*Timeval)(nil).SizeBytes() |
| 15202 |
} |
| 15203 |
|
| 15204 |
|
| 15205 |
func (i *ItimerVal) MarshalBytes(dst []byte) []byte { |
| 15206 |
dst = i.Interval.MarshalUnsafe(dst) |
| 15207 |
dst = i.Value.MarshalUnsafe(dst) |
| 15208 |
return dst |
| 15209 |
} |
| 15210 |
|
| 15211 |
|
| 15212 |
func (i *ItimerVal) UnmarshalBytes(src []byte) []byte { |
| 15213 |
src = i.Interval.UnmarshalUnsafe(src) |
| 15214 |
src = i.Value.UnmarshalUnsafe(src) |
| 15215 |
return src |
| 15216 |
} |
| 15217 |
|
| 15218 |
|
| 15219 |
|
| 15220 |
func (i *ItimerVal) Packed() bool { |
| 15221 |
return i.Interval.Packed() && i.Value.Packed() |
| 15222 |
} |
| 15223 |
|
| 15224 |
|
| 15225 |
func (i *ItimerVal) MarshalUnsafe(dst []byte) []byte { |
| 15226 |
if i.Interval.Packed() && i.Value.Packed() { |
| 15227 |
size := i.SizeBytes() |
| 15228 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 15229 |
return dst[size:] |
| 15230 |
} |
| 15231 |
|
| 15232 |
return i.MarshalBytes(dst) |
| 15233 |
} |
| 15234 |
|
| 15235 |
|
| 15236 |
func (i *ItimerVal) UnmarshalUnsafe(src []byte) []byte { |
| 15237 |
if i.Interval.Packed() && i.Value.Packed() { |
| 15238 |
size := i.SizeBytes() |
| 15239 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 15240 |
return src[size:] |
| 15241 |
} |
| 15242 |
|
| 15243 |
return i.UnmarshalBytes(src) |
| 15244 |
} |
| 15245 |
|
| 15246 |
|
| 15247 |
|
| 15248 |
func (i *ItimerVal) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 15249 |
if !i.Interval.Packed() && i.Value.Packed() { |
| 15250 |
|
| 15251 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 15252 |
i.MarshalBytes(buf) |
| 15253 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 15254 |
} |
| 15255 |
|
| 15256 |
|
| 15257 |
var buf []byte |
| 15258 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15259 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 15260 |
hdr.Len = i.SizeBytes() |
| 15261 |
hdr.Cap = i.SizeBytes() |
| 15262 |
|
| 15263 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 15264 |
|
| 15265 |
|
| 15266 |
runtime.KeepAlive(i) |
| 15267 |
return length, err |
| 15268 |
} |
| 15269 |
|
| 15270 |
|
| 15271 |
|
| 15272 |
func (i *ItimerVal) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15273 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 15274 |
} |
| 15275 |
|
| 15276 |
|
| 15277 |
|
| 15278 |
func (i *ItimerVal) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15279 |
if !i.Interval.Packed() && i.Value.Packed() { |
| 15280 |
|
| 15281 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 15282 |
length, err := cc.CopyInBytes(addr, buf) |
| 15283 |
|
| 15284 |
|
| 15285 |
i.UnmarshalBytes(buf) |
| 15286 |
return length, err |
| 15287 |
} |
| 15288 |
|
| 15289 |
|
| 15290 |
var buf []byte |
| 15291 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15292 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 15293 |
hdr.Len = i.SizeBytes() |
| 15294 |
hdr.Cap = i.SizeBytes() |
| 15295 |
|
| 15296 |
length, err := cc.CopyInBytes(addr, buf) |
| 15297 |
|
| 15298 |
|
| 15299 |
runtime.KeepAlive(i) |
| 15300 |
return length, err |
| 15301 |
} |
| 15302 |
|
| 15303 |
|
| 15304 |
func (i *ItimerVal) WriteTo(writer io.Writer) (int64, error) { |
| 15305 |
if !i.Interval.Packed() && i.Value.Packed() { |
| 15306 |
|
| 15307 |
buf := make([]byte, i.SizeBytes()) |
| 15308 |
i.MarshalBytes(buf) |
| 15309 |
length, err := writer.Write(buf) |
| 15310 |
return int64(length), err |
| 15311 |
} |
| 15312 |
|
| 15313 |
|
| 15314 |
var buf []byte |
| 15315 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15316 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 15317 |
hdr.Len = i.SizeBytes() |
| 15318 |
hdr.Cap = i.SizeBytes() |
| 15319 |
|
| 15320 |
length, err := writer.Write(buf) |
| 15321 |
|
| 15322 |
|
| 15323 |
runtime.KeepAlive(i) |
| 15324 |
return int64(length), err |
| 15325 |
} |
| 15326 |
|
| 15327 |
|
| 15328 |
func (i *Itimerspec) SizeBytes() int { |
| 15329 |
return 0 + |
| 15330 |
(*Timespec)(nil).SizeBytes() + |
| 15331 |
(*Timespec)(nil).SizeBytes() |
| 15332 |
} |
| 15333 |
|
| 15334 |
|
| 15335 |
func (i *Itimerspec) MarshalBytes(dst []byte) []byte { |
| 15336 |
dst = i.Interval.MarshalUnsafe(dst) |
| 15337 |
dst = i.Value.MarshalUnsafe(dst) |
| 15338 |
return dst |
| 15339 |
} |
| 15340 |
|
| 15341 |
|
| 15342 |
func (i *Itimerspec) UnmarshalBytes(src []byte) []byte { |
| 15343 |
src = i.Interval.UnmarshalUnsafe(src) |
| 15344 |
src = i.Value.UnmarshalUnsafe(src) |
| 15345 |
return src |
| 15346 |
} |
| 15347 |
|
| 15348 |
|
| 15349 |
|
| 15350 |
func (i *Itimerspec) Packed() bool { |
| 15351 |
return i.Interval.Packed() && i.Value.Packed() |
| 15352 |
} |
| 15353 |
|
| 15354 |
|
| 15355 |
func (i *Itimerspec) MarshalUnsafe(dst []byte) []byte { |
| 15356 |
if i.Interval.Packed() && i.Value.Packed() { |
| 15357 |
size := i.SizeBytes() |
| 15358 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) |
| 15359 |
return dst[size:] |
| 15360 |
} |
| 15361 |
|
| 15362 |
return i.MarshalBytes(dst) |
| 15363 |
} |
| 15364 |
|
| 15365 |
|
| 15366 |
func (i *Itimerspec) UnmarshalUnsafe(src []byte) []byte { |
| 15367 |
if i.Interval.Packed() && i.Value.Packed() { |
| 15368 |
size := i.SizeBytes() |
| 15369 |
gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) |
| 15370 |
return src[size:] |
| 15371 |
} |
| 15372 |
|
| 15373 |
return i.UnmarshalBytes(src) |
| 15374 |
} |
| 15375 |
|
| 15376 |
|
| 15377 |
|
| 15378 |
func (i *Itimerspec) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 15379 |
if !i.Interval.Packed() && i.Value.Packed() { |
| 15380 |
|
| 15381 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 15382 |
i.MarshalBytes(buf) |
| 15383 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 15384 |
} |
| 15385 |
|
| 15386 |
|
| 15387 |
var buf []byte |
| 15388 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15389 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 15390 |
hdr.Len = i.SizeBytes() |
| 15391 |
hdr.Cap = i.SizeBytes() |
| 15392 |
|
| 15393 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 15394 |
|
| 15395 |
|
| 15396 |
runtime.KeepAlive(i) |
| 15397 |
return length, err |
| 15398 |
} |
| 15399 |
|
| 15400 |
|
| 15401 |
|
| 15402 |
func (i *Itimerspec) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15403 |
return i.CopyOutN(cc, addr, i.SizeBytes()) |
| 15404 |
} |
| 15405 |
|
| 15406 |
|
| 15407 |
|
| 15408 |
func (i *Itimerspec) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15409 |
if !i.Interval.Packed() && i.Value.Packed() { |
| 15410 |
|
| 15411 |
buf := cc.CopyScratchBuffer(i.SizeBytes()) |
| 15412 |
length, err := cc.CopyInBytes(addr, buf) |
| 15413 |
|
| 15414 |
|
| 15415 |
i.UnmarshalBytes(buf) |
| 15416 |
return length, err |
| 15417 |
} |
| 15418 |
|
| 15419 |
|
| 15420 |
var buf []byte |
| 15421 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15422 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 15423 |
hdr.Len = i.SizeBytes() |
| 15424 |
hdr.Cap = i.SizeBytes() |
| 15425 |
|
| 15426 |
length, err := cc.CopyInBytes(addr, buf) |
| 15427 |
|
| 15428 |
|
| 15429 |
runtime.KeepAlive(i) |
| 15430 |
return length, err |
| 15431 |
} |
| 15432 |
|
| 15433 |
|
| 15434 |
func (i *Itimerspec) WriteTo(writer io.Writer) (int64, error) { |
| 15435 |
if !i.Interval.Packed() && i.Value.Packed() { |
| 15436 |
|
| 15437 |
buf := make([]byte, i.SizeBytes()) |
| 15438 |
i.MarshalBytes(buf) |
| 15439 |
length, err := writer.Write(buf) |
| 15440 |
return int64(length), err |
| 15441 |
} |
| 15442 |
|
| 15443 |
|
| 15444 |
var buf []byte |
| 15445 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15446 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) |
| 15447 |
hdr.Len = i.SizeBytes() |
| 15448 |
hdr.Cap = i.SizeBytes() |
| 15449 |
|
| 15450 |
length, err := writer.Write(buf) |
| 15451 |
|
| 15452 |
|
| 15453 |
runtime.KeepAlive(i) |
| 15454 |
return int64(length), err |
| 15455 |
} |
| 15456 |
|
| 15457 |
|
| 15458 |
func (sxts *StatxTimestamp) SizeBytes() int { |
| 15459 |
return 16 |
| 15460 |
} |
| 15461 |
|
| 15462 |
|
| 15463 |
func (sxts *StatxTimestamp) MarshalBytes(dst []byte) []byte { |
| 15464 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(sxts.Sec)) |
| 15465 |
dst = dst[8:] |
| 15466 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(sxts.Nsec)) |
| 15467 |
dst = dst[4:] |
| 15468 |
|
| 15469 |
dst = dst[4:] |
| 15470 |
return dst |
| 15471 |
} |
| 15472 |
|
| 15473 |
|
| 15474 |
func (sxts *StatxTimestamp) UnmarshalBytes(src []byte) []byte { |
| 15475 |
sxts.Sec = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15476 |
src = src[8:] |
| 15477 |
sxts.Nsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 15478 |
src = src[4:] |
| 15479 |
|
| 15480 |
src = src[4:] |
| 15481 |
return src |
| 15482 |
} |
| 15483 |
|
| 15484 |
|
| 15485 |
|
| 15486 |
func (sxts *StatxTimestamp) Packed() bool { |
| 15487 |
return true |
| 15488 |
} |
| 15489 |
|
| 15490 |
|
| 15491 |
func (sxts *StatxTimestamp) MarshalUnsafe(dst []byte) []byte { |
| 15492 |
size := sxts.SizeBytes() |
| 15493 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(sxts), uintptr(size)) |
| 15494 |
return dst[size:] |
| 15495 |
} |
| 15496 |
|
| 15497 |
|
| 15498 |
func (sxts *StatxTimestamp) UnmarshalUnsafe(src []byte) []byte { |
| 15499 |
size := sxts.SizeBytes() |
| 15500 |
gohacks.Memmove(unsafe.Pointer(sxts), unsafe.Pointer(&src[0]), uintptr(size)) |
| 15501 |
return src[size:] |
| 15502 |
} |
| 15503 |
|
| 15504 |
|
| 15505 |
|
| 15506 |
func (sxts *StatxTimestamp) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 15507 |
|
| 15508 |
var buf []byte |
| 15509 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15510 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(sxts))) |
| 15511 |
hdr.Len = sxts.SizeBytes() |
| 15512 |
hdr.Cap = sxts.SizeBytes() |
| 15513 |
|
| 15514 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 15515 |
|
| 15516 |
|
| 15517 |
runtime.KeepAlive(sxts) |
| 15518 |
return length, err |
| 15519 |
} |
| 15520 |
|
| 15521 |
|
| 15522 |
|
| 15523 |
func (sxts *StatxTimestamp) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15524 |
return sxts.CopyOutN(cc, addr, sxts.SizeBytes()) |
| 15525 |
} |
| 15526 |
|
| 15527 |
|
| 15528 |
|
| 15529 |
func (sxts *StatxTimestamp) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15530 |
|
| 15531 |
var buf []byte |
| 15532 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15533 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(sxts))) |
| 15534 |
hdr.Len = sxts.SizeBytes() |
| 15535 |
hdr.Cap = sxts.SizeBytes() |
| 15536 |
|
| 15537 |
length, err := cc.CopyInBytes(addr, buf) |
| 15538 |
|
| 15539 |
|
| 15540 |
runtime.KeepAlive(sxts) |
| 15541 |
return length, err |
| 15542 |
} |
| 15543 |
|
| 15544 |
|
| 15545 |
func (sxts *StatxTimestamp) WriteTo(writer io.Writer) (int64, error) { |
| 15546 |
|
| 15547 |
var buf []byte |
| 15548 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15549 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(sxts))) |
| 15550 |
hdr.Len = sxts.SizeBytes() |
| 15551 |
hdr.Cap = sxts.SizeBytes() |
| 15552 |
|
| 15553 |
length, err := writer.Write(buf) |
| 15554 |
|
| 15555 |
|
| 15556 |
runtime.KeepAlive(sxts) |
| 15557 |
return int64(length), err |
| 15558 |
} |
| 15559 |
|
| 15560 |
|
| 15561 |
|
| 15562 |
func (t *TimeT) SizeBytes() int { |
| 15563 |
return 8 |
| 15564 |
} |
| 15565 |
|
| 15566 |
|
| 15567 |
func (t *TimeT) MarshalBytes(dst []byte) []byte { |
| 15568 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(*t)) |
| 15569 |
return dst[8:] |
| 15570 |
} |
| 15571 |
|
| 15572 |
|
| 15573 |
func (t *TimeT) UnmarshalBytes(src []byte) []byte { |
| 15574 |
*t = TimeT(int64(hostarch.ByteOrder.Uint64(src[:8]))) |
| 15575 |
return src[8:] |
| 15576 |
} |
| 15577 |
|
| 15578 |
|
| 15579 |
|
| 15580 |
func (t *TimeT) Packed() bool { |
| 15581 |
|
| 15582 |
return true |
| 15583 |
} |
| 15584 |
|
| 15585 |
|
| 15586 |
func (t *TimeT) MarshalUnsafe(dst []byte) []byte { |
| 15587 |
size := t.SizeBytes() |
| 15588 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(t), uintptr(size)) |
| 15589 |
return dst[size:] |
| 15590 |
} |
| 15591 |
|
| 15592 |
|
| 15593 |
func (t *TimeT) UnmarshalUnsafe(src []byte) []byte { |
| 15594 |
size := t.SizeBytes() |
| 15595 |
gohacks.Memmove(unsafe.Pointer(t), unsafe.Pointer(&src[0]), uintptr(size)) |
| 15596 |
return src[size:] |
| 15597 |
} |
| 15598 |
|
| 15599 |
|
| 15600 |
|
| 15601 |
func (t *TimeT) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 15602 |
|
| 15603 |
var buf []byte |
| 15604 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15605 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 15606 |
hdr.Len = t.SizeBytes() |
| 15607 |
hdr.Cap = t.SizeBytes() |
| 15608 |
|
| 15609 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 15610 |
|
| 15611 |
|
| 15612 |
runtime.KeepAlive(t) |
| 15613 |
return length, err |
| 15614 |
} |
| 15615 |
|
| 15616 |
|
| 15617 |
|
| 15618 |
func (t *TimeT) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15619 |
return t.CopyOutN(cc, addr, t.SizeBytes()) |
| 15620 |
} |
| 15621 |
|
| 15622 |
|
| 15623 |
|
| 15624 |
func (t *TimeT) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15625 |
|
| 15626 |
var buf []byte |
| 15627 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15628 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 15629 |
hdr.Len = t.SizeBytes() |
| 15630 |
hdr.Cap = t.SizeBytes() |
| 15631 |
|
| 15632 |
length, err := cc.CopyInBytes(addr, buf) |
| 15633 |
|
| 15634 |
|
| 15635 |
runtime.KeepAlive(t) |
| 15636 |
return length, err |
| 15637 |
} |
| 15638 |
|
| 15639 |
|
| 15640 |
func (t *TimeT) WriteTo(writer io.Writer) (int64, error) { |
| 15641 |
|
| 15642 |
var buf []byte |
| 15643 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15644 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 15645 |
hdr.Len = t.SizeBytes() |
| 15646 |
hdr.Cap = t.SizeBytes() |
| 15647 |
|
| 15648 |
length, err := writer.Write(buf) |
| 15649 |
|
| 15650 |
|
| 15651 |
runtime.KeepAlive(t) |
| 15652 |
return int64(length), err |
| 15653 |
} |
| 15654 |
|
| 15655 |
|
| 15656 |
|
| 15657 |
func (t *TimerID) SizeBytes() int { |
| 15658 |
return 4 |
| 15659 |
} |
| 15660 |
|
| 15661 |
|
| 15662 |
func (t *TimerID) MarshalBytes(dst []byte) []byte { |
| 15663 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(*t)) |
| 15664 |
return dst[4:] |
| 15665 |
} |
| 15666 |
|
| 15667 |
|
| 15668 |
func (t *TimerID) UnmarshalBytes(src []byte) []byte { |
| 15669 |
*t = TimerID(int32(hostarch.ByteOrder.Uint32(src[:4]))) |
| 15670 |
return src[4:] |
| 15671 |
} |
| 15672 |
|
| 15673 |
|
| 15674 |
|
| 15675 |
func (t *TimerID) Packed() bool { |
| 15676 |
|
| 15677 |
return true |
| 15678 |
} |
| 15679 |
|
| 15680 |
|
| 15681 |
func (t *TimerID) MarshalUnsafe(dst []byte) []byte { |
| 15682 |
size := t.SizeBytes() |
| 15683 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(t), uintptr(size)) |
| 15684 |
return dst[size:] |
| 15685 |
} |
| 15686 |
|
| 15687 |
|
| 15688 |
func (t *TimerID) UnmarshalUnsafe(src []byte) []byte { |
| 15689 |
size := t.SizeBytes() |
| 15690 |
gohacks.Memmove(unsafe.Pointer(t), unsafe.Pointer(&src[0]), uintptr(size)) |
| 15691 |
return src[size:] |
| 15692 |
} |
| 15693 |
|
| 15694 |
|
| 15695 |
|
| 15696 |
func (t *TimerID) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 15697 |
|
| 15698 |
var buf []byte |
| 15699 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15700 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 15701 |
hdr.Len = t.SizeBytes() |
| 15702 |
hdr.Cap = t.SizeBytes() |
| 15703 |
|
| 15704 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 15705 |
|
| 15706 |
|
| 15707 |
runtime.KeepAlive(t) |
| 15708 |
return length, err |
| 15709 |
} |
| 15710 |
|
| 15711 |
|
| 15712 |
|
| 15713 |
func (t *TimerID) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15714 |
return t.CopyOutN(cc, addr, t.SizeBytes()) |
| 15715 |
} |
| 15716 |
|
| 15717 |
|
| 15718 |
|
| 15719 |
func (t *TimerID) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15720 |
|
| 15721 |
var buf []byte |
| 15722 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15723 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 15724 |
hdr.Len = t.SizeBytes() |
| 15725 |
hdr.Cap = t.SizeBytes() |
| 15726 |
|
| 15727 |
length, err := cc.CopyInBytes(addr, buf) |
| 15728 |
|
| 15729 |
|
| 15730 |
runtime.KeepAlive(t) |
| 15731 |
return length, err |
| 15732 |
} |
| 15733 |
|
| 15734 |
|
| 15735 |
func (t *TimerID) WriteTo(writer io.Writer) (int64, error) { |
| 15736 |
|
| 15737 |
var buf []byte |
| 15738 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15739 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 15740 |
hdr.Len = t.SizeBytes() |
| 15741 |
hdr.Cap = t.SizeBytes() |
| 15742 |
|
| 15743 |
length, err := writer.Write(buf) |
| 15744 |
|
| 15745 |
|
| 15746 |
runtime.KeepAlive(t) |
| 15747 |
return int64(length), err |
| 15748 |
} |
| 15749 |
|
| 15750 |
|
| 15751 |
func (ts *Timespec) SizeBytes() int { |
| 15752 |
return 16 |
| 15753 |
} |
| 15754 |
|
| 15755 |
|
| 15756 |
func (ts *Timespec) MarshalBytes(dst []byte) []byte { |
| 15757 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(ts.Sec)) |
| 15758 |
dst = dst[8:] |
| 15759 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(ts.Nsec)) |
| 15760 |
dst = dst[8:] |
| 15761 |
return dst |
| 15762 |
} |
| 15763 |
|
| 15764 |
|
| 15765 |
func (ts *Timespec) UnmarshalBytes(src []byte) []byte { |
| 15766 |
ts.Sec = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15767 |
src = src[8:] |
| 15768 |
ts.Nsec = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15769 |
src = src[8:] |
| 15770 |
return src |
| 15771 |
} |
| 15772 |
|
| 15773 |
|
| 15774 |
|
| 15775 |
func (ts *Timespec) Packed() bool { |
| 15776 |
return true |
| 15777 |
} |
| 15778 |
|
| 15779 |
|
| 15780 |
func (ts *Timespec) MarshalUnsafe(dst []byte) []byte { |
| 15781 |
size := ts.SizeBytes() |
| 15782 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(ts), uintptr(size)) |
| 15783 |
return dst[size:] |
| 15784 |
} |
| 15785 |
|
| 15786 |
|
| 15787 |
func (ts *Timespec) UnmarshalUnsafe(src []byte) []byte { |
| 15788 |
size := ts.SizeBytes() |
| 15789 |
gohacks.Memmove(unsafe.Pointer(ts), unsafe.Pointer(&src[0]), uintptr(size)) |
| 15790 |
return src[size:] |
| 15791 |
} |
| 15792 |
|
| 15793 |
|
| 15794 |
|
| 15795 |
func (ts *Timespec) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 15796 |
|
| 15797 |
var buf []byte |
| 15798 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15799 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ts))) |
| 15800 |
hdr.Len = ts.SizeBytes() |
| 15801 |
hdr.Cap = ts.SizeBytes() |
| 15802 |
|
| 15803 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 15804 |
|
| 15805 |
|
| 15806 |
runtime.KeepAlive(ts) |
| 15807 |
return length, err |
| 15808 |
} |
| 15809 |
|
| 15810 |
|
| 15811 |
|
| 15812 |
func (ts *Timespec) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15813 |
return ts.CopyOutN(cc, addr, ts.SizeBytes()) |
| 15814 |
} |
| 15815 |
|
| 15816 |
|
| 15817 |
|
| 15818 |
func (ts *Timespec) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15819 |
|
| 15820 |
var buf []byte |
| 15821 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15822 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ts))) |
| 15823 |
hdr.Len = ts.SizeBytes() |
| 15824 |
hdr.Cap = ts.SizeBytes() |
| 15825 |
|
| 15826 |
length, err := cc.CopyInBytes(addr, buf) |
| 15827 |
|
| 15828 |
|
| 15829 |
runtime.KeepAlive(ts) |
| 15830 |
return length, err |
| 15831 |
} |
| 15832 |
|
| 15833 |
|
| 15834 |
func (ts *Timespec) WriteTo(writer io.Writer) (int64, error) { |
| 15835 |
|
| 15836 |
var buf []byte |
| 15837 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15838 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ts))) |
| 15839 |
hdr.Len = ts.SizeBytes() |
| 15840 |
hdr.Cap = ts.SizeBytes() |
| 15841 |
|
| 15842 |
length, err := writer.Write(buf) |
| 15843 |
|
| 15844 |
|
| 15845 |
runtime.KeepAlive(ts) |
| 15846 |
return int64(length), err |
| 15847 |
} |
| 15848 |
|
| 15849 |
|
| 15850 |
func CopyTimespecSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []Timespec) (int, error) { |
| 15851 |
count := len(dst) |
| 15852 |
if count == 0 { |
| 15853 |
return 0, nil |
| 15854 |
} |
| 15855 |
size := (*Timespec)(nil).SizeBytes() |
| 15856 |
|
| 15857 |
ptr := unsafe.Pointer(&dst) |
| 15858 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 15859 |
|
| 15860 |
|
| 15861 |
var buf []byte |
| 15862 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15863 |
hdr.Data = uintptr(val) |
| 15864 |
hdr.Len = size * count |
| 15865 |
hdr.Cap = size * count |
| 15866 |
|
| 15867 |
length, err := cc.CopyInBytes(addr, buf) |
| 15868 |
|
| 15869 |
|
| 15870 |
runtime.KeepAlive(dst) |
| 15871 |
return length, err |
| 15872 |
} |
| 15873 |
|
| 15874 |
|
| 15875 |
func CopyTimespecSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []Timespec) (int, error) { |
| 15876 |
count := len(src) |
| 15877 |
if count == 0 { |
| 15878 |
return 0, nil |
| 15879 |
} |
| 15880 |
size := (*Timespec)(nil).SizeBytes() |
| 15881 |
|
| 15882 |
ptr := unsafe.Pointer(&src) |
| 15883 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 15884 |
|
| 15885 |
|
| 15886 |
var buf []byte |
| 15887 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15888 |
hdr.Data = uintptr(val) |
| 15889 |
hdr.Len = size * count |
| 15890 |
hdr.Cap = size * count |
| 15891 |
|
| 15892 |
length, err := cc.CopyOutBytes(addr, buf) |
| 15893 |
|
| 15894 |
|
| 15895 |
runtime.KeepAlive(src) |
| 15896 |
return length, err |
| 15897 |
} |
| 15898 |
|
| 15899 |
|
| 15900 |
func MarshalUnsafeTimespecSlice(src []Timespec, dst []byte) []byte { |
| 15901 |
count := len(src) |
| 15902 |
if count == 0 { |
| 15903 |
return dst |
| 15904 |
} |
| 15905 |
|
| 15906 |
size := (*Timespec)(nil).SizeBytes() |
| 15907 |
buf := dst[:size*count] |
| 15908 |
gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) |
| 15909 |
return dst[size*count:] |
| 15910 |
} |
| 15911 |
|
| 15912 |
|
| 15913 |
func UnmarshalUnsafeTimespecSlice(dst []Timespec, src []byte) []byte { |
| 15914 |
count := len(dst) |
| 15915 |
if count == 0 { |
| 15916 |
return src |
| 15917 |
} |
| 15918 |
|
| 15919 |
size := (*Timespec)(nil).SizeBytes() |
| 15920 |
buf := src[:size*count] |
| 15921 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) |
| 15922 |
return src[size*count:] |
| 15923 |
} |
| 15924 |
|
| 15925 |
|
| 15926 |
func (tv *Timeval) SizeBytes() int { |
| 15927 |
return 16 |
| 15928 |
} |
| 15929 |
|
| 15930 |
|
| 15931 |
func (tv *Timeval) MarshalBytes(dst []byte) []byte { |
| 15932 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(tv.Sec)) |
| 15933 |
dst = dst[8:] |
| 15934 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(tv.Usec)) |
| 15935 |
dst = dst[8:] |
| 15936 |
return dst |
| 15937 |
} |
| 15938 |
|
| 15939 |
|
| 15940 |
func (tv *Timeval) UnmarshalBytes(src []byte) []byte { |
| 15941 |
tv.Sec = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15942 |
src = src[8:] |
| 15943 |
tv.Usec = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 15944 |
src = src[8:] |
| 15945 |
return src |
| 15946 |
} |
| 15947 |
|
| 15948 |
|
| 15949 |
|
| 15950 |
func (tv *Timeval) Packed() bool { |
| 15951 |
return true |
| 15952 |
} |
| 15953 |
|
| 15954 |
|
| 15955 |
func (tv *Timeval) MarshalUnsafe(dst []byte) []byte { |
| 15956 |
size := tv.SizeBytes() |
| 15957 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(tv), uintptr(size)) |
| 15958 |
return dst[size:] |
| 15959 |
} |
| 15960 |
|
| 15961 |
|
| 15962 |
func (tv *Timeval) UnmarshalUnsafe(src []byte) []byte { |
| 15963 |
size := tv.SizeBytes() |
| 15964 |
gohacks.Memmove(unsafe.Pointer(tv), unsafe.Pointer(&src[0]), uintptr(size)) |
| 15965 |
return src[size:] |
| 15966 |
} |
| 15967 |
|
| 15968 |
|
| 15969 |
|
| 15970 |
func (tv *Timeval) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 15971 |
|
| 15972 |
var buf []byte |
| 15973 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15974 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tv))) |
| 15975 |
hdr.Len = tv.SizeBytes() |
| 15976 |
hdr.Cap = tv.SizeBytes() |
| 15977 |
|
| 15978 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 15979 |
|
| 15980 |
|
| 15981 |
runtime.KeepAlive(tv) |
| 15982 |
return length, err |
| 15983 |
} |
| 15984 |
|
| 15985 |
|
| 15986 |
|
| 15987 |
func (tv *Timeval) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15988 |
return tv.CopyOutN(cc, addr, tv.SizeBytes()) |
| 15989 |
} |
| 15990 |
|
| 15991 |
|
| 15992 |
|
| 15993 |
func (tv *Timeval) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 15994 |
|
| 15995 |
var buf []byte |
| 15996 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 15997 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tv))) |
| 15998 |
hdr.Len = tv.SizeBytes() |
| 15999 |
hdr.Cap = tv.SizeBytes() |
| 16000 |
|
| 16001 |
length, err := cc.CopyInBytes(addr, buf) |
| 16002 |
|
| 16003 |
|
| 16004 |
runtime.KeepAlive(tv) |
| 16005 |
return length, err |
| 16006 |
} |
| 16007 |
|
| 16008 |
|
| 16009 |
func (tv *Timeval) WriteTo(writer io.Writer) (int64, error) { |
| 16010 |
|
| 16011 |
var buf []byte |
| 16012 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16013 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tv))) |
| 16014 |
hdr.Len = tv.SizeBytes() |
| 16015 |
hdr.Cap = tv.SizeBytes() |
| 16016 |
|
| 16017 |
length, err := writer.Write(buf) |
| 16018 |
|
| 16019 |
|
| 16020 |
runtime.KeepAlive(tv) |
| 16021 |
return int64(length), err |
| 16022 |
} |
| 16023 |
|
| 16024 |
|
| 16025 |
func CopyTimevalSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []Timeval) (int, error) { |
| 16026 |
count := len(dst) |
| 16027 |
if count == 0 { |
| 16028 |
return 0, nil |
| 16029 |
} |
| 16030 |
size := (*Timeval)(nil).SizeBytes() |
| 16031 |
|
| 16032 |
ptr := unsafe.Pointer(&dst) |
| 16033 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 16034 |
|
| 16035 |
|
| 16036 |
var buf []byte |
| 16037 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16038 |
hdr.Data = uintptr(val) |
| 16039 |
hdr.Len = size * count |
| 16040 |
hdr.Cap = size * count |
| 16041 |
|
| 16042 |
length, err := cc.CopyInBytes(addr, buf) |
| 16043 |
|
| 16044 |
|
| 16045 |
runtime.KeepAlive(dst) |
| 16046 |
return length, err |
| 16047 |
} |
| 16048 |
|
| 16049 |
|
| 16050 |
func CopyTimevalSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []Timeval) (int, error) { |
| 16051 |
count := len(src) |
| 16052 |
if count == 0 { |
| 16053 |
return 0, nil |
| 16054 |
} |
| 16055 |
size := (*Timeval)(nil).SizeBytes() |
| 16056 |
|
| 16057 |
ptr := unsafe.Pointer(&src) |
| 16058 |
val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) |
| 16059 |
|
| 16060 |
|
| 16061 |
var buf []byte |
| 16062 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16063 |
hdr.Data = uintptr(val) |
| 16064 |
hdr.Len = size * count |
| 16065 |
hdr.Cap = size * count |
| 16066 |
|
| 16067 |
length, err := cc.CopyOutBytes(addr, buf) |
| 16068 |
|
| 16069 |
|
| 16070 |
runtime.KeepAlive(src) |
| 16071 |
return length, err |
| 16072 |
} |
| 16073 |
|
| 16074 |
|
| 16075 |
func MarshalUnsafeTimevalSlice(src []Timeval, dst []byte) []byte { |
| 16076 |
count := len(src) |
| 16077 |
if count == 0 { |
| 16078 |
return dst |
| 16079 |
} |
| 16080 |
|
| 16081 |
size := (*Timeval)(nil).SizeBytes() |
| 16082 |
buf := dst[:size*count] |
| 16083 |
gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) |
| 16084 |
return dst[size*count:] |
| 16085 |
} |
| 16086 |
|
| 16087 |
|
| 16088 |
func UnmarshalUnsafeTimevalSlice(dst []Timeval, src []byte) []byte { |
| 16089 |
count := len(dst) |
| 16090 |
if count == 0 { |
| 16091 |
return src |
| 16092 |
} |
| 16093 |
|
| 16094 |
size := (*Timeval)(nil).SizeBytes() |
| 16095 |
buf := src[:size*count] |
| 16096 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) |
| 16097 |
return src[size*count:] |
| 16098 |
} |
| 16099 |
|
| 16100 |
|
| 16101 |
func (t *Tms) SizeBytes() int { |
| 16102 |
return 0 + |
| 16103 |
(*ClockT)(nil).SizeBytes() + |
| 16104 |
(*ClockT)(nil).SizeBytes() + |
| 16105 |
(*ClockT)(nil).SizeBytes() + |
| 16106 |
(*ClockT)(nil).SizeBytes() |
| 16107 |
} |
| 16108 |
|
| 16109 |
|
| 16110 |
func (t *Tms) MarshalBytes(dst []byte) []byte { |
| 16111 |
dst = t.UTime.MarshalUnsafe(dst) |
| 16112 |
dst = t.STime.MarshalUnsafe(dst) |
| 16113 |
dst = t.CUTime.MarshalUnsafe(dst) |
| 16114 |
dst = t.CSTime.MarshalUnsafe(dst) |
| 16115 |
return dst |
| 16116 |
} |
| 16117 |
|
| 16118 |
|
| 16119 |
func (t *Tms) UnmarshalBytes(src []byte) []byte { |
| 16120 |
src = t.UTime.UnmarshalUnsafe(src) |
| 16121 |
src = t.STime.UnmarshalUnsafe(src) |
| 16122 |
src = t.CUTime.UnmarshalUnsafe(src) |
| 16123 |
src = t.CSTime.UnmarshalUnsafe(src) |
| 16124 |
return src |
| 16125 |
} |
| 16126 |
|
| 16127 |
|
| 16128 |
|
| 16129 |
func (t *Tms) Packed() bool { |
| 16130 |
return t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() |
| 16131 |
} |
| 16132 |
|
| 16133 |
|
| 16134 |
func (t *Tms) MarshalUnsafe(dst []byte) []byte { |
| 16135 |
if t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() { |
| 16136 |
size := t.SizeBytes() |
| 16137 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(t), uintptr(size)) |
| 16138 |
return dst[size:] |
| 16139 |
} |
| 16140 |
|
| 16141 |
return t.MarshalBytes(dst) |
| 16142 |
} |
| 16143 |
|
| 16144 |
|
| 16145 |
func (t *Tms) UnmarshalUnsafe(src []byte) []byte { |
| 16146 |
if t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() { |
| 16147 |
size := t.SizeBytes() |
| 16148 |
gohacks.Memmove(unsafe.Pointer(t), unsafe.Pointer(&src[0]), uintptr(size)) |
| 16149 |
return src[size:] |
| 16150 |
} |
| 16151 |
|
| 16152 |
return t.UnmarshalBytes(src) |
| 16153 |
} |
| 16154 |
|
| 16155 |
|
| 16156 |
|
| 16157 |
func (t *Tms) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 16158 |
if !t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() { |
| 16159 |
|
| 16160 |
buf := cc.CopyScratchBuffer(t.SizeBytes()) |
| 16161 |
t.MarshalBytes(buf) |
| 16162 |
return cc.CopyOutBytes(addr, buf[:limit]) |
| 16163 |
} |
| 16164 |
|
| 16165 |
|
| 16166 |
var buf []byte |
| 16167 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16168 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 16169 |
hdr.Len = t.SizeBytes() |
| 16170 |
hdr.Cap = t.SizeBytes() |
| 16171 |
|
| 16172 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 16173 |
|
| 16174 |
|
| 16175 |
runtime.KeepAlive(t) |
| 16176 |
return length, err |
| 16177 |
} |
| 16178 |
|
| 16179 |
|
| 16180 |
|
| 16181 |
func (t *Tms) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16182 |
return t.CopyOutN(cc, addr, t.SizeBytes()) |
| 16183 |
} |
| 16184 |
|
| 16185 |
|
| 16186 |
|
| 16187 |
func (t *Tms) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16188 |
if !t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() { |
| 16189 |
|
| 16190 |
buf := cc.CopyScratchBuffer(t.SizeBytes()) |
| 16191 |
length, err := cc.CopyInBytes(addr, buf) |
| 16192 |
|
| 16193 |
|
| 16194 |
t.UnmarshalBytes(buf) |
| 16195 |
return length, err |
| 16196 |
} |
| 16197 |
|
| 16198 |
|
| 16199 |
var buf []byte |
| 16200 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16201 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 16202 |
hdr.Len = t.SizeBytes() |
| 16203 |
hdr.Cap = t.SizeBytes() |
| 16204 |
|
| 16205 |
length, err := cc.CopyInBytes(addr, buf) |
| 16206 |
|
| 16207 |
|
| 16208 |
runtime.KeepAlive(t) |
| 16209 |
return length, err |
| 16210 |
} |
| 16211 |
|
| 16212 |
|
| 16213 |
func (t *Tms) WriteTo(writer io.Writer) (int64, error) { |
| 16214 |
if !t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() { |
| 16215 |
|
| 16216 |
buf := make([]byte, t.SizeBytes()) |
| 16217 |
t.MarshalBytes(buf) |
| 16218 |
length, err := writer.Write(buf) |
| 16219 |
return int64(length), err |
| 16220 |
} |
| 16221 |
|
| 16222 |
|
| 16223 |
var buf []byte |
| 16224 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16225 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 16226 |
hdr.Len = t.SizeBytes() |
| 16227 |
hdr.Cap = t.SizeBytes() |
| 16228 |
|
| 16229 |
length, err := writer.Write(buf) |
| 16230 |
|
| 16231 |
|
| 16232 |
runtime.KeepAlive(t) |
| 16233 |
return int64(length), err |
| 16234 |
} |
| 16235 |
|
| 16236 |
|
| 16237 |
func (u *Utime) SizeBytes() int { |
| 16238 |
return 16 |
| 16239 |
} |
| 16240 |
|
| 16241 |
|
| 16242 |
func (u *Utime) MarshalBytes(dst []byte) []byte { |
| 16243 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Actime)) |
| 16244 |
dst = dst[8:] |
| 16245 |
hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Modtime)) |
| 16246 |
dst = dst[8:] |
| 16247 |
return dst |
| 16248 |
} |
| 16249 |
|
| 16250 |
|
| 16251 |
func (u *Utime) UnmarshalBytes(src []byte) []byte { |
| 16252 |
u.Actime = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 16253 |
src = src[8:] |
| 16254 |
u.Modtime = int64(hostarch.ByteOrder.Uint64(src[:8])) |
| 16255 |
src = src[8:] |
| 16256 |
return src |
| 16257 |
} |
| 16258 |
|
| 16259 |
|
| 16260 |
|
| 16261 |
func (u *Utime) Packed() bool { |
| 16262 |
return true |
| 16263 |
} |
| 16264 |
|
| 16265 |
|
| 16266 |
func (u *Utime) MarshalUnsafe(dst []byte) []byte { |
| 16267 |
size := u.SizeBytes() |
| 16268 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) |
| 16269 |
return dst[size:] |
| 16270 |
} |
| 16271 |
|
| 16272 |
|
| 16273 |
func (u *Utime) UnmarshalUnsafe(src []byte) []byte { |
| 16274 |
size := u.SizeBytes() |
| 16275 |
gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) |
| 16276 |
return src[size:] |
| 16277 |
} |
| 16278 |
|
| 16279 |
|
| 16280 |
|
| 16281 |
func (u *Utime) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 16282 |
|
| 16283 |
var buf []byte |
| 16284 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16285 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) |
| 16286 |
hdr.Len = u.SizeBytes() |
| 16287 |
hdr.Cap = u.SizeBytes() |
| 16288 |
|
| 16289 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 16290 |
|
| 16291 |
|
| 16292 |
runtime.KeepAlive(u) |
| 16293 |
return length, err |
| 16294 |
} |
| 16295 |
|
| 16296 |
|
| 16297 |
|
| 16298 |
func (u *Utime) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16299 |
return u.CopyOutN(cc, addr, u.SizeBytes()) |
| 16300 |
} |
| 16301 |
|
| 16302 |
|
| 16303 |
|
| 16304 |
func (u *Utime) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16305 |
|
| 16306 |
var buf []byte |
| 16307 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16308 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) |
| 16309 |
hdr.Len = u.SizeBytes() |
| 16310 |
hdr.Cap = u.SizeBytes() |
| 16311 |
|
| 16312 |
length, err := cc.CopyInBytes(addr, buf) |
| 16313 |
|
| 16314 |
|
| 16315 |
runtime.KeepAlive(u) |
| 16316 |
return length, err |
| 16317 |
} |
| 16318 |
|
| 16319 |
|
| 16320 |
func (u *Utime) WriteTo(writer io.Writer) (int64, error) { |
| 16321 |
|
| 16322 |
var buf []byte |
| 16323 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16324 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) |
| 16325 |
hdr.Len = u.SizeBytes() |
| 16326 |
hdr.Cap = u.SizeBytes() |
| 16327 |
|
| 16328 |
length, err := writer.Write(buf) |
| 16329 |
|
| 16330 |
|
| 16331 |
runtime.KeepAlive(u) |
| 16332 |
return int64(length), err |
| 16333 |
} |
| 16334 |
|
| 16335 |
|
| 16336 |
func (t *Termios) SizeBytes() int { |
| 16337 |
return 17 + |
| 16338 |
1*NumControlCharacters |
| 16339 |
} |
| 16340 |
|
| 16341 |
|
| 16342 |
func (t *Termios) MarshalBytes(dst []byte) []byte { |
| 16343 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.InputFlags)) |
| 16344 |
dst = dst[4:] |
| 16345 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.OutputFlags)) |
| 16346 |
dst = dst[4:] |
| 16347 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.ControlFlags)) |
| 16348 |
dst = dst[4:] |
| 16349 |
hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.LocalFlags)) |
| 16350 |
dst = dst[4:] |
| 16351 |
dst[0] = byte(t.LineDiscipline) |
| 16352 |
dst = dst[1:] |
| 16353 |
for idx := 0; idx < NumControlCharacters; idx++ { |
| 16354 |
dst[0] = byte(t.ControlCharacters[idx]) |
| 16355 |
dst = dst[1:] |
| 16356 |
} |
| 16357 |
return dst |
| 16358 |
} |
| 16359 |
|
| 16360 |
|
| 16361 |
func (t *Termios) UnmarshalBytes(src []byte) []byte { |
| 16362 |
t.InputFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 16363 |
src = src[4:] |
| 16364 |
t.OutputFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 16365 |
src = src[4:] |
| 16366 |
t.ControlFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 16367 |
src = src[4:] |
| 16368 |
t.LocalFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) |
| 16369 |
src = src[4:] |
| 16370 |
t.LineDiscipline = uint8(src[0]) |
| 16371 |
src = src[1:] |
| 16372 |
for idx := 0; idx < NumControlCharacters; idx++ { |
| 16373 |
t.ControlCharacters[idx] = uint8(src[0]) |
| 16374 |
src = src[1:] |
| 16375 |
} |
| 16376 |
return src |
| 16377 |
} |
| 16378 |
|
| 16379 |
|
| 16380 |
|
| 16381 |
func (t *Termios) Packed() bool { |
| 16382 |
return true |
| 16383 |
} |
| 16384 |
|
| 16385 |
|
| 16386 |
func (t *Termios) MarshalUnsafe(dst []byte) []byte { |
| 16387 |
size := t.SizeBytes() |
| 16388 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(t), uintptr(size)) |
| 16389 |
return dst[size:] |
| 16390 |
} |
| 16391 |
|
| 16392 |
|
| 16393 |
func (t *Termios) UnmarshalUnsafe(src []byte) []byte { |
| 16394 |
size := t.SizeBytes() |
| 16395 |
gohacks.Memmove(unsafe.Pointer(t), unsafe.Pointer(&src[0]), uintptr(size)) |
| 16396 |
return src[size:] |
| 16397 |
} |
| 16398 |
|
| 16399 |
|
| 16400 |
|
| 16401 |
func (t *Termios) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 16402 |
|
| 16403 |
var buf []byte |
| 16404 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16405 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 16406 |
hdr.Len = t.SizeBytes() |
| 16407 |
hdr.Cap = t.SizeBytes() |
| 16408 |
|
| 16409 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 16410 |
|
| 16411 |
|
| 16412 |
runtime.KeepAlive(t) |
| 16413 |
return length, err |
| 16414 |
} |
| 16415 |
|
| 16416 |
|
| 16417 |
|
| 16418 |
func (t *Termios) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16419 |
return t.CopyOutN(cc, addr, t.SizeBytes()) |
| 16420 |
} |
| 16421 |
|
| 16422 |
|
| 16423 |
|
| 16424 |
func (t *Termios) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16425 |
|
| 16426 |
var buf []byte |
| 16427 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16428 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 16429 |
hdr.Len = t.SizeBytes() |
| 16430 |
hdr.Cap = t.SizeBytes() |
| 16431 |
|
| 16432 |
length, err := cc.CopyInBytes(addr, buf) |
| 16433 |
|
| 16434 |
|
| 16435 |
runtime.KeepAlive(t) |
| 16436 |
return length, err |
| 16437 |
} |
| 16438 |
|
| 16439 |
|
| 16440 |
func (t *Termios) WriteTo(writer io.Writer) (int64, error) { |
| 16441 |
|
| 16442 |
var buf []byte |
| 16443 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16444 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) |
| 16445 |
hdr.Len = t.SizeBytes() |
| 16446 |
hdr.Cap = t.SizeBytes() |
| 16447 |
|
| 16448 |
length, err := writer.Write(buf) |
| 16449 |
|
| 16450 |
|
| 16451 |
runtime.KeepAlive(t) |
| 16452 |
return int64(length), err |
| 16453 |
} |
| 16454 |
|
| 16455 |
|
| 16456 |
func (w *WindowSize) SizeBytes() int { |
| 16457 |
return 4 + |
| 16458 |
1*4 |
| 16459 |
} |
| 16460 |
|
| 16461 |
|
| 16462 |
func (w *WindowSize) MarshalBytes(dst []byte) []byte { |
| 16463 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Rows)) |
| 16464 |
dst = dst[2:] |
| 16465 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Cols)) |
| 16466 |
dst = dst[2:] |
| 16467 |
|
| 16468 |
dst = dst[1*(4):] |
| 16469 |
return dst |
| 16470 |
} |
| 16471 |
|
| 16472 |
|
| 16473 |
func (w *WindowSize) UnmarshalBytes(src []byte) []byte { |
| 16474 |
w.Rows = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 16475 |
src = src[2:] |
| 16476 |
w.Cols = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 16477 |
src = src[2:] |
| 16478 |
|
| 16479 |
src = src[1*(4):] |
| 16480 |
return src |
| 16481 |
} |
| 16482 |
|
| 16483 |
|
| 16484 |
|
| 16485 |
func (w *WindowSize) Packed() bool { |
| 16486 |
return true |
| 16487 |
} |
| 16488 |
|
| 16489 |
|
| 16490 |
func (w *WindowSize) MarshalUnsafe(dst []byte) []byte { |
| 16491 |
size := w.SizeBytes() |
| 16492 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(w), uintptr(size)) |
| 16493 |
return dst[size:] |
| 16494 |
} |
| 16495 |
|
| 16496 |
|
| 16497 |
func (w *WindowSize) UnmarshalUnsafe(src []byte) []byte { |
| 16498 |
size := w.SizeBytes() |
| 16499 |
gohacks.Memmove(unsafe.Pointer(w), unsafe.Pointer(&src[0]), uintptr(size)) |
| 16500 |
return src[size:] |
| 16501 |
} |
| 16502 |
|
| 16503 |
|
| 16504 |
|
| 16505 |
func (w *WindowSize) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 16506 |
|
| 16507 |
var buf []byte |
| 16508 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16509 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) |
| 16510 |
hdr.Len = w.SizeBytes() |
| 16511 |
hdr.Cap = w.SizeBytes() |
| 16512 |
|
| 16513 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 16514 |
|
| 16515 |
|
| 16516 |
runtime.KeepAlive(w) |
| 16517 |
return length, err |
| 16518 |
} |
| 16519 |
|
| 16520 |
|
| 16521 |
|
| 16522 |
func (w *WindowSize) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16523 |
return w.CopyOutN(cc, addr, w.SizeBytes()) |
| 16524 |
} |
| 16525 |
|
| 16526 |
|
| 16527 |
|
| 16528 |
func (w *WindowSize) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16529 |
|
| 16530 |
var buf []byte |
| 16531 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16532 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) |
| 16533 |
hdr.Len = w.SizeBytes() |
| 16534 |
hdr.Cap = w.SizeBytes() |
| 16535 |
|
| 16536 |
length, err := cc.CopyInBytes(addr, buf) |
| 16537 |
|
| 16538 |
|
| 16539 |
runtime.KeepAlive(w) |
| 16540 |
return length, err |
| 16541 |
} |
| 16542 |
|
| 16543 |
|
| 16544 |
func (w *WindowSize) WriteTo(writer io.Writer) (int64, error) { |
| 16545 |
|
| 16546 |
var buf []byte |
| 16547 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16548 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) |
| 16549 |
hdr.Len = w.SizeBytes() |
| 16550 |
hdr.Cap = w.SizeBytes() |
| 16551 |
|
| 16552 |
length, err := writer.Write(buf) |
| 16553 |
|
| 16554 |
|
| 16555 |
runtime.KeepAlive(w) |
| 16556 |
return int64(length), err |
| 16557 |
} |
| 16558 |
|
| 16559 |
|
| 16560 |
func (w *Winsize) SizeBytes() int { |
| 16561 |
return 8 |
| 16562 |
} |
| 16563 |
|
| 16564 |
|
| 16565 |
func (w *Winsize) MarshalBytes(dst []byte) []byte { |
| 16566 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Row)) |
| 16567 |
dst = dst[2:] |
| 16568 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Col)) |
| 16569 |
dst = dst[2:] |
| 16570 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Xpixel)) |
| 16571 |
dst = dst[2:] |
| 16572 |
hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Ypixel)) |
| 16573 |
dst = dst[2:] |
| 16574 |
return dst |
| 16575 |
} |
| 16576 |
|
| 16577 |
|
| 16578 |
func (w *Winsize) UnmarshalBytes(src []byte) []byte { |
| 16579 |
w.Row = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 16580 |
src = src[2:] |
| 16581 |
w.Col = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 16582 |
src = src[2:] |
| 16583 |
w.Xpixel = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 16584 |
src = src[2:] |
| 16585 |
w.Ypixel = uint16(hostarch.ByteOrder.Uint16(src[:2])) |
| 16586 |
src = src[2:] |
| 16587 |
return src |
| 16588 |
} |
| 16589 |
|
| 16590 |
|
| 16591 |
|
| 16592 |
func (w *Winsize) Packed() bool { |
| 16593 |
return true |
| 16594 |
} |
| 16595 |
|
| 16596 |
|
| 16597 |
func (w *Winsize) MarshalUnsafe(dst []byte) []byte { |
| 16598 |
size := w.SizeBytes() |
| 16599 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(w), uintptr(size)) |
| 16600 |
return dst[size:] |
| 16601 |
} |
| 16602 |
|
| 16603 |
|
| 16604 |
func (w *Winsize) UnmarshalUnsafe(src []byte) []byte { |
| 16605 |
size := w.SizeBytes() |
| 16606 |
gohacks.Memmove(unsafe.Pointer(w), unsafe.Pointer(&src[0]), uintptr(size)) |
| 16607 |
return src[size:] |
| 16608 |
} |
| 16609 |
|
| 16610 |
|
| 16611 |
|
| 16612 |
func (w *Winsize) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 16613 |
|
| 16614 |
var buf []byte |
| 16615 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16616 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) |
| 16617 |
hdr.Len = w.SizeBytes() |
| 16618 |
hdr.Cap = w.SizeBytes() |
| 16619 |
|
| 16620 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 16621 |
|
| 16622 |
|
| 16623 |
runtime.KeepAlive(w) |
| 16624 |
return length, err |
| 16625 |
} |
| 16626 |
|
| 16627 |
|
| 16628 |
|
| 16629 |
func (w *Winsize) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16630 |
return w.CopyOutN(cc, addr, w.SizeBytes()) |
| 16631 |
} |
| 16632 |
|
| 16633 |
|
| 16634 |
|
| 16635 |
func (w *Winsize) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16636 |
|
| 16637 |
var buf []byte |
| 16638 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16639 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) |
| 16640 |
hdr.Len = w.SizeBytes() |
| 16641 |
hdr.Cap = w.SizeBytes() |
| 16642 |
|
| 16643 |
length, err := cc.CopyInBytes(addr, buf) |
| 16644 |
|
| 16645 |
|
| 16646 |
runtime.KeepAlive(w) |
| 16647 |
return length, err |
| 16648 |
} |
| 16649 |
|
| 16650 |
|
| 16651 |
func (w *Winsize) WriteTo(writer io.Writer) (int64, error) { |
| 16652 |
|
| 16653 |
var buf []byte |
| 16654 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16655 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) |
| 16656 |
hdr.Len = w.SizeBytes() |
| 16657 |
hdr.Cap = w.SizeBytes() |
| 16658 |
|
| 16659 |
length, err := writer.Write(buf) |
| 16660 |
|
| 16661 |
|
| 16662 |
runtime.KeepAlive(w) |
| 16663 |
return int64(length), err |
| 16664 |
} |
| 16665 |
|
| 16666 |
|
| 16667 |
func (u *UtsName) SizeBytes() int { |
| 16668 |
return 0 + |
| 16669 |
1*(UTSLen+1) + |
| 16670 |
1*(UTSLen+1) + |
| 16671 |
1*(UTSLen+1) + |
| 16672 |
1*(UTSLen+1) + |
| 16673 |
1*(UTSLen+1) + |
| 16674 |
1*(UTSLen+1) |
| 16675 |
} |
| 16676 |
|
| 16677 |
|
| 16678 |
func (u *UtsName) MarshalBytes(dst []byte) []byte { |
| 16679 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16680 |
dst[0] = byte(u.Sysname[idx]) |
| 16681 |
dst = dst[1:] |
| 16682 |
} |
| 16683 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16684 |
dst[0] = byte(u.Nodename[idx]) |
| 16685 |
dst = dst[1:] |
| 16686 |
} |
| 16687 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16688 |
dst[0] = byte(u.Release[idx]) |
| 16689 |
dst = dst[1:] |
| 16690 |
} |
| 16691 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16692 |
dst[0] = byte(u.Version[idx]) |
| 16693 |
dst = dst[1:] |
| 16694 |
} |
| 16695 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16696 |
dst[0] = byte(u.Machine[idx]) |
| 16697 |
dst = dst[1:] |
| 16698 |
} |
| 16699 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16700 |
dst[0] = byte(u.Domainname[idx]) |
| 16701 |
dst = dst[1:] |
| 16702 |
} |
| 16703 |
return dst |
| 16704 |
} |
| 16705 |
|
| 16706 |
|
| 16707 |
func (u *UtsName) UnmarshalBytes(src []byte) []byte { |
| 16708 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16709 |
u.Sysname[idx] = src[0] |
| 16710 |
src = src[1:] |
| 16711 |
} |
| 16712 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16713 |
u.Nodename[idx] = src[0] |
| 16714 |
src = src[1:] |
| 16715 |
} |
| 16716 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16717 |
u.Release[idx] = src[0] |
| 16718 |
src = src[1:] |
| 16719 |
} |
| 16720 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16721 |
u.Version[idx] = src[0] |
| 16722 |
src = src[1:] |
| 16723 |
} |
| 16724 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16725 |
u.Machine[idx] = src[0] |
| 16726 |
src = src[1:] |
| 16727 |
} |
| 16728 |
for idx := 0; idx < (UTSLen+1); idx++ { |
| 16729 |
u.Domainname[idx] = src[0] |
| 16730 |
src = src[1:] |
| 16731 |
} |
| 16732 |
return src |
| 16733 |
} |
| 16734 |
|
| 16735 |
|
| 16736 |
|
| 16737 |
func (u *UtsName) Packed() bool { |
| 16738 |
return true |
| 16739 |
} |
| 16740 |
|
| 16741 |
|
| 16742 |
func (u *UtsName) MarshalUnsafe(dst []byte) []byte { |
| 16743 |
size := u.SizeBytes() |
| 16744 |
gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) |
| 16745 |
return dst[size:] |
| 16746 |
} |
| 16747 |
|
| 16748 |
|
| 16749 |
func (u *UtsName) UnmarshalUnsafe(src []byte) []byte { |
| 16750 |
size := u.SizeBytes() |
| 16751 |
gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) |
| 16752 |
return src[size:] |
| 16753 |
} |
| 16754 |
|
| 16755 |
|
| 16756 |
|
| 16757 |
func (u *UtsName) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { |
| 16758 |
|
| 16759 |
var buf []byte |
| 16760 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16761 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) |
| 16762 |
hdr.Len = u.SizeBytes() |
| 16763 |
hdr.Cap = u.SizeBytes() |
| 16764 |
|
| 16765 |
length, err := cc.CopyOutBytes(addr, buf[:limit]) |
| 16766 |
|
| 16767 |
|
| 16768 |
runtime.KeepAlive(u) |
| 16769 |
return length, err |
| 16770 |
} |
| 16771 |
|
| 16772 |
|
| 16773 |
|
| 16774 |
func (u *UtsName) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16775 |
return u.CopyOutN(cc, addr, u.SizeBytes()) |
| 16776 |
} |
| 16777 |
|
| 16778 |
|
| 16779 |
|
| 16780 |
func (u *UtsName) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { |
| 16781 |
|
| 16782 |
var buf []byte |
| 16783 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16784 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) |
| 16785 |
hdr.Len = u.SizeBytes() |
| 16786 |
hdr.Cap = u.SizeBytes() |
| 16787 |
|
| 16788 |
length, err := cc.CopyInBytes(addr, buf) |
| 16789 |
|
| 16790 |
|
| 16791 |
runtime.KeepAlive(u) |
| 16792 |
return length, err |
| 16793 |
} |
| 16794 |
|
| 16795 |
|
| 16796 |
func (u *UtsName) WriteTo(writer io.Writer) (int64, error) { |
| 16797 |
|
| 16798 |
var buf []byte |
| 16799 |
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) |
| 16800 |
hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) |
| 16801 |
hdr.Len = u.SizeBytes() |
| 16802 |
hdr.Cap = u.SizeBytes() |
| 16803 |
|
| 16804 |
length, err := writer.Write(buf) |
| 16805 |
|
| 16806 |
|
| 16807 |
runtime.KeepAlive(u) |
| 16808 |
return int64(length), err |
| 16809 |
} |
| 16810 |
|