This source file includes following definitions.
- DN_SK
- dn_eth2dn
- dn_saddr2dn
- dn_dn2eth
- dn_sk_ports_copy
1
2 #ifndef _NET_DN_H
3 #define _NET_DN_H
4
5 #include <linux/dn.h>
6 #include <net/sock.h>
7 #include <net/flow.h>
8 #include <asm/byteorder.h>
9 #include <asm/unaligned.h>
10
11 struct dn_scp
12 {
13 unsigned char state;
14 #define DN_O 1
15 #define DN_CR 2
16 #define DN_DR 3
17 #define DN_DRC 4
18 #define DN_CC 5
19 #define DN_CI 6
20 #define DN_NR 7
21 #define DN_NC 8
22 #define DN_CD 9
23 #define DN_RJ 10
24 #define DN_RUN 11
25 #define DN_DI 12
26 #define DN_DIC 13
27 #define DN_DN 14
28 #define DN_CL 15
29 #define DN_CN 16
30
31 __le16 addrloc;
32 __le16 addrrem;
33 __u16 numdat;
34 __u16 numoth;
35 __u16 numoth_rcv;
36 __u16 numdat_rcv;
37 __u16 ackxmt_dat;
38 __u16 ackxmt_oth;
39 __u16 ackrcv_dat;
40 __u16 ackrcv_oth;
41 __u8 flowrem_sw;
42 __u8 flowloc_sw;
43 #define DN_SEND 2
44 #define DN_DONTSEND 1
45 #define DN_NOCHANGE 0
46 __u16 flowrem_dat;
47 __u16 flowrem_oth;
48 __u16 flowloc_dat;
49 __u16 flowloc_oth;
50 __u8 services_rem;
51 __u8 services_loc;
52 __u8 info_rem;
53 __u8 info_loc;
54
55 __u16 segsize_rem;
56 __u16 segsize_loc;
57
58 __u8 nonagle;
59 __u8 multi_ireq;
60 __u8 accept_mode;
61 unsigned long seg_total;
62
63 struct optdata_dn conndata_in;
64 struct optdata_dn conndata_out;
65 struct optdata_dn discdata_in;
66 struct optdata_dn discdata_out;
67 struct accessdata_dn accessdata;
68
69 struct sockaddr_dn addr;
70 struct sockaddr_dn peer;
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94 #define NSP_MIN_WINDOW 1
95 #define NSP_MAX_WINDOW (0x07fe)
96 unsigned long max_window;
97 unsigned long snd_window;
98 #define NSP_INITIAL_SRTT (HZ)
99 unsigned long nsp_srtt;
100 #define NSP_INITIAL_RTTVAR (HZ*3)
101 unsigned long nsp_rttvar;
102 #define NSP_MAXRXTSHIFT 12
103 unsigned long nsp_rxtshift;
104
105
106
107
108 struct sk_buff_head data_xmit_queue;
109 struct sk_buff_head other_xmit_queue;
110
111
112
113
114 struct sk_buff_head other_receive_queue;
115 int other_report;
116
117
118
119
120 unsigned long stamp;
121 unsigned long persist;
122 int (*persist_fxn)(struct sock *sk);
123 unsigned long keepalive;
124 void (*keepalive_fxn)(struct sock *sk);
125
126 };
127
128 static inline struct dn_scp *DN_SK(struct sock *sk)
129 {
130 return (struct dn_scp *)(sk + 1);
131 }
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151 #define DN_SKB_CB(skb) ((struct dn_skb_cb *)(skb)->cb)
152 struct dn_skb_cb {
153 __le16 dst;
154 __le16 src;
155 __u16 hops;
156 __le16 dst_port;
157 __le16 src_port;
158 __u8 services;
159 __u8 info;
160 __u8 rt_flags;
161 __u8 nsp_flags;
162 __u16 segsize;
163 __u16 segnum;
164 __u16 xmit_count;
165 unsigned long stamp;
166 int iif;
167 };
168
169 static inline __le16 dn_eth2dn(unsigned char *ethaddr)
170 {
171 return get_unaligned((__le16 *)(ethaddr + 4));
172 }
173
174 static inline __le16 dn_saddr2dn(struct sockaddr_dn *saddr)
175 {
176 return *(__le16 *)saddr->sdn_nodeaddr;
177 }
178
179 static inline void dn_dn2eth(unsigned char *ethaddr, __le16 addr)
180 {
181 __u16 a = le16_to_cpu(addr);
182 ethaddr[0] = 0xAA;
183 ethaddr[1] = 0x00;
184 ethaddr[2] = 0x04;
185 ethaddr[3] = 0x00;
186 ethaddr[4] = (__u8)(a & 0xff);
187 ethaddr[5] = (__u8)(a >> 8);
188 }
189
190 static inline void dn_sk_ports_copy(struct flowidn *fld, struct dn_scp *scp)
191 {
192 fld->fld_sport = scp->addrloc;
193 fld->fld_dport = scp->addrrem;
194 }
195
196 unsigned int dn_mss_from_pmtu(struct net_device *dev, int mtu);
197 void dn_register_sysctl(void);
198 void dn_unregister_sysctl(void);
199
200 #define DN_MENUVER_ACC 0x01
201 #define DN_MENUVER_USR 0x02
202 #define DN_MENUVER_PRX 0x04
203 #define DN_MENUVER_UIC 0x08
204
205 struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr);
206 struct sock *dn_find_by_skb(struct sk_buff *skb);
207 #define DN_ASCBUF_LEN 9
208 char *dn_addr2asc(__u16, char *);
209 int dn_destroy_timer(struct sock *sk);
210
211 int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf,
212 unsigned char type);
213 int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn *addr,
214 unsigned char *type);
215
216 void dn_start_slow_timer(struct sock *sk);
217 void dn_stop_slow_timer(struct sock *sk);
218
219 extern __le16 decnet_address;
220 extern int decnet_debug_level;
221 extern int decnet_time_wait;
222 extern int decnet_dn_count;
223 extern int decnet_di_count;
224 extern int decnet_dr_count;
225 extern int decnet_no_fc_max_cwnd;
226
227 extern long sysctl_decnet_mem[3];
228 extern int sysctl_decnet_wmem[3];
229 extern int sysctl_decnet_rmem[3];
230
231 #endif