Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
dbird committed May 5, 2011
1 parent 2d64580 commit 01a2175
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 16 deletions.
19 changes: 16 additions & 3 deletions applet/src/main/java/JRadiusWiFiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.MalformedURLException;
Expand Down Expand Up @@ -219,8 +221,12 @@ public void init()
{
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
netscape.security.PrivilegeManager.enablePrivilege("UniversalConnect");
@SuppressWarnings("rawtypes")
Class privilegeManager = Class.forName("netscape.security.PrivilegeManager");
@SuppressWarnings("unchecked")
Method enablePrivilege = privilegeManager.getMethod("enablePrivilege", new Class[] {String.class});
enablePrivilege.invoke(null, new Object[] { "UniversalXPConnect" });
enablePrivilege.invoke(null, new Object[] { "UniversalConnect" });
}
catch (Throwable e)
{ }
Expand All @@ -229,7 +235,14 @@ public void init()
{
try
{
com.ms.security.PolicyEngine.assertPermission(com.ms.security.PermissionID.NETIO);
@SuppressWarnings("rawtypes")
Class policyEngine = Class.forName("com.ms.security.PolicyEngine");
@SuppressWarnings("rawtypes")
Class permissionID = Class.forName("com.ms.security.PermissionID");
@SuppressWarnings("unchecked")
Method assertPermission = policyEngine.getMethod("assertPermission", new Class[] {permissionID});
Field permId = permissionID.getField("NETIO");
assertPermission.invoke(null, new Object[] { permId.get(null) });
}
catch (Throwable e)
{ }
Expand Down
19 changes: 16 additions & 3 deletions applet/src/main/java/WISPrClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.HttpURLConnection;
Expand Down Expand Up @@ -125,8 +127,12 @@ public void init()
{
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
netscape.security.PrivilegeManager.enablePrivilege("UniversalConnect");
@SuppressWarnings("rawtypes")
Class privilegeManager = Class.forName("netscape.security.PrivilegeManager");
@SuppressWarnings("unchecked")
Method enablePrivilege = privilegeManager.getMethod("enablePrivilege", new Class[] {String.class});
enablePrivilege.invoke(null, new Object[] { "UniversalXPConnect" });
enablePrivilege.invoke(null, new Object[] { "UniversalConnect" });
}
catch (Throwable e)
{ }
Expand All @@ -135,7 +141,14 @@ public void init()
{
try
{
com.ms.security.PolicyEngine.assertPermission(com.ms.security.PermissionID.NETIO);
@SuppressWarnings("rawtypes")
Class policyEngine = Class.forName("com.ms.security.PolicyEngine");
@SuppressWarnings("rawtypes")
Class permissionID = Class.forName("com.ms.security.PermissionID");
@SuppressWarnings("unchecked")
Method assertPermission = policyEngine.getMethod("assertPermission", new Class[] {permissionID});
Field permId = permissionID.getField("NETIO");
assertPermission.invoke(null, new Object[] { permId.get(null) });
}
catch (Throwable e)
{ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class AttributesTableEntry implements Serializable {
private Boolean accountingStart = Boolean.FALSE;
private Boolean accountingUpdate = Boolean.FALSE;
private Boolean accountingStop = Boolean.FALSE;
private Boolean coaRequest = Boolean.FALSE;
private Class valueClass;

public AttributesTableEntry()
Expand Down Expand Up @@ -92,6 +93,13 @@ public Boolean getAccountingStop() {
return accountingStop;
}

/**
* @return Returns the coaRequest.
*/
public Boolean getCoARequest() {
return coaRequest;
}

/**
* @param accountingStop The accountingStop to set.
*/
Expand Down Expand Up @@ -155,5 +163,9 @@ public void setValueClass(Class valueClass) {
this.valueClass = valueClass;
}

public void setCoARequest(Boolean v) {
this.coaRequest = v;
}

};

Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class AttributesTableModel extends AbstractTableModel {
"AcctStart",
"AcctUpdate",
"AcctStop",
"CoA",
"Attribute Value"
};

Expand Down Expand Up @@ -82,7 +83,8 @@ public Object getValueAt(int row, int col) {
case 3: return entry.getAccountingStart();
case 4: return entry.getAccountingUpdate();
case 5: return entry.getAccountingStop();
case 6: return entry.getAttributeValue();
case 6: return entry.getCoARequest();
case 7: return entry.getAttributeValue();
}
return null;
}
Expand All @@ -91,7 +93,7 @@ public Object getValueAt(int row, int col) {
* @see javax.swing.table.AbstractTableModel#getColumnClass(int)
*/
public Class getColumnClass(int col) {
if (col == 0 || col == 6) return String.class;
if (col == 0 || col == 7) return String.class;
return Boolean.class;
}

Expand All @@ -116,7 +118,8 @@ public void setValueAt(Object v, int row, int col) {
case 3: entry.setAccountingStart((Boolean)v); break;
case 4: entry.setAccountingUpdate((Boolean)v); break;
case 5: entry.setAccountingStop((Boolean)v); break;
case 6: entry.setAttributeValue((String)v); break;
case 6: entry.setCoARequest((Boolean)v); break;
case 7: entry.setAttributeValue((String)v); break;
}
fireTableCellUpdated(row, col);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -948,12 +948,12 @@ private JTable getAttributesTable()
if (attributesTable == null)
{
attributesTable = new JTable(attributesTableModel);
TableColumn col = attributesTable.getColumnModel().getColumn(6);
TableColumn col = attributesTable.getColumnModel().getColumn(7);
col.setCellEditor(new ValueTableCellEditor());
for (int i = 0; i < attributesTableModel.getColumnCount(); i++)
{
col = attributesTable.getColumnModel().getColumn(i);
if (i == 0 || i == 6) {
if (i == 0 || i == 7) {
col.setPreferredWidth(120);
} else {
col.setPreferredWidth(40);
Expand Down Expand Up @@ -2444,7 +2444,7 @@ public void run()
}

AttributeList[] authAttributes = { new AttributeList(), new AttributeList() };
AttributeList[] acctAttributes = { new AttributeList(), new AttributeList(), new AttributeList() };
AttributeList[] acctAttributes = { new AttributeList(), new AttributeList(), new AttributeList(), new AttributeList() };

Object[] entries = attributesTableModel.getEntries().toArray();
for (int i = 0; i < entries.length; i++)
Expand All @@ -2461,6 +2461,7 @@ public void run()
if ((bool = entry.getAccountingStart()) != null && bool.booleanValue()) acctAttributes[0].add(AttributeFactory.copyAttribute(attribute), false);
if ((bool = entry.getAccountingUpdate()) != null && bool.booleanValue()) acctAttributes[1].add(AttributeFactory.copyAttribute(attribute), false);
if ((bool = entry.getAccountingStop()) != null && bool.booleanValue()) acctAttributes[2].add(AttributeFactory.copyAttribute(attribute), false);
if ((bool = entry.getCoARequest()) != null && bool.booleanValue()) acctAttributes[3].add(AttributeFactory.copyAttribute(attribute), false);
}
catch (UnknownAttributeException e)
{
Expand Down Expand Up @@ -2610,11 +2611,11 @@ public void onBeforeSend(RadiusClientTransport transport, RadiusPacket packet)
{
if (sendDisconnectRequest)
{
request = PacketFactory.newPacket(DisconnectRequest.CODE, radiusClient, authAttributes[0]);
request = PacketFactory.newPacket(DisconnectRequest.CODE, radiusClient, acctAttributes[3]);
}
else if (sendCoARequest)
{
request = PacketFactory.newPacket(CoARequest.CODE, radiusClient, authAttributes[0]);
request = PacketFactory.newPacket(CoARequest.CODE, radiusClient, acctAttributes[3]);
}
else
{
Expand Down Expand Up @@ -2735,6 +2736,7 @@ else if (sendCoARequest)
acctAttributes[0].clear();
acctAttributes[1].clear();
acctAttributes[2].clear();
acctAttributes[3].clear();

System.out.println("Sent: "+sent+" Recd: "+recd+" in "+((System.currentTimeMillis() - startTime))+"ms");
}
Expand Down
13 changes: 12 additions & 1 deletion freeradius/dict/dictionary.chillispot
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ ATTRIBUTE ChilliSpot-Lang 7 string
ATTRIBUTE ChilliSpot-Version 8 string
ATTRIBUTE ChilliSpot-OriginalURL 9 string
ATTRIBUTE ChilliSpot-Acct-View-Point 10 integer
ATTRIBUTE ChilliSpot-Config-File 11 string

VALUE ChilliSpot-Acct-View-Point ChilliSpot-NAS-View-Point 1
VALUE ChilliSpot-Acct-View-Point ChilliSpot-Client-View-Point 2

ATTRIBUTE ChilliSpot-Require-UAM 11 string
ATTRIBUTE ChilliSpot-Require-Splash 12 string
ATTRIBUTE ChilliSpot-Route-To-Interface 13 string
ATTRIBUTE ChilliSpot-Config-File 14 string

ATTRIBUTE ChilliSpot-Session-State 15 integer

VALUE ChilliSpot-Session-State Authorized 1
VALUE ChilliSpot-Session-State NotAuthorized 2

ATTRIBUTE ChilliSpot-Max-Input-Gigawords 21 integer
ATTRIBUTE ChilliSpot-Max-Output-Gigawords 22 integer
Expand All @@ -46,6 +51,12 @@ ATTRIBUTE ChilliSpot-DHCP-Server-Name 55 string
ATTRIBUTE ChilliSpot-DHCP-Client-FQDN 56 string
ATTRIBUTE ChilliSpot-DHCP-Parameter-Request-List 57 octets

ATTRIBUTE ChilliSpot-DHCP-IP-Address 60 ipaddr
ATTRIBUTE ChilliSpot-DHCP-Netmask 61 ipaddr
ATTRIBUTE ChilliSpot-DHCP-DNS1 62 ipaddr
ATTRIBUTE ChilliSpot-DHCP-DNS2 63 ipaddr
ATTRIBUTE ChilliSpot-DHCP-Gateway 64 ipaddr

# Configuration management parameters (ChilliSpot Only)
ATTRIBUTE ChilliSpot-UAM-Allowed 100 string
ATTRIBUTE ChilliSpot-MAC-Allowed 101 string
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@
<module>client</module>
<module>applet</module>
<!--
-->
<module>ssl</module>
-->
<module>server</module>
</modules>

Expand Down

0 comments on commit 01a2175

Please sign in to comment.