blob: 5fbdd3d49ebabd77526ef5f29b73d66112380f70 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_DN_H
2#define _LINUX_DN_H
3
Jaswinder Singh Rajput57d17802009-01-30 20:52:54 +05304#include <linux/types.h>
Joe Perchese2169752013-08-01 16:17:47 -07005#include <linux/if_ether.h>
Jaswinder Singh Rajput57d17802009-01-30 20:52:54 +05306
Linus Torvalds1da177e2005-04-16 15:20:36 -07007/*
8
9 DECnet Data Structures and Constants
10
11*/
12
13/*
14 * DNPROTO_NSP can't be the same as SOL_SOCKET,
15 * so increment each by one (compared to ULTRIX)
16 */
17#define DNPROTO_NSP 2 /* NSP protocol number */
18#define DNPROTO_ROU 3 /* Routing protocol number */
19#define DNPROTO_NML 4 /* Net mgt protocol number */
20#define DNPROTO_EVL 5 /* Evl protocol number (usr) */
21#define DNPROTO_EVR 6 /* Evl protocol number (evl) */
22#define DNPROTO_NSPT 7 /* NSP trace protocol number */
23
24
25#define DN_ADDL 2
26#define DN_MAXADDL 2 /* ULTRIX headers have 20 here, but pathworks has 2 */
27#define DN_MAXOPTL 16
28#define DN_MAXOBJL 16
29#define DN_MAXACCL 40
30#define DN_MAXALIASL 128
31#define DN_MAXNODEL 256
32#define DNBUFSIZE 65023
33
34/*
35 * SET/GET Socket options - must match the DSO_ numbers below
36 */
37#define SO_CONDATA 1
38#define SO_CONACCESS 2
39#define SO_PROXYUSR 3
40#define SO_LINKINFO 7
41
42#define DSO_CONDATA 1 /* Set/Get connect data */
43#define DSO_DISDATA 10 /* Set/Get disconnect data */
44#define DSO_CONACCESS 2 /* Set/Get connect access data */
45#define DSO_ACCEPTMODE 4 /* Set/Get accept mode */
46#define DSO_CONACCEPT 5 /* Accept deferred connection */
47#define DSO_CONREJECT 6 /* Reject deferred connection */
48#define DSO_LINKINFO 7 /* Set/Get link information */
49#define DSO_STREAM 8 /* Set socket type to stream */
50#define DSO_SEQPACKET 9 /* Set socket type to sequenced packet */
51#define DSO_MAXWINDOW 11 /* Maximum window size allowed */
52#define DSO_NODELAY 12 /* Turn off nagle */
53#define DSO_CORK 13 /* Wait for more data! */
54#define DSO_SERVICES 14 /* NSP Services field */
55#define DSO_INFO 15 /* NSP Info field */
56#define DSO_MAX 15 /* Maximum option number */
57
58
59/* LINK States */
60#define LL_INACTIVE 0
61#define LL_CONNECTING 1
62#define LL_RUNNING 2
63#define LL_DISCONNECTING 3
64
65#define ACC_IMMED 0
66#define ACC_DEFER 1
67
68#define SDF_WILD 1 /* Wild card object */
69#define SDF_PROXY 2 /* Addr eligible for proxy */
70#define SDF_UICPROXY 4 /* Use uic-based proxy */
71
72/* Structures */
73
74
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080075struct dn_naddr {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080076 __le16 a_len;
77 __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
Linus Torvalds1da177e2005-04-16 15:20:36 -070078};
79
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080080struct sockaddr_dn {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080081 __u16 sdn_family;
82 __u8 sdn_flags;
83 __u8 sdn_objnum;
84 __le16 sdn_objnamel;
85 __u8 sdn_objname[DN_MAXOBJL];
Linus Torvalds1da177e2005-04-16 15:20:36 -070086 struct dn_naddr sdn_add;
87};
88#define sdn_nodeaddrl sdn_add.a_len /* Node address length */
89#define sdn_nodeaddr sdn_add.a_addr /* Node address */
90
91
92
93/*
94 * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
95 */
96struct optdata_dn {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080097 __le16 opt_status; /* Extended status return */
Linus Torvalds1da177e2005-04-16 15:20:36 -070098#define opt_sts opt_status
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080099 __le16 opt_optl; /* Length of user data */
100 __u8 opt_data[16]; /* User data */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101};
102
Eric Dumazetd94d9fe2009-11-04 09:50:58 -0800103struct accessdata_dn {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800104 __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 Torvalds1da177e2005-04-16 15:20:36 -0700110};
111
112/*
113 * DECnet logical link information structure
114 */
115struct linkinfo_dn {
Al Virod88e6612007-02-09 18:13:42 +0000116 __u16 idn_segsize; /* Segment size for link */
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800117 __u8 idn_linkstate; /* Logical link state */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118};
119
120/*
121 * Ethernet address format (for DECnet)
122 */
123union etheraddress {
Joe Perchese2169752013-08-01 16:17:47 -0700124 __u8 dne_addr[ETH_ALEN]; /* Full ethernet address */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 struct {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800126 __u8 dne_hiord[4]; /* DECnet HIORD prefix */
127 __u8 dne_nodeaddr[2]; /* DECnet node address */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128 } dne_remote;
129};
130
131
132/*
133 * DECnet physical socket address format
134 */
135struct dn_addr {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800136 __le16 dna_family; /* AF_DECnet */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137 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 */