dn.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #ifndef _LINUX_DN_H
  2. #define _LINUX_DN_H
  3. #include <linux/types.h>
  4. /*
  5. DECnet Data Structures and Constants
  6. */
  7. /*
  8. * DNPROTO_NSP can't be the same as SOL_SOCKET,
  9. * so increment each by one (compared to ULTRIX)
  10. */
  11. #define DNPROTO_NSP 2 /* NSP protocol number */
  12. #define DNPROTO_ROU 3 /* Routing protocol number */
  13. #define DNPROTO_NML 4 /* Net mgt protocol number */
  14. #define DNPROTO_EVL 5 /* Evl protocol number (usr) */
  15. #define DNPROTO_EVR 6 /* Evl protocol number (evl) */
  16. #define DNPROTO_NSPT 7 /* NSP trace protocol number */
  17. #define DN_ADDL 2
  18. #define DN_MAXADDL 2 /* ULTRIX headers have 20 here, but pathworks has 2 */
  19. #define DN_MAXOPTL 16
  20. #define DN_MAXOBJL 16
  21. #define DN_MAXACCL 40
  22. #define DN_MAXALIASL 128
  23. #define DN_MAXNODEL 256
  24. #define DNBUFSIZE 65023
  25. /*
  26. * SET/GET Socket options - must match the DSO_ numbers below
  27. */
  28. #define SO_CONDATA 1
  29. #define SO_CONACCESS 2
  30. #define SO_PROXYUSR 3
  31. #define SO_LINKINFO 7
  32. #define DSO_CONDATA 1 /* Set/Get connect data */
  33. #define DSO_DISDATA 10 /* Set/Get disconnect data */
  34. #define DSO_CONACCESS 2 /* Set/Get connect access data */
  35. #define DSO_ACCEPTMODE 4 /* Set/Get accept mode */
  36. #define DSO_CONACCEPT 5 /* Accept deferred connection */
  37. #define DSO_CONREJECT 6 /* Reject deferred connection */
  38. #define DSO_LINKINFO 7 /* Set/Get link information */
  39. #define DSO_STREAM 8 /* Set socket type to stream */
  40. #define DSO_SEQPACKET 9 /* Set socket type to sequenced packet */
  41. #define DSO_MAXWINDOW 11 /* Maximum window size allowed */
  42. #define DSO_NODELAY 12 /* Turn off nagle */
  43. #define DSO_CORK 13 /* Wait for more data! */
  44. #define DSO_SERVICES 14 /* NSP Services field */
  45. #define DSO_INFO 15 /* NSP Info field */
  46. #define DSO_MAX 15 /* Maximum option number */
  47. /* LINK States */
  48. #define LL_INACTIVE 0
  49. #define LL_CONNECTING 1
  50. #define LL_RUNNING 2
  51. #define LL_DISCONNECTING 3
  52. #define ACC_IMMED 0
  53. #define ACC_DEFER 1
  54. #define SDF_WILD 1 /* Wild card object */
  55. #define SDF_PROXY 2 /* Addr eligible for proxy */
  56. #define SDF_UICPROXY 4 /* Use uic-based proxy */
  57. /* Structures */
  58. struct dn_naddr {
  59. __le16 a_len;
  60. __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
  61. };
  62. struct sockaddr_dn {
  63. __u16 sdn_family;
  64. __u8 sdn_flags;
  65. __u8 sdn_objnum;
  66. __le16 sdn_objnamel;
  67. __u8 sdn_objname[DN_MAXOBJL];
  68. struct dn_naddr sdn_add;
  69. };
  70. #define sdn_nodeaddrl sdn_add.a_len /* Node address length */
  71. #define sdn_nodeaddr sdn_add.a_addr /* Node address */
  72. /*
  73. * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
  74. */
  75. struct optdata_dn {
  76. __le16 opt_status; /* Extended status return */
  77. #define opt_sts opt_status
  78. __le16 opt_optl; /* Length of user data */
  79. __u8 opt_data[16]; /* User data */
  80. };
  81. struct accessdata_dn {
  82. __u8 acc_accl;
  83. __u8 acc_acc[DN_MAXACCL];
  84. __u8 acc_passl;
  85. __u8 acc_pass[DN_MAXACCL];
  86. __u8 acc_userl;
  87. __u8 acc_user[DN_MAXACCL];
  88. };
  89. /*
  90. * DECnet logical link information structure
  91. */
  92. struct linkinfo_dn {
  93. __u16 idn_segsize; /* Segment size for link */
  94. __u8 idn_linkstate; /* Logical link state */
  95. };
  96. /*
  97. * Ethernet address format (for DECnet)
  98. */
  99. union etheraddress {
  100. __u8 dne_addr[6]; /* Full ethernet address */
  101. struct {
  102. __u8 dne_hiord[4]; /* DECnet HIORD prefix */
  103. __u8 dne_nodeaddr[2]; /* DECnet node address */
  104. } dne_remote;
  105. };
  106. /*
  107. * DECnet physical socket address format
  108. */
  109. struct dn_addr {
  110. __le16 dna_family; /* AF_DECnet */
  111. union etheraddress dna_netaddr; /* DECnet ethernet address */
  112. };
  113. #define DECNET_IOCTL_BASE 0x89 /* PROTOPRIVATE range */
  114. #define SIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, struct dn_naddr)
  115. #define SIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, struct dn_naddr)
  116. #define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int)
  117. #define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int)
  118. #endif /* _LINUX_DN_H */