KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cfg_ms.h
1 /*
2  * ms_cfg.h
3  *
4  * Part of the SPIDR firmware.
5  *
6  * Copyright 2012 Nikhef.
7  * National Institute for Subatomic Physics
8  *
9  * Created on: 16 mei 2012
10  * Author: Vincent van Beveren
11  */
12 
13 #ifndef MS_CFG_H_
14 #define MS_CFG_H_
15 
16 // --------------------------------------------------------------------------------------
17 // General configuration
18 // --------------------------------------------------------------------------------------
19 
20 /*!
21  * The size of the provided RX buffer. Used to validate incoming packets.
22  */
23 #define MS_MAX_RX_LEN 1514
24 
25 /*!
26  * uncomment this to bypass any address filtering, i.e. receive
27  * everything you find on the adapter.
28  */
29 // #define MS_PROMISCUOUS
30 
31 // --------------------------------------------------------------------------------------
32 // ARP configuration
33 // --------------------------------------------------------------------------------------
34 /*!
35  * Number of entries in the ARP table. Must be at least be 2, but sensible configurations
36  * have at least 3.
37  */
38 #define MS_ARP_TABLE_SIZE 4
39 
40 /**
41  * Whether or not to track statistics.
42  */
43 #define MS_TRACK_STATISTICS
44 
45 // --------------------------------------------------------------------------------------
46 // BOOTP configuration
47 // --------------------------------------------------------------------------------------
48 /**
49  * Whether or not attempt to get an IP through bootp, when no IP address is assigned.
50  */
51 #define MS_USE_BOOTP
52 
53 #define MS_BOOTP_TIMEOUT 1000
54 
55 // --------------------------------------------------------------------------------------
56 // IP configuration
57 // --------------------------------------------------------------------------------------
58 
59 /*!
60  * The IP version to use, either 4 or 6. It can't do both.
61  */
62 #define MS_IP_VER 4
63 
64 /*! Defines the Time To Live flag */
65 #define MS_TTL 128
66 
67 /*! Turn on ICMP processing, mostly for PING replies */
68 #define MS_USE_ICMP
69 
70 /*!
71  * When set, a stub function _ms_icmp_du() is invoked when
72  * a destination unreachable message is received. This can be used to disable sending of data to
73  * this location
74  */
75 #define MS_ICMP_DEST_UNREACHABLE
76 
77 /*!
78  * Whether or not you want to receive fragmented packets, and
79  * not prohibit fragmenting. Note that the reconstruction of
80  * packets is not handled by Mini Stack. Check the context
81  * flags for fragment information. You will need to reconstruct
82  * it yourself.
83  */
84 // #define MS_RECV_FRAGMENTS
85 
86 
87 /*!
88  * Whether or not to check the checksums of incoming packets
89  */
90 #define MS_CHECK_CHECKSUM
91 
92 
93 
94 // --------------------------------------------------------------------------------------
95 // UDP services configuration
96 // --------------------------------------------------------------------------------------
97 
98 /*! Whether or not UDP should be available */
99 #define MS_USE_UDP
100 
101 /*! Whether or not UDP should calculate a checksum. Its not required, but it is advised. */
102 #define MS_UDP_CALC_CHECKSUM
103 
104 /*! The maximum number of ports we can listen to. Though not strictly required by UDP
105  * semantics, it adds a filter before some heavier operations (like checksum) are done.
106  *
107  * The higher this number, the more bytes will be used (2 per port), and the longer the check may take.
108  */
109 #define MS_UDP_MAX_PORT_LST 4
110 
111 // --------------------------------------------------------------------------------------
112 // TCP services configuration
113 // --------------------------------------------------------------------------------------
114 
115 /*! Whether or not TCP should be available */
116 // TCP not supported yet
117 // #define MS_USE_TCP
118 
119 /*! The maximum number of ports we can listen to. Though not strictly required by UDP
120  * semantics, it adds a filter before some heavier operations (like checksum) are done.
121  *
122  * The higher this number, the more bytes will be used (2 per port), and the longer the check may take.
123  */
124 #define MS_TCP_MAX_PORT_LST 4
125 
126 /*! The maximum number of sessions that can be created.
127  *
128  * The higher the number the more simultaneous sessions can be maintained.
129  * The number of bytes used are MS_TCP_MAX_SESSIONS * <session entry size>.
130 
131  * The session entry size depends. For IP4 it is around 16 bytes, for IP6 it
132  * would be around 28.
133  *
134  * On a 32 bit processor, 10 entries would take 160 bytes, if it has 4 byte
135  * packing.
136  */
137 #define MS_TCP_MAX_SESSIONS 10
138 
139 #endif /* MS_CFG_H_ */