atmsap.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /* atmsap.h - ATM Service Access Point addressing definitions */
  2. /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
  3. #ifndef _LINUX_ATMSAP_H
  4. #define _LINUX_ATMSAP_H
  5. #include <linux/atmapi.h>
  6. /*
  7. * BEGIN_xx and END_xx markers are used for automatic generation of
  8. * documentation. Do not change them.
  9. */
  10. /*
  11. * Layer 2 protocol identifiers
  12. */
  13. /* BEGIN_L2 */
  14. #define ATM_L2_NONE 0 /* L2 not specified */
  15. #define ATM_L2_ISO1745 0x01 /* Basic mode ISO 1745 */
  16. #define ATM_L2_Q291 0x02 /* ITU-T Q.291 (Rec. I.441) */
  17. #define ATM_L2_X25_LL 0x06 /* ITU-T X.25, link layer */
  18. #define ATM_L2_X25_ML 0x07 /* ITU-T X.25, multilink */
  19. #define ATM_L2_LAPB 0x08 /* Extended LAPB, half-duplex (Rec. T.71) */
  20. #define ATM_L2_HDLC_ARM 0x09 /* HDLC ARM (ISO/IEC 4335) */
  21. #define ATM_L2_HDLC_NRM 0x0a /* HDLC NRM (ISO/IEC 4335) */
  22. #define ATM_L2_HDLC_ABM 0x0b /* HDLC ABM (ISO/IEC 4335) */
  23. #define ATM_L2_ISO8802 0x0c /* LAN LLC (ISO/IEC 8802/2) */
  24. #define ATM_L2_X75 0x0d /* ITU-T X.75, SLP */
  25. #define ATM_L2_Q922 0x0e /* ITU-T Q.922 */
  26. #define ATM_L2_USER 0x10 /* user-specified */
  27. #define ATM_L2_ISO7776 0x11 /* ISO 7776 DTE-DTE */
  28. /* END_L2 */
  29. /*
  30. * Layer 3 protocol identifiers
  31. */
  32. /* BEGIN_L3 */
  33. #define ATM_L3_NONE 0 /* L3 not specified */
  34. #define ATM_L3_X25 0x06 /* ITU-T X.25, packet layer */
  35. #define ATM_L3_ISO8208 0x07 /* ISO/IEC 8208 */
  36. #define ATM_L3_X223 0x08 /* ITU-T X.223 | ISO/IEC 8878 */
  37. #define ATM_L3_ISO8473 0x09 /* ITU-T X.233 | ISO/IEC 8473 */
  38. #define ATM_L3_T70 0x0a /* ITU-T T.70 minimum network layer */
  39. #define ATM_L3_TR9577 0x0b /* ISO/IEC TR 9577 */
  40. #define ATM_L3_H310 0x0c /* ITU-T Recommendation H.310 */
  41. #define ATM_L3_H321 0x0d /* ITU-T Recommendation H.321 */
  42. #define ATM_L3_USER 0x10 /* user-specified */
  43. /* END_L3 */
  44. /*
  45. * High layer identifiers
  46. */
  47. /* BEGIN_HL */
  48. #define ATM_HL_NONE 0 /* HL not specified */
  49. #define ATM_HL_ISO 0x01 /* ISO */
  50. #define ATM_HL_USER 0x02 /* user-specific */
  51. #define ATM_HL_HLP 0x03 /* high layer profile - UNI 3.0 only */
  52. #define ATM_HL_VENDOR 0x04 /* vendor-specific application identifier */
  53. /* END_HL */
  54. /*
  55. * ITU-T coded mode of operation
  56. */
  57. /* BEGIN_IMD */
  58. #define ATM_IMD_NONE 0 /* mode not specified */
  59. #define ATM_IMD_NORMAL 1 /* normal mode of operation */
  60. #define ATM_IMD_EXTENDED 2 /* extended mode of operation */
  61. /* END_IMD */
  62. /*
  63. * H.310 code points
  64. */
  65. #define ATM_TT_NONE 0 /* terminal type not specified */
  66. #define ATM_TT_RX 1 /* receive only */
  67. #define ATM_TT_TX 2 /* send only */
  68. #define ATM_TT_RXTX 3 /* receive and send */
  69. #define ATM_MC_NONE 0 /* no multiplexing */
  70. #define ATM_MC_TS 1 /* transport stream (TS) */
  71. #define ATM_MC_TS_FEC 2 /* transport stream with forward error corr. */
  72. #define ATM_MC_PS 3 /* program stream (PS) */
  73. #define ATM_MC_PS_FEC 4 /* program stream with forward error corr. */
  74. #define ATM_MC_H221 5 /* ITU-T Rec. H.221 */
  75. /*
  76. * SAP structures
  77. */
  78. #define ATM_MAX_HLI 8 /* maximum high-layer information length */
  79. struct atm_blli {
  80. unsigned char l2_proto; /* layer 2 protocol */
  81. union {
  82. struct {
  83. unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
  84. /* absent */
  85. unsigned char window; /* window size (k), 1-127 (0 to omit) */
  86. } itu; /* ITU-T encoding */
  87. unsigned char user; /* user-specified l2 information */
  88. } l2;
  89. unsigned char l3_proto; /* layer 3 protocol */
  90. union {
  91. struct {
  92. unsigned char mode; /* mode of operation (ATM_IMD_xxx), 0 if */
  93. /* absent */
  94. unsigned char def_size; /* default packet size (log2), 4-12 (0 to */
  95. /* omit) */
  96. unsigned char window;/* packet window size, 1-127 (0 to omit) */
  97. } itu; /* ITU-T encoding */
  98. unsigned char user; /* user specified l3 information */
  99. struct { /* if l3_proto = ATM_L3_H310 */
  100. unsigned char term_type; /* terminal type */
  101. unsigned char fw_mpx_cap; /* forward multiplexing capability */
  102. /* only if term_type != ATM_TT_NONE */
  103. unsigned char bw_mpx_cap; /* backward multiplexing capability */
  104. /* only if term_type != ATM_TT_NONE */
  105. } h310;
  106. struct { /* if l3_proto = ATM_L3_TR9577 */
  107. unsigned char ipi; /* initial protocol id */
  108. unsigned char snap[5];/* IEEE 802.1 SNAP identifier */
  109. /* (only if ipi == NLPID_IEEE802_1_SNAP) */
  110. } tr9577;
  111. } l3;
  112. } __ATM_API_ALIGN;
  113. struct atm_bhli {
  114. unsigned char hl_type; /* high layer information type */
  115. unsigned char hl_length; /* length (only if hl_type == ATM_HL_USER || */
  116. /* hl_type == ATM_HL_ISO) */
  117. unsigned char hl_info[ATM_MAX_HLI];/* high layer information */
  118. };
  119. #define ATM_MAX_BLLI 3 /* maximum number of BLLI elements */
  120. struct atm_sap {
  121. struct atm_bhli bhli; /* local SAP, high-layer information */
  122. struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
  123. /* local SAP, low-layer info */
  124. };
  125. static __inline__ int blli_in_use(struct atm_blli blli)
  126. {
  127. return blli.l2_proto || blli.l3_proto;
  128. }
  129. #endif