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