Changeset 10759


Ignore:
Timestamp:
11/05/08 03:01:03 (5 years ago)
Author:
BrainSlayer
Message:

radius support for rt2880

Location:
src/router/services
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/router/services/Makefile

    r10747 r10759  
    623623  CFLAGS += -DHAVE_WHRG300N 
    624624endif 
     625ifeq ($(CONFIG_NAS),y) 
     626  CFLAGS += -DHAVE_NAS 
     627endif 
    625628 
    626629vpath %.c sysinit sysinit/switchlib services tools networking $(TOP)/shared $(SRCBASE)/rts/src 
  • src/router/services/networking/rt2880.c

    r10755 r10759  
    542542 
    543543} 
     544 
     545 
     546void start_radius(void) 
     547{ 
     548    char psk[64]; 
     549 
     550    // wrt-radauth $IFNAME $server $port $share $override $mackey $maxun & 
     551    char ifname[32]; 
     552 
     553    char *prefix="wl0"; 
     554    strcpy( ifname, "ra0"); 
     555 
     556    if( nvram_nmatch( "1", "%s_radauth", prefix ) 
     557        && nvram_nmatch( "ap", "%s_mode", prefix ) ) 
     558    { 
     559        char *server = nvram_nget( "%s_radius_ipaddr", prefix ); 
     560        char *port = nvram_nget( "%s_radius_port", prefix ); 
     561        char *share = nvram_nget( "%s_radius_key", prefix ); 
     562        char type[32]; 
     563 
     564        sprintf( type, "%s_radmactype", prefix ); 
     565        char *pragma = ""; 
     566 
     567        if( nvram_default_match( type, "0", "0" ) ) 
     568            pragma = "-n1 "; 
     569        if( nvram_match( type, "1" ) ) 
     570            pragma = "-n2 "; 
     571        if( nvram_match( type, "2" ) ) 
     572            pragma = "-n3 "; 
     573        if( nvram_match( type, "3" ) ) 
     574            pragma = ""; 
     575        sleep( 1 );             // some delay is usefull 
     576        sysprintf( "wrt-radauth %s %s %s %s %s %s %s %s &", pragma, ifname, 
     577                   server, port, share, nvram_nget( "%s_radius_override", 
     578                                                    prefix ), 
     579                   nvram_nget( "%s_radmacpassword", prefix ), 
     580                   nvram_nget( "%s_max_unauth_users", prefix ) ); 
     581    } 
     582 
     583} 
     584 
    544585 
    545586void configure_wifi( void )     // madwifi implementation for atheros based 
     
    9661007        } 
    9671008    } 
    968  
     1009    start_radius(); 
    9691010} 
    9701011 
  • src/router/services/services/wpa.c

    r10736 r10759  
    2020 * $Id: 
    2121 */ 
     22#ifdef HAVE_NAS 
     23 
    2224#include <unistd.h> 
    2325#include <string.h> 
     
    819821    return; 
    820822} 
     823#endif 
Note: See TracChangeset for help on using the changeset viewer.