NetBurner 3.1
SSH/SshServerUserKey/src/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 #if defined MOD5441X
43 #define NB_FACTORY_MODULE_BASE_NAME "MOD5441X"
44 #elif defined NANO54415
45 #define NB_FACTORY_MODULE_BASE_NAME "NANO54415"
46 #elif defined SB800EX
47 #define NB_FACTORY_MODULE_BASE_NAME "SB800EX"
48 #elif defined MODM7AE70
49 #define NB_FACTORY_MODULE_BASE_NAME "MODM7AE70"
50 #else
51 #error Module not supported
52 #endif
53 // Module Description
54 #define NB_FACTORY_BASE_DESC "SSH User Key Example"
55 
56 /* Feature Name and Description */
57 #define NB_FACTORY_FEATURE_NAME ""
58 #define NB_FACTORY_FEATURE_DESC "Upload SSH Key Example"
59 
60 #define NB_FACTORY_INCLUDE_SSH ( 1 )
61 #define SSH_KEY_SIZE_MAX_PEM ( ( 4 * 1024 ) - 1 )
62 
63 #define NB_FACTORY_INACTIVITY_TIMEOUT_SSH_DEFAULT ( 180 )
64 #define NB_FACTORY_NEW_CONNECTION_TIMEOUT_SSH_DEFAULT ( 360 )
65 
66 #define NB_FACTORY_SSH_PERMANENT_KEY_DESC_DEFAULT "NetBurner Library Default "
67 #define NB_FACTORY_SSH_INCLUDED_KEY_DESC_DEFAULT "Application Default "
68 #define NB_FACTORY_SSH_INSTALLED_KEY_DESC_DEFAULT "User Installed "
69 
70 #define NB_FACTORY_SSH_FILE_NAME_KEY_RSA "rsa.key"
71 #define NB_FACTORY_SSH_FILE_NAME_KEY_DSA "dsa.key"
72 
73 // DHCP timeout
74 #define NB_FACTORY_DHCP_TIMEOUT_IN_TICKS ( 10 * TICKS_PER_SECOND )
75 
76 /*
77  * Maximum size of certificate or key files in bytes
78  * Must the maximum of
79  * SERIAL_BURNER_CERTIFICATE_SIZE_MAX
80  * SERIAL_BURNER_RSA_KEY_SIZE_MAX
81  * SERIAL_BURNER_DSA_KEY_SIZE_MAX
82  */
83 #define NB_FACTORY_FILE_SIZE_MAXIMUM ( 4 * 1024 )
84 
85 /*
86  * On-chip file system EFFS-STD
87  * COMPCODEFLAGS end address must be set to file system start
88  * (FIRST_ADDR)
89  */
90 
91 /* Module unique flash parameters */
92 #if defined MOD5441X
93 /* Flash */
94 #define NB_FACTORY_FLASH_32MB_128KB_SECTORS (1)
95 /* Base address */
96 #define NB_FACTORY_FS_FLASHBASE (0xC0000000)
97 /* COMPCODEFLAGS = 0xC0040000 0xC1EC0000 */
98 
99 #elif defined NANO54415
100 /* Flash */
101 #define NB_FACTORY_FLASH_SPI_8MB_4KB_SECTORS (1)
102 /* Base address */
103 //#define NB_FACTORY_FS_FLASHBASE ( 0x040000 ) // not used for spi flash
104 /* COMPCODEFLAGS = 0x7F0000 0x040000 */
105 
106 #elif defined SB800EX
107  /* Flash */
108  #define NB_FACTORY_FLASH_SPI_8MB_4KB_SECTORS ( 1 )
109  /* Base address */
110  // #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 ) // not used for spi flash
111 /* COMPCODEFLAGS = 0x00004000 0x007F0000 */
112 
113 #elif defined MODM7AE70
114 /* Flash */
115 #define NB_FACTORY_FLASH_2MB_8KB_SECTORS (1)
116 /* Base address */
117 #define NB_FACTORY_FS_FLASHBASE (0x00400000)
118 /* COMPCODEFLAGS = 0x00406004 0x005A0000 */
119 
120 #else
121 #error Module not supported
122 #endif
123 
124 
125 #define debug_iprintf(...)\
126 { \
127  if ( bShowDebug == TRUE ) \
128  { \
129  iprintf( __VA_ARGS__ ); \
130  } \
131 }
132 
133 
134 #endif /* #ifdef _NB_FACTORY_H_ */
135