diff --git a/unix/linux/types.go b/unix/linux/types.go index a6a9952d..c400c031 100644 --- a/unix/linux/types.go +++ b/unix/linux/types.go @@ -117,6 +117,7 @@ struct termios2 { #include #include #include +#include #include #include #include @@ -224,6 +225,8 @@ union sockaddr_all { struct sockaddr_pppox s7; struct sockaddr_l2tpip s8; struct sockaddr_l2tpip6 s9; + struct sockaddr_nfc s10; + struct sockaddr_nfc_llcp s11; }; struct sockaddr_any { @@ -280,6 +283,18 @@ struct sockaddr_iucv { signed char siucv_name[8]; }; +// copied from /usr/include/linux/nfc.h modified with explicit unsigned chars. +struct my_sockaddr_nfc_llcp { + sa_family_t sa_family; + uint32_t dev_idx; + uint32_t target_idx; + uint32_t nfc_protocol; + uint8_t dsap; + uint8_t ssap; + uint8_t service_name[NFC_LLCP_MAX_SERVICE_NAME]; + size_t service_name_len; +}; + #ifdef __ARM_EABI__ typedef struct user_regs PtraceRegs; #elif defined(__aarch64__) @@ -578,6 +593,10 @@ type RawSockaddrL2TPIP6 C.struct_sockaddr_l2tpip6 type RawSockaddrIUCV C.struct_sockaddr_iucv +type RawSockaddrNFC C.struct_sockaddr_nfc + +type RawSockaddrNFCLLCP C.struct_my_sockaddr_nfc_llcp + type RawSockaddr C.struct_sockaddr type RawSockaddrAny C.struct_sockaddr_any @@ -633,6 +652,8 @@ const ( SizeofSockaddrL2TPIP = C.sizeof_struct_sockaddr_l2tpip SizeofSockaddrL2TPIP6 = C.sizeof_struct_sockaddr_l2tpip6 SizeofSockaddrIUCV = C.sizeof_struct_sockaddr_iucv + SizeofSockaddrNFC = C.sizeof_struct_sockaddr_nfc + SizeofSockaddrNFCLLCP = C.sizeof_struct_sockaddr_nfc_llcp SizeofLinger = C.sizeof_struct_linger SizeofIovec = C.sizeof_struct_iovec SizeofIPMreq = C.sizeof_struct_ip_mreq @@ -3704,3 +3725,74 @@ const ( MTD_FILE_MODE_OTP_USER = C.MTD_FILE_MODE_OTP_USER MTD_FILE_MODE_RAW = C.MTD_FILE_MODE_RAW ) + +// NFC Subsystem enums. + +const ( + NFC_CMD_UNSPEC = C.NFC_CMD_UNSPEC + NFC_CMD_GET_DEVICE = C.NFC_CMD_GET_DEVICE + NFC_CMD_DEV_UP = C.NFC_CMD_DEV_UP + NFC_CMD_DEV_DOWN = C.NFC_CMD_DEV_DOWN + NFC_CMD_DEP_LINK_UP = C.NFC_CMD_DEP_LINK_UP + NFC_CMD_DEP_LINK_DOWN = C.NFC_CMD_DEP_LINK_DOWN + NFC_CMD_START_POLL = C.NFC_CMD_START_POLL + NFC_CMD_STOP_POLL = C.NFC_CMD_STOP_POLL + NFC_CMD_GET_TARGET = C.NFC_CMD_GET_TARGET + NFC_EVENT_TARGETS_FOUND = C.NFC_EVENT_TARGETS_FOUND + NFC_EVENT_DEVICE_ADDED = C.NFC_EVENT_DEVICE_ADDED + NFC_EVENT_DEVICE_REMOVED = C.NFC_EVENT_DEVICE_REMOVED + NFC_EVENT_TARGET_LOST = C.NFC_EVENT_TARGET_LOST + NFC_EVENT_TM_ACTIVATED = C.NFC_EVENT_TM_ACTIVATED + NFC_EVENT_TM_DEACTIVATED = C.NFC_EVENT_TM_DEACTIVATED + NFC_CMD_LLC_GET_PARAMS = C.NFC_CMD_LLC_GET_PARAMS + NFC_CMD_LLC_SET_PARAMS = C.NFC_CMD_LLC_SET_PARAMS + NFC_CMD_ENABLE_SE = C.NFC_CMD_ENABLE_SE + NFC_CMD_DISABLE_SE = C.NFC_CMD_DISABLE_SE + NFC_CMD_LLC_SDREQ = C.NFC_CMD_LLC_SDREQ + NFC_EVENT_LLC_SDRES = C.NFC_EVENT_LLC_SDRES + NFC_CMD_FW_DOWNLOAD = C.NFC_CMD_FW_DOWNLOAD + NFC_EVENT_SE_ADDED = C.NFC_EVENT_SE_ADDED + NFC_EVENT_SE_REMOVED = C.NFC_EVENT_SE_REMOVED + NFC_EVENT_SE_CONNECTIVITY = C.NFC_EVENT_SE_CONNECTIVITY + NFC_EVENT_SE_TRANSACTION = C.NFC_EVENT_SE_TRANSACTION + NFC_CMD_GET_SE = C.NFC_CMD_GET_SE + NFC_CMD_SE_IO = C.NFC_CMD_SE_IO + NFC_CMD_ACTIVATE_TARGET = C.NFC_CMD_ACTIVATE_TARGET + NFC_CMD_VENDOR = C.NFC_CMD_VENDOR + NFC_CMD_DEACTIVATE_TARGET = C.NFC_CMD_DEACTIVATE_TARGET + NFC_ATTR_UNSPEC = C.NFC_ATTR_UNSPEC + NFC_ATTR_DEVICE_INDEX = C.NFC_ATTR_DEVICE_INDEX + NFC_ATTR_DEVICE_NAME = C.NFC_ATTR_DEVICE_NAME + NFC_ATTR_PROTOCOLS = C.NFC_ATTR_PROTOCOLS + NFC_ATTR_TARGET_INDEX = C.NFC_ATTR_TARGET_INDEX + NFC_ATTR_TARGET_SENS_RES = C.NFC_ATTR_TARGET_SENS_RES + NFC_ATTR_TARGET_SEL_RES = C.NFC_ATTR_TARGET_SEL_RES + NFC_ATTR_TARGET_NFCID1 = C.NFC_ATTR_TARGET_NFCID1 + NFC_ATTR_TARGET_SENSB_RES = C.NFC_ATTR_TARGET_SENSB_RES + NFC_ATTR_TARGET_SENSF_RES = C.NFC_ATTR_TARGET_SENSF_RES + NFC_ATTR_COMM_MODE = C.NFC_ATTR_COMM_MODE + NFC_ATTR_RF_MODE = C.NFC_ATTR_RF_MODE + NFC_ATTR_DEVICE_POWERED = C.NFC_ATTR_DEVICE_POWERED + NFC_ATTR_IM_PROTOCOLS = C.NFC_ATTR_IM_PROTOCOLS + NFC_ATTR_TM_PROTOCOLS = C.NFC_ATTR_TM_PROTOCOLS + NFC_ATTR_LLC_PARAM_LTO = C.NFC_ATTR_LLC_PARAM_LTO + NFC_ATTR_LLC_PARAM_RW = C.NFC_ATTR_LLC_PARAM_RW + NFC_ATTR_LLC_PARAM_MIUX = C.NFC_ATTR_LLC_PARAM_MIUX + NFC_ATTR_SE = C.NFC_ATTR_SE + NFC_ATTR_LLC_SDP = C.NFC_ATTR_LLC_SDP + NFC_ATTR_FIRMWARE_NAME = C.NFC_ATTR_FIRMWARE_NAME + NFC_ATTR_SE_INDEX = C.NFC_ATTR_SE_INDEX + NFC_ATTR_SE_TYPE = C.NFC_ATTR_SE_TYPE + NFC_ATTR_SE_AID = C.NFC_ATTR_SE_AID + NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS = C.NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS + NFC_ATTR_SE_APDU = C.NFC_ATTR_SE_APDU + NFC_ATTR_TARGET_ISO15693_DSFID = C.NFC_ATTR_TARGET_ISO15693_DSFID + NFC_ATTR_TARGET_ISO15693_UID = C.NFC_ATTR_TARGET_ISO15693_UID + NFC_ATTR_SE_PARAMS = C.NFC_ATTR_SE_PARAMS + NFC_ATTR_VENDOR_ID = C.NFC_ATTR_VENDOR_ID + NFC_ATTR_VENDOR_SUBCMD = C.NFC_ATTR_VENDOR_SUBCMD + NFC_ATTR_VENDOR_DATA = C.NFC_ATTR_VENDOR_DATA + NFC_SDP_ATTR_UNSPEC = C.NFC_SDP_ATTR_UNSPEC + NFC_SDP_ATTR_URI = C.NFC_SDP_ATTR_URI + NFC_SDP_ATTR_SAP = C.NFC_SDP_ATTR_SAP +) diff --git a/unix/mkerrors.sh b/unix/mkerrors.sh index c4e3e1ee..3f670fab 100755 --- a/unix/mkerrors.sh +++ b/unix/mkerrors.sh @@ -239,6 +239,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -502,6 +503,9 @@ ccflags="$@" $2 ~ /^LO_(KEY|NAME)_SIZE$/ || $2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ || $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL)_/ || + $2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ || + $2 ~ /^NFC_.*_(MAX)?SIZE$/ || + $2 ~ /^RAW_PAYLOAD_/ || $2 ~ /^TP_STATUS_/ || $2 ~ /^FALLOC_/ || $2 ~ /^ICMPV?6?_(FILTER|SEC)/ || diff --git a/unix/syscall_internal_linux_test.go b/unix/syscall_internal_linux_test.go index 55ae32e1..7ec21ca7 100644 --- a/unix/syscall_internal_linux_test.go +++ b/unix/syscall_internal_linux_test.go @@ -205,6 +205,54 @@ func Test_anyToSockaddr(t *testing.T) { }, proto: makeProto(CAN_J1939), }, + { + name: "AF_NFC RAW", + rsa: sockaddrNFCToAny(RawSockaddrNFC{ + Sa_family: AF_NFC, + Dev_idx: 10, + Target_idx: 20, + Nfc_protocol: 30, + }), + sa: &SockaddrNFC{ + DeviceIdx: 10, + TargetIdx: 20, + NFCProtocol: 30, + }, + proto: makeProto(NFC_SOCKPROTO_RAW), + }, + { + name: "AF_NFC LLCP", + rsa: sockaddrNFCLLCPToAny(RawSockaddrNFCLLCP{ + Sa_family: AF_NFC, + Dev_idx: 10, + Target_idx: 20, + Nfc_protocol: 30, + Dsap: 40, + Ssap: 50, + Service_name: [63]uint8{'t', 'e', 's', 't'}, + Service_name_len: 4, + }), + sa: &SockaddrNFCLLCP{ + DeviceIdx: 10, + TargetIdx: 20, + NFCProtocol: 30, + DestinationSAP: 40, + SourceSAP: 50, + ServiceName: "test", + }, + proto: makeProto(NFC_SOCKPROTO_LLCP), + }, + { + name: "AF_NFC unknown", + rsa: sockaddrNFCToAny(RawSockaddrNFC{ + Sa_family: AF_NFC, + Dev_idx: 10, + Target_idx: 20, + Nfc_protocol: 30, + }), + err: EINVAL, + proto: makeProto(^0), + }, { name: "AF_MAX EAFNOSUPPORT", rsa: &RawSockaddrAny{ @@ -631,6 +679,115 @@ func TestSockaddrCAN_sockaddr(t *testing.T) { } } +func TestSockaddrNFC_sockaddr(t *testing.T) { + tests := []struct { + name string + sa *SockaddrNFC + raw *RawSockaddrNFC + err error + }{ + { + name: "NFC RAW", + sa: &SockaddrNFC{ + DeviceIdx: 12345678, + TargetIdx: 87654321, + NFCProtocol: 0xBBBBBBBB, + }, + raw: &RawSockaddrNFC{ + Sa_family: AF_NFC, + Dev_idx: 12345678, + Target_idx: 87654321, + Nfc_protocol: 0xBBBBBBBB, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + out, l, err := tt.sa.sockaddr() + if err != tt.err { + t.Fatalf("unexpected error: %v, want: %v", err, tt.err) + } + + // Must be 0 on error or a fixed size otherwise. + if (tt.err != nil && l != 0) || (tt.raw != nil && l != SizeofSockaddrNFC) { + t.Fatalf("unexpected Socklen: %d", l) + } + + if out != nil { + raw := (*RawSockaddrNFC)(out) + if !reflect.DeepEqual(raw, tt.raw) { + t.Fatalf("unexpected RawSockaddrNFC:\n got: %#v\nwant: %#v", raw, tt.raw) + } + } + }) + } +} + +func TestSockaddrNFCLLCP_sockaddr(t *testing.T) { + tests := []struct { + name string + sa *SockaddrNFCLLCP + raw *RawSockaddrNFCLLCP + err error + }{ + { + name: "valid", + sa: &SockaddrNFCLLCP{ + DeviceIdx: 12345678, + TargetIdx: 87654321, + NFCProtocol: 0xBBBBBBBB, + DestinationSAP: 55, + SourceSAP: 56, + ServiceName: "test service", + }, + raw: &RawSockaddrNFCLLCP{ + Sa_family: AF_NFC, + Dev_idx: 12345678, + Target_idx: 87654321, + Nfc_protocol: 0xBBBBBBBB, + Dsap: 55, + Ssap: 56, + Service_name: [63]uint8{'t', 'e', 's', 't', ' ', 's', 'e', 'r', 'v', 'i', 'c', 'e'}, + Service_name_len: 12, + }, + }, + { + name: "too long service name", + sa: &SockaddrNFCLLCP{ + DeviceIdx: 12345678, + TargetIdx: 87654321, + NFCProtocol: 0xBBBBBBBB, + DestinationSAP: 55, + SourceSAP: 56, + ServiceName: "too long too long too long too long too long too long too long too long too long", + }, + err: EINVAL, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + out, l, err := tt.sa.sockaddr() + if err != tt.err { + t.Fatalf("unexpected error: %v, want: %v", err, tt.err) + } + + // Must be 0 on error or a fixed size otherwise. + if (tt.err != nil && l != 0) || (tt.raw != nil && l != SizeofSockaddrNFCLLCP) { + t.Fatalf("unexpected Socklen: %d", l) + } + + if out != nil { + raw := (*RawSockaddrNFCLLCP)(out) + if !reflect.DeepEqual(raw, tt.raw) { + t.Fatalf("unexpected RawSockaddrNFCLLCP:\n got: %#v\nwant: %#v", raw, tt.raw) + } + } + }) + } +} + // These helpers explicitly copy the contents of in into out to produce // the correct sockaddr structure, without relying on unsafe casting to // a type of a larger size. @@ -687,3 +844,21 @@ func sockaddrCANToAny(in RawSockaddrCAN) *RawSockaddrAny { ) return &out } + +func sockaddrNFCToAny(in RawSockaddrNFC) *RawSockaddrAny { + var out RawSockaddrAny + copy( + (*(*[SizeofSockaddrAny]byte)(unsafe.Pointer(&out)))[:], + (*(*[SizeofSockaddrNFC]byte)(unsafe.Pointer(&in)))[:], + ) + return &out +} + +func sockaddrNFCLLCPToAny(in RawSockaddrNFCLLCP) *RawSockaddrAny { + var out RawSockaddrAny + copy( + (*(*[SizeofSockaddrAny]byte)(unsafe.Pointer(&out)))[:], + (*(*[SizeofSockaddrNFCLLCP]byte)(unsafe.Pointer(&in)))[:], + ) + return &out +} diff --git a/unix/syscall_linux.go b/unix/syscall_linux.go index 2dd7c8e3..41b91fdf 100644 --- a/unix/syscall_linux.go +++ b/unix/syscall_linux.go @@ -904,6 +904,46 @@ func (sa *SockaddrIUCV) sockaddr() (unsafe.Pointer, _Socklen, error) { return unsafe.Pointer(&sa.raw), SizeofSockaddrIUCV, nil } +type SockaddrNFC struct { + DeviceIdx uint32 + TargetIdx uint32 + NFCProtocol uint32 + raw RawSockaddrNFC +} + +func (sa *SockaddrNFC) sockaddr() (unsafe.Pointer, _Socklen, error) { + sa.raw.Sa_family = AF_NFC + sa.raw.Dev_idx = sa.DeviceIdx + sa.raw.Target_idx = sa.TargetIdx + sa.raw.Nfc_protocol = sa.NFCProtocol + return unsafe.Pointer(&sa.raw), SizeofSockaddrNFC, nil +} + +type SockaddrNFCLLCP struct { + DeviceIdx uint32 + TargetIdx uint32 + NFCProtocol uint32 + DestinationSAP uint8 + SourceSAP uint8 + ServiceName string + raw RawSockaddrNFCLLCP +} + +func (sa *SockaddrNFCLLCP) sockaddr() (unsafe.Pointer, _Socklen, error) { + sa.raw.Sa_family = AF_NFC + sa.raw.Dev_idx = sa.DeviceIdx + sa.raw.Target_idx = sa.TargetIdx + sa.raw.Nfc_protocol = sa.NFCProtocol + sa.raw.Dsap = sa.DestinationSAP + sa.raw.Ssap = sa.SourceSAP + if len(sa.ServiceName) > len(sa.raw.Service_name) { + return nil, 0, EINVAL + } + copy(sa.raw.Service_name[:], sa.ServiceName) + sa.raw.SetServiceNameLen(len(sa.ServiceName)) + return unsafe.Pointer(&sa.raw), SizeofSockaddrNFCLLCP, nil +} + var socketProtocol = func(fd int) (int, error) { return GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL) } @@ -1144,6 +1184,37 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { } return sa, nil } + case AF_NFC: + proto, err := socketProtocol(fd) + if err != nil { + return nil, err + } + switch proto { + case NFC_SOCKPROTO_RAW: + pp := (*RawSockaddrNFC)(unsafe.Pointer(rsa)) + sa := &SockaddrNFC{ + DeviceIdx: pp.Dev_idx, + TargetIdx: pp.Target_idx, + NFCProtocol: pp.Nfc_protocol, + } + return sa, nil + case NFC_SOCKPROTO_LLCP: + pp := (*RawSockaddrNFCLLCP)(unsafe.Pointer(rsa)) + if uint64(pp.Service_name_len) > uint64(len(pp.Service_name)) { + return nil, EINVAL + } + sa := &SockaddrNFCLLCP{ + DeviceIdx: pp.Dev_idx, + TargetIdx: pp.Target_idx, + NFCProtocol: pp.Nfc_protocol, + DestinationSAP: pp.Dsap, + SourceSAP: pp.Ssap, + ServiceName: string(pp.Service_name[:pp.Service_name_len]), + } + return sa, nil + default: + return nil, EINVAL + } } return nil, EAFNOSUPPORT } diff --git a/unix/syscall_linux_386.go b/unix/syscall_linux_386.go index 7b52e5d8..b430536c 100644 --- a/unix/syscall_linux_386.go +++ b/unix/syscall_linux_386.go @@ -378,6 +378,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint32(length) +} + //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { diff --git a/unix/syscall_linux_amd64.go b/unix/syscall_linux_amd64.go index 28b76411..85cd97da 100644 --- a/unix/syscall_linux_amd64.go +++ b/unix/syscall_linux_amd64.go @@ -172,6 +172,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint64(length) +} + //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { diff --git a/unix/syscall_linux_arm.go b/unix/syscall_linux_arm.go index 68877728..39a864d4 100644 --- a/unix/syscall_linux_arm.go +++ b/unix/syscall_linux_arm.go @@ -256,6 +256,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint32(length) +} + //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { diff --git a/unix/syscall_linux_arm64.go b/unix/syscall_linux_arm64.go index 7ed70347..7f27ebf2 100644 --- a/unix/syscall_linux_arm64.go +++ b/unix/syscall_linux_arm64.go @@ -207,6 +207,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint64(length) +} + func InotifyInit() (fd int, err error) { return InotifyInit1(0) } diff --git a/unix/syscall_linux_mips64x.go b/unix/syscall_linux_mips64x.go index 06dec06f..27aee81d 100644 --- a/unix/syscall_linux_mips64x.go +++ b/unix/syscall_linux_mips64x.go @@ -217,6 +217,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint64(length) +} + func InotifyInit() (fd int, err error) { return InotifyInit1(0) } diff --git a/unix/syscall_linux_mipsx.go b/unix/syscall_linux_mipsx.go index 8f0d0a5b..3a5621e3 100644 --- a/unix/syscall_linux_mipsx.go +++ b/unix/syscall_linux_mipsx.go @@ -229,6 +229,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint32(length) +} + //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { diff --git a/unix/syscall_linux_ppc.go b/unix/syscall_linux_ppc.go index 7e65e088..cf0d36f7 100644 --- a/unix/syscall_linux_ppc.go +++ b/unix/syscall_linux_ppc.go @@ -215,6 +215,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint32(length) +} + //sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { diff --git a/unix/syscall_linux_ppc64x.go b/unix/syscall_linux_ppc64x.go index 0b1f0d6d..5259a5fe 100644 --- a/unix/syscall_linux_ppc64x.go +++ b/unix/syscall_linux_ppc64x.go @@ -100,6 +100,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint64(length) +} + //sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { diff --git a/unix/syscall_linux_riscv64.go b/unix/syscall_linux_riscv64.go index ce9bcd31..8ef821e5 100644 --- a/unix/syscall_linux_riscv64.go +++ b/unix/syscall_linux_riscv64.go @@ -188,6 +188,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint64(length) +} + func InotifyInit() (fd int, err error) { return InotifyInit1(0) } diff --git a/unix/syscall_linux_s390x.go b/unix/syscall_linux_s390x.go index a1e45694..a1c0574b 100644 --- a/unix/syscall_linux_s390x.go +++ b/unix/syscall_linux_s390x.go @@ -129,6 +129,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint64(length) +} + // Linux on s390x uses the old mmap interface, which requires arguments to be passed in a struct. // mmap2 also requires arguments to be passed in a struct; it is currently not exposed in . func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { diff --git a/unix/syscall_linux_sparc64.go b/unix/syscall_linux_sparc64.go index 49055a3c..de14b889 100644 --- a/unix/syscall_linux_sparc64.go +++ b/unix/syscall_linux_sparc64.go @@ -116,6 +116,10 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } +func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) { + rsa.Service_name_len = uint64(length) +} + //sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { diff --git a/unix/zerrors_linux.go b/unix/zerrors_linux.go index 4e4583b6..c3fa2248 100644 --- a/unix/zerrors_linux.go +++ b/unix/zerrors_linux.go @@ -1566,6 +1566,59 @@ const ( NETLINK_XFRM = 0x6 NETNSA_MAX = 0x5 NETNSA_NSID_NOT_ASSIGNED = -0x1 + NFC_ATR_REQ_GB_MAXSIZE = 0x30 + NFC_ATR_REQ_MAXSIZE = 0x40 + NFC_ATR_RES_GB_MAXSIZE = 0x2f + NFC_ATR_RES_MAXSIZE = 0x40 + NFC_COMM_ACTIVE = 0x0 + NFC_COMM_PASSIVE = 0x1 + NFC_DEVICE_NAME_MAXSIZE = 0x8 + NFC_DIRECTION_RX = 0x0 + NFC_DIRECTION_TX = 0x1 + NFC_FIRMWARE_NAME_MAXSIZE = 0x20 + NFC_GB_MAXSIZE = 0x30 + NFC_GENL_MCAST_EVENT_NAME = "events" + NFC_GENL_NAME = "nfc" + NFC_GENL_VERSION = 0x1 + NFC_HEADER_SIZE = 0x1 + NFC_ISO15693_UID_MAXSIZE = 0x8 + NFC_LLCP_MAX_SERVICE_NAME = 0x3f + NFC_LLCP_MIUX = 0x1 + NFC_LLCP_REMOTE_LTO = 0x3 + NFC_LLCP_REMOTE_MIU = 0x2 + NFC_LLCP_REMOTE_RW = 0x4 + NFC_LLCP_RW = 0x0 + NFC_NFCID1_MAXSIZE = 0xa + NFC_NFCID2_MAXSIZE = 0x8 + NFC_NFCID3_MAXSIZE = 0xa + NFC_PROTO_FELICA = 0x3 + NFC_PROTO_FELICA_MASK = 0x8 + NFC_PROTO_ISO14443 = 0x4 + NFC_PROTO_ISO14443_B = 0x6 + NFC_PROTO_ISO14443_B_MASK = 0x40 + NFC_PROTO_ISO14443_MASK = 0x10 + NFC_PROTO_ISO15693 = 0x7 + NFC_PROTO_ISO15693_MASK = 0x80 + NFC_PROTO_JEWEL = 0x1 + NFC_PROTO_JEWEL_MASK = 0x2 + NFC_PROTO_MAX = 0x8 + NFC_PROTO_MIFARE = 0x2 + NFC_PROTO_MIFARE_MASK = 0x4 + NFC_PROTO_NFC_DEP = 0x5 + NFC_PROTO_NFC_DEP_MASK = 0x20 + NFC_RAW_HEADER_SIZE = 0x2 + NFC_RF_INITIATOR = 0x0 + NFC_RF_NONE = 0x2 + NFC_RF_TARGET = 0x1 + NFC_SENSB_RES_MAXSIZE = 0xc + NFC_SENSF_RES_MAXSIZE = 0x12 + NFC_SE_DISABLED = 0x0 + NFC_SE_EMBEDDED = 0x2 + NFC_SE_ENABLED = 0x1 + NFC_SE_UICC = 0x1 + NFC_SOCKPROTO_LLCP = 0x1 + NFC_SOCKPROTO_MAX = 0x2 + NFC_SOCKPROTO_RAW = 0x0 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1991,6 +2044,11 @@ const ( QNX4_SUPER_MAGIC = 0x2f QNX6_SUPER_MAGIC = 0x68191122 RAMFS_MAGIC = 0x858458f6 + RAW_PAYLOAD_DIGITAL = 0x3 + RAW_PAYLOAD_HCI = 0x2 + RAW_PAYLOAD_LLCP = 0x0 + RAW_PAYLOAD_NCI = 0x1 + RAW_PAYLOAD_PROPRIETARY = 0x4 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 RENAME_EXCHANGE = 0x2 diff --git a/unix/ztypes_linux.go b/unix/ztypes_linux.go index c9b2c9aa..72887abe 100644 --- a/unix/ztypes_linux.go +++ b/unix/ztypes_linux.go @@ -351,6 +351,13 @@ type RawSockaddrIUCV struct { Name [8]int8 } +type RawSockaddrNFC struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 +} + type _Socklen uint32 type Linger struct { @@ -464,6 +471,7 @@ const ( SizeofSockaddrL2TPIP = 0x10 SizeofSockaddrL2TPIP6 = 0x20 SizeofSockaddrIUCV = 0x20 + SizeofSockaddrNFC = 0x10 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc @@ -3828,3 +3836,72 @@ const ( MTD_FILE_MODE_OTP_USER = 0x2 MTD_FILE_MODE_RAW = 0x3 ) + +const ( + NFC_CMD_UNSPEC = 0x0 + NFC_CMD_GET_DEVICE = 0x1 + NFC_CMD_DEV_UP = 0x2 + NFC_CMD_DEV_DOWN = 0x3 + NFC_CMD_DEP_LINK_UP = 0x4 + NFC_CMD_DEP_LINK_DOWN = 0x5 + NFC_CMD_START_POLL = 0x6 + NFC_CMD_STOP_POLL = 0x7 + NFC_CMD_GET_TARGET = 0x8 + NFC_EVENT_TARGETS_FOUND = 0x9 + NFC_EVENT_DEVICE_ADDED = 0xa + NFC_EVENT_DEVICE_REMOVED = 0xb + NFC_EVENT_TARGET_LOST = 0xc + NFC_EVENT_TM_ACTIVATED = 0xd + NFC_EVENT_TM_DEACTIVATED = 0xe + NFC_CMD_LLC_GET_PARAMS = 0xf + NFC_CMD_LLC_SET_PARAMS = 0x10 + NFC_CMD_ENABLE_SE = 0x11 + NFC_CMD_DISABLE_SE = 0x12 + NFC_CMD_LLC_SDREQ = 0x13 + NFC_EVENT_LLC_SDRES = 0x14 + NFC_CMD_FW_DOWNLOAD = 0x15 + NFC_EVENT_SE_ADDED = 0x16 + NFC_EVENT_SE_REMOVED = 0x17 + NFC_EVENT_SE_CONNECTIVITY = 0x18 + NFC_EVENT_SE_TRANSACTION = 0x19 + NFC_CMD_GET_SE = 0x1a + NFC_CMD_SE_IO = 0x1b + NFC_CMD_ACTIVATE_TARGET = 0x1c + NFC_CMD_VENDOR = 0x1d + NFC_CMD_DEACTIVATE_TARGET = 0x1e + NFC_ATTR_UNSPEC = 0x0 + NFC_ATTR_DEVICE_INDEX = 0x1 + NFC_ATTR_DEVICE_NAME = 0x2 + NFC_ATTR_PROTOCOLS = 0x3 + NFC_ATTR_TARGET_INDEX = 0x4 + NFC_ATTR_TARGET_SENS_RES = 0x5 + NFC_ATTR_TARGET_SEL_RES = 0x6 + NFC_ATTR_TARGET_NFCID1 = 0x7 + NFC_ATTR_TARGET_SENSB_RES = 0x8 + NFC_ATTR_TARGET_SENSF_RES = 0x9 + NFC_ATTR_COMM_MODE = 0xa + NFC_ATTR_RF_MODE = 0xb + NFC_ATTR_DEVICE_POWERED = 0xc + NFC_ATTR_IM_PROTOCOLS = 0xd + NFC_ATTR_TM_PROTOCOLS = 0xe + NFC_ATTR_LLC_PARAM_LTO = 0xf + NFC_ATTR_LLC_PARAM_RW = 0x10 + NFC_ATTR_LLC_PARAM_MIUX = 0x11 + NFC_ATTR_SE = 0x12 + NFC_ATTR_LLC_SDP = 0x13 + NFC_ATTR_FIRMWARE_NAME = 0x14 + NFC_ATTR_SE_INDEX = 0x15 + NFC_ATTR_SE_TYPE = 0x16 + NFC_ATTR_SE_AID = 0x17 + NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS = 0x18 + NFC_ATTR_SE_APDU = 0x19 + NFC_ATTR_TARGET_ISO15693_DSFID = 0x1a + NFC_ATTR_TARGET_ISO15693_UID = 0x1b + NFC_ATTR_SE_PARAMS = 0x1c + NFC_ATTR_VENDOR_ID = 0x1d + NFC_ATTR_VENDOR_SUBCMD = 0x1e + NFC_ATTR_VENDOR_DATA = 0x1f + NFC_SDP_ATTR_UNSPEC = 0x0 + NFC_SDP_ATTR_URI = 0x1 + NFC_SDP_ATTR_SAP = 0x2 +) diff --git a/unix/ztypes_linux_386.go b/unix/ztypes_linux_386.go index 4d4d283d..235c62e4 100644 --- a/unix/ztypes_linux_386.go +++ b/unix/ztypes_linux_386.go @@ -128,6 +128,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint32 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -160,9 +171,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x8 - SizeofMsghdr = 0x1c - SizeofCmsghdr = 0xc + SizeofSockaddrNFCLLCP = 0x58 + SizeofIovec = 0x8 + SizeofMsghdr = 0x1c + SizeofCmsghdr = 0xc ) const ( diff --git a/unix/ztypes_linux_amd64.go b/unix/ztypes_linux_amd64.go index 8a2eed5e..99b1e5b6 100644 --- a/unix/ztypes_linux_amd64.go +++ b/unix/ztypes_linux_amd64.go @@ -130,6 +130,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint64 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -163,9 +174,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x10 - SizeofMsghdr = 0x38 - SizeofCmsghdr = 0x10 + SizeofSockaddrNFCLLCP = 0x60 + SizeofIovec = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 ) const ( diff --git a/unix/ztypes_linux_arm.go b/unix/ztypes_linux_arm.go index 94b34add..cc8bba79 100644 --- a/unix/ztypes_linux_arm.go +++ b/unix/ztypes_linux_arm.go @@ -134,6 +134,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint32 +} + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -166,9 +177,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x8 - SizeofMsghdr = 0x1c - SizeofCmsghdr = 0xc + SizeofSockaddrNFCLLCP = 0x58 + SizeofIovec = 0x8 + SizeofMsghdr = 0x1c + SizeofCmsghdr = 0xc ) const ( diff --git a/unix/ztypes_linux_arm64.go b/unix/ztypes_linux_arm64.go index 2143de4d..fa8fe3a7 100644 --- a/unix/ztypes_linux_arm64.go +++ b/unix/ztypes_linux_arm64.go @@ -131,6 +131,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint64 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -164,9 +175,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x10 - SizeofMsghdr = 0x38 - SizeofCmsghdr = 0x10 + SizeofSockaddrNFCLLCP = 0x60 + SizeofIovec = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 ) const ( diff --git a/unix/ztypes_linux_mips.go b/unix/ztypes_linux_mips.go index a40216ee..e7fb8d9b 100644 --- a/unix/ztypes_linux_mips.go +++ b/unix/ztypes_linux_mips.go @@ -133,6 +133,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint32 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -165,9 +176,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x8 - SizeofMsghdr = 0x1c - SizeofCmsghdr = 0xc + SizeofSockaddrNFCLLCP = 0x58 + SizeofIovec = 0x8 + SizeofMsghdr = 0x1c + SizeofCmsghdr = 0xc ) const ( diff --git a/unix/ztypes_linux_mips64.go b/unix/ztypes_linux_mips64.go index e834b069..2fa61d59 100644 --- a/unix/ztypes_linux_mips64.go +++ b/unix/ztypes_linux_mips64.go @@ -131,6 +131,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint64 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -164,9 +175,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x10 - SizeofMsghdr = 0x38 - SizeofCmsghdr = 0x10 + SizeofSockaddrNFCLLCP = 0x60 + SizeofIovec = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 ) const ( diff --git a/unix/ztypes_linux_mips64le.go b/unix/ztypes_linux_mips64le.go index e31083b0..7f363993 100644 --- a/unix/ztypes_linux_mips64le.go +++ b/unix/ztypes_linux_mips64le.go @@ -131,6 +131,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint64 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -164,9 +175,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x10 - SizeofMsghdr = 0x38 - SizeofCmsghdr = 0x10 + SizeofSockaddrNFCLLCP = 0x60 + SizeofIovec = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 ) const ( diff --git a/unix/ztypes_linux_mipsle.go b/unix/ztypes_linux_mipsle.go index 42811f7f..f3c20cb8 100644 --- a/unix/ztypes_linux_mipsle.go +++ b/unix/ztypes_linux_mipsle.go @@ -133,6 +133,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint32 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -165,9 +176,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x8 - SizeofMsghdr = 0x1c - SizeofCmsghdr = 0xc + SizeofSockaddrNFCLLCP = 0x58 + SizeofIovec = 0x8 + SizeofMsghdr = 0x1c + SizeofCmsghdr = 0xc ) const ( diff --git a/unix/ztypes_linux_ppc.go b/unix/ztypes_linux_ppc.go index af7a7201..885d2795 100644 --- a/unix/ztypes_linux_ppc.go +++ b/unix/ztypes_linux_ppc.go @@ -134,6 +134,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint32 +} + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -166,9 +177,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x8 - SizeofMsghdr = 0x1c - SizeofCmsghdr = 0xc + SizeofSockaddrNFCLLCP = 0x58 + SizeofIovec = 0x8 + SizeofMsghdr = 0x1c + SizeofCmsghdr = 0xc ) const ( diff --git a/unix/ztypes_linux_ppc64.go b/unix/ztypes_linux_ppc64.go index 2a3afbae..a94eb8e1 100644 --- a/unix/ztypes_linux_ppc64.go +++ b/unix/ztypes_linux_ppc64.go @@ -132,6 +132,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint64 +} + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -165,9 +176,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x10 - SizeofMsghdr = 0x38 - SizeofCmsghdr = 0x10 + SizeofSockaddrNFCLLCP = 0x60 + SizeofIovec = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 ) const ( diff --git a/unix/ztypes_linux_ppc64le.go b/unix/ztypes_linux_ppc64le.go index c0de30a6..659e32eb 100644 --- a/unix/ztypes_linux_ppc64le.go +++ b/unix/ztypes_linux_ppc64le.go @@ -132,6 +132,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint64 +} + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -165,9 +176,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x10 - SizeofMsghdr = 0x38 - SizeofCmsghdr = 0x10 + SizeofSockaddrNFCLLCP = 0x60 + SizeofIovec = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 ) const ( diff --git a/unix/ztypes_linux_riscv64.go b/unix/ztypes_linux_riscv64.go index 74faf2e9..ab8ec604 100644 --- a/unix/ztypes_linux_riscv64.go +++ b/unix/ztypes_linux_riscv64.go @@ -131,6 +131,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint64 +} + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -164,9 +175,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x10 - SizeofMsghdr = 0x38 - SizeofCmsghdr = 0x10 + SizeofSockaddrNFCLLCP = 0x60 + SizeofIovec = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 ) const ( diff --git a/unix/ztypes_linux_s390x.go b/unix/ztypes_linux_s390x.go index 9a8f0c2c..3ec08237 100644 --- a/unix/ztypes_linux_s390x.go +++ b/unix/ztypes_linux_s390x.go @@ -130,6 +130,17 @@ const ( FADV_NOREUSE = 0x7 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint64 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -163,9 +174,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x10 - SizeofMsghdr = 0x38 - SizeofCmsghdr = 0x10 + SizeofSockaddrNFCLLCP = 0x60 + SizeofIovec = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 ) const ( diff --git a/unix/ztypes_linux_sparc64.go b/unix/ztypes_linux_sparc64.go index 72cdda75..23d47447 100644 --- a/unix/ztypes_linux_sparc64.go +++ b/unix/ztypes_linux_sparc64.go @@ -134,6 +134,17 @@ const ( FADV_NOREUSE = 0x5 ) +type RawSockaddrNFCLLCP struct { + Sa_family uint16 + Dev_idx uint32 + Target_idx uint32 + Nfc_protocol uint32 + Dsap uint8 + Ssap uint8 + Service_name [63]uint8 + Service_name_len uint64 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -167,9 +178,10 @@ type Cmsghdr struct { } const ( - SizeofIovec = 0x10 - SizeofMsghdr = 0x38 - SizeofCmsghdr = 0x10 + SizeofSockaddrNFCLLCP = 0x60 + SizeofIovec = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 ) const (