Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  * INET     An implementation of the TCP/IP protocol suite for the LINUX
0004  *      operating system.  INET is implemented using the BSD Socket
0005  *      interface as the means of communication with the user level.
0006  *
0007  *      Global definitions for the ANSI FDDI interface.
0008  *
0009  * Version: @(#)if_fddi.h   1.0.3   Oct  6 2018
0010  *
0011  * Author:  Lawrence V. Stefani, <stefani@yahoo.com>
0012  * Maintainer:  Maciej W. Rozycki, <macro@orcam.me.uk>
0013  *
0014  *      if_fddi.h is based on previous if_ether.h and if_tr.h work by
0015  *          Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
0016  *          Donald Becker, <becker@super.org>
0017  *          Alan Cox, <alan@lxorguk.ukuu.org.uk>
0018  *          Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
0019  *          Peter De Schrijver, <stud11@cc4.kuleuven.ac.be>
0020  *
0021  *      This program is free software; you can redistribute it and/or
0022  *      modify it under the terms of the GNU General Public License
0023  *      as published by the Free Software Foundation; either version
0024  *      2 of the License, or (at your option) any later version.
0025  */
0026 #ifndef _UAPI_LINUX_IF_FDDI_H
0027 #define _UAPI_LINUX_IF_FDDI_H
0028 
0029 #include <linux/types.h>
0030 
0031 /*
0032  *  Define max and min legal sizes.  The frame sizes do not include
0033  *  4 byte FCS/CRC (frame check sequence).
0034  */
0035 #define FDDI_K_ALEN     6   /* Octets in one FDDI address */
0036 #define FDDI_K_8022_HLEN    16  /* Total octets in 802.2 header */
0037 #define FDDI_K_SNAP_HLEN    21  /* Total octets in 802.2 SNAP header */
0038 #define FDDI_K_8022_ZLEN    16  /* Min octets in 802.2 frame sans
0039                        FCS */
0040 #define FDDI_K_SNAP_ZLEN    21  /* Min octets in 802.2 SNAP frame sans
0041                        FCS */
0042 #define FDDI_K_8022_DLEN    4475    /* Max octets in 802.2 payload */
0043 #define FDDI_K_SNAP_DLEN    4470    /* Max octets in 802.2 SNAP payload */
0044 #define FDDI_K_LLC_ZLEN     13  /* Min octets in LLC frame sans FCS */
0045 #define FDDI_K_LLC_LEN      4491    /* Max octets in LLC frame sans FCS */
0046 #define FDDI_K_OUI_LEN      3   /* Octets in OUI in 802.2 SNAP
0047                        header */
0048 
0049 /* Define FDDI Frame Control (FC) Byte masks */
0050 #define FDDI_FC_K_CLASS_MASK        0x80    /* class bit */
0051 #define FDDI_FC_K_CLASS_SYNC        0x80
0052 #define FDDI_FC_K_CLASS_ASYNC       0x00
0053 #define FDDI_FC_K_ALEN_MASK     0x40    /* address length bit */
0054 #define FDDI_FC_K_ALEN_48       0x40
0055 #define FDDI_FC_K_ALEN_16       0x00
0056 #define FDDI_FC_K_FORMAT_MASK       0x30    /* format bits */
0057 #define FDDI_FC_K_FORMAT_FUTURE     0x30
0058 #define FDDI_FC_K_FORMAT_IMPLEMENTOR    0x20
0059 #define FDDI_FC_K_FORMAT_LLC        0x10
0060 #define FDDI_FC_K_FORMAT_MANAGEMENT 0x00
0061 #define FDDI_FC_K_CONTROL_MASK      0x0f    /* control bits */
0062 
0063 /* Define FDDI Frame Control (FC) Byte specific values */
0064 #define FDDI_FC_K_VOID          0x00
0065 #define FDDI_FC_K_NON_RESTRICTED_TOKEN  0x80
0066 #define FDDI_FC_K_RESTRICTED_TOKEN  0xC0
0067 #define FDDI_FC_K_SMT_MIN       0x41
0068 #define FDDI_FC_K_SMT_MAX       0x4F
0069 #define FDDI_FC_K_MAC_MIN       0xC1
0070 #define FDDI_FC_K_MAC_MAX       0xCF
0071 #define FDDI_FC_K_ASYNC_LLC_MIN     0x50
0072 #define FDDI_FC_K_ASYNC_LLC_DEF     0x54
0073 #define FDDI_FC_K_ASYNC_LLC_MAX     0x5F
0074 #define FDDI_FC_K_SYNC_LLC_MIN      0xD0
0075 #define FDDI_FC_K_SYNC_LLC_MAX      0xD7
0076 #define FDDI_FC_K_IMPLEMENTOR_MIN   0x60
0077 #define FDDI_FC_K_IMPLEMENTOR_MAX   0x6F
0078 #define FDDI_FC_K_RESERVED_MIN      0x70
0079 #define FDDI_FC_K_RESERVED_MAX      0x7F
0080 
0081 /* Define LLC and SNAP constants */
0082 #define FDDI_EXTENDED_SAP       0xAA
0083 #define FDDI_UI_CMD         0x03
0084 
0085 /* Define 802.2 Type 1 header */
0086 struct fddi_8022_1_hdr {
0087     __u8    dsap;           /* destination service access point */
0088     __u8    ssap;           /* source service access point */
0089     __u8    ctrl;           /* control byte #1 */
0090 } __attribute__((packed));
0091 
0092 /* Define 802.2 Type 2 header */
0093 struct fddi_8022_2_hdr {
0094     __u8    dsap;           /* destination service access point */
0095     __u8    ssap;           /* source service access point */
0096     __u8    ctrl_1;         /* control byte #1 */
0097     __u8    ctrl_2;         /* control byte #2 */
0098 } __attribute__((packed));
0099 
0100 /* Define 802.2 SNAP header */
0101 struct fddi_snap_hdr {
0102     __u8    dsap;           /* always 0xAA */
0103     __u8    ssap;           /* always 0xAA */
0104     __u8    ctrl;           /* always 0x03 */
0105     __u8    oui[FDDI_K_OUI_LEN];    /* organizational universal id */
0106     __be16  ethertype;      /* packet type ID field */
0107 } __attribute__((packed));
0108 
0109 /* Define FDDI LLC frame header */
0110 struct fddihdr {
0111     __u8    fc;         /* frame control */
0112     __u8    daddr[FDDI_K_ALEN]; /* destination address */
0113     __u8    saddr[FDDI_K_ALEN]; /* source address */
0114     union {
0115         struct fddi_8022_1_hdr  llc_8022_1;
0116         struct fddi_8022_2_hdr  llc_8022_2;
0117         struct fddi_snap_hdr    llc_snap;
0118     } hdr;
0119 } __attribute__((packed));
0120 
0121 
0122 #endif /* _UAPI_LINUX_IF_FDDI_H */