mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-28 05:40:26 +00:00
74 lines
3.8 KiB
Plaintext
74 lines
3.8 KiB
Plaintext
# Copyright 2017 syzkaller project authors. All rights reserved.
|
|
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
|
|
|
# AF_NETLINK support.
|
|
|
|
include <linux/net.h>
|
|
include <uapi/linux/netlink.h>
|
|
|
|
resource sock_netlink[sock]
|
|
|
|
socket$netlink(domain const[AF_NETLINK], type const[SOCK_RAW], proto flags[netlink_proto]) sock_netlink
|
|
bind$netlink(fd sock_netlink, addr ptr[in, sockaddr_nl], addrlen len[addr])
|
|
connect$netlink(fd sock_netlink, addr ptr[in, sockaddr_nl], addrlen len[addr])
|
|
getsockname$netlink(fd sock_netlink, addr ptr[out, sockaddr_nl], addrlen ptr[inout, len[addr, int32]])
|
|
getpeername$netlink(fd sock_netlink, peer ptr[out, sockaddr_nl], peerlen ptr[inout, len[peer, int32]])
|
|
sendmsg$netlink(fd sock_netlink, msg ptr[in, msghdr_netlink], f flags[send_flags])
|
|
setsockopt$netlink_NETLINK_ADD_MEMBERSHIP(fd sock_netlink, level const[SOL_NETLINK], opt const[NETLINK_ADD_MEMBERSHIP], arg ptr[in, int32], arglen len[arg])
|
|
setsockopt$netlink_NETLINK_DROP_MEMBERSHIP(fd sock_netlink, level const[SOL_NETLINK], opt const[NETLINK_DROP_MEMBERSHIP], arg ptr[in, int32], arglen len[arg])
|
|
setsockopt$netlink_NETLINK_PKTINFO(fd sock_netlink, level const[SOL_NETLINK], opt const[NETLINK_PKTINFO], arg ptr[in, int32], arglen len[arg])
|
|
setsockopt$netlink_NETLINK_BROADCAST_ERROR(fd sock_netlink, level const[SOL_NETLINK], opt const[NETLINK_BROADCAST_ERROR], arg ptr[in, int32], arglen len[arg])
|
|
setsockopt$netlink_NETLINK_NO_ENOBUFS(fd sock_netlink, level const[SOL_NETLINK], opt const[NETLINK_NO_ENOBUFS], arg ptr[in, int32], arglen len[arg])
|
|
setsockopt$netlink_NETLINK_RX_RING(fd sock_netlink, level const[SOL_NETLINK], opt const[NETLINK_RX_RING], arg ptr[in, nl_mmap_req], arglen len[arg])
|
|
setsockopt$netlink_NETLINK_TX_RING(fd sock_netlink, level const[SOL_NETLINK], opt const[NETLINK_TX_RING], arg ptr[in, nl_mmap_req], arglen len[arg])
|
|
setsockopt$netlink_NETLINK_LISTEN_ALL_NSID(fd sock_netlink, level const[SOL_NETLINK], opt const[NETLINK_LISTEN_ALL_NSID], arg ptr[in, int32], arglen len[arg])
|
|
setsockopt$netlink_NETLINK_CAP_ACK(fd sock_netlink, level const[SOL_NETLINK], opt const[NETLINK_CAP_ACK], arg ptr[in, int32], arglen len[arg])
|
|
getsockopt$netlink(fd sock_netlink, level const[SOL_NETLINK], opt flags[netlink_sockopts], arg buffer[out], arglen ptr[inout, len[arg, int32]])
|
|
|
|
netlink_family = AF_NETLINK, AF_UNSPEC
|
|
netlink_proto = NETLINK_ROUTE, NETLINK_UNUSED, NETLINK_USERSOCK, NETLINK_FIREWALL, NETLINK_SOCK_DIAG, NETLINK_NFLOG, NETLINK_XFRM, NETLINK_SELINUX, NETLINK_ISCSI, NETLINK_AUDIT, NETLINK_FIB_LOOKUP, NETLINK_CONNECTOR, NETLINK_NETFILTER, NETLINK_IP6_FW, NETLINK_DNRTMSG, NETLINK_KOBJECT_UEVENT, NETLINK_GENERIC, NETLINK_SCSITRANSPORT, NETLINK_ECRYPTFS, NETLINK_RDMA, NETLINK_CRYPTO, NETLINK_INET_DIAG
|
|
netlink_sockopts = NETLINK_ADD_MEMBERSHIP, NETLINK_DROP_MEMBERSHIP, NETLINK_PKTINFO, NETLINK_BROADCAST_ERROR, NETLINK_NO_ENOBUFS, NETLINK_RX_RING, NETLINK_TX_RING, NETLINK_LISTEN_ALL_NSID, NETLINK_LIST_MEMBERSHIPS, NETLINK_CAP_ACK
|
|
netlink_msg_flags = NLM_F_REQUEST, NLM_F_MULTI, NLM_F_ACK, NLM_F_ECHO, NLM_F_DUMP_INTR, NLM_F_DUMP_FILTERED, NLM_F_ROOT, NLM_F_MATCH, NLM_F_ATOMIC, NLM_F_DUMP, NLM_F_REPLACE, NLM_F_EXCL, NLM_F_CREATE, NLM_F_APPEND
|
|
|
|
sockaddr_nl {
|
|
family flags[netlink_family, int16]
|
|
pad const[0, int16]
|
|
pid int32
|
|
groups int32
|
|
}
|
|
|
|
msghdr_netlink {
|
|
addr ptr[in, sockaddr_nl, opt]
|
|
addrlen len[addr, int32]
|
|
vec ptr[in, array[iovec_nl]]
|
|
vlen len[vec, intptr]
|
|
ctrl ptr[in, array[cmsghdr_un], opt]
|
|
ctrllen len[ctrl, intptr]
|
|
f flags[send_flags, int32]
|
|
}
|
|
|
|
iovec_nl {
|
|
data ptr[in, array[netlink_msg]]
|
|
len bytesize[data, intptr]
|
|
}
|
|
|
|
netlink_msg {
|
|
len len[parent, int32]
|
|
type int16
|
|
flags flags[netlink_msg_flags, int16]
|
|
seq int32
|
|
pid int32
|
|
data array[int8]
|
|
}
|
|
|
|
nl_mmap_req {
|
|
bsize int32
|
|
bnumber int32
|
|
fsize int32
|
|
fnumber int32
|
|
}
|
|
|
|
# Removed (if __KERNEL__ defined) in next-20160229 (commit d1b4c689)
|
|
define NETLINK_RX_RING 6
|
|
define NETLINK_TX_RING 7
|