Changeset 10910


Ignore:
Timestamp:
11/14/08 00:19:54 (5 years ago)
Author:
BrainSlayer
Message:

decided to go this way

Location:
src/router
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/router/httpd/visuals/dd-wrt.c

    r10904 r10910  
    20972097    websWrite( wp, "<div class=\"label\">Bonding Type</div>\n", count ); 
    20982098    showOptions( wp, "bonding_type", 
    2099                  "balance-rr active-backup balance-xor broadcast 802.3ad balance-tlb balance-alb weighted-rr duplex-master duplex-slave", 
     2099                 "balance-rr active-backup balance-xor broadcast 802.3ad balance-tlb balance-alb weighted-rr duplex", 
    21002100                 nvram_default_get( "bonding_type", "balance-rr" ) ); 
    21012101    websWrite( wp, "&nbsp;Bonding Interfaces&nbsp;" ); 
  • src/router/services/networking/madwifi.c

    r10850 r10910  
    12471247            sysprintf("iwpriv %s wds 1",var); 
    12481248 
     1249#ifdef HAVE_BONDING 
     1250    if( !strcmp( m, "wdsap" ) && !isBond(var)) 
     1251#else 
    12491252    if( !strcmp( m, "wdsap" ) ) 
     1253#endif 
    12501254        sysprintf("iwpriv %s wdssep 1",var); 
    12511255    else 
    1252         sysprintf("iwpriv %s wdssep 1",var); 
     1256        sysprintf("iwpriv %s wdssep 0",var); 
    12531257 
    12541258        sysprintf("iwpriv %s hostroaming 0",var); 
  • src/router/services/services/bonding.c

    r10889 r10910  
    2626#include <utils.h> 
    2727#include <syslog.h> 
    28  
    29 void start_bonding( void ) 
    30 { 
    31     char mode[64]; 
    32     char count[64]; 
    33  
    34     sprintf( mode, "mode=%s", 
    35              nvram_default_get( "bonding_type", "balance-rr" ) ); 
    36     sprintf( count, "max_bonds=%s", 
    37              nvram_default_get( "bonding_number", "1" ) ); 
    38     eval( "insmod", "bonding", "miimon=100","downdelay=200","updelay=200", mode, count ); 
    39  
    40     static char word[256]; 
    41     char *next, *wordlist; 
    42  
    43     wordlist = nvram_safe_get( "bondings" ); 
    44     foreach( word, wordlist, next ) 
    45     { 
    46         char *port = word; 
    47         char *tag = strsep( &port, ">" ); 
    48  
    49         if( !tag || !port ) 
    50         { 
    51             break; 
    52         } 
    53         eval( "ifconfig", tag, "0.0.0.0", "up" ); 
    54         eval( "ifenslave", tag, port ); 
    55     } 
    56     int c = atoi( nvram_safe_get( "bonding_number" ) ); 
    57     int i; 
    58  
    59     for( i = 0; i < c; i++ ) 
    60     { 
    61         sprintf( word, "bond%d", i ); 
    62         char *br = getRealBridge( word ); 
    63  
    64         if( br ) 
    65             br_add_interface( br, word ); 
    66  
    67     } 
    68 } 
    6928void stop_bonding( void ) 
    7029{ 
     
    8847} 
    8948 
     49void start_bonding( void ) 
     50{ 
     51    char mode[64]; 
     52    char count[64]; 
     53    stop_bonding(); 
     54 
     55    sprintf( mode, "mode=%s", 
     56             nvram_default_get( "bonding_type", "balance-rr" ) ); 
     57    sprintf( count, "max_bonds=%s", 
     58             nvram_default_get( "bonding_number", "1" ) ); 
     59    eval( "insmod", "bonding", "miimon=100","downdelay=200","updelay=200", mode, count ); 
     60 
     61    static char word[256]; 
     62    char *next, *wordlist; 
     63 
     64    wordlist = nvram_safe_get( "bondings" ); 
     65    foreach( word, wordlist, next ) 
     66    { 
     67        char *port = word; 
     68        char *tag = strsep( &port, ">" ); 
     69 
     70        if( !tag || !port ) 
     71        { 
     72            break; 
     73        } 
     74        if (!strncmp(port,"ath",3) && nvram_nmatch("wdsap","%s_mode",port)) 
     75            { 
     76            sysprintf("ifconfig %s down",port); 
     77            sysprintf("iwpriv %s wdssep 0",port); 
     78            sysprintf("ifconfig %s up",port); 
     79            } 
     80        eval( "ifconfig", tag, "0.0.0.0", "up" ); 
     81        eval( "ifenslave", tag, port ); 
     82    } 
     83    int c = atoi( nvram_safe_get( "bonding_number" ) ); 
     84    int i; 
     85 
     86    for( i = 0; i < c; i++ ) 
     87    { 
     88        sprintf( word, "bond%d", i ); 
     89        char *br = getRealBridge( word ); 
     90 
     91        if( br ) 
     92            br_add_interface( br, word ); 
     93 
     94    } 
     95} 
     96 
     97int isBond(char *ifname) 
     98{ 
     99    static char word[256]; 
     100    char *next, *wordlist; 
     101 
     102    wordlist = nvram_safe_get( "bondings" ); 
     103    foreach( word, wordlist, next ) 
     104    { 
     105        char *port = word; 
     106        char *tag = strsep( &port, ">" ); 
     107 
     108        if( !tag || !port ) 
     109        { 
     110            break; 
     111        } 
     112        if (!strcmp(port,ifname)) 
     113            return 1; 
     114    } 
     115    return 0; 
     116} 
     117 
    90118#endif 
Note: See TracChangeset for help on using the changeset viewer.