remove some useless junk from the nvram libraries
authorFelix Fietkau <nbd@openwrt.org>
Sat, 2 Sep 2006 18:37:11 +0000 (18:37 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 2 Sep 2006 18:37:11 +0000 (18:37 +0000)
SVN-Revision: 4726

openwrt/package/nvram/src/Makefile
openwrt/package/nvram/src/defaults.c [deleted file]
openwrt/package/nvram/src/nvram_convert.c [deleted file]
openwrt/package/nvram/src/nvram_convert.h [deleted file]
openwrt/package/nvram/src/nvram_linux.c

index 376c2b7de7794fb4a6948453abdf039ae13eceac..b06528e82e7074e20c792644d25e096291d3970d 100644 (file)
@@ -1,8 +1,8 @@
 # $Id$
 
 EXTRA_CFLAGS := -c -I. -I../include
-LIBSHARED_OBJS := shutils.o wl.o wl_linux.o defaults.o linux_timer.o
-LIBNVRAM_OBJS := nvram_linux.o nvram_convert.o
+LIBSHARED_OBJS := shutils.o wl.o wl_linux.o linux_timer.o
+LIBNVRAM_OBJS := nvram_linux.o
 
 all: libshared.so libnvram.so nvram
 
diff --git a/openwrt/package/nvram/src/defaults.c b/openwrt/package/nvram/src/defaults.c
deleted file mode 100644 (file)
index 119eaac..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Router default NVRAM values
- *
- * Copyright 2004, Broadcom Corporation
- * All Rights Reserved.
- * 
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * $Id$
- */
-
-#include <epivers.h>
-#include <string.h>
-#include <bcmnvram.h>
-#include <typedefs.h>
-#include <wlioctl.h>
-
-#define XSTR(s) STR(s)
-#define STR(s) #s
-
-struct nvram_tuple router_defaults[] = {
-       /* OS parameters */
-       { "os_name", "", 0 },                   /* OS name string */
-       { "os_version", EPI_VERSION_STR, 0 },   /* OS revision */
-       { "os_date", __DATE__, 0 },             /* OS date */
-
-       /* Miscellaneous parameters */
-       { "timer_interval", "3600", 0 },        /* Timer interval in seconds */
-       { "ntp_server", "192.5.41.40 192.5.41.41 133.100.9.2", 0 },             /* NTP server */
-       { "time_zone", "PST8PDT", 0 },          /* Time zone (GNU TZ format) */
-       { "log_level", "0", 0 },                /* Bitmask 0:off 1:denied 2:accepted */
-       { "upnp_enable", "0", 0 },              /* Start UPnP */
-       { "ezc_enable", "1", 0 },               /* Enable EZConfig updates */
-       { "ezc_version", "1", 0 },              /* EZConfig version */
-       { "is_default", "1", 0 },               /* is it default setting: 1:yes 0:no*/
-       { "os_server", "", 0 },                 /* URL for getting upgrades */
-       { "stats_server", "", 0 },              /* URL for posting stats */
-       { "console_loglevel", "1", 0 },         /* Kernel panics only */
-
-       /* Big switches */
-       { "router_disable", "0", 0 },           /* lan_proto=static lan_stp=0 wan_proto=disabled */
-       { "fw_disable", "0", 0 },               /* Disable firewall (allow new connections from the WAN) */
-
-       { "log_ipaddr", "", 0 },                /* syslog recipient */
-       
-       /* LAN H/W parameters */
-       { "lan_ifname", "", 0 },                /* LAN interface name */
-       { "lan_ifnames", "", 0 },               /* Enslaved LAN interfaces */
-       { "lan_hwnames", "", 0 },               /* LAN driver names (e.g. et0) */
-       { "lan_hwaddr", "", 0 },                /* LAN interface MAC address */
-       
-       /* LAN TCP/IP parameters */
-       { "lan_proto", "dhcp", 0 },             /* [static|dhcp] */
-       { "lan_ipaddr", "192.168.1.1", 0 },     /* LAN IP address */
-       { "lan_netmask", "255.255.255.0", 0 },  /* LAN netmask */
-       { "lan_stp", "0", 0 },                  /* LAN spanning tree protocol */
-       { "lan_wins", "", 0 },                  /* x.x.x.x x.x.x.x ... */
-       { "lan_domain", "", 0 },                /* LAN domain name */
-       { "lan_lease", "86400", 0 },            /* LAN lease time in seconds */
-
-       /* WAN H/W parameters */
-       { "wan_ifname", "", 0 },                /* WAN interface name */
-       { "wan_ifnames", "", 0 },               /* WAN interface names */
-       { "wan_hwname", "", 0 },                /* WAN driver name (e.g. et1) */
-       { "wan_hwaddr", "", 0 },                /* WAN interface MAC address */
-       
-       /* WAN TCP/IP parameters */
-       { "wan_proto", "dhcp", 0 },             /* [static|dhcp|pppoe|disabled] */
-       { "wan_ipaddr", "0.0.0.0", 0 },         /* WAN IP address */
-       { "wan_netmask", "0.0.0.0", 0 },        /* WAN netmask */
-       { "wan_gateway", "0.0.0.0", 0 },        /* WAN gateway */
-       { "wan_dns", "", 0 },                   /* x.x.x.x x.x.x.x ... */
-       { "wan_wins", "", 0 },                  /* x.x.x.x x.x.x.x ... */
-       { "wan_hostname", "", 0 },              /* WAN hostname */
-       { "wan_domain", "", 0 },                /* WAN domain name */
-       { "wan_lease", "86400", 0 },            /* WAN lease time in seconds */
-       
-       /* PPPoE parameters */
-       { "wan_pppoe_ifname", "", 0 },          /* PPPoE enslaved interface */
-       { "wan_pppoe_username", "", 0 },        /* PPP username */
-       { "wan_pppoe_passwd", "", 0 },          /* PPP password */
-       { "wan_pppoe_idletime", "60", 0 },      /* Dial on demand max idle time (seconds) */
-       { "wan_pppoe_keepalive", "0", 0 },      /* Restore link automatically */
-       { "wan_pppoe_demand", "0", 0 },         /* Dial on demand */
-       { "wan_pppoe_mru", "1492", 0 },         /* Negotiate MRU to this value */
-       { "wan_pppoe_mtu", "1492", 0 },         /* Negotiate MTU to the smaller of this value or the peer MRU */
-       { "wan_pppoe_service", "", 0 },         /* PPPoE service name */
-       { "wan_pppoe_ac", "", 0 },              /* PPPoE access concentrator name */
-
-       /* Misc WAN parameters */
-       { "wan_desc", "", 0 },                  /* WAN connection description */
-       { "wan_route", "", 0 },                 /* Static routes (ipaddr:netmask:gateway:metric:ifname ...) */
-       { "wan_primary", "0", 0 },              /* Primary wan connection */
-
-       { "wan_unit", "0", 0 },                 /* Last configured connection */
-       
-       /* Filters */
-       { "filter_maclist", "", 0 },            /* xx:xx:xx:xx:xx:xx ... */
-       { "filter_macmode", "deny", 0 },        /* "allow" only, "deny" only, or "disabled" (allow all) */
-       { "filter_client0", "", 0 },            /* [lan_ipaddr0-lan_ipaddr1|*]:lan_port0-lan_port1,proto,enable,day_start-day_end,sec_start-sec_end,desc */
-
-       /* Port forwards */
-       { "dmz_ipaddr", "", 0 },                /* x.x.x.x (equivalent to 0-60999>dmz_ipaddr:0-60999) */
-       { "forward_port0", "", 0 },             /* wan_port0-wan_port1>lan_ipaddr:lan_port0-lan_port1[:,]proto[:,]enable[:,]desc */
-       { "autofw_port0", "", 0 },              /* out_proto:out_port,in_proto:in_port0-in_port1>to_port0-to_port1,enable,desc */
-
-       /* DHCP server parameters */
-       { "dhcp_start", "192.168.1.100", 0 },   /* First assignable DHCP address */
-       { "dhcp_end", "192.168.1.150", 0 },     /* Last assignable DHCP address */
-       { "dhcp_domain", "wan", 0 },            /* Use WAN domain name first if available (wan|lan) */
-       { "dhcp_wins", "wan", 0 },              /* Use WAN WINS first if available (wan|lan) */
-
-       /* Web server parameters */
-       { "http_username", "", 0 },             /* Username */
-       { "http_passwd", "admin", 0 },          /* Password */
-       { "http_wanport", "", 0 },              /* WAN port to listen on */
-       { "http_lanport", "80", 0 },            /* LAN port to listen on */
-
-       /* Wireless parameters */
-       { "wl_ifname", "", 0 },                 /* Interface name */
-       { "wl_hwaddr", "", 0 },                 /* MAC address */
-       { "wl_phytype", "g", 0 },               /* Current wireless band ("a" (5 GHz), "b" (2.4 GHz), or "g" (2.4 GHz)) */
-       { "wl_corerev", "", 0 },                /* Current core revision */
-       { "wl_phytypes", "", 0 },               /* List of supported wireless bands (e.g. "ga") */
-       { "wl_radioids", "", 0 },               /* List of radio IDs */
-       { "wl_ssid", "OpenWrt", 0 },            /* Service set ID (network name) */
-       { "wl_country", "", 0 },                /* Country (default obtained from driver) */
-       { "wl_radio", "1", 0 },                 /* Enable (1) or disable (0) radio */
-       { "wl_closed", "0", 0 },                /* Closed (hidden) network */
-        { "wl_ap_isolate", "0", 0 },            /* AP isolate mode */
-       { "wl_mode", "ap", 0 },                 /* AP mode (ap|sta|wds) */
-       { "wl_lazywds", "0", 0 },               /* Enable "lazy" WDS mode (0|1) */
-       { "wl_wds", "", 0 },                    /* xx:xx:xx:xx:xx:xx ... */
-       { "wl_wep", "disabled", 0 },            /* WEP data encryption (enabled|disabled) */
-       { "wl_auth", "0", 0 },                  /* Shared key authentication optional (0) or required (1) */
-       { "wl_key", "1", 0 },                   /* Current WEP key */
-       { "wl_key1", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
-       { "wl_key2", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
-       { "wl_key3", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
-       { "wl_key4", "", 0 },                   /* 5/13 char ASCII or 10/26 char hex */
-       { "wl_maclist", "", 0 },                /* xx:xx:xx:xx:xx:xx ... */
-       { "wl_macmode", "disabled", 0 },        /* "allow" only, "deny" only, or "disabled" (allow all) */
-       { "wl_channel", "11", 0 },              /* Channel number */
-       { "wl_rate", "0", 0 },                  /* Rate (bps, 0 for auto) */
-       { "wl_rateset", "default", 0 },         /* "default" or "all" or "12" */
-       { "wl_frag", "2346", 0 },               /* Fragmentation threshold */
-       { "wl_rts", "2347", 0 },                /* RTS threshold */
-       { "wl_dtim", "1", 0 },                  /* DTIM period */
-       { "wl_bcn", "100", 0 },                 /* Beacon interval */
-       { "wl_plcphdr", "long", 0 },            /* 802.11b PLCP preamble type */
-       { "wl_net_mode", "mixed", 0 },          /* 54g mode */
-       { "wl_gmode", "6", 0 },                 /* 54g mode */
-       { "wl_gmode_protection", "auto", 0 },   /* 802.11g RTS/CTS protection (off|auto) */
-       { "wl_afterburner", "auto", 0 },        /* AfterBurner */
-       { "wl_frameburst", "off", 0 },          /* BRCM Frambursting mode (off|on) */
-       { "wl_antdiv", "-1", 0 },               /* Antenna Diversity (-1|0|1|3) */
-       { "wl_infra", "1", 0 },                 /* Network Type (BSS/IBSS) */
-
-       /* WPA parameters */
-       { "security_mode", "open", 0 },
-       { "wl_auth_mode", "open", 0 },          /* Network authentication mode (open|shared|radius|wpa|psk) */
-       { "wl_wpa_psk", "", 0 },                /* WPA pre-shared key */
-       { "wl_wpa_gtk_rekey", "3600", 0 },      /* GTK rotation interval */
-       { "wl_radius_ipaddr", "", 0 },          /* RADIUS server IP address */
-       { "wl_radius_key", "", 0 },             /* RADIUS shared secret */
-       { "wl_radius_port", "1812", 0 },        /* RADIUS server UDP port */
-       { "wl_crypto", "tkip", 0 },             /* WPA data encryption */
-
-
-       { "wl_unit", "0", 0 },                  /* Last configured interface */
-               
-       /* Restore defaults */
-       { "restore_defaults", "0", 0 },         /* Set to 0 to not restore defaults on boot */
-
-       { 0, 0, 0 }
-};
diff --git a/openwrt/package/nvram/src/nvram_convert.c b/openwrt/package/nvram/src/nvram_convert.c
deleted file mode 100644 (file)
index 4859090..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-
-#define WL(a)  "wl_"a  
-#define WL0(a) "wl0_"a 
-#define D11G(a)        "d11g_"a
-
-#define PPP(a)         "ppp_"a
-#define PPPOE(a)       "pppoe_"a
-
-struct nvram_convert {
-        char *name;            // for WEB
-       char *wl0_name;         // for driver
-        char *d11g_name;       // for old nv name
-};
-
-struct nvram_convert nvram_converts[] = {
-       // Bellow change from 3.11.48.7
-       { WL("ssid"),           WL0("ssid"),    ""},
-       { WL("radio"),          WL0("mode"),    ""},
-       { WL("mode"),           WL0("mode"),    ""},
-       { WL("wds"),            WL0("wds"),     ""},
-       { WL("auth"),           WL0("auth"),    ""},
-       { WL("key"),            WL0("key"),     ""},
-       { WL("key1"),           WL0("key1"),    ""},
-       { WL("key2"),           WL0("key2"),    ""},
-       { WL("key3"),           WL0("key3"),    ""},
-       { WL("key4"),           WL0("key4"),    ""},
-       { WL("maclist"),        WL0("maclist"), ""},
-       { WL("channel"),        WL0("channel"), D11G("channel")},
-       { WL("rateset"),        WL0("rateset"), D11G("rateset")},
-       { WL("rts"),            WL0("rts"),     D11G("rts")},
-       { WL("bcn"),            WL0("bcn"),     D11G("bcn")},
-       { WL("gmode"),          WL0("gmode"),   "d11g_mode"},
-       { WL("unit"),           WL0("unit"),    ""},
-       { WL("ifname"),         WL0("ifname"),  ""},
-       { WL("phytype"),        WL0("phytype"), ""},
-       { WL("country"),        WL0("country"), ""},
-       { WL("closed"),         WL0("closed"),  ""},
-       { WL("lazywds"),        WL0("lazywds"), ""},
-       { WL("wep"),            WL0("wep"),     ""},
-       { WL("macmode"),        WL0("macmode"), ""},
-       { WL("rate"),           WL0("rate"),    D11G("rate")},
-       { WL("frag"),           WL0("frag"),    D11G("frag")},
-       { WL("dtim"),           WL0("dtim"),    D11G("dtim")},
-       { WL("plcphdr"),        WL0("plcphdr"), ""},
-       { WL("gmode_protection"),       WL0("gmode_protection"),        ""},
-       { WL("radio"),          WL0("radio"),   ""},
-       // Bellow change from 3.21.9.0
-       { WL("auth_mode"),      WL0("auth_mode"),       ""},
-       { WL("radius_ipaddr"),  WL0("radius_ipaddr"),   ""},
-       { WL("radius_port"),    WL0("radius_port"),     ""},
-       { WL("radius_key"),     WL0("radius_key"),      ""},
-       { WL("wpa_psk"),        WL0("wpa_psk"),         ""},
-       { WL("wpa_gtk_rekey"),  WL0("wpa_gtk_rekey"),   ""},
-       { WL("frameburst"),     WL0("frameburst"),      ""},
-       { WL("crypto"),         WL0("crypto"),          ""},
-       { WL("ap_isolate"),     WL0("ap_isolate"),      ""},
-       { WL("afterburner"),    WL0("afterburner"),     ""},
-       // for PPPoE
-       { PPP("username"),      PPPOE("username"),      ""},
-       { PPP("passwd"),        PPPOE("passwd"),        ""},
-       { PPP("idletime"),      PPPOE("idletime"),      ""},
-       { PPP("keepalive"),     PPPOE("keepalive"),     ""},
-       { PPP("demand"),        PPPOE("demand"),        ""},
-       { PPP("service"),       PPPOE("service"),       ""},
-       { PPP("ac"),            PPPOE("ac"),            ""},
-       { PPP("static"),        PPPOE("static"),        ""},
-       { PPP("static_ip"),     PPPOE("static_ip"),     ""},
-       { PPP("username_1"),    PPPOE("username_1"),    ""},
-       { PPP("passwd_1"),      PPPOE("passwd_1"),      ""},
-       { PPP("idletime_1"),    PPPOE("idletime_1"),    ""},
-       { PPP("keepalive_1"),   PPPOE("keepalive_1"),   ""},
-       { PPP("demand_1"),      PPPOE("demand_1"),      ""},
-       { PPP("service_1"),     PPPOE("service_1"),     ""},
-       { PPP("ac_1"),          PPPOE("ac_1"),          ""},
-       
-       { 0, 0, 0},
-};
diff --git a/openwrt/package/nvram/src/nvram_convert.h b/openwrt/package/nvram/src/nvram_convert.h
deleted file mode 100644 (file)
index 70e1232..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-struct nvram_convert {
-        char *name;
-       char *wl0_name;
-        char *d11g_name;
-};
-
index c41e32118ac1e03fe10b2d6e045635a60d23325c..7757d681992ffc25868de15c795907c4d2716181 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <typedefs.h>
 #include <bcmnvram.h>
-#include <nvram_convert.h>
 #include <shutils.h>
 #include <utils.h>
 
@@ -116,8 +115,8 @@ nvram_getall(char *buf, int count)
        return (ret == count) ? 0 : ret;
 }
 
-static int
-_nvram_set(const char *name, const char *value)
+int
+nvram_set(const char *name, const char *value)
 {
        size_t count = strlen(name) + 1;
        char tmp[100], *buf = tmp;
@@ -152,29 +151,10 @@ _nvram_set(const char *name, const char *value)
        return (ret == count) ? 0 : ret;
 }
 
-int
-nvram_set(const char *name, const char *value)
-{
-        extern struct nvram_convert nvram_converts[];
-         struct nvram_convert *v;
-         int ret;
-
-         ret = _nvram_set(name, value);
-
-         for(v = nvram_converts ; v->name ; v++) {
-                 if(!strcmp(v->name, name)){
-                         if(strcmp(v->wl0_name,""))      _nvram_set(v->wl0_name, value);
-                         if(strcmp(v->d11g_name,""))     _nvram_set(v->d11g_name, value);
-                 }
-         }
-
-         return ret;
-}
-
 int
 nvram_unset(const char *name)
 {
-       return _nvram_set(name, NULL);
+       return nvram_set(name, NULL);
 }
 
 int
@@ -182,8 +162,6 @@ nvram_commit(void)
 {
        int ret;
        
-       cprintf("nvram_commit(): start\n");     
-       
        if((check_action() == ACT_IDLE) || 
           (check_action() == ACT_SW_RESTORE) || 
           (check_action() == ACT_HW_RESTORE)){
@@ -195,11 +173,7 @@ nvram_commit(void)
 
                if (ret < 0)
                        perror(PATH_DEV_NVRAM);
-       
-               cprintf("nvram_commit(): end\n");       
        }
-       else
-               cprintf("nvram_commit():  nothing to do...\n");
 
        return ret;
 }