- single KERNEL_VERSION(a,b,c) macro in platform.h
[oweals/busybox.git] / networking / ifupdown.c
index d4167e9a0f8327b593fee961a6c4eafe26728de1..32b92fb62bceaf3dfebff89e4adf84f35c0c36b4 100644 (file)
@@ -32,7 +32,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "libbb.h"
+#include "busybox.h"
 
 #define MAX_OPT_DEPTH 10
 #define EUNBALBRACK 10001
@@ -135,8 +135,7 @@ static int count_netmask_bits(char *dotted_quad)
 }
 #endif
 
-#if ENABLE_FEATURE_IFUPDOWN_IPV4 || ENABLE_FEATURE_IFUPDOWN_IPV6 || \
-       ENABLE_FEATURE_IFUPDOWN_IPX
+#if ENABLE_FEATURE_IFUPDOWN_IPV4 || ENABLE_FEATURE_IFUPDOWN_IPV6
 static void addstr(char **buf, size_t *len, size_t *pos, char *str, size_t str_length)
 {
        if (*pos + str_length >= *len) {
@@ -257,7 +256,7 @@ static char *parse(char *command, struct interface_defn_t *ifd)
                                        varvalue = get_var(command, nextpercent - command, ifd);
 
                                        if (varvalue) {
-                                               addstr(&result, &len, &pos, varvalue, bb_strlen(varvalue));
+                                               addstr(&result, &len, &pos, varvalue, strlen(varvalue));
                                        } else {
 #ifdef CONFIG_FEATURE_IFUPDOWN_IP
                                                /* Sigh...  Add a special case for 'ip' to convert from
@@ -268,7 +267,7 @@ static char *parse(char *command, struct interface_defn_t *ifd)
                                                        if (varvalue && (res=count_netmask_bits(varvalue)) > 0) {
                                                                char argument[255];
                                                                sprintf(argument, "%d", res);
-                                                               addstr(&result, &len, &pos, argument, bb_strlen(argument));
+                                                               addstr(&result, &len, &pos, argument, strlen(argument));
                                                                command = nextpercent + 1;
                                                                break;
                                                        }
@@ -317,39 +316,6 @@ static int execute(char *command, struct interface_defn_t *ifd, execfn *exec)
 }
 #endif
 
-#ifdef CONFIG_FEATURE_IFUPDOWN_IPX
-static int static_up_ipx(struct interface_defn_t *ifd, execfn *exec)
-{
-       return(execute("ipx_interface add %iface% %frame% %netnum%", ifd, exec));
-}
-
-static int static_down_ipx(struct interface_defn_t *ifd, execfn *exec)
-{
-       return(execute("ipx_interface del %iface% %frame%", ifd, exec));
-}
-
-static int dynamic_up(struct interface_defn_t *ifd, execfn *exec)
-{
-       return(execute("ipx_interface add %iface% %frame%", ifd, exec));
-}
-
-static int dynamic_down(struct interface_defn_t *ifd, execfn *exec)
-{
-       return(execute("ipx_interface del %iface% %frame%", ifd, exec));
-}
-
-static struct method_t methods_ipx[] = {
-       { "dynamic", dynamic_up, dynamic_down, },
-       { "static", static_up_ipx, static_down_ipx, },
-};
-
-static struct address_family_t addr_ipx = {
-       "ipx",
-       sizeof(methods_ipx) / sizeof(struct method_t),
-       methods_ipx
-};
-#endif /* IFUP_FEATURE_IPX */
-
 #ifdef CONFIG_FEATURE_IFUPDOWN_IPV6
 static int loopback_up6(struct interface_defn_t *ifd, execfn *exec)
 {
@@ -720,9 +686,6 @@ static struct interfaces_file_t *read_interfaces(const char *filename)
 #endif
 #ifdef CONFIG_FEATURE_IFUPDOWN_IPV6
                                        &addr_inet6,
-#endif
-#ifdef CONFIG_FEATURE_IFUPDOWN_IPX
-                                       &addr_ipx,
 #endif
                                        NULL
                                };
@@ -800,7 +763,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename)
                                        {
                                                int i;
 
-                                               if (bb_strlen(buf_ptr) == 0) {
+                                               if (strlen(buf_ptr) == 0) {
                                                        bb_error_msg("option with empty value \"%s\"", buf);
                                                        return NULL;
                                                }
@@ -882,7 +845,7 @@ static char *setlocalenv(char *format, const char *name, const char *value)
        char *here;
        char *there;
 
-       result = xmalloc(bb_strlen(format) + bb_strlen(name) + bb_strlen(value) + 1);
+       result = xmalloc(strlen(format) + strlen(name) + strlen(value) + 1);
 
        sprintf(result, format, name, value);
 
@@ -897,7 +860,7 @@ static char *setlocalenv(char *format, const char *name, const char *value)
                        here++;
                }
        }
-       memmove(here, there, bb_strlen(there) + 1);
+       memmove(here, there, strlen(there) + 1);
 
        return result;
 }
@@ -1098,7 +1061,7 @@ static char *run_mapping(char *physical, struct mapping_defn_t * map)
                        /* If we are able to read a line of output from the script,
                         * remove any trailing whitespace and use this value
                         * as the name of the logical interface. */
-                       char *pch = new_logical + bb_strlen(new_logical) - 1;
+                       char *pch = new_logical + strlen(new_logical) - 1;
 
                        while (pch >= new_logical && isspace(*pch))
                                *(pch--) = '\0';
@@ -1120,7 +1083,7 @@ static char *run_mapping(char *physical, struct mapping_defn_t * map)
 
 static llist_t *find_iface_state(llist_t *state_list, const char *iface)
 {
-       unsigned short iface_len = bb_strlen(iface);
+       unsigned short iface_len = strlen(iface);
        llist_t *search = state_list;
 
        while (search) {
@@ -1345,7 +1308,7 @@ int ifupdown_main(int argc, char **argv)
                        llist_t *iface_state = find_iface_state(state_list, iface);
 
                        if (cmds == iface_up) {
-                               char *newiface = xmalloc(bb_strlen(iface) + 1 + bb_strlen(liface) + 1);
+                               char *newiface = xmalloc(strlen(iface) + 1 + strlen(liface) + 1);
                                sprintf(newiface, "%s=%s", iface, liface);
                                if (iface_state == NULL) {
                                        state_list = llist_add_to_end(state_list, newiface);