github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/socket_nfc.txt (about)

     1  # Copyright 2017 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  # AF_NFC support.
     5  
     6  include <uapi/linux/socket.h>
     7  include <uapi/linux/net.h>
     8  include <uapi/linux/nfc.h>
     9  include <net/sock.h>
    10  include <net/nfc/nfc.h>
    11  include <net/nfc/llcp.h>
    12  
    13  resource sock_nfc_llcp[sock]
    14  
    15  syz_init_net_socket$nfc_llcp(domain const[AF_NFC], type flags[nfc_llcp_type], proto const[NFC_SOCKPROTO_LLCP]) sock_nfc_llcp
    16  bind$nfc_llcp(fd sock_nfc_llcp, addr ptr[in, sockaddr_nfc_llcp], addrlen len[addr])
    17  connect$nfc_llcp(fd sock_nfc_llcp, addr ptr[in, sockaddr_nfc_llcp], addrlen len[addr])
    18  accept$nfc_llcp(fd sock_nfc_llcp, peer ptr[out, sockaddr_nfc_llcp, opt], peerlen ptr[inout, len[peer, int32]]) sock_nfc_llcp
    19  accept4$nfc_llcp(fd sock_nfc_llcp, peer ptr[out, sockaddr_nfc_llcp, opt], peerlen ptr[inout, len[peer, int32]], flags flags[accept_flags]) sock_nfc_llcp
    20  setsockopt$nfc_llcp_NFC_LLCP_RW(fd sock_nfc_llcp, level const[SOL_NFC], opt const[NFC_LLCP_RW], arg ptr[in, int32[0:LLCP_MAX_RW]], arglen len[arg])
    21  setsockopt$nfc_llcp_NFC_LLCP_MIUX(fd sock_nfc_llcp, level const[SOL_NFC], opt const[NFC_LLCP_MIUX], arg ptr[in, int32[0:LLCP_MAX_MIUX]], arglen len[arg])
    22  getsockopt$nfc_llcp(fd sock_nfc_llcp, level const[SOL_NFC], opt flags[nfc_llcp_opts], arg buffer[out], arglen len[arg])
    23  sendmsg$nfc_llcp(fd sock_nfc_llcp, msg ptr[in, nfc_llcp_send_msghdr], f flags[send_flags])
    24  sendmmsg$nfc_llcp(fd sock_nfc_llcp, mmsg ptr[in, array[nfc_llcp_send_msghdr]], vlen len[mmsg], f flags[send_flags])
    25  
    26  resource sock_nfc_raw[sock]
    27  
    28  syz_init_net_socket$nfc_raw(domain const[AF_NFC], type flags[nfc_raw_type], proto const[NFC_SOCKPROTO_RAW]) sock_nfc_raw
    29  connect$nfc_raw(fd sock_nfc_raw, addr ptr[in, sockaddr_nfc], addrlen len[addr])
    30  
    31  nfc_llcp_type = SOCK_STREAM, SOCK_DGRAM, SOCK_RAW
    32  nfc_raw_type = SOCK_SEQPACKET, SOCK_RAW
    33  nfc_proto = NFC_PROTO_JEWEL, NFC_PROTO_MIFARE, NFC_PROTO_FELICA, NFC_PROTO_ISO14443, NFC_PROTO_NFC_DEP, NFC_PROTO_ISO14443_B, NFC_PROTO_ISO15693
    34  nfc_proto_mask = NFC_PROTO_JEWEL_MASK, NFC_PROTO_MIFARE_MASK, NFC_PROTO_FELICA_MASK, NFC_PROTO_ISO14443_MASK, NFC_PROTO_NFC_DEP_MASK, NFC_PROTO_ISO14443_B_MASK, NFC_PROTO_ISO15693_MASK
    35  nfc_llcp_opts = NFC_LLCP_RW, NFC_LLCP_MIUX, NFC_LLCP_REMOTE_MIU, NFC_LLCP_REMOTE_LTO, NFC_LLCP_REMOTE_RW
    36  
    37  sockaddr_nfc_llcp {
    38  	family		const[AF_NFC, int16]
    39  	devidx		nfc_dev_id
    40  	target		nfc_target_idx
    41  	nfc_protocol	flags[nfc_proto, int32]
    42  	dsap		int8
    43  	ssap		int8
    44  	service_name	array[int8, NFC_LLCP_MAX_SERVICE_NAME]
    45  	servlen		intptr[0:NFC_LLCP_MAX_SERVICE_NAME]
    46  }
    47  
    48  sockaddr_nfc {
    49  	sa_family	const[AF_NFC, int16]
    50  	dev_idx		nfc_dev_id
    51  	target_idx	nfc_target_idx
    52  	nfc_protocol	flags[nfc_proto, int32]
    53  }
    54  
    55  nfc_llcp_send_msghdr {
    56  	addr	ptr[in, sockaddr_nfc_llcp]
    57  	addrlen	len[addr, int32]
    58  	vec	ptr[in, array[iovec_in]]
    59  	vlen	len[vec, intptr]
    60  	ctrl	ptr[in, cmsghdr, opt]
    61  	ctrllen	bytesize[ctrl, intptr]
    62  	f	flags[send_flags, int32]
    63  }