public class L3Shim extends java.lang.Object implements Layer2Listener
Modifier and Type | Field and Description |
---|---|
static int |
L3TYPE_L3
L3TYPE_L3 is the uniquely-assigned identifier for the L3 protocol --
the main protocol for forwarding packets across multiple networks
through routers.
|
Constructor and Description |
---|
L3Shim(Layer2Endpoint le)
Create this object, storing the layer2 endpoint, and setting
this object as a listener of frames from that layer 2 object.
|
Modifier and Type | Method and Description |
---|---|
void |
frameReceived(Layer2Handler handler,
Layer2Frame frame)
Called when a frame is received for this endpoint at layer 2.
|
void |
send(java.lang.String bits,
int protocol,
int destMac)
Given a string of bits to send, the layer 3 protocol these bits
are part of, and the layer 2 destination to send the data to,
create the 2-bit layer 3 shim header, then create the Layer2Frame
and send the frame via layer 2.
|
void |
setListener(L3ShimListener l,
int protoType)
register a listener for the protocol with number protoType.
|
public static final int L3TYPE_L3
public L3Shim(Layer2Endpoint le)
public void frameReceived(Layer2Handler handler, Layer2Frame frame)
frameReceived
in interface Layer2Listener
public void send(java.lang.String bits, int protocol, int destMac)
public void setListener(L3ShimListener l, int protoType)