xref: /linux/include/uapi/linux/llc.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
4607ca46eSDavid Howells  *
5607ca46eSDavid Howells  * Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
6607ca46eSDavid Howells  *
7607ca46eSDavid Howells  * This program can be redistributed or modified under the terms of the
8607ca46eSDavid Howells  * GNU General Public License as published by the Free Software Foundation.
9607ca46eSDavid Howells  * This program is distributed without any warranty or implied warranty
10607ca46eSDavid Howells  * of merchantability or fitness for a particular purpose.
11607ca46eSDavid Howells  *
12607ca46eSDavid Howells  * See the GNU General Public License for more details.
13607ca46eSDavid Howells  */
14607ca46eSDavid Howells #ifndef _UAPI__LINUX_LLC_H
15607ca46eSDavid Howells #define _UAPI__LINUX_LLC_H
16607ca46eSDavid Howells 
17607ca46eSDavid Howells #include <linux/socket.h>
1840df93beSDmitry V. Levin #include <linux/if.h> 		/* For IFHWADDRLEN. */
19607ca46eSDavid Howells 
20607ca46eSDavid Howells #define __LLC_SOCK_SIZE__ 16	/* sizeof(sockaddr_llc), word align. */
21607ca46eSDavid Howells struct sockaddr_llc {
22607ca46eSDavid Howells 	__kernel_sa_family_t sllc_family; /* AF_LLC */
23607ca46eSDavid Howells 	__kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
24607ca46eSDavid Howells 	unsigned char   sllc_test;
25607ca46eSDavid Howells 	unsigned char   sllc_xid;
26607ca46eSDavid Howells 	unsigned char	sllc_ua;	/* UA data, only for SOCK_STREAM. */
27607ca46eSDavid Howells 	unsigned char   sllc_sap;
28607ca46eSDavid Howells 	unsigned char   sllc_mac[IFHWADDRLEN];
29607ca46eSDavid Howells 	unsigned char   __pad[__LLC_SOCK_SIZE__ -
30607ca46eSDavid Howells 			      sizeof(__kernel_sa_family_t) * 2 -
31607ca46eSDavid Howells 			      sizeof(unsigned char) * 4 - IFHWADDRLEN];
32607ca46eSDavid Howells };
33607ca46eSDavid Howells 
34607ca46eSDavid Howells /* sockopt definitions. */
35607ca46eSDavid Howells enum llc_sockopts {
36607ca46eSDavid Howells 	LLC_OPT_UNKNOWN = 0,
37607ca46eSDavid Howells 	LLC_OPT_RETRY,		/* max retrans attempts. */
38607ca46eSDavid Howells 	LLC_OPT_SIZE,		/* max PDU size (octets). */
39607ca46eSDavid Howells 	LLC_OPT_ACK_TMR_EXP,	/* ack expire time (secs). */
40607ca46eSDavid Howells 	LLC_OPT_P_TMR_EXP,	/* pf cycle expire time (secs). */
41607ca46eSDavid Howells 	LLC_OPT_REJ_TMR_EXP,	/* rej sent expire time (secs). */
42607ca46eSDavid Howells 	LLC_OPT_BUSY_TMR_EXP,	/* busy state expire time (secs). */
43607ca46eSDavid Howells 	LLC_OPT_TX_WIN,		/* tx window size. */
44607ca46eSDavid Howells 	LLC_OPT_RX_WIN,		/* rx window size. */
45607ca46eSDavid Howells 	LLC_OPT_PKTINFO,	/* ancillary packet information. */
46607ca46eSDavid Howells 	LLC_OPT_MAX
47607ca46eSDavid Howells };
48607ca46eSDavid Howells 
49607ca46eSDavid Howells #define LLC_OPT_MAX_RETRY	 100
50607ca46eSDavid Howells #define LLC_OPT_MAX_SIZE	4196
51607ca46eSDavid Howells #define LLC_OPT_MAX_WIN		 127
52607ca46eSDavid Howells #define LLC_OPT_MAX_ACK_TMR_EXP	  60
53607ca46eSDavid Howells #define LLC_OPT_MAX_P_TMR_EXP	  60
54607ca46eSDavid Howells #define LLC_OPT_MAX_REJ_TMR_EXP	  60
55607ca46eSDavid Howells #define LLC_OPT_MAX_BUSY_TMR_EXP  60
56607ca46eSDavid Howells 
57607ca46eSDavid Howells /* LLC SAP types. */
58607ca46eSDavid Howells #define LLC_SAP_NULL	0x00		/* NULL SAP. 			*/
59607ca46eSDavid Howells #define LLC_SAP_LLC	0x02		/* LLC Sublayer Management. 	*/
60607ca46eSDavid Howells #define LLC_SAP_SNA	0x04		/* SNA Path Control. 		*/
61607ca46eSDavid Howells #define LLC_SAP_PNM	0x0E		/* Proway Network Management.	*/
62607ca46eSDavid Howells #define LLC_SAP_IP	0x06		/* TCP/IP. 			*/
63607ca46eSDavid Howells #define LLC_SAP_BSPAN	0x42		/* Bridge Spanning Tree Proto	*/
64607ca46eSDavid Howells #define LLC_SAP_MMS	0x4E		/* Manufacturing Message Srv.	*/
65607ca46eSDavid Howells #define LLC_SAP_8208	0x7E		/* ISO 8208			*/
66607ca46eSDavid Howells #define LLC_SAP_3COM	0x80		/* 3COM. 			*/
67607ca46eSDavid Howells #define LLC_SAP_PRO	0x8E		/* Proway Active Station List	*/
68607ca46eSDavid Howells #define LLC_SAP_SNAP	0xAA		/* SNAP. 			*/
69607ca46eSDavid Howells #define LLC_SAP_BANYAN	0xBC		/* Banyan. 			*/
70607ca46eSDavid Howells #define LLC_SAP_IPX	0xE0		/* IPX/SPX. 			*/
71607ca46eSDavid Howells #define LLC_SAP_NETBEUI	0xF0		/* NetBEUI. 			*/
72607ca46eSDavid Howells #define LLC_SAP_LANMGR	0xF4		/* LanManager. 			*/
73607ca46eSDavid Howells #define LLC_SAP_IMPL	0xF8		/* IMPL				*/
74607ca46eSDavid Howells #define LLC_SAP_DISC	0xFC		/* Discovery			*/
75607ca46eSDavid Howells #define LLC_SAP_OSI	0xFE		/* OSI Network Layers. 		*/
76607ca46eSDavid Howells #define LLC_SAP_LAR	0xDC		/* LAN Address Resolution 	*/
77607ca46eSDavid Howells #define LLC_SAP_RM	0xD4		/* Resource Management 		*/
78607ca46eSDavid Howells #define LLC_SAP_GLOBAL	0xFF		/* Global SAP. 			*/
79607ca46eSDavid Howells 
80607ca46eSDavid Howells struct llc_pktinfo {
81607ca46eSDavid Howells 	int lpi_ifindex;
82607ca46eSDavid Howells 	unsigned char lpi_sap;
83607ca46eSDavid Howells 	unsigned char lpi_mac[IFHWADDRLEN];
84607ca46eSDavid Howells };
85607ca46eSDavid Howells 
86607ca46eSDavid Howells #endif /* _UAPI__LINUX_LLC_H */
87