llc.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
  2. /*
  3. * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators.
  4. *
  5. * Copyright (c) 2001 by Jay Schulist <jschlst@samba.org>
  6. *
  7. * This program can be redistributed or modified under the terms of the
  8. * GNU General Public License as published by the Free Software Foundation.
  9. * This program is distributed without any warranty or implied warranty
  10. * of merchantability or fitness for a particular purpose.
  11. *
  12. * See the GNU General Public License for more details.
  13. */
  14. #ifndef __LINUX_LLC_H
  15. #define __LINUX_LLC_H
  16. #include <linux/socket.h>
  17. #include <linux/if.h> /* For IFHWADDRLEN. */
  18. #define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
  19. struct sockaddr_llc {
  20. __kernel_sa_family_t sllc_family; /* AF_LLC */
  21. __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
  22. unsigned char sllc_test;
  23. unsigned char sllc_xid;
  24. unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */
  25. unsigned char sllc_sap;
  26. unsigned char sllc_mac[IFHWADDRLEN];
  27. unsigned char __pad[__LLC_SOCK_SIZE__ -
  28. sizeof(__kernel_sa_family_t) * 2 -
  29. sizeof(unsigned char) * 4 - IFHWADDRLEN];
  30. };
  31. /* sockopt definitions. */
  32. enum llc_sockopts {
  33. LLC_OPT_UNKNOWN = 0,
  34. LLC_OPT_RETRY, /* max retrans attempts. */
  35. LLC_OPT_SIZE, /* max PDU size (octets). */
  36. LLC_OPT_ACK_TMR_EXP, /* ack expire time (secs). */
  37. LLC_OPT_P_TMR_EXP, /* pf cycle expire time (secs). */
  38. LLC_OPT_REJ_TMR_EXP, /* rej sent expire time (secs). */
  39. LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */
  40. LLC_OPT_TX_WIN, /* tx window size. */
  41. LLC_OPT_RX_WIN, /* rx window size. */
  42. LLC_OPT_PKTINFO, /* ancillary packet information. */
  43. LLC_OPT_MAX
  44. };
  45. #define LLC_OPT_MAX_RETRY 100
  46. #define LLC_OPT_MAX_SIZE 4196
  47. #define LLC_OPT_MAX_WIN 127
  48. #define LLC_OPT_MAX_ACK_TMR_EXP 60
  49. #define LLC_OPT_MAX_P_TMR_EXP 60
  50. #define LLC_OPT_MAX_REJ_TMR_EXP 60
  51. #define LLC_OPT_MAX_BUSY_TMR_EXP 60
  52. /* LLC SAP types. */
  53. #define LLC_SAP_NULL 0x00 /* NULL SAP. */
  54. #define LLC_SAP_LLC 0x02 /* LLC Sublayer Management. */
  55. #define LLC_SAP_SNA 0x04 /* SNA Path Control. */
  56. #define LLC_SAP_PNM 0x0E /* Proway Network Management. */
  57. #define LLC_SAP_IP 0x06 /* TCP/IP. */
  58. #define LLC_SAP_BSPAN 0x42 /* Bridge Spanning Tree Proto */
  59. #define LLC_SAP_MMS 0x4E /* Manufacturing Message Srv. */
  60. #define LLC_SAP_8208 0x7E /* ISO 8208 */
  61. #define LLC_SAP_3COM 0x80 /* 3COM. */
  62. #define LLC_SAP_PRO 0x8E /* Proway Active Station List */
  63. #define LLC_SAP_SNAP 0xAA /* SNAP. */
  64. #define LLC_SAP_BANYAN 0xBC /* Banyan. */
  65. #define LLC_SAP_IPX 0xE0 /* IPX/SPX. */
  66. #define LLC_SAP_NETBEUI 0xF0 /* NetBEUI. */
  67. #define LLC_SAP_LANMGR 0xF4 /* LanManager. */
  68. #define LLC_SAP_IMPL 0xF8 /* IMPL */
  69. #define LLC_SAP_DISC 0xFC /* Discovery */
  70. #define LLC_SAP_OSI 0xFE /* OSI Network Layers. */
  71. #define LLC_SAP_LAR 0xDC /* LAN Address Resolution */
  72. #define LLC_SAP_RM 0xD4 /* Resource Management */
  73. #define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
  74. struct llc_pktinfo {
  75. int lpi_ifindex;
  76. unsigned char lpi_sap;
  77. unsigned char lpi_mac[IFHWADDRLEN];
  78. };
  79. #endif /* __LINUX_LLC_H */