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