atmbr2684.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _LINUX_ATMBR2684_H
  3. #define _LINUX_ATMBR2684_H
  4. #include <linux/types.h>
  5. #include <linux/atm.h>
  6. #include <linux/if.h> /* For IFNAMSIZ */
  7. /*
  8. * Type of media we're bridging (ethernet, token ring, etc) Currently only
  9. * ethernet is supported
  10. */
  11. #define BR2684_MEDIA_ETHERNET (0) /* 802.3 */
  12. #define BR2684_MEDIA_802_4 (1) /* 802.4 */
  13. #define BR2684_MEDIA_TR (2) /* 802.5 - token ring */
  14. #define BR2684_MEDIA_FDDI (3)
  15. #define BR2684_MEDIA_802_6 (4) /* 802.6 */
  16. /* used only at device creation: */
  17. #define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */
  18. /*
  19. * Is there FCS inbound on this VC? This currently isn't supported.
  20. */
  21. #define BR2684_FCSIN_NO (0)
  22. #define BR2684_FCSIN_IGNORE (1)
  23. #define BR2684_FCSIN_VERIFY (2)
  24. /*
  25. * Is there FCS outbound on this VC? This currently isn't supported.
  26. */
  27. #define BR2684_FCSOUT_NO (0)
  28. #define BR2684_FCSOUT_SENDZERO (1)
  29. #define BR2684_FCSOUT_GENERATE (2)
  30. /*
  31. * Does this VC include LLC encapsulation?
  32. */
  33. #define BR2684_ENCAPS_VC (0) /* VC-mux */
  34. #define BR2684_ENCAPS_LLC (1)
  35. #define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
  36. /*
  37. * Is this VC bridged or routed?
  38. */
  39. #define BR2684_PAYLOAD_ROUTED (0)
  40. #define BR2684_PAYLOAD_BRIDGED (1)
  41. /*
  42. * This is for the ATM_NEWBACKENDIF call - these are like socket families:
  43. * the first element of the structure is the backend number and the rest
  44. * is per-backend specific
  45. */
  46. struct atm_newif_br2684 {
  47. atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
  48. int media; /* BR2684_MEDIA_*, flags in upper bits */
  49. char ifname[IFNAMSIZ];
  50. int mtu;
  51. };
  52. /*
  53. * This structure is used to specify a br2684 interface - either by a
  54. * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
  55. */
  56. #define BR2684_FIND_BYNOTHING (0)
  57. #define BR2684_FIND_BYNUM (1)
  58. #define BR2684_FIND_BYIFNAME (2)
  59. struct br2684_if_spec {
  60. int method; /* BR2684_FIND_* */
  61. union {
  62. char ifname[IFNAMSIZ];
  63. int devnum;
  64. } spec;
  65. };
  66. /*
  67. * This is for the ATM_SETBACKEND call - these are like socket families:
  68. * the first element of the structure is the backend number and the rest
  69. * is per-backend specific
  70. */
  71. struct atm_backend_br2684 {
  72. atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
  73. struct br2684_if_spec ifspec;
  74. int fcs_in; /* BR2684_FCSIN_* */
  75. int fcs_out; /* BR2684_FCSOUT_* */
  76. int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
  77. int encaps; /* BR2684_ENCAPS_* */
  78. int has_vpiid; /* 1: use vpn_id - Unsupported */
  79. __u8 vpn_id[7];
  80. int send_padding; /* unsupported */
  81. int min_size; /* we will pad smaller packets than this */
  82. };
  83. /*
  84. * The BR2684_SETFILT ioctl is an experimental mechanism for folks
  85. * terminating a large number of IP-only vcc's. When netfilter allows
  86. * efficient per-if in/out filters, this support will be removed
  87. */
  88. struct br2684_filter {
  89. __be32 prefix; /* network byte order */
  90. __be32 netmask; /* 0 = disable filter */
  91. };
  92. struct br2684_filter_set {
  93. struct br2684_if_spec ifspec;
  94. struct br2684_filter filter;
  95. };
  96. enum br2684_payload {
  97. p_routed = BR2684_PAYLOAD_ROUTED,
  98. p_bridged = BR2684_PAYLOAD_BRIDGED,
  99. };
  100. #define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
  101. struct br2684_filter_set)
  102. #endif /* _LINUX_ATMBR2684_H */