RE: wrt54g
"Simon, Mike" <[email protected]>
| Newsgroups | gmane.network.nocat |
|---|---|
| Message-ID | <73D97F9B756ED1119A7E00A0C906979F08055AEF@WWW> |
Here is some signal handle code that I use to reload my nocat.conf file w/o
restarting the gateway:
in Gateway.pm I have :
local $SIG{PIPE} = "IGNORE";
local $SIG{CHLD} = sub { $kids++ };
local $SIG{HUP} = sub { $hup++ };
local $SIG{USR1} = sub { $usr1++ };
local $SIG{USR2} = sub { $usr2++ };
and here is the sub for usr1 and usr2 that are contained in the while(1)
loop of Gateway.pm:
# Handle connections as they come in.
#
while ( 1 ) {
# Spend some time waiting for something to happen.
# If poll_socket doesn't return true, we're a child who's done.
#
$self->poll_socket or return;
# See if any logins have reached their timeout period.
if (time > $expired) {
$self->check_expired;
$expired += 10;
}
# See if any sessions have been inactive too long
if ( $self->{MaxMissedARP} and time >= $inactive ) {
$self->check_inactive;
$inactive += $self->{IdleTimeout};
}
# Have we caught a HUP? If so, re-initialize log files.
if ( $hup ) {
$self->open_log;
$self->log( 6, "HUP received, resetting log file." );
$hup = 0;
}
# Have we caught a USR1? If so, re-read config.
if ( $usr1 ) {
$self->open_log;
#hmm... how to reread nocat.conf;
$self->read_config('/usr/local/aaa_gw/nocat.conf');
$self->log( 6, "USR1 received, resetting log file AND rereading
nocat.conf" );
$usr1 = 0;
}
# Have we caught a USR2? If so log it.
if ( $usr2 ) {
$self->open_log;
#hmm... how to reread nocat.conf;
$self->log( 6, "USR2 received, resetting log file, USR2 avail
for future use." );
$usr2 = 0;
}
# See if any kids have expired, reap zombies
if ( $kids ) {
1 until ( wait == -1 );
$kids = 0;
}
} # loop forever
}
-----Original Message-----
From: Ian White [mailto:[email protected]]
Sent: Wednesday, May 18, 2005 1:20 PM
To: [email protected]
Subject: [NoCat] wrt54g
Has anyone put together a requirement spec for auth in nocatsplash ?
Currently the wrt can use :-
nocat
chillispot
wifidog
With chillispot having the radius server support etc.
I've been using nocatsplash with locustworld for a couple of years, and they
use external sh script call to validate a user/name password, but its not
without problems.
The main problem with external code is getting instructions back to nocat,
i.e. if you want to kick off a mac, you can't inform nocat. You can delete
the iptable rule, but then the nocat status tables still have that user as
validated.
I guess it depends on how secure you want the authorication process, and how
much you want nocatsplash to do.
For example, we've been looking at nocat on ewrt, and deciding if we can add
a simple pin code to the process so that for wifi cafe, someone has to get
today's pin to get access. Now I could add the pin to the conf file, and
read it on restart, but restart wipes the current status and iptables.
The other option is to add a signal handler that tells nocat to pick up a
new config/command file. i.e. on pin change, signal nocatsplash, signal
handler picks up the new pin, and stores it for login checking.
If you don't want radius inbedded then go the LW route, and call an external
script which calls wget/curl and gets a valid/not valid from an external.
I'd also be interest in signal to pick up commands... i.e. disconnect this
mac, ban this mac etc....
My issue would be working with the tpool etc as I'm not used to that
process.
Thoughts ?
_______________________________________________
NoCat mailing list
[email protected]
http://lists.nocat.net/mailman/listinfo/nocat