-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathipal_cfg.h
399 lines (278 loc) · 10.3 KB
/
ipal_cfg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
/*
* Copyright (C) 2011 Department of Robotics Brain and Cognitive Sciences - Istituto Italiano di Tecnologia
* Author: Marco Accame
* email: [email protected]
* website: www.robotcub.org
* Permission is granted to copy, distribute, and/or modify this program
* under the terms of the GNU General Public License, version 2 or any
* later version published by the Free Software Foundation.
*
* A copy of the license can be found at
* http://www.robotcub.org/icub/license/gpl.txt
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details
*/
// - include guard ----------------------------------------------------------------------------------------------------
#ifndef _IPAL_CFG_H_
#define _IPAL_CFG_H_
// --------------------------------------------------------------------------------------------------------------------
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <h> Configuration of IPAL
// <i> It holds configuration for objects used in IPAl
// <h> Porting specifics
// <i> sssssssss
// <o> Used TCP/IP stack <0=> IIT modified TCPNET
// <i> Only IIT modified TCPNET is now supported.
#ifndef IPAL_TCPIPTYPE
#define IPAL_TCPIPTYPE 0
#endif
// <o> Memory model <0=> static
// <i> Only static model is now supported.
#ifndef IPAL_MEMMODEL
#define IPAL_MEMMODEL 0
#endif
// </h>Porting
// <h> System
// <i> sssssssss
// <o> Time tick for internal counters <10000=> 10 ms <20000=> 20 ms <25000=> 25 ms
// <50000=> 50 ms <100000=> 100 ms <200000=> 200 ms <250000=> 250 ms <500000=> 500 ms
// <i> The IPAL must be ticked every time interval in here defined
#ifndef IPAL_TIMETICK
#define IPAL_TIMETICK 200000
#endif
// <o> Memory Pool size [Bytes] <1500-32000:4>
// <i> It keeps buffers for IP transmission.
#ifndef IPAL_MEMPOOLSIZE
#define IPAL_MEMPOOLSIZE 6144
#endif
// </h>System
// <h> Network interface
// <i> Defines network interface
// <e> Ethernet
// <i> Use Ethernet as network interface
#ifndef IPAL_ETH_ENABLE
#define IPAL_ETH_ENABLE 1
#endif
// <o> ETH ISR priority <0-15>
// <i> The IPAL needs an ETH ISR teh priority of which can be specified (lower number, higher priority)
#ifndef IPAL_ETH_ISRPRIO
#define IPAL_ETH_ISRPRIO 1
#endif
// <h> MAC address
// <o> MAC OUI <0x00000000-0x00FFFFFF>
// <i> IEEE-assigned part of the MAC (first three octets).
// <i> Default: 0x010103
#ifndef IPAL_MACOUI
#define IPAL_MACOUI 1978476
#endif
// <o> MAC final 3 octets <0x00000000-0x00FFFFFF>
// <i> Free-assigned part of the MAC (last three octets).
// <i> Default: 0x010103
#ifndef IPAL_MAC3OCT
#define IPAL_MAC3OCT 10634593
#endif
// </h>MAC address
// <h> Address Resolution Protocol
// <i> Address Resolution Protocol
// <o> Cache table size <4-100>
// <i> Number of cached hardware/IP addresses
// <i> Default: 10
#define IPAL_ARP_CACHESIZE 16
// <o> Cache Timeout [sec] <5-255><#*1000000>
// <i> A timeout for a cached hardware/IP addresses
// <i> Default: 150
#define IPAL_ARP_CACHETIMEOUT 255000000
// <o> Number of retries <0-20>
// <i> Number of retries to resolve an IP address
// <i> before ARP module gives up
// <i> Default: 4
#define IPAL_ARP_RETRYMAXNUM 0
// <o> Retry Timeout [sec] <1-10><#*1000000>
// <i> A timeout to resend the ARP Request
// <i> Default: 1
#define IPAL_ARP_RETRYTIMEOUT 0
// <q> Autonotify enabled
// <i> When this option is enabled, the embedded host
// <i> will send a gratuitous ARP notification at startup,
// <i> or when the device IP address has changed.
// <i> Default: Enabled
#define IPAL_ARP_AUTONOTIFY 0
// </h>Address Resolution Protocol
// </e>Ethernet
// </h>Network interface
// <h> IP Network
// <h> Fixed IP address
// <i> Used if DHCP is disabled.
// <i> Default: 10.255.39.151
// <o> IP0 <0-255>
#ifndef IPAL_IP0
#define IPAL_IP0 10
#endif
// <o> IP1 <0-255>
#ifndef IPAL_IP1
#define IPAL_IP1 255
#endif
// <o> IP2 <0-255>
#ifndef IPAL_IP2
#define IPAL_IP2 72
#endif
// <o> IP3 <0-255>
#ifndef IPAL_IP3
#define IPAL_IP3 19
#endif
// </h>Fixed IP address
// <h> Subnet mask
// <i> Default: 255.255.252.0
// <o> MSK0 <0-255>
#ifndef IPAL_MSK0
#define IPAL_MSK0 255
#endif
// <o> MSK1 <0-255>
#ifndef IPAL_MSK1
#define IPAL_MSK1 255
#endif
// <o> MSK2 <0-255>
#ifndef IPAL_MSK2
#define IPAL_MSK2 255
#endif
// <o> MSK3 <0-255>
#ifndef IPAL_MSK3
#define IPAL_MSK3 0
#endif
// </h>Subnet mask
// </h>IP Network
// <h> IP Protocols
// <e> DHCP client
// <i> If enabled, the IP address is achieved using DHCP. It needs one dedicated UDP socket
#define IPAL_DHCP_ENABLE 0
// </e>DHCP
// <e> UDP
// <i> If enabled, you can use UDP sockets and services whcih rely on them (DHCP client, NBNS, IGMP?, DNS client?)
#define IPAL_UDP_ENABLE 1
// <o> Number of UDP sockets <1-20>
// <i> Number of available UDP sockets (DHCP uses one)
// <i> Default: 3
#define IPAL_UDP_SOCKETNUM 5
// </e>UDP
// <e> IGMP
// <i> The Internet Group Management Protocol (IGMP) is a communications protocol used
// <i> to manage the membership of Internet Protocol multicast groups.
#define IPAL_IGMP_ENABLE 1
// <o> Max number of IGMP groups <2-10>
// <i> Number of groups this host can join
// <i> Default: 3
#define IPAL_IGMP_GROUPSNUM 4
// </e>IGMP
// <e> TCP
// <i> If enabled, you can use TCP sockets and services based on them (Telnet, FTP)
#define IPAL_TCP_ENABLE 0
// <o> Number of TCP sockets <1-20>
// <i> Number of available TCP sockets (Telnet uses one per session, FTP uses two per session)
// <i> Default: 5
#define IPAL_TCP_SOCKETNUM 3
// <o> Number of retries <0-20>
// <i> How many times TCP module will try to retransmit data
// <i> before giving up. Increase this value for high-latency
// <i> and low_throughput networks.
// <i> Default: 5
#define IPAL_TCP_RETRYMAXNUM 5
// <o> Retry timeout [sec] <1-10><#*1000000>
// <i> If data frame not acknowledged within this time frame,
// <i> TCP module will try to resend data again
// <i> Default: 4
#define IPAL_TCP_RETRYTOUT 2000000
// <o> Default connection timeout [sec] <1-1800><#*1000000>
// <i> Default TCP Socket Keep Alive timeout. When it expires
// <i> with no TCP data frame send, TCP Connection is closed.
// <i> Default: 120
#define IPAL_TCP_CONNECTIONTIMEOUT 1800000000
// </e>TCP
// <e> TFTP server
// <i> Enable or disable TFTP Server (single session only)
#define IPAL_TFTP_ENABLE 0
// <o> Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 69
#define IPAL_TFTP_PORT 69
// <o> Number of Retries <1-10>
// <i> How many times TFTP Server will try to retransmit data
// <i> before giving up.
// <i> Default: 4
#define IPAL_TFTP_RETRYMAXNUM 4
// <o> Inactive session timeout [sec] <5-120><#*1000000>
// <i> When timeout expires TFTP Session is closed. This timeout
// <i> is used when the UDP connection is broken because of error.
// <i> Default: 15
#define IPAL_TFTP_TIMEOUT 15000000
// </e>TFTP server
// <e> FTP server
// <i> Enable or disable FTP Server (single session only: each connection uses 2 TCP sockets)
#define IPAL_FTP_ENABLE 0
// <o> Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 21
#define IPAL_FTP_PORT 21
// <e> Enable user authentication
// <i> When enabled, the user will have to authenticate
// <i> himself by username and password before access
// <i> to the system is allowed.
#define IPAL_FTP_AUTHENABLE 1
// <s.15> Authentication username
// <i> Default: "admin"
#define IPAL_FTP_USER "admin"
// <s.15>Authentication Password
// <i> Default: "admin"
#define IPAL_FTP_PASS "admin"
// </e>Enable user authentication
// </e>FTP server
// <e> Telnet server
// <i> Enable or disable Telnet Server
#define IPAL_TEL_ENABLE 0
// <o> Number of Telnet Connections <1-2>
// <i> Number of simultaneously active Telnet Connections.
// <i> Modify also the number of TCP Sockets because
// <i> each Telnet connection uses it's own TCP socket
// <i> Default: 1
#define IPAL_TEL_CONNSNUM 1
// <o> Port Number <1-65535>
// <i> Listening port number.
// <i> Default: 23
#define IPAL_TEL_PORT 23
// <e> Enable user authentication
// <i> When enabled, the user will have to authenticate
// <i> himself by username and password before access
// <i> to the system is allowed.
#define IPAL_TEL_AUTHENABLE 1
// <s.15>Authentication Username
// <i> Default: "admin"
#define IPAL_TEL_USER "admin"
// <s.15> Authentication Password
// <i> Default: "admin"
#define IPAL_TEL_PASS "admin"
// </e>Enable user authentication
// </e>Telnet server
// </h>IP Protocols
// </h>
// --------------------------------------------------------------------------------------------------------------------
//------------- <<< end of configuration section >>> ------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// - some controls ----------------------------------------------------------------------------------------------------
#if(0 != IPAL_TCPIPTYPE)
#error only tcpnet is supported so far
#endif
#if(0 == IPAL_ETH_ENABLE)
#error must have ethernet network interface enabled
#endif
#if(((IPAL_FTP_ENABLE*2)+IPAL_TEL_ENABLE) > IPAL_TCP_SOCKETNUM)
#error need 2 tcp sockets for ftp and 1 for telnet
#endif
#if(((IPAL_DHCP_ENABLE)+IPAL_TFTP_ENABLE) > IPAL_UDP_SOCKETNUM)
#error need 1 upd socket for tftp and 1 for dchp
#endif
// - end of controls --------------------------------------------------------------------------------------------------
#endif // include-guard
// - end-of-file (leave a blank line after)----------------------------------------------------------------------------