Import 2.3.6
[davej-history.git] / include / linux / dn.h
blob266dc0f2525c2c4ab4c8f44cdfb4daf096969849
1 #ifndef _LINUX_DN_H
2 #define _LINUX_DN_H
4 /*
6 DECnet Data Structures and Constants
8 */
10 /*
11 * DNPROTO_NSP can't be the same as SOL_SOCKET,
12 * so increment each by one (compared to ULTRIX)
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 */
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
31 /*
32 * SET/GET Socket options - must match the DSO_ numbers below
34 #define SO_CONDATA 1
35 #define SO_CONACCESS 2
36 #define SO_PROXYUSR 3
37 #define SO_LINKINFO 7
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_MAX 10 /* Maximum option number */
51 /* LINK States */
52 #define LL_INACTIVE 0
53 #define LL_CONNECTING 1
54 #define LL_RUNNING 2
55 #define LL_DISCONNECTING 3
57 #define ACC_IMMED 0
58 #define ACC_DEFER 1
60 #define SDF_WILD 1 /* Wild card object */
61 #define SDF_PROXY 2 /* Addr eligible for proxy */
62 #define SDF_UICPROXY 4 /* Use uic-based proxy */
64 /* Structures */
67 struct dn_naddr
69 unsigned short a_len;
70 unsigned char a_addr[DN_MAXADDL];
73 struct sockaddr_dn
75 unsigned short sdn_family;
76 unsigned char sdn_flags;
77 unsigned char sdn_objnum;
78 unsigned short sdn_objnamel;
79 unsigned char sdn_objname[DN_MAXOBJL];
80 struct dn_naddr sdn_add;
82 #define sdn_nodeaddrl sdn_add.a_len /* Node address length */
83 #define sdn_nodeaddr sdn_add.a_addr /* Node address */
88 * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure
90 struct optdata_dn {
91 unsigned short opt_status; /* Extended status return */
92 #define opt_sts opt_status
93 unsigned short opt_optl; /* Length of user data */
94 unsigned char opt_data[16]; /* User data */
97 struct accessdata_dn
99 unsigned char acc_accl;
100 unsigned char acc_acc[DN_MAXACCL];
101 unsigned char acc_passl;
102 unsigned char acc_pass[DN_MAXACCL];
103 unsigned char acc_userl;
104 unsigned char acc_user[DN_MAXACCL];
108 * DECnet logical link information structure
110 struct linkinfo_dn {
111 unsigned short idn_segsize; /* Segment size for link */
112 unsigned char idn_linkstate; /* Logical link state */
116 * Ethernet address format (for DECnet)
118 union etheraddress {
119 unsigned char dne_addr[6]; /* Full ethernet address */
120 struct {
121 unsigned char dne_hiord[4]; /* DECnet HIORD prefix */
122 unsigned char dne_nodeaddr[2]; /* DECnet node address */
123 } dne_remote;
128 * DECnet physical socket address format
130 struct dn_addr {
131 unsigned short dna_family; /* AF_DECnet */
132 union etheraddress dna_netaddr; /* DECnet ethernet address */
135 #define DECNET_IOCTL_BASE 0x89 /* PROTOPRIVATE range */
137 #define SIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, struct dn_naddr)
138 #define SIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, struct dn_naddr)
139 #define OSIOCSNETADDR _IOW(DECNET_IOCTL_BASE, 0xe0, int)
140 #define OSIOCGNETADDR _IOR(DECNET_IOCTL_BASE, 0xe1, int)
143 * An unofficial structure used to set/get routes.
144 * Be warned, this will probably change as the routing
145 * evolves. Also this is only for use with the ioctl()
146 * and the routing will use rtnetlink eventually.
148 struct dn_fib_rtinfo {
149 unsigned long flags; /* Flags */
150 #define DN_FIB_RTINFO_F_REPLACE 0x0001 /* Replace any existing route */
151 #define DN_FIB_RTINFO_F_DEVCOST 0x0002 /* Add cost of device */
152 unsigned long timeout; /* Time in seconds route should last */
153 unsigned short src; /* Source Address, 0 = any */
154 unsigned short dst; /* Destination Address */
155 unsigned short nhp; /* Next Hop Address */
156 unsigned short hops; /* Hops on path */
157 unsigned short cost; /* Cost of path */
158 char device[16];
161 #endif /* _LINUX_DN_H */