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