|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.uiuc.cs.net.DPRPManager.DPRPRestriction
This class comprises a set of restrictions against a potential DPRP client. In the interests of security, there are several operations that the site administrator may wish to constrain for certain clients. These capabilities include:
Field Summary | |
(package private) int |
allowedNumRenewals
Number of times client is allowed to renew lease (to prevent running unauthorized servers). |
(package private) java.net.InetAddress |
clientIP
The IP address of the client to be restricted. |
static int |
defaultMaxDuration
Default maximum duration (MAX_INT). |
static int |
defaultMaxPort
Default maximum allowed port (65536). |
static int |
defaultMinDuration
Default minimum duration (500). |
(package private) boolean |
denied
If the client is even allowed to speak DPRP. |
(package private) int |
maxDuration
The longest lease time the client is allowed (to prevent running unauthorized servers). |
(package private) int |
maxPort
The highest port the client is allowed to request. |
(package private) int |
minDuration
The shortest lease time the client is allowed (to prevent DoS). |
(package private) int |
minPort
The smallest port the client is allowed to request. |
(package private) boolean |
renewOK
If the client is allowed to renew at all. |
Constructor Summary | |
DPRPRestriction(java.net.InetAddress cip)
The main constructor for a new restriction. |
Method Summary | |
boolean |
checkDuration(int inDur)
Checks the given duration, to see if it is allowed. |
boolean |
checkNumRenews(int nr)
Checks if the number of times a lease has been renewed is allowed. |
boolean |
checkPort(int inPort)
Checks the given port, to see if it is allowed. |
java.net.InetAddress |
getClientIP()
Returns the client IP address. |
int |
getMaxDuration()
Returns maxDuration. |
int |
getMaxPort()
Returns maxPort. |
int |
getMinDuration()
Returns minDuration. |
int |
getMinPort()
Returns minPort. |
int |
getNumRenewals()
Returns allowedNumRenewals. |
boolean |
isDenied()
Returns true if client is denied from accessing server. |
void |
prettyPrint()
A utility method, for displaying the restriction contents in a human-readable way. |
boolean |
renewAllowed()
Returns true if client allowed to renew leases. |
void |
setClientIP(java.net.InetAddress cr)
Sets the client IP address for this restriction. |
void |
setIsDenied()
Denies the client. |
void |
setMaxDuration(int mad)
Sets the maximum allowed duration. |
void |
setMaxPort(int map)
Sets the maximum allowed port. |
void |
setMinDuration(int mid)
Sets the minimum allowed duration. |
void |
setMinPort(int mip)
Sets the minimum allowed port. |
void |
setNumRenewals(int mr)
Sets the maximum number of lease renewals. |
void |
setRenewNotOK()
Stops the client from being able to renewing any leases. |
Methods inherited from class java.lang.Object |
|
Field Detail |
java.net.InetAddress clientIP
boolean denied
boolean renewOK
int allowedNumRenewals
int minDuration
int maxDuration
int minPort
int maxPort
public static final int defaultMinDuration
public static final int defaultMaxDuration
public static final int defaultMaxPort
Constructor Detail |
public DPRPRestriction(java.net.InetAddress cip)
cip
- The client IP address.Method Detail |
public boolean checkDuration(int inDur)
inDur
- A duration, checked to see that it is greater than
(or equal to) minDuration, but less than
(or equal to) maxDuration.public boolean checkPort(int inPort)
inPort
- A port number, checked to see that it is greater than
(or equal to) minPort, but less than
(or equal to) maxPort.public boolean checkNumRenews(int nr)
nr
- A number of renews, that should be less than the
number of NumRenewals allowed for this client.public void setMaxDuration(int mad)
public void setMinDuration(int mid)
public void setMaxPort(int map)
public void setMinPort(int mip)
public void setIsDenied()
public void setRenewNotOK()
public void setNumRenewals(int mr)
public void setClientIP(java.net.InetAddress cr)
public int getMaxDuration()
public int getMinDuration()
public int getMaxPort()
public int getMinPort()
public boolean isDenied()
public boolean renewAllowed()
public int getNumRenewals()
public java.net.InetAddress getClientIP()
public void prettyPrint()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |