Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
dbird committed Nov 17, 2011
1 parent d521ffb commit e43857f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public void copy(AttributeValue value)
this.byteValue = new byte[cValue.byteValueLength];
this.byteValueLength = cValue.byteValueLength;
this.byteValueOffset = 0;
System.arraycopy(cValue.byteValue, cValue.byteValueOffset, this.byteValue, 0, cValue.byteValueLength);
if (this.byteValueLength > 0)
System.arraycopy(cValue.byteValue, cValue.byteValueOffset, this.byteValue, 0, this.byteValueLength);
}

public void getBytes(OutputStream out) throws IOException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,9 @@ private JComboBox getSimulationTypeComboBox() {
"Auth & Acct (Start, Stop)",
"Auth & Acct (Start Only)",
"Acct Only (Start, Interim, Stop)",
"Acct Only (Start Only)",
"Acct Only (Stop Only)",
"Acct On/Off",
"Disconnect Request",
"CoA Request"});
// "Auth & Acct (Start until you Stop)" });
Expand Down Expand Up @@ -2472,6 +2474,7 @@ public void run()
boolean sendPackets[] = { true, false, false, false };
boolean sendDisconnectRequest = false;
boolean sendCoARequest = false;
boolean sendOnOff = false;
boolean simulationSuccess = true;
interactiveSession = false;

Expand All @@ -2481,9 +2484,11 @@ public void run()
case 2: sendPackets[1] = sendPackets[3] = true; break;
case 3: sendPackets[1] = true; break;
case 4: sendPackets = new boolean[]{ false, true, true, true }; break;
case 5: sendPackets = new boolean[]{ false, false, false, true }; break;
case 6: sendDisconnectRequest = true; break;
case 7: sendCoARequest = true; break;
case 5: sendPackets = new boolean[]{ false, true, false, false }; break;
case 6: sendPackets = new boolean[]{ false, false, false, true }; break;
case 7: sendPackets = new boolean[]{ false, true, false, true }; sendOnOff = true; break;
case 8: sendDisconnectRequest = true; break;
case 9: sendCoARequest = true; break;
//case 3: sendPackets[1] = true; interactiveSession = true; break;
}

Expand Down Expand Up @@ -2624,15 +2629,15 @@ else if (sendCoARequest)
}
else
{
request = PacketFactory.newPacket(AccountingRequest.CODE, radiusClient, acctAttributes[i - 1]);
request = PacketFactory.newPacket(AccountingRequest.CODE, radiusClient, acctAttributes[sendOnOff ? 3 : (i - 1)]);

if (request.findAttribute(Attr_AcctStatusType.TYPE) == null)
{
switch(i)
{
case 1: request.addAttribute(AttributeFactory.newAttribute(Attr_AcctStatusType.TYPE, Attr_AcctStatusType.Start, false)); break;
case 1: request.addAttribute(AttributeFactory.newAttribute(Attr_AcctStatusType.TYPE, sendOnOff ? Attr_AcctStatusType.AccountingOn : Attr_AcctStatusType.Start, false)); break;
case 2: request.addAttribute(AttributeFactory.newAttribute(Attr_AcctStatusType.TYPE, Attr_AcctStatusType.InterimUpdate, false)); break;
case 3: request.addAttribute(AttributeFactory.newAttribute(Attr_AcctStatusType.TYPE, Attr_AcctStatusType.Stop, false)); break;
case 3: request.addAttribute(AttributeFactory.newAttribute(Attr_AcctStatusType.TYPE, sendOnOff ? Attr_AcctStatusType.AccountingOff : Attr_AcctStatusType.Stop, false)); break;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ protected void processRequest(ListenerRequest listenerRequest) throws Exception
{
SSLSocket sslSocket = (SSLSocket) socket;
sslSocket.setWantClientAuth(true);
SSLSession sslSession = sslSocket.getSession();
try
{
SSLSession sslSession = sslSocket.getSession();
Certificate[] certs = sslSession.getPeerCertificates();
if (certs != null)
{
Expand All @@ -81,7 +81,7 @@ protected void processRequest(ListenerRequest listenerRequest) throws Exception
x509 = (X509Certificate) cert;
}
}
catch (Exception e)
catch (Throwable e)
{
}
}
Expand Down Expand Up @@ -188,7 +188,7 @@ else if (headers.get("WWW-Authenticate") != null)

writer.write(server);
writer.write(conclose);
for (Iterator i = headers.entrySet().iterator(); i.hasNext();)
for (Iterator<?> i = headers.entrySet().iterator(); i.hasNext();)
{
Map.Entry entry = (Map.Entry)i.next();
String key = (String)entry.getKey();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class WebServiceRequest extends JRadiusEvent

private Object sessionObject;

private Object userObject;

/**
* @return the request type
*/
Expand Down Expand Up @@ -238,4 +240,12 @@ public Map<String, String> getServerVariableMap() {
public void setServerVariableMap(Map<String, String> serverVariableMap) {
this.serverVariableMap = serverVariableMap;
}

public Object getUserObject() {
return userObject;
}

public void setUserObject(Object userObject) {
this.userObject = userObject;
}
}
26 changes: 24 additions & 2 deletions freeradius/dict/dictionary.chillispot
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,28 @@ ATTRIBUTE ChilliSpot-Config-File 14 string

ATTRIBUTE ChilliSpot-Session-State 15 integer

VALUE ChilliSpot-Session-State Authorized 1
VALUE ChilliSpot-Session-State NotAuthorized 2
VALUE ChilliSpot-Session-State Authorized 1
VALUE ChilliSpot-Session-State NotAuthorized 2
VALUE ChilliSpot-Session-State Started 3
VALUE ChilliSpot-Session-State Stopped 4
VALUE ChilliSpot-Session-State UserLogoutUrl 10
VALUE ChilliSpot-Session-State IdleTimeoutReached 11
VALUE ChilliSpot-Session-State TimeoutReached 12
VALUE ChilliSpot-Session-State LogoutTimeReached 13
VALUE ChilliSpot-Session-State InDataLimitReached 14
VALUE ChilliSpot-Session-State OutDataLimitReached 15
VALUE ChilliSpot-Session-State TotalDataLimitReached 16
VALUE ChilliSpot-Session-State LocationChanged 17

ATTRIBUTE ChilliSpot-Session-Id 16 string

ATTRIBUTE ChilliSpot-Max-Input-Gigawords 21 integer
ATTRIBUTE ChilliSpot-Max-Output-Gigawords 22 integer
ATTRIBUTE ChilliSpot-Max-Total-Gigawords 23 integer

ATTRIBUTE ChilliSpot-VLAN-Id 24 integer
ATTRIBUTE ChilliSpot-Location 25 string
ATTRIBUTE ChilliSpot-Old-Location 26 string

ATTRIBUTE ChilliSpot-Sys-Uptime 40 integer
ATTRIBUTE ChilliSpot-Sys-LoadAvg 41 string
Expand All @@ -60,6 +73,15 @@ ATTRIBUTE ChilliSpot-DHCP-Domain 65 string

ATTRIBUTE ChilliSpot-Inject-URL 70 string

ATTRIBUTE ChilliSpot-Garden-Input-Octets 80 integer
ATTRIBUTE ChilliSpot-Garden-Output-Octets 81 integer
ATTRIBUTE ChilliSpot-Garden-Input-Gigawords 82 integer
ATTRIBUTE ChilliSpot-Garden-Output-Gigawords 83 integer
ATTRIBUTE ChilliSpot-Other-Input-Octets 84 integer
ATTRIBUTE ChilliSpot-Other-Output-Octets 85 integer
ATTRIBUTE ChilliSpot-Other-Input-Gigawords 86 integer
ATTRIBUTE ChilliSpot-Other-Output-Gigawords 87 integer

# Configuration management parameters (ChilliSpot Only)
ATTRIBUTE ChilliSpot-UAM-Allowed 100 string
ATTRIBUTE ChilliSpot-MAC-Allowed 101 string
Expand Down

0 comments on commit e43857f

Please sign in to comment.