blob: 9c50445462d99dc755af6e442c217784ba940f83 [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>
5
Linus Torvalds1da177e2005-04-16 15:20:36 -07006/*
7
8 DECnet Data Structures and Constants
9
10*/
11
12/*
13 * DNPROTO_NSP can't be the same as SOL_SOCKET,
14 * so increment each by one (compared to ULTRIX)
15 */
16#define DNPROTO_NSP 2 /* NSP protocol number */
17#define DNPROTO_ROU 3 /* Routing protocol number */
18#define DNPROTO_NML 4 /* Net mgt protocol number */
19#define DNPROTO_EVL 5 /* Evl protocol number (usr) */
20#define DNPROTO_EVR 6 /* Evl protocol number (evl) */
21#define DNPROTO_NSPT 7 /* NSP trace protocol number */
22
23
24#define DN_ADDL 2
25#define DN_MAXADDL 2 /* ULTRIX headers have 20 here, but pathworks has 2 */
26#define DN_MAXOPTL 16
27#define DN_MAXOBJL 16
28#define DN_MAXACCL 40
29#define DN_MAXALIASL 128
30#define DN_MAXNODEL 256
31#define DNBUFSIZE 65023
32
33/*
34 * SET/GET Socket options - must match the DSO_ numbers below
35 */
36#define SO_CONDATA 1
37#define SO_CONACCESS 2
38#define SO_PROXYUSR 3
39#define SO_LINKINFO 7
40
41#define DSO_CONDATA 1 /* Set/Get connect data */
42#define DSO_DISDATA 10 /* Set/Get disconnect data */
43#define DSO_CONACCESS 2 /* Set/Get connect access data */
44#define DSO_ACCEPTMODE 4 /* Set/Get accept mode */
45#define DSO_CONACCEPT 5 /* Accept deferred connection */
46#define DSO_CONREJECT 6 /* Reject deferred connection */
47#define DSO_LINKINFO 7 /* Set/Get link information */
48#define DSO_STREAM 8 /* Set socket type to stream */
49#define DSO_SEQPACKET 9 /* Set socket type to sequenced packet */
50#define DSO_MAXWINDOW 11 /* Maximum window size allowed */
51#define DSO_NODELAY 12 /* Turn off nagle */
52#define DSO_CORK 13 /* Wait for more data! */
53#define DSO_SERVICES 14 /* NSP Services field */
54#define DSO_INFO 15 /* NSP Info field */
55#define DSO_MAX 15 /* Maximum option number */
56
57
58/* LINK States */
59#define LL_INACTIVE 0
60#define LL_CONNECTING 1
61#define LL_RUNNING 2
62#define LL_DISCONNECTING 3
63
64#define ACC_IMMED 0
65#define ACC_DEFER 1
66
67#define SDF_WILD 1 /* Wild card object */
68#define SDF_PROXY 2 /* Addr eligible for proxy */
69#define SDF_UICPROXY 4 /* Use uic-based proxy */
70
71/* Structures */
72
73
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080074struct dn_naddr {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080075 __le16 a_len;
76 __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
Linus Torvalds1da177e2005-04-16 15:20:36 -070077};
78
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080079struct sockaddr_dn {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080080 __u16 sdn_family;
81 __u8 sdn_flags;
82 __u8 sdn_objnum;
83 __le16 sdn_objnamel;
84 __u8 sdn_objname[DN_MAXOBJL];
Linus Torvalds1da177e2005-04-16 15:20:36 -070085 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 */
95struct optdata_dn {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080096 __le16 opt_status; /* Extended status return */
Linus Torvalds1da177e2005-04-16 15:20:36 -070097#define opt_sts opt_status
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080098 __le16 opt_optl; /* Length of user data */
99 __u8 opt_data[16]; /* User data */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100};
101
Eric Dumazetd94d9fe2009-11-04 09:50:58 -0800102struct accessdata_dn {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800103 __u8 acc_accl;
104 __u8 acc_acc[DN_MAXACCL];
105 __u8 acc_passl;
106 __u8 acc_pass[DN_MAXACCL];
107 __u8 acc_userl;
108 __u8 acc_user[DN_MAXACCL];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109};
110
111/*
112 * DECnet logical link information structure
113 */
114struct linkinfo_dn {
Al Virod88e6612007-02-09 18:13:42 +0000115 __u16 idn_segsize; /* Segment size for link */
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800116 __u8 idn_linkstate; /* Logical link state */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117};
118
119/*
120 * Ethernet address format (for DECnet)
121 */
122union etheraddress {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800123 __u8 dne_addr[6]; /* Full ethernet address */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124 struct {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800125 __u8 dne_hiord[4]; /* DECnet HIORD prefix */
126 __u8 dne_nodeaddr[2]; /* DECnet node address */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127 } dne_remote;
128};
129
130
131/*
132 * DECnet physical socket address format
133 */
134struct dn_addr {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800135 __le16 dna_family; /* AF_DECnet */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136 union etheraddress dna_netaddr; /* DECnet ethernet address */
137};
138
139#define DECNET_IOCTL_BASE 0x89 /* PROTOPRIVATE range */
140
141#define SIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, struct dn_naddr)
142#define SIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, struct dn_naddr)
143#define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int)
144#define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int)
145
146#endif /* _LINUX_DN_H */