netpass-devel Mailing List for NetPass (Page 12)
Brought to you by:
jeffmurphy
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(39) |
May
(103) |
Jun
(89) |
Jul
(22) |
Aug
(100) |
Sep
(21) |
Oct
(5) |
Nov
|
Dec
(7) |
2006 |
Jan
(25) |
Feb
(8) |
Mar
(12) |
Apr
(2) |
May
|
Jun
(1) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: jeff m. <jef...@us...> - 2005-06-03 17:00:05
|
Update of /cvsroot/netpass/NetPass/www/htdocs/Admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16208/www/htdocs/Admin Modified Files: auth.mhtml autohandler switch.mhtml Log Message: switch config gui Index: switch.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/switch.mhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- switch.mhtml 2 Jun 2005 19:59:08 -0000 1.3 +++ switch.mhtml 3 Jun 2005 16:59:55 -0000 1.4 @@ -4,6 +4,8 @@ $submitButton => ''; $switch => ''; $vlanmap => ''; + $rocomm => ''; + $rwcomm => ''; </%args> <%perl> $switch = pop @$switch if (ref($switch) eq "ARRAY"); @@ -29,9 +31,14 @@ (ref($lstat) eq "HASH") ) { if ($lstat->{'user'} eq $whoami) { - $vm = join(';', grep(!/^\-/, @$vlanmap)); + $vm = $vlanmap; + $vm = join(';', grep(!/^\-/, @$vlanmap)) if (ref($vlanmap) eq "ARRAY"); my $rv = $np->cfg->setVlanMap($switch, $vm); push @err, $rv if ($rv); + $rv = $np->cfg->setCommunities(-switch => $switch, + -readonly => $rocomm, + -readwrite => $rwcomm); + push @err, $rv if ($rv); $np->cfg->save(-user => $whoami) if ($#err == -1); } else { push @err, "The config is not locked."; @@ -45,7 +52,12 @@ </%perl> <h2> Switch Configuration </h2> -Select a switch, or add a new one. Once selected, edit the port-to-vlan mappings. + +Select a switch, or add a new one. Once selected, edit the port-to-vlan mappings. To delete +a switch, remove all of its mappings. This will not delete the switch from any +<a href="network.mhtml">networks</a> it may be assigned to. It will only delete it from this +section of the config. + <P> <B>Warnings: <ul> <li>No error checking is performed, at present, to detect overlaps or malformed VLAN mappings. Double @@ -106,6 +118,11 @@ name='deleteVlan' id='deleteVlan' value='Delete Vlan'> </td> </tr> +<tr class='vlanmapRow' id='commnameRow' style='display:none;'> +<td style='text-align:right;'>Read Community:<BR>(Read/)Write Community:</td> +<td colspan=2><input size=16 name='rocomm' value='<%$rocomm%>'><BR> +<input size=16 name='rwcomm' value='<%$rwcomm%>'></td> +</tr> </table> </form> @@ -115,6 +132,7 @@ <script language='JavaScript'> % if ($switch && ($switch ne $WH)) { showHideObj2('vlanmapRow'); +showHideObj2('commnameRow'); % } </script> Index: autohandler =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/autohandler,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- autohandler 2 Jun 2005 19:04:54 -0000 1.13 +++ autohandler 3 Jun 2005 16:59:55 -0000 1.14 @@ -39,7 +39,7 @@ <a class="sbLinks" href="/Admin/gencfg.mhtml" title="">General</a><br> <a class="sbLinks" href="/Admin/network.mhtml" title="">Network</a><br> <a class="sbLinks" href="/Admin/netgroups.mhtml" title="">Netgroup</a><br> -<a class="sbLinks" href="/Admin/switch.mhtml" title="">VLAN Map</a><br> +<a class="sbLinks" href="/Admin/switch.mhtml" title="">Switches</a><br> <!--<a class="sbLinks" href="/Admin/urlfilter.mhtml" title="">URL Filter</a><br>--> <a class="sbLinks" href="/Admin/greset.mhtml" title="">Global Reset</a><br> <a class="sbLinks" href="/Admin/Scan/ids.mhtml" title="">IDS Config</a><br> Index: auth.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/auth.mhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- auth.mhtml 3 May 2005 16:13:29 -0000 1.2 +++ auth.mhtml 3 Jun 2005 16:59:55 -0000 1.3 @@ -1,7 +1,19 @@ <%doc> </%doc> <%args> + $auth_method => ''; + $admin_auth_method => ''; </%args> +<%perl> +my ($isRoot, $junk) = $m->comp('/Admin/MemberOf', 'acl' => [ 'Admin' ], 'group' => 'default'); +if (!$isRoot) { + print qq{<p class='error'>Sorry, you don't have access to this form.</P>}; + return; +} +my $WH = "----------------------"; +my $aa = $np->cfg->policy(-key => 'ADMIN_AUTH_METHOD'); +my $ca = $np->cfg->policy(-key => 'AUTH_METHOD'); +</%perl> <script language='JavaScript'><!-- var pageDirty = false; @@ -16,25 +28,35 @@ <TR> <TD CLASS='left'>Client Auth Method</TD> <TD CLASS='right'> - -<%perl> -print $q->popup_menu ( - -name => 'policy:AUTH_METHOD', - -default => $np->cfg->policy(-key => 'AUTH_METHOD'), +<%$q->popup_menu ( + -name => 'auth_method', + -default => $ca, -values => [ 'NetPass::Auth::DB' , 'NetPass::Auth::Radius', 'NetPass::Auth::LDAP', 'NetPass::Auth::Unix' ] - ); -print "</TD></TR>"; - -print "<TR>"; -print "<TD CLASS='left'>Admin Auth Method</TD>"; -print "<TD CLASS='right'>"; -print $q->popup_menu ( - -name => 'policy:ADMIN_AUTH_METHOD', - -default => $np->cfg->policy(-key => 'ADMIN_AUTH_METHOD'), + )%> +</TD></TR> +<TR><TD> +% if ($ca eq "Netpass::Auth::Radius") { +% $m->comp('/Admin/FormAuthRadius', %ARGS); +% elsif ($ca eq "Netpass::Auth::LDAP") { +% $m->comp('/Admin/FormAuthLDAP', %ARGS); +% } +</tD></TR> +<TR> +<TD CLASS='left'>Admin Auth Method</TD> +<TD CLASS='right'> +<%$q->popup_menu ( + -name => 'admin_auth_method', + -default => $aa, -values => [ 'NetPass::Auth::DB' , 'NetPass::Auth::Radius', 'NetPass::Auth::LDAP', 'NetPass::Auth::Unix' ] - ); -print "</TD></TR>"; -</%perl> + )%> +</TD></TR> +<TR><TD> +% if ($aa eq "Netpass::Auth::Radius") { +% $m->comp('/Admin/FormAuthRadius', 'prefix' => 'admin_', %ARGS); +% elsif ($aa eq "Netpass::Auth::LDAP") { +% $m->comp('/Admin/FormAuthLDAP', 'prefix' => 'admin_', %ARGS); +% } +</tD></TR> </table> |
From: jeff m. <jef...@us...> - 2005-06-03 17:00:05
|
Update of /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16208/www/htdocs/OSSTemplate/js Modified Files: switch.js Log Message: switch config gui Index: switch.js =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js/switch.js,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- switch.js 2 Jun 2005 19:59:09 -0000 1.2 +++ switch.js 3 Jun 2005 16:59:55 -0000 1.3 @@ -6,6 +6,7 @@ for (var i = vm.options.length-1 ; i > 0 ; i--) { vm.options[i].selected = true; } + vm.options[0].selected = false; } else { dbg (1, RN + ": cant find vlanmap field"); } @@ -34,6 +35,12 @@ unHighLightList("switch"); sw.options[sw.options.length-1].selected = true; sortList("switch"); + unHighLightList("vlanmap"); + var vm = document.getElementById("vlanmap"); + if (vm) { + for(i = vm.options.length-1 ; i > 0 ; i--) + vm.options[i] = undefined; + } } else { dbg (1, RN + ": switch already exists: " + o.value); } |
From: jeff m. <jef...@us...> - 2005-06-03 17:00:04
|
Update of /cvsroot/netpass/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16208 Modified Files: MANIFEST Log Message: switch config gui Index: MANIFEST =================================================================== RCS file: /cvsroot/netpass/NetPass/MANIFEST,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- MANIFEST 2 Jun 2005 19:04:53 -0000 1.43 +++ MANIFEST 3 Jun 2005 16:59:54 -0000 1.44 @@ -162,6 +162,7 @@ www/components/CookieDetect www/components/Audit www/components/OSDetect +www/components/FormAuthRadius www/htdocs/Admin/Editor/edit.mhtml www/htdocs/Admin/Editor/index.mhtml www/htdocs/Admin/Editor/view.mhtml |
From: jeff m. <jef...@us...> - 2005-06-03 17:00:04
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16208/lib/NetPass Modified Files: Config.pm Log Message: switch config gui Index: Config.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/Config.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- Config.pm 2 Jun 2005 19:05:22 -0000 1.44 +++ Config.pm 3 Jun 2005 16:59:55 -0000 1.45 @@ -653,7 +653,7 @@ Return the list of switches defined for this E<lt>networkE<gt>. Returns an ARRAY REF on success, C<undef> on failure. If "network" is "", then we return all configured -switches. +switches (all switches in all networks, vlanmaps and community name sections). =cut @@ -679,6 +679,10 @@ $switches{$sw} = 1; } } + @switches = ($self->{'cfg'}->keys('vlanmap'), $self->{'cfg'}->obj('snmpcommunities')->keys('host')); + foreach my $sw (@switches) { + $switches{$sw} = 1; + } } return [ keys %switches ]; @@ -1681,6 +1685,80 @@ return 0; } +=head2 $cfg-E<gt>setCommunities(-switch => '', -readonly => '', -readwrite => '') + +Set the readonly and readwrite community names to use when +accessing the specified switch. Switch may be a network, in CIDR +notation. Setting readonly and readwrite to '' causes the switch to +be deleted from the communities section of the config (but not from +the 'network' section or 'vlanmap' section) + +RETURNS + + 0 on success + "invalid parameters" on failure + "..." on failure + +=cut + +sub setCommunities { + my $self = shift; + + my $parms = parse_parms({ + -parms => \@_, + -required => [ qw(-switch) ], + -defaults => { + -switch => '', + -readonly => '', + -readwrite => '' + } + } + ); + + return "invalid parameters\n".Carp::longmess (Class::ParmList->error) + if (!defined($parms)); + + my ($sw, $ro, $rw) = $parms->get('-switch', '-readonly', '-readwrite'); + + if ($sw =~ /\/\d{1,2}$/) { + # looks like CIDR + if (!recur_exists($self->{'cfg'}, "snmpcommunities", "network")) { + $self->{'cfg'}->obj("snmpcommunities")->network({}); + } + if (!recur_exists($self->{'cfg'}, "snmpcommunities", 'network', $sw)) { + $self->{'cfg'}->obj('snmpcommunities')->obj('network')->$sw({}); + } + + if ($ro eq "" && $rw eq "") { + $self->{'cfg'}->obj('snmpcommunities')->obj('network')->delete($sw); + } else { + $self->{'cfg'}->obj('snmpcommunities')->obj('network')->$sw({'read' => $ro, + 'write' => $rw}); + } + return 0; + } + + if (!recur_exists($self->{'cfg'}, "snmpcommunities", 'host')) { + $self->{'cfg'}->obj('snmpcommunities')->host({}); + } + + if (!recur_exists($self->{'cfg'}, "snmpcommunities", 'host', $sw)) { + $self->{'cfg'}->obj('snmpcommunities')->obj('host')->$sw({}); + } + + if ($ro eq "" && $rw eq "") { + _log("DEBUG", "ro/rw empty. del $sw\n"); + $self->{'cfg'}->obj('snmpcommunities')->obj('host')->delete($sw); + } else { + $self->{'cfg'}->obj('snmpcommunities')->obj('host')->$sw({'read' => $ro, + 'write' => $rw}); + } + + return 0; +} + + + =head2 my ($r, $w) = $cfg-E<gt>getCommunities(hostname) Given a hostname (or IP address) lookup return the @@ -2091,6 +2169,17 @@ return $s; } + +=head2 $vlanmap = getVlanMap($switch) + +Retrieve an encoded vlanmap. + +RETURNS + scalar on success + undef on failure (or switch doesnt exist) + +=cut + sub getVlanMap { my $self = shift; my $sw = shift; @@ -2102,13 +2191,28 @@ return undef; } +=head2 (void) setVlanMap($switch, $vlanmap) + +Pass in an encoded vlanmap. If vlanmap is "" then it deletes +the switch from the vlanmap portion of the config. + +RETURNS + nothing useful + +=cut + sub setVlanMap { my $self = shift; my $sw = shift; my $vm = shift; $sw ||= ''; - $self->{'cfg'}->obj('vlanmap')->$sw($vm); + $vm ||= ''; + if ($vm ne "") { + $self->{'cfg'}->obj('vlanmap')->$sw($vm); + } else { + $self->{'cfg'}->obj('vlanmap')->delete($sw); + } return undef; } |
From: Matt <mt...@us...> - 2005-06-03 15:32:22
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5627 Modified Files: API.pm Log Message: Index: API.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/API.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- API.pm 3 Jun 2005 15:15:13 -0000 1.18 +++ API.pm 3 Jun 2005 15:32:11 -0000 1.19 @@ -199,7 +199,7 @@ -mac => $mac, -ip => $ip, -user => 'npapi', - @msgs + -msg => \@msgs, ); return ("nothing") if $mode eq "not_really"; |
From: Matt <mt...@us...> - 2005-06-03 15:17:02
|
Update of /cvsroot/netpass/NetPass/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29793 Modified Files: npsubagent.pl Log Message: Index: npsubagent.pl =================================================================== RCS file: /cvsroot/netpass/NetPass/bin/npsubagent.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- npsubagent.pl 1 Jun 2005 18:11:24 -0000 1.4 +++ npsubagent.pl 3 Jun 2005 15:16:53 -0000 1.5 @@ -4,8 +4,8 @@ use NetSNMP::agent (':all'); use NetSNMP::OID (':all'); use NetSNMP::ASN (':all'); -use SNMP; use FileHandle; +use SNMP; my $BASEOID = ".1.3.6.1.4.1.8072.9999.9999.7375"; my $BRCTLCMD = "/usr/local/sbin/brctl showmacs br0 |"; @@ -83,8 +83,10 @@ exit 0; sub sendTrap { + my($port, $traptype, $traphost, $traphostcom) = @_; my $enterpriseoid; + my $generic; my $portoidbase = $BASEOID.'1'; print "sending linkup trap\n"; @@ -97,24 +99,27 @@ if ($traptype eq "up") { $enterpriseoid = ".1.3.6.1.4.1.45.3.35.1"; + $generic = 3; } else { $enterpriseoid = ".1.3.6.1.4.1.45.3.30.2"; + $generic = 2; } my $snmp = new SNMP::Session( DestHost => $traphost, RemotePort => 162, - Community => $traphostcom, ); if (!defined($snmp)) { - warn "Unable to connect to $traphost with community = $traphostcom"; + warn "Unable to connect to $traphost"; return -1; } print "about to send trap\n"; $snmp->trap ( - oid => $enterpriseoid, - uptime => 1234, + enterprise => $enterpriseoid, + agent => $traphost, + generic => $generic, + specific => 0, [[$portoidbase, $port, 1]] ); print "trap sent\n"; |
From: Matt <mt...@us...> - 2005-06-03 15:15:21
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29126 Modified Files: API.pm Log Message: Index: API.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/API.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- API.pm 2 Jun 2005 20:37:42 -0000 1.17 +++ API.pm 3 Jun 2005 15:15:13 -0000 1.18 @@ -223,17 +223,37 @@ _log("ERROR", "Unknown Error"); return undef; } + } - my $rv2 = $np->db->updateResult ( - -mac => $mac, - -status => "QUAR", - ); + my $rv2 = $np->db->updateRegister ( + -mac => $mac, + -status => "QUAR", + ); - if ($rv2 ne 1) { - _log("ERROR", "Unable to quarantine $mac"); - return undef; - } + if ($rv2 ne 1) { + _log("ERROR", "Unable to quarantine $mac"); + return undef; + } + + my($sw, $po, $m2p, $p2m) = $np->findOurSwitchPort($mac, $ip); + + if (!defined($sw) || !defined($po)) { + _log("ERROR", "unable to determine switch for $mac $ip\n"); + return undef; + } + + my $rv3 = $np->db->requestMovePort( + -switch => $sw, + -port => $po, + -vlan => 'quarantine', + -by => 'npapi', + ); + + if (!$rv3) { + _log("ERROR", "$mac requestMovePort($sw, $po) failed\n"); + return undef; } + return ("quarantined"); } |
From: jeff m. <jef...@us...> - 2005-06-03 15:13:34
|
Update of /cvsroot/netpass/NetPass/www/htdocs/Admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28441/www/htdocs/Admin Modified Files: qc.mhtml Log Message: bug Index: qc.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/qc.mhtml,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- qc.mhtml 17 May 2005 20:34:28 -0000 1.22 +++ qc.mhtml 3 Jun 2005 15:13:20 -0000 1.23 @@ -651,7 +651,7 @@ } elsif ($args->{"status:$mac"} =~ /^(UNQUAR|PUNQUAR)$/) { - push @params, undef; + #push @params, undef; } else { LA("ERROR", $m->session->{'username'}, " invalid status specified for $mac ", |
From: Matt <mt...@us...> - 2005-06-02 20:37:52
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5895 Modified Files: API.pm Log Message: Index: API.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/API.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- API.pm 7 May 2005 04:31:16 -0000 1.16 +++ API.pm 2 Jun 2005 20:37:42 -0000 1.17 @@ -219,10 +219,20 @@ _log("ERROR", "database failure"); return undef; } - if ($rv ne "duplicate result" && $rv != 0) { + if ($rv ne "duplicate result" && $rv ne 0) { _log("ERROR", "Unknown Error"); return undef; } + + my $rv2 = $np->db->updateResult ( + -mac => $mac, + -status => "QUAR", + ); + + if ($rv2 ne 1) { + _log("ERROR", "Unable to quarantine $mac"); + return undef; + } } return ("quarantined"); } |
From: Matt <mt...@us...> - 2005-06-02 20:34:58
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4403 Modified Files: DB.pm Log Message: Index: DB.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/DB.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- DB.pm 2 Jun 2005 19:59:08 -0000 1.44 +++ DB.pm 2 Jun 2005 20:34:49 -0000 1.45 @@ -2668,25 +2668,54 @@ return $self->{'dbh'}->commit; } - - - =head2 updateRegister(-mac => '', -status => [QUAR|PQUAR|UNQUAR|PUNQUAR]) Update the register table for the given MAC address. RETURNS - 0 on success + 1 on success "invalid parameters" routine called improperly - "mac not exist" given mac doesnt exist (use registerHost first) + "mac doesnt exist" given mac doesnt exist (use registerHost first) "..." db error =cut sub updateRegister { - my $self = shift; - # params... + my $self = shift; + + $self->reconnect() || return undef; + my $parms = parse_parms({ + -parms => \@_, + -legal => [ qw(-mac -status) ], + -defaults => { -mac => '', + -status => '', + } + } + ); + + return "invalid params\n".Carp::longmess(Class::ParmList->error) if (!defined($parms)); + my ($mac, $status) = $parms->get('-mac', '-status'); + + if ($mac !~ /^[0-9a-fA-F]+$/ || $status !~ /^(QUAR|PQUAR|UNQUAR|PUNQUAR)$/) { + return "invalid parameters"; + } + + $mac = NetPass::padMac($mac); + + my $sql = "UPDATE register SET status=? WHERE macAddress = ?"; + my $sth = $self->{'dbh'}->prepare($sql); + my $rv = $sth->execute($status, $mac); + + if ($rv == 0) { + return "mac doesnt exist"; + } + + if ($rv < 0) { + _log("ERROR", "db failure ".$self->{'dbh'}->errstr); + return "db failure ".$self->{'dbh'}->errstr; + } + return 1; } |
From: jeff m. <jef...@us...> - 2005-06-02 20:02:36
|
Update of /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20346/www/htdocs/OSSTemplate/js Modified Files: network.js Log Message: switch config Index: network.js =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js/network.js,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- network.js 20 May 2005 20:32:59 -0000 1.4 +++ network.js 2 Jun 2005 20:02:27 -0000 1.5 @@ -223,3 +223,4 @@ dbg(1, RN); if (o && o.value == "Add Switch...") o.value = ''; } + |
From: jeff m. <jef...@us...> - 2005-06-02 19:59:27
|
Update of /cvsroot/netpass/NetPass/www/htdocs/Admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18786/www/htdocs/Admin Modified Files: switch.mhtml Log Message: switch config Index: switch.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/switch.mhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- switch.mhtml 2 Jun 2005 19:04:54 -0000 1.2 +++ switch.mhtml 2 Jun 2005 19:59:08 -0000 1.3 @@ -1,8 +1,9 @@ <%doc> </%doc> <%args> - $switch => ''; - $vlanmap => ''; + $submitButton => ''; + $switch => ''; + $vlanmap => ''; </%args> <%perl> $switch = pop @$switch if (ref($switch) eq "ARRAY"); @@ -20,16 +21,27 @@ $m->comp('/Admin/LockConfig', 'enableWhenLocked' => [ 'addSwitch', 'submitButton' ], 'init' => 0); my $lstat = $np->db->isConfigLocked(); -my @err; +my @err = (); +my $vm = ''; + +if ( $switch && ($switch ne $WH) && + ($submitButton eq "Commit Changes") && + (ref($lstat) eq "HASH") ) { -if ( $switch && ($switch ne $WH) && (ref($lstat) eq "HASH") ) { if ($lstat->{'user'} eq $whoami) { - + $vm = join(';', grep(!/^\-/, @$vlanmap)); + my $rv = $np->cfg->setVlanMap($switch, $vm); + push @err, $rv if ($rv); + $np->cfg->save(-user => $whoami) if ($#err == -1); } else { push @err, "The config is not locked."; } } +if ($#err > -1) { + print "<P class='error'>The following errors occurred:</P> "; + print "<OL><LI class='error'>", join("<LI class='error'>", @err), "</OL>"; +} </%perl> <h2> Switch Configuration </h2> @@ -52,7 +64,6 @@ <%perl> my $allSwitches = $np->cfg->getSwitches(); my $tlh; -my $vm; if ($switch) { $vm = $np->cfg->getVlanMap($switch); if (defined($vm)) { |
From: jeff m. <jef...@us...> - 2005-06-02 19:59:26
|
Update of /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18786/www/htdocs/OSSTemplate/js Modified Files: switch.js Log Message: switch config Index: switch.js =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js/switch.js,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- switch.js 2 Jun 2005 19:04:55 -0000 1.1 +++ switch.js 2 Jun 2005 19:59:09 -0000 1.2 @@ -1,4 +1,15 @@ function switch_onclick_submitButton() { + var RN = "switch_onclick_submitButton"; + dbg(1, RN); + var vm = document.getElementById('vlanmap'); + if (vm) { + for (var i = vm.options.length-1 ; i > 0 ; i--) { + vm.options[i].selected = true; + } + } else { + dbg (1, RN + ": cant find vlanmap field"); + } + return false; } function switch_onfocus_addSwitch(o) { @@ -84,11 +95,8 @@ dbg(1, RN); var vm = document.getElementById('vlanmap'); if (vm) { - dbg(1, RN + ": len=" + vm.options.length); for (var i = vm.options.length-1 ; i > 0 ; i--) { - dbg(1, RN + ": check " + i); if (vm.options[i].selected) { - dbg (1, RN + ": del " + i + " " + vm.options[i].value); vm.options[i] = undefined; } } |
From: jeff m. <jef...@us...> - 2005-06-02 19:59:24
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18786/lib/NetPass Modified Files: DB.pm Log Message: switch config Index: DB.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/DB.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- DB.pm 2 Jun 2005 19:04:54 -0000 1.43 +++ DB.pm 2 Jun 2005 19:59:08 -0000 1.44 @@ -64,6 +64,7 @@ AutoCommit => 1 # commit on execute } ); + return undef if ( !defined($dbh) ); $self->{'dbh'} = $dbh; @@ -2290,7 +2291,9 @@ $sql .= " WHERE rev = ".$self->dbh->quote($r) if $r; $sql .= " WHERE rev = (select MAX(rev) FROM config)" if ($r == 0); - $rv = $self->dbh->selectall_arrayref($sql); + $self->reconnect() || return "db failure"; + + $rv = $self->{'dbh'}->selectall_arrayref($sql); return "db failure ".$self->dbh->errstr if (ref($rv) ne "ARRAY"); |
From: jeff m. <jef...@us...> - 2005-06-02 19:59:19
|
Update of /cvsroot/netpass/NetPass/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18786/bin Modified Files: resetport.pl Log Message: switch config Index: resetport.pl =================================================================== RCS file: /cvsroot/netpass/NetPass/bin/resetport.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- resetport.pl 19 May 2005 20:15:03 -0000 1.13 +++ resetport.pl 2 Jun 2005 19:59:08 -0000 1.14 @@ -122,7 +122,7 @@ my ($dbuser, $dbpass) = exists $opts{'U'} ? split('/', $opts{'U'}) : (undef, undef); -my $np = new NetPass(-cstr => exists $opts{'c'} ? $opts{'c'} : undef, +my $np = new NetPass(-cstr => exists $opts{'c'} ? $opts{'c'} : undef, -dbuser => $dbuser, -dbpass => $dbpass, -debug => exists $opts{'D'} ? 1 : 0, -quiet => exists $opts{'q'} ? 1 : 0); |
From: jeff m. <jef...@us...> - 2005-06-02 19:10:23
|
Update of /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23325/www/htdocs/OSSTemplate/js Modified Files: debug.js Log Message: bug fixes, switch config, snort stuff Index: debug.js =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js/debug.js,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- debug.js 2 Jun 2005 19:04:55 -0000 1.8 +++ debug.js 2 Jun 2005 19:10:13 -0000 1.9 @@ -1,4 +1,4 @@ -var DBGLEVEL = 1; +var DBGLEVEL = 0; var dbgwin; var browserType_IE = 0; |
From: jeff m. <jef...@us...> - 2005-06-02 19:05:33
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20933/lib/NetPass Modified Files: Config.pm Log Message: bug fixes, switch config, snort stuff Index: Config.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/Config.pm,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- Config.pm 2 Jun 2005 19:04:53 -0000 1.43 +++ Config.pm 2 Jun 2005 19:05:22 -0000 1.44 @@ -502,13 +502,13 @@ if (recur_exists($self->{'cfg'}, 'network', $nw, 'snort', 'mode')) { my $s = $self->{'cfg'}->obj('network')->obj($nw)->obj('snort')->value('mode'); - return $s if ($s =~ /^(enabled|disabled|not_really)$/); + return $s if ($s =~ /^(enabled|disabled|not_really)$/i); return 0; } if (recur_exists($self->{'cfg'}, 'snort', 'mode')) { my $s = $self->{'cfg'}->obj('snort')->value('mode'); - return $s if ($s =~ /^(enabled|disabled|not_really)$/); + return $s if ($s =~ /^(enabled|disabled|not_really)$/i); return 0; } |
From: jeff m. <jef...@us...> - 2005-06-02 19:05:06
|
Update of /cvsroot/netpass/NetPass/lib/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20551/lib/NetPass Modified Files: Config.pm DB.pm Log Message: bug fixes, switch config, snort stuff Index: Config.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/Config.pm,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- Config.pm 20 May 2005 20:32:59 -0000 1.42 +++ Config.pm 2 Jun 2005 19:04:53 -0000 1.43 @@ -2004,19 +2004,137 @@ return ($good == $v || $bad == $v) ? 1 : 0; } +=head2 $encodedTagList = encodeTagList($tlHref) -# tagList format: -# port1,port3-port5:good/bad;port7-port10:good/bad -# -# e.g. if the switch services multiple networks (2 in this case) -# -# 1,10-20:12/812;2-9,21-24:13/813 -# -# or more simply, you'll typically have: -# -# 1-24:12/812 -# -# where '12' is the 'good/normal' vlan and '812' is the quarantine +This routine is not a method. Given a tagList hash ref such as + + $tl->{'12/812'} = [ 1,2,3,5,6 ]; + $tl->{'13/813'} = [ 10,11,12,20,21 ]; + +encode it into the format: + + port1,port3-port5:good/bad;port7-port10:good/bad + +See also: expandTagList() + +Returns + "..." encoded tag list + "invalid parameters" routine called improperly + +=cut + +sub encodeTagList { + my $th = shift; + if (ref($th) ne "HASH") { + return "invalid parameters"; + } + + my $v = {}; + foreach my $port (keys %$th) { + my $val = $th->{$port}; + $val =~ s/\|/\//g; + if ( exists $v->{$val} ) { + $v->{$val} = [ $port ]; + } + else { + push @{$v->{$val}}, $port; + } + } + + # now we have th->{'12/812'} = [ 1,2,3,6,7,8 ] + # and we want to go to + # th->{'12/812'} = '1-3,6-8' + + foreach my $vlan (keys %$th) { + $th->{$vlan} = formatPorts($th->{$vlan}); + } + + +} + +sub formatPorts { + my $d = shift; + my $s = ""; + + foreach my $vid (keys %$d) { + my @t = sort {$a<=>$b} @{$d->{$vid}}; + + my $start = $t[0]; + my $prev = $start; + my $cur = $start; + + my @myline; + + for (my $i = 1 ; $i <= $#t ; $i++) { + $cur = $t[$i]; + if ($cur - $prev > 1) { + # we've hit a break + if ($start != $prev) { + push @myline, "$start-$prev"; + } else { + push @myline, "$start"; + } + $prev = $start = $cur ; + } else { + $prev = $cur; + } + } + + if ($start != $prev) { + push @myline, "$start-$prev"; + } else { + push @myline, "$start"; + } + + $s .= join(',', @myline).':'.$vid.';'; + } + return $s; +} + +sub getVlanMap { + my $self = shift; + my $sw = shift; + + $sw ||= ''; + if (recur_exists($self->{'cfg'}, 'vlanmap', $sw)) { + return $self->{'cfg'}->obj('vlanmap')->value($sw); + } + return undef; +} + +sub setVlanMap { + my $self = shift; + my $sw = shift; + my $vm = shift; + + $sw ||= ''; + $self->{'cfg'}->obj('vlanmap')->$sw($vm); + return undef; +} + +=head2 $tlHref = expandTagList($encodedTagList) + +This routine is not a method. Given an encoded tag list (vlanmap) like + + + tagList format: + port1,port3-port5:good/bad;port7-port10:good/bad + + e.g. if the switch services multiple networks (2 in this case) + + 1,10-20:12/812;2-9,21-24:13/813 + + or more simply, you'll typically have: + + 1-24:12/812 + + where '12' is the 'good/normal' vlan and '812' is the quarantine + +Return a hash ref with the port as the key and the vlan as the value. +So, for example, you'll have: $tl->{10} = '12|812'. For historical +reasons the "/" is converted to "|". + +=cut sub expandTagList { my $tl = shift; Index: DB.pm =================================================================== RCS file: /cvsroot/netpass/NetPass/lib/NetPass/DB.pm,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- DB.pm 17 May 2005 20:34:27 -0000 1.42 +++ DB.pm 2 Jun 2005 19:04:54 -0000 1.43 @@ -299,90 +299,6 @@ return 0; } - -=head2 setMessage(mac, message | url) - -This routine will set the message on an already registered MAC. It will over-write -any existing message. If the message begins with "http:" then the web front end -will assume it's a URL. Otherwise, the web frontend will assume it's text or HTML -code and display it appropriately. It's OK to set the message to C<undef>. Returns: - -=over 4 - -=item 1 - -on success - -=item 0 - -on failure (e.g. mac isnt registered) - -=back - -=cut - -sub setMessage { - my $self = shift; - my ($ma, $msg) = (shift, shift); - - #called by macIsReg .. $self->reconnect() || return 0; - - my $rv = $self->macIsRegistered($ma); - return 0 if ($rv < 1); - - if (defined($msg) && ($msg !~ /^null$/i)) { - $msg = $self->{'dbh'}->quote($msg); - } else { - $msg = 'NULL'; - } - - my $sql = "UPDATE register SET message = $msg WHERE macAddress = '$ma'"; - - _log ("DEBUG", "$ma setMessage to $msg (sql=$sql)\n"); - - return 1 if $self->{'dbh'}->do($sql); - - _log("ERROR", "setMessage failed: ".$self->{'dbh'}->errstr."\n"); - - return 0; -} - -=head2 $msg = getMessage(mac) - -This routine will get the message on an already registered MAC. Returns: - -=over 4 - -=item C<scalar> - -on success - -=item undef - -on failure or no message set - -=back - -=cut - -sub getMessage { - my $self = shift; - my $ma = shift; - - #called by macIsReg .. $self->reconnect() || return undef; - - my $rv = $self->macIsRegistered($ma); - return undef if ($rv == 0); - return undef if ($rv == -1); - - my $sql = "SELECT message FROM register WHERE macAddress = '$ma'"; - - my $a = $self->{'dbh'}->selectrow_arrayref($sql); - _log "ERROR", "select failed: ".$self->{'dbh'}->errstr."\n" - unless (defined($a) && (ref($a) eq "ARRAY")); - return $a->[0]; -} - =head2 $rv = getRegisterInfo(-mac => mac, -macs => [], -ip => ip, -ips => []) This routine will get the registered info on an already registered MAC. Returns: @@ -433,7 +349,7 @@ my ($mac, $macs, $ip, $ips) = $parms->get('-mac', '-macs', '-ip', '-ips'); - my $sql = "SELECT macAddress, ipAddress, lastSeen, registeredOn, status, message, username, OS, switchIP, switchPort, uqlinkup FROM register WHERE "; + my $sql = "SELECT macAddress, ipAddress, lastSeen, registeredOn, status, username, OS, switchIP, switchPort, uqlinkup FROM register WHERE "; if ($mac ne "") { $sql .= " macAddress = ".$self->dbh->quote($mac); $kfield = "macAddress"; @@ -2743,8 +2659,6 @@ - - sub commit { my $self = shift; $self->reconnect() || return 0; @@ -2754,6 +2668,24 @@ +=head2 updateRegister(-mac => '', -status => [QUAR|PQUAR|UNQUAR|PUNQUAR]) + +Update the register table for the given MAC address. + +RETURNS + + 0 on success + "invalid parameters" routine called improperly + "mac not exist" given mac doesnt exist (use registerHost first) + "..." db error + +=cut + +sub updateRegister { + my $self = shift; + # params... +} + =head1 AUTHOR |
From: jeff m. <jef...@us...> - 2005-06-02 19:05:06
|
Update of /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20551/www/htdocs/OSSTemplate/js Modified Files: debug.js Added Files: switch.js Log Message: bug fixes, switch config, snort stuff Index: debug.js =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/js/debug.js,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- debug.js 6 May 2005 20:14:06 -0000 1.7 +++ debug.js 2 Jun 2005 19:04:55 -0000 1.8 @@ -1,4 +1,4 @@ -var DBGLEVEL = 0; +var DBGLEVEL = 1; var dbgwin; var browserType_IE = 0; --- NEW FILE: switch.js --- function switch_onclick_submitButton() { } function switch_onfocus_addSwitch(o) { var RN = "switch_onfocus_addSwitch"; dbg(1, RN); if (o && o.value == "Add Switch...") o.value = ''; } function switch_onblur_addSwitch(o) { var RN = "switch_onblur_addSwitch"; dbg(1, RN); var sw = document.getElementById('switch'); if (sw && o.value != '') { if ( o.value.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/) ) { var exists = false; for(var i = 1 ; i < sw.options.length ; i++) { if (sw.options[i].value == o.value) exists = true; } if (!exists) { var no = new Option(o.value, o.value, false, false); sw.options[sw.options.length] = no; unHighLightList("switch"); sw.options[sw.options.length-1].selected = true; sortList("switch"); } else { dbg (1, RN + ": switch already exists: " + o.value); } } else { dbg (1, RN + ": " + o.value + " not an IP address."); } } o.value = 'Add Switch...'; } function switch_onchange_switch() { var RN = "switch_onchange_switch"; dbg (1, RN); var o = document.getElementById("switch"); if (!o) return; if(o.options[0].selected == true) { //IE o.options[0].selected == false; return; } document.forms[0].submit(); } function switch_onblur_addVlan(o) { var RN = "switch_onblur_addVlan"; dbg(1, RN); var vm = document.getElementById('vlanmap'); if (vm && o.value != '') { if (o.value.match(/^[\d\-\,]+:\d+\/\d+/)) { var exists = false; for (var i = 1 ; i < vm.options.length ; i++) { if (vm.options[i].value == o.value) exists = true; } if (!exists) { var no = new Option(o.value, o.value, false, false); vm.options[vm.options.length] = no; unHighLightList("vlanmap"); vm.options[vm.options.length-1].selected = true; sortList("vlanmap"); } else { dbg (1, RN + ": " + o.value + " already exists in vlanmap"); } } else { dbg(1, RN + ": " + o.value + " does not match /^[\d\-\,]+:\d+\/\d+/"); } } o.value = 'Add Vlan Map...'; } function switch_onfocus_addVlan(o) { var RN = "switch_onfocus_addVlan"; dbg(1, RN); if (o && o.value == "Add Vlan Map...") o.value = ''; } function switch_onclick_deleteVlan() { var RN = "switch_onclick_deleteVlan"; dbg(1, RN); var vm = document.getElementById('vlanmap'); if (vm) { dbg(1, RN + ": len=" + vm.options.length); for (var i = vm.options.length-1 ; i > 0 ; i--) { dbg(1, RN + ": check " + i); if (vm.options[i].selected) { dbg (1, RN + ": del " + i + " " + vm.options[i].value); vm.options[i] = undefined; } } } else { dbg (1, RN + ": cant find vlanmap field"); } return false; } |
From: jeff m. <jef...@us...> - 2005-06-02 19:05:05
|
Update of /cvsroot/netpass/NetPass/www/htdocs/Admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20551/www/htdocs/Admin Modified Files: autohandler network.mhtml switch.mhtml Log Message: bug fixes, switch config, snort stuff Index: switch.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/switch.mhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- switch.mhtml 8 May 2005 02:35:47 -0000 1.1 +++ switch.mhtml 2 Jun 2005 19:04:54 -0000 1.2 @@ -1,6 +1,131 @@ <%doc> </%doc> <%args> - $switch => ''; + $switch => ''; + $vlanmap => ''; </%args> -switch: <%$switch%> +<%perl> +$switch = pop @$switch if (ref($switch) eq "ARRAY"); +my ($isRoot, $junk) = $m->comp('/Admin/MemberOf', 'acl' => [ 'Admin' ], 'group' => 'default'); +if (!$isRoot) { + print qq{<p class='error'>Sorry, you don't have access to this form.</P>}; + return; +} + +my $ip = $ENV{'REMOTE_ADDR'}; +my $whoami = $m->session->{'username'}; +my $WH = "--Select a Switch--"; +my $WH2 = "----------------------"; + +$m->comp('/Admin/LockConfig', 'enableWhenLocked' => [ 'addSwitch', 'submitButton' ], 'init' => 0); +my $lstat = $np->db->isConfigLocked(); + +my @err; + +if ( $switch && ($switch ne $WH) && (ref($lstat) eq "HASH") ) { + if ($lstat->{'user'} eq $whoami) { + + } else { + push @err, "The config is not locked."; + } +} + +</%perl> + +<h2> Switch Configuration </h2> +Select a switch, or add a new one. Once selected, edit the port-to-vlan mappings. +<P> <B>Warnings: +<ul> +<li>No error checking is performed, at present, to detect overlaps or malformed VLAN mappings. Double +check what you enter to make sure it's correct! +<li>Be sure that you <I>exclude</I> any uplink/downlink ports. If you accidentally include them, it's likely +that the switch (or downstream switches) will lose all connectivity and +you'll need to reconfigure it/them via the console port. +</ul> +</B> + +<script language='JavaScript'><!-- +setWhereAmI('Configuration > Switch'); +DBG_init(); +--></script> + +<%perl> +my $allSwitches = $np->cfg->getSwitches(); +my $tlh; +my $vm; +if ($switch) { + $vm = $np->cfg->getVlanMap($switch); + if (defined($vm)) { + my $tlh = NetPass::Config::expandTagList($vm); + } +} + +</%perl> + +<form method='post'> +<table border='0' width=1000 id='switchConfig'> +<tr class='selector'> + <td class='selector'> + <%$q->popup_menu(-id => 'switch', -name => 'switch', -values => [ $WH, sort @$allSwitches ], + -default => $switch, -onchange => 'switch_onchange_switch();')%> + </td> + <td class='selector'> + <input id='addSwitch' name='addSwitch' size=20 value='Add Switch...' disabled + onblur='switch_onblur_addSwitch(this);' onfocus='switch_onfocus_addSwitch(this);'> + </td> + <td class='selector'> + <input type='submit' onclick='switch_onclick_submitButton();' + name='submitButton' id='submitButton' value='Commit Changes' disabled> + </td> +</tr> +<tr class='vlanmapRow' id='vlanmapRow' style='display:none;'> + <td class='vlanmapRow'> + <%$q->scrolling_list(-id => 'vlanmap', -name => 'vlanmap', -size=>5, + -values => [ $WH2, split(/;/, $vm) ], -multiple => 'true')%> + </td> + <td class='vlanmapRow'><input id='addVlan' name='addVlan' size=20 value='Add Vlan Map...' + onblur='switch_onblur_addVlan(this);' onfocus='switch_onfocus_addVlan(this);'><BR> + <B><U>Format examples:</U></B><BR> + <I>portA,portB-portF:unquar/quar</I><BR> + <I>1,5-7:101/201</I><BR> + <I>1-24:101/201</I><BR> + <I>1,2,3,4,5:101/201</I><BR> + </td> + <td class='vlanmapRow'><input type='submit' onclick='switch_onclick_deleteVlan();return false;' + name='deleteVlan' id='deleteVlan' value='Delete Vlan'> + </td> +</tr> +</table> +</form> + + +<script src="/resources/js/common.js" type="text/javascript"></script> +<script src="/resources/js/switch.js" type="text/javascript"></script> +<script language='JavaScript'> +% if ($switch && ($switch ne $WH)) { +showHideObj2('vlanmapRow'); +% } +</script> + +<%perl> + + +if (ref($lstat) eq "HASH") { + # the config is locked + if ($lstat->{'user'} eq $m->session->{'username'}) { + # by us, so show the unlock button + print qq{<script>lockConfig_results("OK lock");lockConfig_enableElements();</script>}; + } else { + # but not by us, show the force unlock button + print qq{<script>lockConfig_results("NOK lock $lstat->{'user'}");lockConfig_disableElements();</script>}; + } +} +elsif ($lstat) { + # there was a problem +} +else { + # the config is not locked, show the lock button + print qq{<script>lockConfig_results("OK unlock");lockConfig_disableElements();</script>}; +} + +</%perl> Index: autohandler =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/autohandler,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- autohandler 6 May 2005 03:09:33 -0000 1.12 +++ autohandler 2 Jun 2005 19:04:54 -0000 1.13 @@ -39,6 +39,7 @@ <a class="sbLinks" href="/Admin/gencfg.mhtml" title="">General</a><br> <a class="sbLinks" href="/Admin/network.mhtml" title="">Network</a><br> <a class="sbLinks" href="/Admin/netgroups.mhtml" title="">Netgroup</a><br> +<a class="sbLinks" href="/Admin/switch.mhtml" title="">VLAN Map</a><br> <!--<a class="sbLinks" href="/Admin/urlfilter.mhtml" title="">URL Filter</a><br>--> <a class="sbLinks" href="/Admin/greset.mhtml" title="">Global Reset</a><br> <a class="sbLinks" href="/Admin/Scan/ids.mhtml" title="">IDS Config</a><br> Index: network.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/network.mhtml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- network.mhtml 20 May 2005 20:32:59 -0000 1.8 +++ network.mhtml 2 Jun 2005 19:04:54 -0000 1.9 @@ -44,7 +44,7 @@ #print "<PRE>", Dumper(\%ARGS), "</PRE>"; my ($isRoot, $junk) = $m->comp('/Admin/MemberOf', 'acl' => [ 'Admin' ], 'group' => 'default'); if (!$isRoot) { - print qq{<p class='error'>Sorry, you don't have access to this form.}; + print qq{<p class='error'>Sorry, you don't have access to this form.</P>}; return; } |
From: jeff m. <jef...@us...> - 2005-06-02 19:05:03
|
Update of /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20551/www/htdocs/OSSTemplate/css Modified Files: site.css Log Message: bug fixes, switch config, snort stuff Index: site.css =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/OSSTemplate/css/site.css,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- site.css 6 May 2005 20:13:35 -0000 1.8 +++ site.css 2 Jun 2005 19:04:54 -0000 1.9 @@ -204,3 +204,32 @@ border-bottom: 2px solid black; border-top: 2px solid black; } + + +TABLE#switchConfig { + border-collapse: collapse; +} + +TABLE#switchConfig TD.left { + text-align: right; +} + +TABLE#switchConfig TD.selector { + text-align: center; + border-bottom: solid 1px black; + border-top: solid 1px black; + width: 33%; +} + +TABLE#switchConfig TR.selector { + border-bottom: 2px solid black; + border-top: 2px solid black; +} + +TABLE#switchConfig TD.vlanmapRow { + text-align: center; + width: 33%; +} + +TABLE#switchConfig TR.vlanmapRow { +} |
From: jeff m. <jef...@us...> - 2005-06-02 19:05:02
|
Update of /cvsroot/netpass/NetPass/bin/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20551/bin/test Added Files: formatPorts.pl Log Message: bug fixes, switch config, snort stuff --- NEW FILE: formatPorts.pl --- #!/opt/perl/bin/perl -w use strict; use lib '/opt/netpass/lib'; use NetPass::Config; my $h = { '12/812' => [ 1,2,3,10,11,12,20 ], '13/813' => [ 4,5,6,24,28,29,30 ] }; print NetPass::Config::formatPorts($h), "\n"; exit 0; |
From: jeff m. <jef...@us...> - 2005-06-02 19:05:01
|
Update of /cvsroot/netpass/NetPass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20551 Modified Files: MANIFEST Log Message: bug fixes, switch config, snort stuff Index: MANIFEST =================================================================== RCS file: /cvsroot/netpass/NetPass/MANIFEST,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- MANIFEST 17 May 2005 15:13:10 -0000 1.42 +++ MANIFEST 2 Jun 2005 19:04:53 -0000 1.43 @@ -5,6 +5,7 @@ bin/test/getMatchingNetwork.pl bin/test/policy.pl bin/test/getUsersGroups.pl +bin/test/formatPorts.pl bin/import_nessus_scans.pl bin/appstarter.pl bin/bulk_moveport.pl @@ -31,6 +32,7 @@ bin/quarantine_host.pl bin/lsconf.pl bin/rogue-dhcp-detect.pl +bin/npsubagent.pl bin/npurlfilter.pl doc/cron.monthly/mysql_binlog_rotate doc/logrotate.d/apache @@ -63,6 +65,7 @@ doc/npsnort.txt doc/netpass-install.sxw doc/snort-2.3.3-vlan.patch +doc/ebtablesnmpsetup.txt etc/netpass-example.conf etc/oui.txt install.d/logrotate.d/apache @@ -212,6 +215,7 @@ www/htdocs/OSSTemplate/js/lockcfg.js www/htdocs/OSSTemplate/js/common.js www/htdocs/OSSTemplate/js/network.js +www/htdocs/OSSTemplate/js/switch.js www/htdocs/OSSTemplate/.htaccess www/htdocs/load-test.mhtml www/htdocs/autohandler |
From: Matt <mt...@us...> - 2005-06-02 18:28:39
|
Update of /cvsroot/netpass/NetPass/www/htdocs/Admin/Scan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32230 Modified Files: ids.mhtml Log Message: Index: ids.mhtml =================================================================== RCS file: /cvsroot/netpass/NetPass/www/htdocs/Admin/Scan/ids.mhtml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ids.mhtml 25 Apr 2005 05:32:49 -0000 1.8 +++ ids.mhtml 2 Jun 2005 18:28:30 -0000 1.9 @@ -132,16 +132,25 @@ } } elsif ($rulesave eq "Save" && $readOnly ne "disabled") { if ($raw) { - addRawRule($dbh, $rule, $desc, $sid); + my $rv = $np->db->addSnortRuleEntry( + -rule => $rule, + -user => $m->session->{'username'}, + -desc => $desc + ); + + if ($rv != 1) { + print $q->p({-class=>'error'}, "ERROR $rv"); + } + } else { my $o = $alloptions; my $s = $sid; if ($newsid) { - if ($newsid < 1000000) { + if ($newsid < 2000000) { print $q->p({-class=>'error'}, - "Snort ID not in private SID space (>1000000)"); + "Snort ID not in private SID space (>2000000)"); return; } |
From: Robert V. <re...@no...> - 2005-06-01 21:48:36
|
Jeff Murphy wrote: > > you can ignore this doc and anything that refers to ebtables. this is > for a perfigo-like inline device that can sit in front of waps, dialups > and vpns. these are config notes for the inline device, not for the > netpass server. neat, thanks. rev |