Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
0002 /*
0003  * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
0004  *
0005  * Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
0006  *
0007  * This program can be redistributed or modified under the terms of the
0008  * GNU General Public License as published by the Free Software Foundation.
0009  * This program is distributed without any warranty or implied warranty
0010  * of merchantability or fitness for a particular purpose.
0011  *
0012  * See the GNU General Public License for more details.
0013  */
0014 #ifndef _UAPI__LINUX_LLC_H
0015 #define _UAPI__LINUX_LLC_H
0016 
0017 #include <linux/socket.h>
0018 #include <linux/if.h>       /* For IFHWADDRLEN. */
0019 
0020 #define __LLC_SOCK_SIZE__ 16    /* sizeof(sockaddr_llc), word align. */
0021 struct sockaddr_llc {
0022     __kernel_sa_family_t sllc_family; /* AF_LLC */
0023     __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
0024     unsigned char   sllc_test;
0025     unsigned char   sllc_xid;
0026     unsigned char   sllc_ua;    /* UA data, only for SOCK_STREAM. */
0027     unsigned char   sllc_sap;
0028     unsigned char   sllc_mac[IFHWADDRLEN];
0029     unsigned char   __pad[__LLC_SOCK_SIZE__ -
0030                   sizeof(__kernel_sa_family_t) * 2 -
0031                   sizeof(unsigned char) * 4 - IFHWADDRLEN];
0032 };
0033 
0034 /* sockopt definitions. */
0035 enum llc_sockopts {
0036     LLC_OPT_UNKNOWN = 0,
0037     LLC_OPT_RETRY,      /* max retrans attempts. */
0038     LLC_OPT_SIZE,       /* max PDU size (octets). */
0039     LLC_OPT_ACK_TMR_EXP,    /* ack expire time (secs). */
0040     LLC_OPT_P_TMR_EXP,  /* pf cycle expire time (secs). */
0041     LLC_OPT_REJ_TMR_EXP,    /* rej sent expire time (secs). */
0042     LLC_OPT_BUSY_TMR_EXP,   /* busy state expire time (secs). */
0043     LLC_OPT_TX_WIN,     /* tx window size. */
0044     LLC_OPT_RX_WIN,     /* rx window size. */
0045     LLC_OPT_PKTINFO,    /* ancillary packet information. */
0046     LLC_OPT_MAX
0047 };
0048 
0049 #define LLC_OPT_MAX_RETRY    100
0050 #define LLC_OPT_MAX_SIZE    4196
0051 #define LLC_OPT_MAX_WIN      127
0052 #define LLC_OPT_MAX_ACK_TMR_EXP   60
0053 #define LLC_OPT_MAX_P_TMR_EXP     60
0054 #define LLC_OPT_MAX_REJ_TMR_EXP   60
0055 #define LLC_OPT_MAX_BUSY_TMR_EXP  60
0056 
0057 /* LLC SAP types. */
0058 #define LLC_SAP_NULL    0x00        /* NULL SAP.            */
0059 #define LLC_SAP_LLC 0x02        /* LLC Sublayer Management.     */
0060 #define LLC_SAP_SNA 0x04        /* SNA Path Control.        */
0061 #define LLC_SAP_PNM 0x0E        /* Proway Network Management.   */  
0062 #define LLC_SAP_IP  0x06        /* TCP/IP.          */
0063 #define LLC_SAP_BSPAN   0x42        /* Bridge Spanning Tree Proto   */
0064 #define LLC_SAP_MMS 0x4E        /* Manufacturing Message Srv.   */
0065 #define LLC_SAP_8208    0x7E        /* ISO 8208         */
0066 #define LLC_SAP_3COM    0x80        /* 3COM.            */
0067 #define LLC_SAP_PRO 0x8E        /* Proway Active Station List   */
0068 #define LLC_SAP_SNAP    0xAA        /* SNAP.            */
0069 #define LLC_SAP_BANYAN  0xBC        /* Banyan.          */
0070 #define LLC_SAP_IPX 0xE0        /* IPX/SPX.             */
0071 #define LLC_SAP_NETBEUI 0xF0        /* NetBEUI.             */
0072 #define LLC_SAP_LANMGR  0xF4        /* LanManager.          */
0073 #define LLC_SAP_IMPL    0xF8        /* IMPL             */
0074 #define LLC_SAP_DISC    0xFC        /* Discovery            */
0075 #define LLC_SAP_OSI 0xFE        /* OSI Network Layers.      */
0076 #define LLC_SAP_LAR 0xDC        /* LAN Address Resolution   */
0077 #define LLC_SAP_RM  0xD4        /* Resource Management      */
0078 #define LLC_SAP_GLOBAL  0xFF        /* Global SAP.          */
0079 
0080 struct llc_pktinfo {
0081     int lpi_ifindex;
0082     unsigned char lpi_sap;
0083     unsigned char lpi_mac[IFHWADDRLEN];
0084 };
0085 
0086 #endif /* _UAPI__LINUX_LLC_H */