Changeset 10910
- Timestamp:
- 11/14/08 00:19:54 (5 years ago)
- Location:
- src/router
- Files:
-
- 3 edited
-
httpd/visuals/dd-wrt.c (modified) (1 diff)
-
services/networking/madwifi.c (modified) (1 diff)
-
services/services/bonding.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/httpd/visuals/dd-wrt.c
r10904 r10910 2097 2097 websWrite( wp, "<div class=\"label\">Bonding Type</div>\n", count ); 2098 2098 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", 2100 2100 nvram_default_get( "bonding_type", "balance-rr" ) ); 2101 2101 websWrite( wp, " Bonding Interfaces " ); -
src/router/services/networking/madwifi.c
r10850 r10910 1247 1247 sysprintf("iwpriv %s wds 1",var); 1248 1248 1249 #ifdef HAVE_BONDING 1250 if( !strcmp( m, "wdsap" ) && !isBond(var)) 1251 #else 1249 1252 if( !strcmp( m, "wdsap" ) ) 1253 #endif 1250 1254 sysprintf("iwpriv %s wdssep 1",var); 1251 1255 else 1252 sysprintf("iwpriv %s wdssep 1",var);1256 sysprintf("iwpriv %s wdssep 0",var); 1253 1257 1254 1258 sysprintf("iwpriv %s hostroaming 0",var); -
src/router/services/services/bonding.c
r10889 r10910 26 26 #include <utils.h> 27 27 #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 }69 28 void stop_bonding( void ) 70 29 { … … 88 47 } 89 48 49 void 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 97 int 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 90 118 #endif
Note: See TracChangeset
for help on using the changeset viewer.
