/*****************************************************************************
-//
-// Copyright (c) 2000-2001 Broadcom Corporation
-// All Rights Reserved
-// No portions of this material may be reproduced in any form without the
-// written permission of:
-// Broadcom Corporation
-// 16215 Alton Parkway
-// Irvine, California 92619
-// All information contained in this document is Broadcom Corporation
-// company private, proprietary, and trade secret.
-//
+# <:copyright-gpl
+# Copyright 2004 Broadcom Corp. All Rights Reserved.
+# This program is free software; you can distribute it and/or modify it
+# under the terms of the GNU General Public License (Version 2) as
+# published by the Free Software Foundation.
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+# :>
******************************************************************************
//
// Filename: syscall.h
#define MNTR_STS_DHCPC_PROGRESS 5
#define MNTR_STS_DHCPC_FAIL 6
#define MNTR_STS_ADSL_TRAINING 7
+#define MNTR_STS_BRIDGE 8
#define DHCPC_STS_FAIL 0
#define DHCPC_STS_SUCCESS 1
#define SYS_LOG_ID 9
#define SYS_SNMP_ID 10
#define SYS_FLAG_ID 11
-#define SYS_TR69C_ID 12
+#define SYS_TR69C_ID 12
+#define SYS_MGMT_LOCK_ID 13
+#define SYS_HOSTNAME_ID 14 //Andy add to support hostname
+#define SYS_DOMAINNAME_ID 15 //Andy add to support domain name
+#define SYS_DDNS_ID 16 //Andy add to suuport ddns status
+
+#define SYS_ACTPPPCONN_ID 17 //Andy add to support active ppp connect
+#define SYS_FIREWALL_ID_ODM 18 //Wilson add to support enable/disable firewall from web page.
+#define SYS_REMOTE_SERVICE_ID 19 //Andy Add to support Remote Access Service
+#define SYS_REMOTE_AUTHSER_ID 20 //Andy Add to support Remote Access Service
+#define SYS_PRINTERSERVER_ID 21 //Wilson add to support print server
+#define SYS_ODM_VOICE_QOS_ID 22
+#ifdef BUILD_PPP_DOMAIN_SUFFIX
+#define SYS_SUFFIX_ID 23
+#endif
+#ifdef ODM_MULTI_LANG
+#define SYS_WEBLANG_ID 24
+#endif
+#if defined(SUPPORT_SYS_ALG)
+#if defined(SUPPORT_SYS_VPN_ALG) || defined(SUPPORT_SYS_SIP_ALG)
+#define SYS_ALG_ID 25
+#endif
+#endif
+#if defined(ODM_LANG_NETGEAR)
+#define SYS_BLANKSTATE_ID 26
+#endif
+
+#if defined(SUPPORT_AUTO_DETECT_DEFAULT_PVC)
+#define SYS_AUTO_DETECT_DEFAULT_PVC_ID 27
+#endif
// Values that are used in syscall.c
#define SYS_CMD_LEN 256
#define UPNP_IP_ADDRESS "239.255.255.250"
+#if defined(INCLUDE_EMBHTTPD)
+typedef struct expTime_s {
+ int expNever;
+ int expTime;
+}ExpTime_t;
+#endif
+
+
+//Paul add, 8/29/2006
+#ifdef SUPPORT_IPP
+#define PRINTER_STR_LEN 40
+typedef struct {
+ char printername[PRINTER_STR_LEN];
+ char ethmacaddr[PRINTER_STR_LEN];
+ char ipaddr[PRINTER_STR_LEN];
+ int dhcpsstatus;
+ char wssid[PRINTER_STR_LEN];
+ char networktype[PRINTER_STR_LEN];
+ int wnetstatus;
+ char adsllinerate[PRINTER_STR_LEN];
+ char internet[PRINTER_STR_LEN];
+ char dfgateway[PRINTER_STR_LEN];
+ char pdnsserver[PRINTER_STR_LEN];
+ char sdnsserver[PRINTER_STR_LEN];
+ char swverion[PRINTER_STR_LEN];
+} PRINTER_VAR, *PPRINTER_VAR;
+#endif
+//Paul add end
+
+//Paul porting from 2.21.5, 7/24/2006
+#ifdef INCLUDE_PRINT_SERVER
+
+#define PRINTER_STR_LEN 40
+typedef struct {
+ char printername[PRINTER_STR_LEN];
+ char ethmacaddr[PRINTER_STR_LEN];
+ char ipaddr[PRINTER_STR_LEN];
+ int dhcpsstatus;
+ char wssid[PRINTER_STR_LEN];
+ char networktype[PRINTER_STR_LEN];
+ int wnetstatus;
+ char adsllinerate[PRINTER_STR_LEN];
+ char internet[PRINTER_STR_LEN];
+ char dfgateway[PRINTER_STR_LEN];
+ char pdnsserver[PRINTER_STR_LEN];
+ char sdnsserver[PRINTER_STR_LEN];
+ char swverion[PRINTER_STR_LEN];
+} PRINTER_VAR, *PPRINTER_VAR;
+#endif
+//Paul porting end
+
+//Paul add, 8/10/2006
+#define STATUS_PRINTING 0x80
+#define STATUS_OK 0x0
+#define STATUS_OUT_PAPER 0x1
+#define STATUS_OFFLINE 0x2
+#define STATUS_ONFIRE 0x3
+#define STATUS_NOT_CONNECTED 0x4
+#define STATUS_UNKNOWN 0x5
+
+struct lpstate {
+ char status;
+};
+//Paul add end
#if defined(__cplusplus)
extern "C" {
int bcmGetPid (char *command);
int *bcmGetPidList(char * command);
int bcmCreateDhcpCfg(char *ipAddr, char *mask, char *addrStart, char *addrEnd,
- char *dns1, char *dns2, int leasedTime, int protocol,
- int enblNat, int enblFirewall);
-int bcmCreateIpExtDhcpCfg(char *lanAddr, char *mask, char *wanAddr);
-int bcmCreateLocalDhcpCfg(char *addr, char *mask);
+ char *dns1, char *dns2, int leasedTime, int isForever, int protocol,
+ int enblNat, int enblFirewall, char *domain);
+int bcmCreateIpExtDhcpCfg(char *lanAddr, char *mask, char *wanAddr, char *domain);
+int bcmCreateLocalDhcpCfg(char *addr, char *mask, char *domain, char *startIp);
int bcmCreateResolvCfg(char *dns1, char *dns2);
-int bcmCreateLoginCfg(char *cp_admin, char *cp_support, char *cp_user);
+//int bcmCreateLoginCfg(char *cp_admin, char *cp_support, char *cp_user);
+int bcmCreateLoginCfg(char *, char *, char *, char *, char *, char *);
int bcmGetAdslStatus(void);
+int bcmGetVdslStatus(void);
+int bcmGetXdslStatus(void);
int bcmGetPppStatus(char *str, int len, char *devName);
int bcmGetDhcpcStatus(char *str, int len);
int bcmGetSystemStatus(char *str, int len);
void bcmGetDns(char *dns);
void bcmGetDns2(char *dns);
void bcmGetDnsSettings(int *mode, char *primary, char *secondary);
-void bcmRestartDnsProbe(void);
+//void bcmRestartDnsProbe(void);
void bcmConfigDns(char *dns1, char *dns2, int dynamic);
void bcmRemoveDefaultGatewayByWanIf(char *wanIf);
void bcmGetDefaultGateway(char *gtwy, char *wanIf);
+void wsnGetDefaultGateway(char *gtwy, char *wanIf);
int bcmIsDefaultGatewayExisted(char *gw, char *wanIf);
-void bcmSetAutoDefaultGateway(char *errMsg);
+void bcmSetAutoDefaultGateway(char *errMsg, int runcmd);
void bcmSetStaticDefaultGateway(char *gw, char *wanIf, char *errMsg);
void bcmKillAllApps(void);
void disconnectPPP(void);
int bcmRemoveEbTableRule(char *device, char *table, char *chain);
void bcmRemoveAllEbTableRules(char *device);
+void bcmRemoveAllBrFilterRules(char *device);
+int bcmRemoveAllEbTableFORWARDrule();
+
+int getIfaceIpAddr(char *buff, char *ifaceName);
+int ODMCreateDhcpMap(void);
+int odmbase64Encode(const void *inp, int insize, char **outptr);
+void odmbase64Decode(unsigned char *dest, char *src, int *rawLength);
+
+int GetMASQIpTableRule(char *device, char *table, char *chain);
+int GetTCPMSSIpTableRule(char *device, char *table, char *chain);
void parseStrInfo(char *info, char *var, char *val, int len);
void bcmConvertStrToShellStr(char *str, char *buf);
void bcmProcessMarkStrChars(char *str);
int bcmIsMarkStrChar(char c);
+void bcmSetVdslSwVer(char *swVer);
void bcmGetSwVer(char *swVer, int size);
-void bcmGetBuildVer(char *swVer, int size); // USR9108
+void bcmGetVdslSwVer(char *swVer, int size);
int isAccessFromLan(struct in_addr clntAddr);
int checkChipId(char *strTagChipId, char *sig2);
void bcmRemoveModules(int lanIf);
int bcmWaitIntfExists(char *ifName);
+
+#ifdef SUPPORT_IPP //Paul add, 8/29/2006
+int print_test_page();
+#endif
+
+//Paul porting from 2.21.5, 7/24/2006
+//Charles 12/23/2003
+#ifdef INCLUDE_PRINT_SERVER
+int print_test_page();
+int get_printer_status(char *status_str, char *lp_name);
+#endif
+
int bcmMacStrToNum(char *macAddr, char *str);
int bcmMacNumToStr(char *macAddr, char *str);
int bcmWanEnetQuerySwitch(char *ifName);
+#ifdef PORT_MIRRORING
int bcmConfigPortMirroring (void *pMirrorCfg) ;
+#endif
+void bcmStoreDeviceInfoToProcFile(void);
+#ifdef BUILD_DOMAIN_LOCK
+int wsnCheckStrTail(char *username, char *validDomain);
+int wsnIsValidPppUser(char *pppUser);
+#endif
+
+#ifdef IP_MGCP
+int SysPstnVoipStatus(char *status);
+#endif
+
+void bcmGetDynamicDnsAddr(char *dns, int primary);
+#ifdef SUPPORT_TR69C
+void getInterfaceMac(char *macstr, char *iface);
+#endif
#define BCM_PPPOE_CLIENT_STATE_PADO 0 /* waiting for PADO */
#define BCM_PPPOE_CLIENT_STATE_PADS 1 /* got PADO, waiting for PADS */
#define BCM_PPPOE_SERVICE_AVAILABLE 5 /* ppp service is available on the remote */
#define BCM_PPPOE_AUTH_FAILED 7
+#define WSN_PPPOE_STATE_DISCONNECTED -10//wilson add for Tr069 status
+#define WSN_PPPOE_STATE_CONNECTING -11//wilson add for Tr069 status
#define BCM_PRIMARY_DNS 1
#define BCM_SECONDARY_DNS 0