1/***************************************************************************
2#***
3#***    Copyright 2005  Hon Hai Precision Ind. Co. Ltd.
4#***    All Rights Reserved.
5#***    No portions of this material shall be reproduced in any form without the
6#***    written permission of Hon Hai Precision Ind. Co. Ltd.
7#***
8#***    All information contained in this document is Hon Hai Precision Ind.
9#***    Co. Ltd. company private, proprietary, and trade secret property and
10#***    are protected by international intellectual property laws and treaties.
11#***
12#****************************************************************************/
13#ifndef _ACOSNVRAMCONFIG_H
14#define _ACOSNVRAMCONFIG_H
15
16#ifdef __cplusplus
17extern "C"
18{                               /* Assume C declarations for C++ */
19#endif                          /* __cplusplus */
20
21#include "acosTypes.h"
22
23/* definitions */
24#define ACOSNVRAM_MAX_TAG_LEN     32
25#define ACOSNVRAM_MAX_VAL_LEN     512
26#define ACOSNVRAM_MAX_FVAL_LEN    500   /* maximum length formatted string */
27/* acos configuration error number */
28#define ACOSNVRAM_SUCCESS         0
29#define ACOSNVRAM_FAIL            1
30#define ACOSNVRAM_TAGNOTFOUND     2
31#define ACOSNVRAM_RESOURCE        3
32#define ACOSNVRAM_TAGTOOLONG      4
33#define ACOSNVRAM_VALTOOLONG      5
34
35/* ambit added start, bright wang, 03/08/2004 */
36#define ENCRYPT_START_TAG           "<en>"
37#define ENCRYPT_END_TAG             "</en>"
38#define DECRYPT_START_TAG           "<de>"
39#define DECRYPT_END_TAG             "</de>"
40/* ambit added end, bright wang, 03/08/2004 */
41
42/* foxconn modified start, tm wol workaround, jonathan 2012/07/31 */
43/* NVRAM Parameters */
44#define ACOSNVRAM_TAG_VERSION           "system_nvram_version"
45#define ACOSNVRAM_TAG_WAN_IFS           "system_wan_ifs"
46#define ACOSNVRAM_TAG_LAN_IFS           "system_lan_ifs"
47#define ACOSNVRAM_TAG_BRIDGE_IFS        "system_bridge_ifs"
48#define ACOSNVRAM_TAG_NAT_IFS           "system_nat_ifs"
49/* Ambit added start, Jacky Yu 2003/12/22 */
50#define ACOSNVRAM_TAG_NAT_INBOUNDNUM    "system_nat_inboundnum"
51/* Ambit added end, Jacky Yu 2003/12/22 */
52/* Ambit added start, Jacky Yu, 2004/02/26 */
53#define ACOSNVRAM_TAG_RTSPALG_TIMEOUT    "system_rtspalg_timeout"
54#define ACOSNVRAM_TAG_RTSPALG_SERVERPORT "system_rtspalg_serverport"
55/* Ambit added end, Jacky Yu, 2004/02/26 */
56#define ACOSNVRAM_TAG_DHCPC_IFS         "system_dhcpc_ifs"
57#define ACOSNVRAM_TAG_DHCPS_IFS         "system_dhcps_ifs"
58#define ACOSNVRAM_TAG_PPPOE_IFS         "system_pppoe_ifs"
59
60#define ACOSNVRAM_TAG_LAN_IP_ADDR       "system_lan_ipaddr"     /* LAN IP address */
61#define ACOSNVRAM_TAG_LAN_NET_MASK      "system_lan_netmask"    /* LAN subnet mask */
62    /*#define ACOSNVRAM_TAG_LAN_MAC_ADDR      "system_lan_hwaddr" *//* LAN MAC address */
63
64#define ACOSNVRAM_TAG_WAN_PROTO         "system_wan_ipconfig"   /* WAN protocol, "dhcp", "static" or "pppoe" */
65#define ACOSNVRAM_TAG_WAN_IP_ADDR       "system_wan_ipaddr"     /* WAN IP address */
66#define ACOSNVRAM_TAG_WAN_NET_MASK      "system_wan_netmask"    /* WAN subnet mask */
67    /*#define ACOSNVRAM_TAG_WAN_MAC_ADDR      "system_wan_hwaddr" *//* WAN MAC address */
68#define ACOSNVRAM_TAG_WAN_GATEWAY       "system_wan_gateway"    /* WAN default gateway */
69#define ACOSNVRAM_TAG_WAN_DNS           "system_wan_dns"        /* WAN DNS */
70#define ACOSNVRAM_TAG_WAN_WINS          "system_wan_wins"       /* WAN WINS */
71#define ACOSNVRAM_TAG_WAN_HOSTNAME      "system_hostname"       /* WAN hostname */
72#define ACOSNVRAM_TAG_WAN_DOMAIN        "system_wan_domain"     /* WAN Domain name */
73#define ACOSNVRAM_TAG_FIREWALL          "system_firewall"       /* Firewall enable or disable */
74/* Ambit added start, grace kuo, 08/06/2003*/
75#define ACOSNVRAM_TAG_CA_NAME           "system_ca_name"        /* Call agent name */
76#define ACOSNVRAM_TAG_CA_IP_ADDR        "system_ca_ipaddr"      /* Call agent IP address */
77/* Ambit added end, grace kuo, 08/06/2003*/
78#define ACOSNVRAM_TAG_TFTP_SERVER       "system_tftp_server"    /* tftp server ip address */
79
80#define ACOSNVRAM_TAG_COUNTRYCODE       "system_countrycode"    /* country code for wireless device */
81
82//Ambit added start, nathan, 2004
83#define ACOSNVRAM_TAG_NAPT_MODE         "system_napt_mode"      /* NAPT modes */
84#define ACOSNVRAM_TAG_SRV_MODE          "system_srv_mode"       /* Service modes */
85//Ambit added end, nathan, 2004
86
87#define ACOSNVRAM_TAG_DHCPS_STATUS      "dhcps_status"  /* Enable / Disable DHPCS, "dhcp" or "static" */
88#define ACOSNVRAM_TAG_DHCPS_STARTIP     "dhcps_startip" /* First IP Address in pool */
89#define ACOSNVRAM_TAG_DHCPS_ENDIP       "dhcps_endip"   /* Last IP Address in pool */
90#define ACOSNVRAM_TAG_DHCPS_MODE        "dhcps_mode"    /* "auto" or "manual" */
91#define ACOSNVRAM_TAG_DHCPS_DF_GW       "dhcps_df_gw"   /* Default gateway */
92#define ACOSNVRAM_TAG_DHCPS_DNS         "dhcps_dns"     /* DNS */
93#define ACOSNVRAM_TAG_DHCPS_WINS        "dhcps_wins"    /* WINS server */
94#define ACOSNVRAM_TAG_DHCPS_DOMAIN      "dhcps_domain"  /* Domain name */
95#define ACOSNVRAM_TAG_DHCPS_LEASE_TIME  "dhcps_lease_time"      /* Lease time */
96#define ACOSNVRAM_TAG_DHCPS_RESERVED_IP "dhcps_reserved_ip"     /* Reserved IP address */
97#define ACOSNVRAM_TAG_DHCPS_RESERVED_MAC "dhcps_reserved_mac"   /* MAC address to get the reserved IP */
98
99#define ACOSNVRAM_TAG_DHCPC_CLID        "dhcpc_clid"    /* DHCP client ID */
100#define ACOSNVRAM_TAG_DHCPC_OPT         "dhcpc_opts"    /* DHCP Options */
101
102#define ACOSNVRAM_TAG_PPPOE_VIRTUAL_IFS "pppoe_virtual_ifs"     /* PPPOE virtual interface name */
103#define ACOSNVRAM_TAG_PPPOE_USERNAME    "pppoe_username"        /* PPPOE username */
104#define ACOSNVRAM_TAG_PPPOE_PASSWD      "pppoe_passwd"  /* PPPOE password */
105#define ACOSNVRAM_TAG_PPPOE_MTU         "pppoe_mtu"     /* PPPOE MTU size */
106#define ACOSNVRAM_TAG_PPPOE_MRU         "pppoe_mru"     /* PPPOE MRU size */
107#define ACOSNVRAM_TAG_PPPOE_IDLETIME    "pppoe_idletime"        /* PPPOE idle time */
108#define ACOSNVRAM_TAG_PPPOE_KEEPALIVE   "pppoe_keepalive"       /* PPPOE keep alive function, "0" or "1" */
109#define ACOSNVRAM_TAG_PPPOE_AUTHTYPE    "pppoe_authtype"        /* PPP authentication type */
110#define ACOSNVRAM_TAG_PPPOE_SERVICENAME "pppoe_servicename"     /* PPPOE service name */
111#define ACOSNVRAM_TAG_PPPOE_ACNAME      "pppoe_acname"  /* PPPOE AC name */
112#define ACOSNVRAM_TAG_PPPOE_DOD         "pppoe_dod"     /* PPPOE dial on demand */
113#define ACOSNVRAM_TAG_PPPOE_SESSIONID   "pppoe_session_id"      /* PPPoE previous session ID */
114#define ACOSNVRAM_TAG_PPPOE_SERVER_MAC  "pppoe_server_mac"      /* PPPoE previous server Mac */
115
116#define ACOSNVRAM_TAG_NAT_ENABLE        "nat_enable"    /* Enable/disable NAT, 0=disable,1=enable */
117#define ACOSNVRAM_TAG_TCP_FORWARD       "nat_forward_tcp"       /* TCP port forwarding rules */
118#define ACOSNVRAM_TAG_UDP_FORWARD       "nat_forward_udp"       /* UDP port forwarding rules */
119#define ACOSNVRAM_TAG_DMZ_ADDR          "nat_dmz_ipaddr"        /* DMZ address */
120#define ACOSNVRAM_TAG_STATIC_ROUTE      "nat_static_route"      /* Static routing table */
121
122#define ACOSNVRAM_TAG_RIP_ENABLE        "rip_enable"    /* Enable / disable RIP */
123#define ACOSNVRAM_TAG_RIP_FILTER_ENABLE "rip_filter_enable"     /* Enable / disable RIP filter */
124#define ACOSNVRAM_TAG_RIP_MULTICAST     "rip_multicast" /* RIP multicast */
125#define ACOSNVRAM_TAG_RIP_VERSION       "rip_version"   /* RIP version */
126
127#define ACOSNVRAM_TAG_LAN_IP_FILTER     "filter_ip"     /* LAN IP filters */
128#define ACOSNVRAM_TAG_LAN_TCP_FILTER    "filter_tcp"    /* LAN TCP filters */
129#define ACOSNVRAM_TAG_LAN_UDP_FILTER    "filter_udp"    /* LAN UDP filters */
130#define ACOSNVRAM_TAG_LAN_MAC_FILTER    "filter_mac"    /* LAN MAC filters */
131
132    /*#define ACOSNVRAM_TAG_RESTORE_DEFAULT   "restore_defaults" *//* Set to "1" to restore factory defaults */
133
134#define ACOSNVRAM_TAG_SYSLOG_SERVER     "system_syslog_server"  /* Syslog server */
135#define ACOSNVRAM_TAG_NTP_SERVER        "system_ntp_server"     /* SNTP server */
136#define ACOSNVRAM_TAG_TIMEZONE          "system_time_zone"      /* Timezone */
137#define ACOSNVRAM_TAG_PERIOD            "sntp_period"   /* sntp get NTP server time period */
138#define ACOSNVRAM_TAG_FASTUDP_FLAG      "fastudp_flag"  /* fastudp flag */
139
140#define ACOSNVRAM_TAG_HTTP_NAME1         "httpd_username1"      /* WEB UI login name */
141#define ACOSNVRAM_TAG_HTTP_PASSWD1       "httpd_password1"      /* WEB UI password */
142#define ACOSNVRAM_TAG_HTTP_NAME2         "httpd_username2"      /* WEB UI login name */
143#define ACOSNVRAM_TAG_HTTP_PASSWD2       "httpd_password2"      /* WEB UI password */
144#define ACOSNVRAM_TAG_HTTP_NAME3         "httpd_username3"      /* WEB UI login name */
145#define ACOSNVRAM_TAG_HTTP_PASSWD3       "httpd_password3"      /* WEB UI password */
146#define ACOSNVRAM_TAG_HTTP_NAME4         "httpd_username4"      /* WEB UI login name */
147#define ACOSNVRAM_TAG_HTTP_PASSWD4       "httpd_password4"      /* WEB UI password */
148
149/* Ambit add start for-CLI user tags, Castro Huang, 2003/10/06 */
150#define ACOSNVRAM_TAG_CLI_SUPER          "cli_super_username"
151#define ACOSNVRAM_TAG_CLI_SUPER_PWD      "cli_super_passwd"
152#define ACOSNVRAM_TAG_CLI_SUPER_RMTPWD   "cli_super_rmtpwd"
153#define ACOSNVRAM_TAG_CLI_USR1           "cli_user_01"
154#define ACOSNVRAM_TAG_CLI_USR1_PWD       "cli_user_01_passwd"
155#define ACOSNVRAM_TAG_CLI_USR1_RMTPWD    "cli_user_01_rmtpwd"
156#define ACOSNVRAM_TAG_CLI_USR2           "cli_user_02"
157#define ACOSNVRAM_TAG_CLI_USR2_PWD       "cli_user_02_passwd"
158#define ACOSNVRAM_TAG_CLI_USR2_RMTPWD    "cli_user_02_rmtpwd"
159#define ACOSNVRAM_TAG_CLI_USR3           "cli_user_03"
160#define ACOSNVRAM_TAG_CLI_USR3_PWD       "cli_user_03_passwd"
161#define ACOSNVRAM_TAG_CLI_USR3_RMTPWD    "cli_user_03_rmtpwd"
162
163/* Ambit add start for- cli session timeout, Castro Huang, 2004/04/27 */
164#define ACOSNVRAM_TAG_CLI_SESS_TIMEOUT   "cli_sess_timeout"
165#define ACOSNVRAM_TAG_CLI_RMT_TIMEOUT    "cli_rmt_timeout"
166#define ACOSNVRAM_TAG_CLI_CONSOLE_LOCK   "cli_console_lock"
167/* Ambit add end for- cli session timeout, Castro Huang, 2004/04/27 */
168
169    /* #define ACOSNVRAM_TAG_USER_NAME          "cli_user_username" *//* CLI user-level username */
170    /* #define ACOSNVRAM_TAG_USER_PASSWD        "cli_user_passwd"      *//* CLI user-level password */
171    /* #define ACOSNVRAM_TAG_SUPER_NAME         "cli_super_username"   *//* CLI supervisor-level username */
172    /* #define ACOSNVRAM_TAG_SUPER_PASSWD       "cli_super_passwd"     *//* CLI supervisor-level password */
173
174#define ACOSNVRAM_TAG_SSH_TYPE           "SSH_TYPE"     /* SSH_THROUGH_TELNET */
175#define ACOSNVRAM_TAG_SSH_LISTEN_PORT    "SSH_LISTEN_PORT"
176#define ACOSNVRAM_TAG_SSH_HOST_KEY       "SSH_HOST_KEY"
177/* Ambit add end for-CLI user tags, Castro Huang, 2003/10/06 */
178
179
180/* Ambit add start, Peter Chen, 12/26/2003 */
181/* Reason: Save static routes to nvram */
182#define ACOSNVRAM_TAG_ROUTE_NUM       	 "route_num"    /* total static route number */
183#define ACOSNVRAM_TAG_ROUTE_TAG_NUM      "route_tag_num"        /* total tag number in use   */
184#define ACOSNVRAM_TAG_ROUTE_ENTRY0       "route_entry0" /* static route index  0     */
185#define ACOSNVRAM_TAG_ROUTE_ENTRY1       "route_entry1" /* static route index  1     */
186#define ACOSNVRAM_TAG_ROUTE_ENTRY2       "route_entry2" /* static route index  2     */
187#define ACOSNVRAM_TAG_ROUTE_ENTRY3       "route_entry3" /* static route index  3     */
188#define ACOSNVRAM_TAG_ROUTE_ENTRY4       "route_entry4" /* static route index  4     */
189#define ACOSNVRAM_TAG_ROUTE_ENTRY5       "route_entry5" /* static route index  5     */
190#define ACOSNVRAM_TAG_ROUTE_ENTRY6       "route_entry6" /* static route index  6     */
191#define ACOSNVRAM_TAG_ROUTE_ENTRY7       "route_entry7" /* static route index  7     */
192#define ACOSNVRAM_TAG_ROUTE_ENTRY8       "route_entry8" /* static route index  8     */
193#define ACOSNVRAM_TAG_ROUTE_ENTRY9       "route_entry9" /* static route index  9     */
194/* Ambit add end, Peter Chen, 12/26/2003 */
195
196/* 802.11b parameters */
197#define ACOSNVRAM_TAG_WLB_NAME          "wlb_name"
198#define ACOSNVRAM_TAG_WLB_SSID          "wlb_ssid"
199#define ACOSNVRAM_TAG_WLB_AUTH_ALG      "wlb_auth"
200#define ACOSNVRAM_TAG_WLB_CHANNEL       "wlb_channel"
201#define ACOSNVRAM_TAG_WLB_PREAMBLE      "wlb_preamble"
202#define ACOSNVRAM_TAG_WLB_BASIC_RATE    "wlb_basic_rate"
203#define ACOSNVRAM_TAG_WLB_SUPPORT_RATE  "wlb_sup_rate"
204#define ACOSNVRAM_TAG_WLB_TX_RATE       "wlb_tx_rate"
205#define ACOSNVRAM_TAG_WLB_FRAG          "wlb_frag"
206#define ACOSNVRAM_TAG_WLB_RTS           "wlb_rts"
207#define ACOSNVRAM_TAG_WLB_DTIM          "wlb_dtim"
208#define ACOSNVRAM_TAG_WLB_BEACON        "wlb_bcn"
209#define ACOSNVRAM_TAG_WLB_PRIVACY       "wlb_wep"
210#define ACOSNVRAM_TAG_WLB_EXCL_NOWEP    "wlb_excl_nowep"
211#define ACOSNVRAM_TAG_WLB_KEYID         "wlb_key"
212#define ACOSNVRAM_TAG_WLB_KEYID_64      "wlb_key_64"
213#define ACOSNVRAM_TAG_WLB_KEYID_128     "wlb_key_128"
214#define ACOSNVRAM_TAG_WLB_KEY64_1       "wlb_key64_1"
215#define ACOSNVRAM_TAG_WLB_KEY64_2       "wlb_key64_2"
216#define ACOSNVRAM_TAG_WLB_KEY64_3       "wlb_key64_3"
217#define ACOSNVRAM_TAG_WLB_KEY64_4       "wlb_key64_4"
218#define ACOSNVRAM_TAG_WLB_KEY128_1      "wlb_key128_1"
219#define ACOSNVRAM_TAG_WLB_KEY128_2      "wlb_key128_2"
220#define ACOSNVRAM_TAG_WLB_KEY128_3      "wlb_key128_3"
221#define ACOSNVRAM_TAG_WLB_KEY128_4      "wlb_key128_4"
222#define ACOSNVRAM_TAG_WLB_ACL_ENABLE    "wlb_acl_enable"
223#define ACOSNVRAM_TAG_WLB_MAC           "wlb_mac"
224#define ACOSNVRAM_TAG_WLB_ICC           "wlb_icc"
225#define ACOSNVRAM_TAG_WLB_COUNTRY       "wlb_country"
226#define ACOSNVRAM_TAG_WLB_AP_DENSITY    "wlb_ap_density"
227#define ACOSNVRAM_TAG_WLB_AUTO_CHANNEL  "wlb_auto_channel"
228#define ACOSNVRAM_TAG_WLB_ENH_SECURITY  "wlb_enh_security"
229#define ACOSNVRAM_TAG_WLB_ENABLE_BRIDGE "wlb_enable_bridge"
230#define ACOSNVRAM_TAG_WLB_WANLINK       "wlb_wanlink"
231#define ACOSNVRAM_TAG_WLB_TXPOWER       "wlb_txpower"
232#define ACOSNVRAM_TAG_WLB_TXPOWER_OFFSET "wlb_txpower_offset"
233#define ACOSNVRAM_TAG_WLB_CLIENTTHRES   "wlb_clientthres"
234#define ACOSNVRAM_TAG_WLB_TRAFFICTHRES  "wlb_trafficthres"
235
236#define ACOSNVRAM_TAG_WLB_MODE          "wlb_mode"
237#define ACOSNVRAM_TAG_WLB_WDS_MAC       "wlb_wds_mac"
238
239#define ACOSNVRAM_TAG_WDS_PORT_ENABLE_1 "wlb_wds_port_enable_1"
240#define ACOSNVRAM_TAG_WDS_PORT_ENABLE_2 "wlb_wds_port_enable_2"
241#define ACOSNVRAM_TAG_WDS_PORT_ENABLE_3 "wlb_wds_port_enable_3"
242#define ACOSNVRAM_TAG_WDS_PORT_ENABLE_4 "wlb_wds_port_enable_4"
243#define ACOSNVRAM_TAG_WDS_PORT_ENABLE_5 "wlb_wds_port_enable_5"
244#define ACOSNVRAM_TAG_WDS_PORT_ENABLE_6 "wlb_wds_port_enable_6"
245#define ACOSNVRAM_TAG_WDS_AP_MAC_1      "wlb_wds_ap_mac_1"
246#define ACOSNVRAM_TAG_WDS_AP_MAC_2      "wlb_wds_ap_mac_2"
247#define ACOSNVRAM_TAG_WDS_AP_MAC_3      "wlb_wds_ap_mac_3"
248#define ACOSNVRAM_TAG_WDS_AP_MAC_4      "wlb_wds_ap_mac_4"
249#define ACOSNVRAM_TAG_WDS_AP_MAC_5      "wlb_wds_ap_mac_5"
250#define ACOSNVRAM_TAG_WDS_AP_MAC_6      "wlb_wds_ap_mac_6"
251
252#define ACOSNVRAM_TAG_SNMP_GET_COMM_NAME        "snmp_get_comm_name"
253#define ACOSNVRAM_TAG_SNMP_SET_COMM_NAME        "snmp_set_comm_name"
254
255#define ACOSNVRAM_TAG_RADIUS_AUTH_MODE   "radius_auth_mode"
256#define ACOSNVRAM_TAG_RADIUS_AUTH_IP     "radius_auth_ip"
257#define ACOSNVRAM_TAG_RADIUS_AUTH_PORT   "radius_auth_port"
258#define ACOSNVRAM_TAG_RADIUS_AUTH_SECRET "radius_auth_secret"
259#define ACOSNVRAM_TAG_RADIUS_ACCT_IP     "radius_acct_ip"
260#define ACOSNVRAM_TAG_RADIUS_ACCT_PORT   "radius_acct_port"
261#define ACOSNVRAM_TAG_RADIUS_ACCT_SECRET "radius_acct_secret"
262#define ACOSNVRAM_TAG_RADIUS_DWEP        "radius_dwep"
263
264#define ACOSNVRAM_TAG_HTTP_RMEANBlE     "httpd_rmenable"        /* Enable/ Disable remote management */
265#define ACOSNVRAM_TAG_HTTP_RMPORT       "httpd_rmport"  /* Remote management port number */
266#define ACOSNVRAM_TAG_HTTP_RMSTARTIP    "httpd_rmstartip"       /* Remote management allowed ip range start */
267#define ACOSNVRAM_TAG_HTTP_RMENDIP      "httpd_rmendip" /* Remote management allowed ip range end */
268
269/* Ambit add start, Peter Chen, 03/11/2004 */
270#define ACOSNVRAM_TAG_UPNP_EANBlE       "upnp_enable"   /* UPnP enable/disable */
271#define ACOSNVRAM_TAG_UPNP_PERIOD       "upnp_period"   /* UPnP advertisement period */
272#define ACOSNVRAM_TAG_UPNP_TTL          "upnp_ttl"      /* UPnP advertisement TTL */
273/* Ambit add end, Peter Chen, 03/11/2004 */
274/* Ambit added start, Eddic, 03/16/2004 */
275#define ACOSNVRAM_TAG_UPNP_PORT         "upnp_port"     /* UPnP TCP port for HTTP GET, GENA, and SOAP */
276#define ACOSNVRAM_TAG_UPNP_IFENABLE     "upnp_ifenable" /* Enable/Disable UPnP support for the specified interface */
277/* Ambit added end, Eddic, 03/16/2004 */
278/* Ambit added start, Eddic, 05/17/2004 */
279#define ACOSNVRAM_TAG_UPNP_ALGPORTNUM		"upnp_algport_num"      /* Number of ALG port related to UPnP */
280#define ACOSNVRAM_TAG_UPNP_ALGPORT_PREFIX	"upnp_algport"  /* ALG port related to UPnP */
281#define ACOSNVRAM_TAG_UPNP_ALGPROT_PREFIX	"upnp_algport_pro"      /* ALG port protocol related to UPnP */
282/* Ambit added end, Eddic, 05/17/2004 */
283
284    extern int acosNvramConfig_init (IN char *pcFsMount);
285    extern char *acosNvramConfig_get(const char *name);
286    /* wklin added start */
287    extern char *acosNvramConfig_bget(const char *name, char *buf, int buf_len);
288    extern char *acosNvramConfig_get_decode(const char *name);
289    extern int acosNvramConfig_set_encode(const char *name, const char *value);
290    extern int acosNvramConfig_read_decode(IN char *pcTagName, OUT char *pcValue,
291                                     IN int iMaxBufSize);
292    /* wklin added end */
293    extern int acosNvramConfig_set (const char *name, const char *value);
294    extern int acosNvramConfig_unset (const char *name);
295    extern int acosNvramConfig_match (char *name, char *match);
296    extern int acosNvramConfig_invmatch (char *name, char *invmatch);
297
298    extern int acosNvramConfig_read (IN char *pcTagName, OUT char *pcValue,
299                                     IN int iMaxBufSize);
300    extern int acosNvramConfig_readAsInt (IN char *pcTagName,
301                                          OUT int *pcValue,
302                                          IN int iMaxBufSize);
303    extern int acosNvramConfig_readFile (IN char *pcTagName,
304                                         OUT char *pcValue,
305                                         IN int iMaxBufSize);
306    extern int acosNvramConfig_readDefault (IN char *pcTagName,
307                                            OUT char *pcValue,
308                                            IN int iMaxBufSize);
309    extern int acosNvramConfig_write (IN char *pcTagName, IN char *pcValue,
310                                      IN BOOL blSaveImmediately);
311    extern int acosNvramConfig_writeAsInt (IN char *pcTagName, IN int iValue,
312                                           IN BOOL blSaveImmediately);
313    extern int acosNvramConfig_save (void);
314
315    /* Foxconn added start Peter Ling 12/05/2005 */
316    /* used for config backup and restore */
317    extern int acosNvramConfig_readflash (char *buf);
318    extern int acosNvramConfig_writeflash (char *buf, int size);
319    /* Foxconn added end Peter Ling 12/05/2005 */
320
321/******************The naming rule of config tag name *************************
322*** 1. <module name or grpou name>_<config name>
323*** e.g. "system_lan_ipaddr"
324*** e.g. "system_wan_ipaddr"
325*** e.g. "dhcpserver_lease_time"
326*** e.g. "dhcpserver_reservedip"
327*** The config items those are not belong to any module please classify them to "system".
328*** 2. The length of TAG name and VALUE name can not exceed 32 and 512 characters
329*** 3. The written config data are saved to separated config files
330*** e.g. % system.cfg
331***    system_lan_ipaddr=192.168.1.1 255.255.255.0
332***    system_web_loginname=admin
333***    system_web_password=password
334***            ...
335*** e.g. % dhcpserver.cfg
336***    dhcpserver_leasetime=86400
337***    dhcpserver_reservedip_1=00:11:22:33:44:55 192.168.1.10
338***    dhcpserver_reservedip_2=00:11:22:33:44:66 192.168.1.11
339*******************************************************************************/
340    extern int acosNvramConfig_readHuge (char *pTagName, char *pBuf,
341                                         int *piBufLen);
342    extern int acosNvramConfig_writeHuge (char *pTagName, char *pBuf,
343                                          int iBufLen);
344    extern int acosNvramConfig_updateProfile (char *pBuf);
345    extern int acosNvramConfig_loadFactoryDefault (char *pFileName);
346    extern int acosNvramConfig_cmiGetVersion (char *pstrVersion,
347                                              int iBufSize);
348    extern int acosNvramConfig_loadTagDefault (IN char *pTagName,
349                                               OUT char *pTagValue,
350                                               IN int iMaxBufSize);
351/* ambit added start, bright wang, 03/08/2004 */
352    extern int acosNvramConfig_readEncryption (IN char *pTagName,
353                                               OUT char *pValue,
354                                               IN int iMaxValBufSize);
355    extern int acosNvramConfig_writeEncryption (IN char *pTagName,
356                                                IN const char *pValue,
357                                                IN BOOL blSaveImmediately);
358/* ambit added end, bright wang, 03/08/2004 */
359#ifndef foreach
360
361/* Copy each token in wordlist delimited by space into word */
362#define foreach(word, wordlist, next) \
363	for (next = &wordlist[strspn(wordlist, " ")], \
364	     strncpy(word, next, sizeof(word)), \
365	     word[strcspn(word, " ")] = '\0', \
366	     word[sizeof(word) - 1] = '\0', \
367	     next = strchr(next, ' '); \
368	     strlen(word); \
369	     next = next ? &next[strspn(next, " ")] : "", \
370	     strncpy(word, next, sizeof(word)), \
371	     word[strcspn(word, " ")] = '\0', \
372	     word[sizeof(word) - 1] = '\0', \
373	     next = strchr(next, ' '))
374
375#endif
376#ifdef __cplusplus
377}
378#endif
379
380
381/* Foxconn add start, FredPeng, 03/18/2009 */
382extern int WAN_ith_CONFIG_SET_AS_STR(int wanIdx, char *name, char *value);
383/* Foxconn add end, FredPeng, 03/18/2009 */
384
385#endif                          /* _ACOSNVRAMCONFIG_H */
386