NetBurner 3.0
SSH/SshServerUserKey/nbfactory.h
1 /* Revision: 2.8.7 */
2 
3 /******************************************************************************
4 * Copyright 1998-2018 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact sales@Netburner.com for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 5405 Morehouse Dr.
23 * San Diego, CA 92121
24 * www.netburner.com
25 ******************************************************************************/
26 
27 #ifndef _NB_FACTORY_H_
28 #define _NB_FACTORY_H_
29 
30 /******************************************************************************
31  *
32  * Factory defaults for this factory application
33  *
34  *****************************************************************************/
35 
36 // Version VV.NN.vvvv ( 0xVVNNvvvv ), string must match constant
37 #define NB_FACTORY_DEFAULTS_VERSION (DWORD)( 0x01110000 )
38 #define NB_FACTORY_DEFAULTS_VERSION_STRING "01.00"
39 
40 
41 // Module Base Name
42 #ifdef SB70
43  #define NB_FACTORY_MODULE_BASE_NAME "SB70"
44 #elif defined SB70B
45  #define NB_FACTORY_MODULE_BASE_NAME "SB70B"
46 #elif defined SB70LC
47  #define NB_FACTORY_MODULE_BASE_NAME "SB70LC"
48 #elif defined SB70EX
49  #define NB_FACTORY_MODULE_BASE_NAME "SB70EX"
50 #elif defined MOD5270
51  #define NB_FACTORY_MODULE_BASE_NAME "MOD5270"
52 #elif defined MOD5234
53  #define NB_FACTORY_MODULE_BASE_NAME "MOD5234"
54 #elif defined MOD5282
55  #define NB_FACTORY_MODULE_BASE_NAME "MOD5282"
56 #elif defined CB34EX
57  #define NB_FACTORY_MODULE_BASE_NAME "CB34"
58 #elif defined MOD5272
59  #define NB_FACTORY_MODULE_BASE_NAME "MOD5272"
60 #elif defined SB72
61  #define NB_FACTORY_MODULE_BASE_NAME "SB72"
62 #elif defined SB72EX
63  #define NB_FACTORY_MODULE_BASE_NAME "SB72EX"
64 #elif defined SB700EX
65  #define NB_FACTORY_MODULE_BASE_NAME "SB700EX"
66 #elif defined MOD5441X
67  #define NB_FACTORY_MODULE_BASE_NAME "MOD5441X"
68 #else
69  #error Module not supported
70 #endif
71 
72 // Module Description
73 #define NB_FACTORY_BASE_DESC "SSH User Key Example"
74 
75 /* Feature Name and Description */
76 #define NB_FACTORY_FEATURE_NAME ""
77 #define NB_FACTORY_FEATURE_DESC "Upload SSH Key Example"
78 
79 #define NB_FACTORY_INCLUDE_SSH ( 1 )
80 #define SSH_KEY_SIZE_MAX_PEM ( ( 4 * 1024 ) - 1 )
81 
82 #define NB_FACTORY_INACTIVITY_TIMEOUT_SSH_DEFAULT ( 180 )
83 #define NB_FACTORY_NEW_CONNECTION_TIMEOUT_SSH_DEFAULT ( 360 )
84 
85 #define NB_FACTORY_SSH_PERMANENT_KEY_DESC_DEFAULT "NetBurner Library Default "
86 #define NB_FACTORY_SSH_INCLUDED_KEY_DESC_DEFAULT "Application Default "
87 #define NB_FACTORY_SSH_INSTALLED_KEY_DESC_DEFAULT "User Installed "
88 
89 #define NB_FACTORY_SSH_FILE_NAME_KEY_RSA "rsa.key"
90 #define NB_FACTORY_SSH_FILE_NAME_KEY_DSA "dsa.key"
91 
92 // DHCP timeout
93 #define NB_FACTORY_DHCP_TIMEOUT_IN_TICKS ( 10 * TICKS_PER_SECOND )
94 
95 /*
96  * Maximum size of certificate or key files in bytes
97  * Must the maximum of
98  * SERIAL_BURNER_CERTIFICATE_SIZE_MAX
99  * SERIAL_BURNER_RSA_KEY_SIZE_MAX
100  * SERIAL_BURNER_DSA_KEY_SIZE_MAX
101  */
102 #define NB_FACTORY_FILE_SIZE_MAXIMUM ( 4 * 1024 )
103 
104 /*
105  * On-chip file system EFFS-STD
106  * COMPCODEFLAGS end address must be set to file system start
107  * (FIRST_ADDR)
108  */
109 
110 /* Module unique flash parameters */
111 #ifdef SB70
112 
113  /* Flash */
114  #define NB_FACTORY_FLASH_500KB_1KB_SECTORS ( 1 )
115  /* Base address */
116  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
117  /* COMPCODEFLAGS = 0xFFC08000 0xFFC70000 */
118 
119 #elif defined SB70B
120 
121  /* Flash */
122  #define NB_FACTORY_FLASH_500KB_1KB_SECTORS ( 1 )
123  /* Base address */
124  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
125  /* COMPCODEFLAGS = 0xFFC08000 0xFFC70000 */
126 
127 #elif defined SB70LC
128 
129  /* Flash */
130  #define NB_FACTORY_FLASH_500KB_1KB_SECTORS ( 1 )
131  /* Base address */
132  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
133  /* COMPCODEFLAGS = 0xFFC08000 0xFFC70000 */
134 
135 #elif defined SB70EX
136  #error Module not supported
137 #elif defined MOD5270
138 
139  /* Flash */
140  #define NB_FACTORY_FLASH_500KB_1KB_SECTORS ( 1 )
141  /* Base address */
142  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
143  /* COMPCODEFLAGS = 0xFFC08000 0xFFC70000 */
144 
145 #elif defined MOD5234
146 
147  /* Flash */
148  #define NB_FACTORY_FLASH_2MB_16KB_SECTORS ( 1 )
149  /* Base address */
150  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
151  /* COMPCODEFLAGS = 0xFFC08000 0xFFD80000 */
152 
153 #elif defined MOD5282
154 
155  /* Flash */
156  #define NB_FACTORY_FLASH_500KB_1KB_SECTORS ( 1 )
157  /* Base address */
158  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
159  /* COMPCODEFLAGS = 0xFFC08000 0xFFC70000 */
160 
161 #elif defined CB34EX
162 
163  /* Flash */
164  #define NB_FACTORY_FLASH_2MB_16KB_SECTORS ( 1 )
165  /* Base address */
166  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
167  /* COMPCODEFLAGS = 0xFFC08000 0xFFD80000 */
168 
169 #elif defined MOD5272
170 
171  /* Flash */
172  #define NB_FACTORY_FLASH_2MB_16KB_SECTORS ( 1 )
173  /* Base address */
174  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
175  /* COMPCODEFLAGS = 0xFFC08000 0xFFD80000 */
176 
177 #elif defined SB72
178 
179  /* Flash */
180  #define NB_FACTORY_FLASH_500KB_1KB_SECTORS ( 1 )
181  /* Base address */
182  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
183  /* COMPCODEFLAGS = 0xFFC08000 0xFFC70000 */
184 
185 #elif defined SB72EX
186 
187  /* Flash */
188  #define NB_FACTORY_FLASH_2MB_16KB_SECTORS ( 1 )
189  /* Base address */
190  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
191  /* COMPCODEFLAGS = 0xFFC08000 0xFFD80000 */
192 
193 #elif defined SB700EX
194 
195  /* Flash */
196  #define NB_FACTORY_FLASH_2MB_16KB_SECTORS ( 1 )
197  /* Base address */
198  #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 )
199  /* COMPCODEFLAGS = 0xFFC08000 0xFFD80000 */
200 
201 #elif defined MOD5441X
202 
203  /* Flash */
204  #define NB_FACTORY_FLASH_32MB_128KB_SECTORS ( 1 )
205  /* Base address */
206  #define NB_FACTORY_FS_FLASHBASE ( 0xC0000000 )
207  // COMPCODEFLAGS = 0xC0040000 0xC1EC0000
208 
209 
210 
211 #else
212  #error Module not supported
213 #endif
214 
215 
216 #define debug_iprintf(...)\
217 { \
218  if ( bShowDebug == TRUE ) \
219  { \
220  iprintf( __VA_ARGS__ ); \
221  } \
222 }
223 
224 
225 #endif /* #ifdef _NB_FACTORY_H_ */
226