|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.component.base.ClackComponent net.clackrouter.component.extension.NAPT
public class NAPT
VERY basic implementation of NAT. Only handles TCP/UDP for now, no ICMP. Defaults to using the first interface (usually eth0) of the current router as the external IP, and 10.1.1.0/24 as the private network (assumes that it has interfaces in the private networks, so it hears about them from routing).
Nested Class Summary | |
---|---|
class |
NAPT.ICMPMapping
|
class |
NAPT.TransportLevelMapping
|
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent |
---|
ClackComponent.Waiter |
Field Summary | |
---|---|
static int |
DEST_PORT
|
static int |
ICMP_MAX_TTL
|
static int |
NUM_PORTS
|
static int |
PORT_IN
|
static int |
PORT_OUT
|
static int |
SRC_PORT
|
static int |
TRANSPORT_MAX_TTL
|
Fields inherited from class net.clackrouter.component.base.ClackComponent |
---|
componentCell, m_has_error, m_log, m_name, m_num_ports, m_packetcount_in, m_packetcount_out, m_ports, mListeners, mRouter, pendingError, SIGNAL_ERROR_LEN_MSEC, UNIQUE_COUNT, view |
Constructor Summary | |
---|---|
NAPT(Router router,
java.lang.String name)
|
Method Summary | |
---|---|
void |
acceptPacket(VNSPacket packet,
int port_num)
The starting point for packet-processing when packets are "pushed" to this component. |
java.awt.Color |
getColor()
The color this component should be rendered in, assuming a standard component rendering by the ComponentView.ComponentRenderer class. |
java.util.Hashtable |
getICMPMappings()
|
javax.swing.JPanel |
getPropertiesView()
Method for getting the properties view associated with this component Property views are used to display more detailed information about internal component state. |
NAPT.TransportLevelMapping[] |
getTransportLevelMappings()
|
void |
notifyAlarm()
call-back method implemented by the code setting the alarm. |
void |
setExternalIPAddress(java.net.InetAddress new_addr)
|
void |
setInternalNetwork(java.net.InetAddress net,
java.net.InetAddress mask)
|
protected void |
setupPorts(int numports)
Allocates an array of ClackPort objects to be used by this component |
Methods inherited from class net.clackrouter.component.base.ClackComponent |
---|
createCopy, createInputPullPort, createInputPushPort, createOutputPullPort, createOutputPushPort, error, fireListeners, getComponentCell, getHierarchicalView, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getRouter, getSerializableProperties, getTime, getTypeName, getUniqueCount, getView, handlePullRequest, hasError, initializeProperties, isHierarchical, isModifying, log, poll, registerListener, sendOutPort, setAlarm, setComponentCell, setName, setPendingError, setView, showErrorDialog, signalError, try_repaint, unregisterListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PORT_IN
public static final int PORT_OUT
public static final int NUM_PORTS
public static final int DEST_PORT
public static final int SRC_PORT
public static int TRANSPORT_MAX_TTL
public static int ICMP_MAX_TTL
Constructor Detail |
---|
public NAPT(Router router, java.lang.String name)
Method Detail |
---|
protected void setupPorts(int numports)
ClackComponent
setupPorts
in class ClackComponent
numports
- the number of ports to createpublic void acceptPacket(VNSPacket packet, int port_num)
ClackComponent
The starting point for packet-processing when packets are "pushed" to this component.
The default implementation warns that the packet is being ignored.
acceptPacket
in class ClackComponent
packet
- The pushed packetport_num
- The number of the port that this packet is arriving onpublic void notifyAlarm()
Alarm
notifyAlarm
in interface Alarm
notifyAlarm
in class ClackComponent
public void setExternalIPAddress(java.net.InetAddress new_addr)
public void setInternalNetwork(java.net.InetAddress net, java.net.InetAddress mask)
public NAPT.TransportLevelMapping[] getTransportLevelMappings()
public java.util.Hashtable getICMPMappings()
public javax.swing.JPanel getPropertiesView()
ClackComponent
getPropertiesView
in class ClackComponent
public java.awt.Color getColor()
ClackComponent
The color this component should be rendered in, assuming a standard component rendering by the
ComponentView.ComponentRenderer
class.
Other renderers may ignore this value.
getColor
in class ClackComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |