|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.DrclObj
drcl.comp.Component
drcl.net.Module
drcl.inet.Protocol
The base class for transport, routing and other signaling protocols.
A protocol may receive services and events from CoreServiceLayer.
It provides a complete set of methods (create<xxx>Port())
for a subclass to create service and event ports for the purpose,
and a complete set of event handler/callback methods
(<xxx>Handler(...)) that a subclass may override to handle
interested events. Refer to CoreServiceLayer for details regarding
what services and events are available.
A subclass must create the corresponding service port and then take
advantage of the corresponding service contract class in order to use a
service. For example, to use
the Route Configuration services, a subclass must
create a port by calling createRTServicePort() and then invoke the
services with the port and the contract class.
To receive and handle a type of events, a subclass must create the
corresponding event port and then override the corresponding handler method.
For example, to receive the packet arrival event, the protocol subclass may call
createPktArrivalEventPort() in the initialized codes, and then override
pktArrivalHandler(EventContract.Message, Port).
| Nested Class Summary |
| Nested classes inherited from class drcl.comp.Component |
Component.Locks |
| Field Summary |
| Fields inherited from class drcl.net.Module |
address, downPort, PortGroup_DOWN, PortGroup_UP, timerPort, upPort |
| Constructor Summary | |
Protocol()
|
|
Protocol(java.lang.String id_)
|
|
| Method Summary | |
void |
broadcast(java.lang.Object body_,
int bodySize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_)
Broadcast a raw packet body. |
void |
broadcast(java.lang.Object body_,
int bodySize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int excludeIf_)
Broadcast excluding the specified link. |
void |
broadcast(java.lang.Object p_,
int bodysize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int[] excludeIfs_)
Broadcast excluding the specified links. |
void |
broadcast(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_)
Broadcast the packet. |
void |
broadcast(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int excludeIf_)
Broadcast excluding the specified link. |
void |
broadcast(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int[] excludeIfs_)
Broadcast excluding the specified links. |
Port |
createConfigSwitchPort()
Creates and returns a port to use with the ConfigSwitch contract
in this protocol implementation. |
Port |
createIDChangedEventPort()
Creates and returns a port to accept the identity changed events from the core service layer in this protocol implementation. |
Port |
createIDServicePort()
Creates and returns a port to use with the IDLookup
and/or the {#link IDConfig} contracts
in this protocol implementation. |
Port |
createIFEventPort()
Creates and returns a port to accept the interface/neighbor events from the core service layer in this protocol implementation. |
Port |
createIFQueryPort()
Creates and returns a port to use with the IFQuery contract
in this protocol implementation. |
Port |
createLinkBrokenEventPort()
Creates and returns a port to accept the link broken events from CSL. |
Port |
createMcastHostEventPort()
Creates and returns a port to accept the multicast host join/leave events in this protocol implementation. |
Port |
createMcastQueryPort()
Creates and returns a port to accept the multicast queries from the core service layer in this protocol implementation. |
Port |
createMulticastRTChangedEventPort()
Creates and returns a port to accept the multicast routing entry changed events from the core service layer in this protocol implementation. |
Port |
createPktArrivalEventPort()
Creates and returns a port to accept the packet arrival events from the core service layer in this protocol implementation. |
Port |
createRTServicePort()
Creates and returns a port to use with the RTLookup
and/or the RTConfig contracts
in this protocol implementation. |
Port |
createUcastQueryPort()
Creates and returns a port to accept the unicast queries from the core service layer in this protocol implementation. |
Port |
createUnicastRTChangedEventPort()
Creates and returns a port to accept the unicast routing entry changed events from the core service layer in this protocol implementation. |
Port |
createVIFEventPort()
Creates and returns a port to accept the virtual interface/neighbor events from the core service layer in this protocol implementation. |
void |
duplicate(java.lang.Object source_)
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. |
void |
forward(java.lang.Object p_,
int bodysize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_)
Route lookup forwarding. |
void |
forward(java.lang.Object p_,
int bodysize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int if_)
Forward packet via specified link. |
void |
forward(java.lang.Object p_,
int bodysize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int[] ifs_)
This method presents the most general case where the packet is forwarded on arbitrarily specified interfaces. |
void |
forward(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_)
Route lookup forwarding. |
void |
forward(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int if_)
Forward packet via specified link. |
void |
forward(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int[] ifs_)
This method presents the most general case where the packet is forwarded on arbitrarily specified interfaces. |
protected void |
idAddedEventHandler(java.lang.Object data_,
Port inPort_)
Called back when an identity added event is received. |
protected void |
idRemovedEventHandler(java.lang.Object data_,
Port inPort_)
Called back when an identity removed event is received. |
void |
LinkBrokenEventHandler(InetPacket p,
Port inPort_)
Called back when a link broken event is received. |
protected void |
mcastHostJoinEventHandler(long src_,
long srcmask_,
long group_,
int ifindex_,
Port inPort_)
Called back when a multicast host join event is received. |
protected void |
mcastHostLeaveEventHandler(long src_,
long srcmask_,
long group_,
int ifindex_,
Port inPort_)
Called back when a multicast host leave event is received. |
protected void |
neighborDownEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
Called back when a neighbor down event is received. |
protected void |
neighborUpEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
Called back when a neighbor up event is received. |
protected void |
pktArrivalHandler(EventContract.Message event_,
Port inPort_)
Called back when a packet arrival event is received. |
protected void |
processOther(java.lang.Object data_,
Port inPort_)
The handler invoked when a packet arrived at a port other than the "up", "down" and timer ports. |
protected int[] |
routeQueryHandler(InetPacket p,
int incomingIf_,
Port inPort_)
Called back when a unicast/multicast query event is received. |
protected int[] |
routeQueryHandler(RTKey request_,
Port inPort_)
Called back when a unicast/multicast query event is received. |
protected void |
rtAddedEventHandler(java.lang.Object data_,
Port inPort_)
Called back when a routing entry added event is received. |
protected void |
rtModifiedEventHandler(java.lang.Object data_,
Port inPort_)
Called back when a routing entry modified event is received. |
protected void |
rtRemovedEventHandler(java.lang.Object data_,
Port inPort_)
Called back when a routing entry removed event is received. |
protected void |
vNeighborDownEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
Called back when a (virtual) neighbor down event is received. |
protected void |
vNeighborUpEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
Called back when a (virtual) neighbor up event is received. |
| Methods inherited from class drcl.net.Module |
cancelTimeout, dataArriveAtDownPort, dataArriveAtUpPort, deliver, getAddress, process, removeDefaultDownPort, removeDefaultUpPort, removeTimerPort, setAddress, setTimeout, setTimeoutAt, timeout |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Protocol()
public Protocol(java.lang.String id_)
| Method Detail |
public Port createIDServicePort()
IDLookup
and/or the {#link IDConfig} contracts
in this protocol implementation.
public Port createRTServicePort()
RTLookup
and/or the RTConfig contracts
in this protocol implementation.
public Port createIFQueryPort()
IFQuery contract
in this protocol implementation.
public Port createConfigSwitchPort()
ConfigSwitch contract
in this protocol implementation.
public Port createUcastQueryPort()
routeQueryHandler(RTKey, Port),
routeQueryHandler(InetPacket, int, Port)public Port createMcastQueryPort()
routeQueryHandler(RTKey, Port),
routeQueryHandler(InetPacket, int, Port)public Port createPktArrivalEventPort()
pktArrivalHandler(EventContract.Message, Port)public Port createIDChangedEventPort()
idAddedEventHandler(Object, Port),
idRemovedEventHandler(Object, Port)public Port createUnicastRTChangedEventPort()
rtAddedEventHandler(Object, Port),
rtRemovedEventHandler(Object, Port),
rtModifiedEventHandler(Object, Port)public Port createMulticastRTChangedEventPort()
rtAddedEventHandler(Object, Port),
rtRemovedEventHandler(Object, Port),
rtModifiedEventHandler(Object, Port)public Port createIFEventPort()
neighborUpEventHandler(int, NetAddress, Port),
neighborDownEventHandler(int, NetAddress, Port)public Port createVIFEventPort()
vNeighborUpEventHandler(int, NetAddress, Port),
vNeighborDownEventHandler(int, NetAddress, Port)public Port createMcastHostEventPort()
mcastHostJoinEventHandler(long, long, long, int, Port),
mcastHostLeaveEventHandler(long, long, long, int, Port)
protected int[] routeQueryHandler(RTKey request_,
Port inPort_)
RTLookup,
createUcastQueryPort(),
createMcastQueryPort()
protected int[] routeQueryHandler(InetPacket p,
int incomingIf_,
Port inPort_)
RTLookup,
createUcastQueryPort(),
createMcastQueryPort()
public void LinkBrokenEventHandler(InetPacket p,
Port inPort_)
createLinkBrokenEventPort()public Port createLinkBrokenEventPort()
protected void pktArrivalHandler(EventContract.Message event_,
Port inPort_)
createPktArrivalEventPort()
protected void idAddedEventHandler(java.lang.Object data_,
Port inPort_)
createIDChangedEventPort()
protected void idRemovedEventHandler(java.lang.Object data_,
Port inPort_)
createIDChangedEventPort()
protected void rtAddedEventHandler(java.lang.Object data_,
Port inPort_)
createUnicastRTChangedEventPort(),
createMulticastRTChangedEventPort()
protected void rtRemovedEventHandler(java.lang.Object data_,
Port inPort_)
createUnicastRTChangedEventPort(),
createMulticastRTChangedEventPort()
protected void rtModifiedEventHandler(java.lang.Object data_,
Port inPort_)
createUnicastRTChangedEventPort(),
createMulticastRTChangedEventPort()
protected void neighborUpEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
ifindex_ - index of the interface.createIFEventPort()
protected void neighborDownEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
ifindex_ - index of the interface.createIFEventPort()
protected void vNeighborUpEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
ifindex_ - index of the virtual interface.createVIFEventPort()
protected void vNeighborDownEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
ifindex_ - index of the interface.createVIFEventPort()
protected void mcastHostJoinEventHandler(long src_,
long srcmask_,
long group_,
int ifindex_,
Port inPort_)
group_ - the multicast group the host network joins.ifindex_ - index of the interface where the host network is connected.
Could be -1 if it is a local join (multihomed router).createMcastHostEventPort()
protected void mcastHostLeaveEventHandler(long src_,
long srcmask_,
long group_,
int ifindex_,
Port inPort_)
group_ - the multicast group the host network leaves.ifindex_ - index of the interface where the host network is connected.
Could be -1 if it is a local leave (multihomed router).createMcastHostEventPort()
protected void processOther(java.lang.Object data_,
Port inPort_)
Module
processOther in class Modulepublic void duplicate(java.lang.Object source_)
Component
duplicate in interface ObjectDuplicableduplicate in class Module
public void broadcast(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_)
public void broadcast(java.lang.Object body_,
int bodySize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_)
public void broadcast(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int excludeIf_)
public void broadcast(java.lang.Object body_,
int bodySize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int excludeIf_)
public void broadcast(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int[] excludeIfs_)
public void broadcast(java.lang.Object p_,
int bodysize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int[] excludeIfs_)
public void forward(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int if_)
public void forward(java.lang.Object p_,
int bodysize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int if_)
public void forward(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int[] ifs_)
public void forward(java.lang.Object p_,
int bodysize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_,
int[] ifs_)
public void forward(Packet p_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_)
public void forward(java.lang.Object p_,
int bodysize_,
long src_,
long dest_,
boolean routerAlert_,
int TTL_,
long ToS_)
|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||