• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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# http://www.bocc.de/llcsocket.c
5
6# AF_LLC support.
7
8include <linux/socket.h>
9include <linux/net.h>
10include <linux/if_ether.h>
11include <linux/if_arp.h>
12include <linux/llc.h>
13
14resource sock_llc[sock]
15
16syz_init_net_socket$llc(domain const[AF_LLC], type flags[llc_socket_type], proto const[0]) sock_llc
17bind$llc(fd sock_llc, addr ptr[in, sockaddr_llc], addrlen len[addr])
18connect$llc(fd sock_llc, addr ptr[in, sockaddr_llc], addrlen len[addr])
19accept4$llc(fd sock_llc, peer ptr[out, sockaddr_llc, opt], peerlen ptr[inout, len[peer, int32]], flags flags[accept_flags]) sock_llc
20sendto$llc(fd sock_llc, buf buffer[in], len len[buf], f flags[send_flags], addr ptr[in, sockaddr_llc, opt], addrlen len[addr])
21recvfrom$llc(fd sock_llc, buf buffer[out], len len[buf], f flags[recv_flags], addr ptr[in, sockaddr_llc, opt], addrlen len[addr])
22getsockname$llc(fd sock_llc, addr ptr[out, sockaddr_llc], addrlen ptr[inout, len[addr, int32]])
23getpeername$llc(fd sock_llc, peer ptr[out, sockaddr_llc], peerlen ptr[inout, len[peer, int32]])
24
25llc_socket_type = SOCK_DGRAM, SOCK_STREAM
26
27sockaddr_llc {
28	sllc_family	const[AF_LLC, int16]
29	sllc_arphrd	flags[dev_type_arphdr, int16]
30	sllc_test	int8
31	sllc_xid	int8
32	sllc_ua		int8
33	sllc_sap	int8
34	sll_addr	mac_addr
35} [size[SOCKADDR_SIZE]]
36
37# Generic options
38
39llc_option_types_int = LLC_OPT_RETRY, LLC_OPT_SIZE, LLC_OPT_ACK_TMR_EXP, LLC_OPT_P_TMR_EXP, LLC_OPT_REJ_TMR_EXP, LLC_OPT_BUSY_TMR_EXP, LLC_OPT_TX_WIN, LLC_OPT_RX_WIN, LLC_OPT_PKTINFO
40
41getsockopt$llc_int(fd sock_llc, level const[SOL_LLC], optname flags[llc_option_types_int], optval ptr[out, int32], optlen ptr[inout, len[optval, int32]])
42setsockopt$llc_int(fd sock_llc, level const[SOL_LLC], optname flags[llc_option_types_int], optval ptr[in, int32], optlen len[optval])
43