blob: 4295c745f342a8a5096ae851d4fad8c95823975e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_DN_H
2#define _LINUX_DN_H
3
Mike Frysingerc3189242014-01-23 15:54:10 -08004#include <linux/ioctl.h>
Jaswinder Singh Rajput57d17802009-01-30 20:52:54 +05305#include <linux/types.h>
Joe Perchese2169752013-08-01 16:17:47 -07006#include <linux/if_ether.h>
Jaswinder Singh Rajput57d17802009-01-30 20:52:54 +05307
Linus Torvalds1da177e2005-04-16 15:20:36 -07008/*
9
10 DECnet Data Structures and Constants
11
12*/
13
14/*
15 * DNPROTO_NSP can't be the same as SOL_SOCKET,
16 * so increment each by one (compared to ULTRIX)
17 */
18#define DNPROTO_NSP 2 /* NSP protocol number */
19#define DNPROTO_ROU 3 /* Routing protocol number */
20#define DNPROTO_NML 4 /* Net mgt protocol number */
21#define DNPROTO_EVL 5 /* Evl protocol number (usr) */
22#define DNPROTO_EVR 6 /* Evl protocol number (evl) */
23#define DNPROTO_NSPT 7 /* NSP trace protocol number */
24
25
26#define DN_ADDL 2
27#define DN_MAXADDL 2 /* ULTRIX headers have 20 here, but pathworks has 2 */
28#define DN_MAXOPTL 16
29#define DN_MAXOBJL 16
30#define DN_MAXACCL 40
31#define DN_MAXALIASL 128
32#define DN_MAXNODEL 256
33#define DNBUFSIZE 65023
34
35/*
36 * SET/GET Socket options - must match the DSO_ numbers below
37 */
38#define SO_CONDATA 1
39#define SO_CONACCESS 2
40#define SO_PROXYUSR 3
41#define SO_LINKINFO 7
42
43#define DSO_CONDATA 1 /* Set/Get connect data */
44#define DSO_DISDATA 10 /* Set/Get disconnect data */
45#define DSO_CONACCESS 2 /* Set/Get connect access data */
46#define DSO_ACCEPTMODE 4 /* Set/Get accept mode */
47#define DSO_CONACCEPT 5 /* Accept deferred connection */
48#define DSO_CONREJECT 6 /* Reject deferred connection */
49#define DSO_LINKINFO 7 /* Set/Get link information */
50#define DSO_STREAM 8 /* Set socket type to stream */
51#define DSO_SEQPACKET 9 /* Set socket type to sequenced packet */
52#define DSO_MAXWINDOW 11 /* Maximum window size allowed */
53#define DSO_NODELAY 12 /* Turn off nagle */
54#define DSO_CORK 13 /* Wait for more data! */
55#define DSO_SERVICES 14 /* NSP Services field */
56#define DSO_INFO 15 /* NSP Info field */
57#define DSO_MAX 15 /* Maximum option number */
58
59
60/* LINK States */
61#define LL_INACTIVE 0
62#define LL_CONNECTING 1
63#define LL_RUNNING 2
64#define LL_DISCONNECTING 3
65
66#define ACC_IMMED 0
67#define ACC_DEFER 1
68
69#define SDF_WILD 1 /* Wild card object */
70#define SDF_PROXY 2 /* Addr eligible for proxy */
71#define SDF_UICPROXY 4 /* Use uic-based proxy */
72
73/* Structures */
74
75
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080076struct dn_naddr {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080077 __le16 a_len;
78 __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */
Linus Torvalds1da177e2005-04-16 15:20:36 -070079};
80
Eric Dumazetd94d9fe2009-11-04 09:50:58 -080081struct sockaddr_dn {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080082 __u16 sdn_family;
83 __u8 sdn_flags;
84 __u8 sdn_objnum;
85 __le16 sdn_objnamel;
86 __u8 sdn_objname[DN_MAXOBJL];
Linus Torvalds1da177e2005-04-16 15:20:36 -070087 struct dn_naddr sdn_add;
88};
89#define sdn_nodeaddrl sdn_add.a_len /* Node address length */
90#define sdn_nodeaddr sdn_add.a_addr /* Node address */
91
92
93
94/*
95 * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
96 */
97struct optdata_dn {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -080098 __le16 opt_status; /* Extended status return */
Linus Torvalds1da177e2005-04-16 15:20:36 -070099#define opt_sts opt_status
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800100 __le16 opt_optl; /* Length of user data */
101 __u8 opt_data[16]; /* User data */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102};
103
Eric Dumazetd94d9fe2009-11-04 09:50:58 -0800104struct accessdata_dn {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800105 __u8 acc_accl;
106 __u8 acc_acc[DN_MAXACCL];
107 __u8 acc_passl;
108 __u8 acc_pass[DN_MAXACCL];
109 __u8 acc_userl;
110 __u8 acc_user[DN_MAXACCL];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111};
112
113/*
114 * DECnet logical link information structure
115 */
116struct linkinfo_dn {
Al Virod88e6612007-02-09 18:13:42 +0000117 __u16 idn_segsize; /* Segment size for link */
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800118 __u8 idn_linkstate; /* Logical link state */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119};
120
121/*
122 * Ethernet address format (for DECnet)
123 */
124union etheraddress {
Joe Perchese2169752013-08-01 16:17:47 -0700125 __u8 dne_addr[ETH_ALEN]; /* Full ethernet address */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126 struct {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800127 __u8 dne_hiord[4]; /* DECnet HIORD prefix */
128 __u8 dne_nodeaddr[2]; /* DECnet node address */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 } dne_remote;
130};
131
132
133/*
134 * DECnet physical socket address format
135 */
136struct dn_addr {
Steven Whitehousec4ea94a2006-03-20 22:42:39 -0800137 __le16 dna_family; /* AF_DECnet */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138 union etheraddress dna_netaddr; /* DECnet ethernet address */
139};
140
141#define DECNET_IOCTL_BASE 0x89 /* PROTOPRIVATE range */
142
143#define SIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, struct dn_naddr)
144#define SIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, struct dn_naddr)
145#define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int)
146#define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int)
147
148#endif /* _LINUX_DN_H */