|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjist.swans.mac.MacDumb
public class MacDumb
A dumb, pass-through mac implementation.
| Nested Class Summary | |
|---|---|
private static class |
MacDumb.MacDumbMessage
MacDumbMessage is the packet sent out by the MacDumb mac. |
| Nested classes/interfaces inherited from interface jist.swans.mac.MacInterface |
|---|
MacInterface.Mac802_11 |
| Field Summary | |
|---|---|
private int |
bandwidth
link bandwidth. |
private MacAddress |
localAddr
local mac address. |
private NetInterface |
netEntity
network entity. |
private byte |
netId
network interface identifier. |
private boolean |
promisc
whether in promiscuous mode. |
private RadioInterface |
radioEntity
radio entity. |
private byte |
radioMode
radio mode: transmit, receive, etc. |
private MacInterface |
self
self-referencing proxy entity. |
| Constructor Summary | |
|---|---|
MacDumb(MacAddress addr,
RadioInfo radioInfo)
Create a new "dumb" mac entity. |
|
| Method Summary | |
|---|---|
MacInterface |
getProxy()
Return self-referencing proxy entity. |
void |
peek(Message msg)
Radio has locked onto a packet signal; mac may have a peek. |
void |
receive(Message msg)
Radio has received a packet for mac to process. |
void |
send(Message msg,
MacAddress nextHop)
Network layer would like to send the following packet. |
void |
setNetEntity(NetInterface net,
byte netid)
Hook up with the network entity. |
void |
setPromiscuous(boolean promisc)
Set promiscuous mode (whether to pass all packets through). |
void |
setRadioEntity(RadioInterface radio)
Hook up with the radio entity. |
void |
setRadioMode(byte mode)
Update mac regarding new mode of its radio. |
java.lang.String |
toString()
|
private long |
transmitTime(Message msg)
Compute packet transmission time at current bandwidth. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private RadioInterface radioEntity
private NetInterface netEntity
private byte netId
private final MacInterface self
private byte radioMode
private MacAddress localAddr
private final int bandwidth
private boolean promisc
| Constructor Detail |
|---|
public MacDumb(MacAddress addr,
RadioInfo radioInfo)
addr - local mac addressradioInfo - radio information| Method Detail |
|---|
public void setPromiscuous(boolean promisc)
promisc - promiscuous flag
public void setNetEntity(NetInterface net,
byte netid)
net - network entitynetid - network interface numberpublic void setRadioEntity(RadioInterface radio)
radio - radio entitypublic MacInterface getProxy()
public java.lang.String toString()
toString in class java.lang.Objectpublic void setRadioMode(byte mode)
setRadioMode in interface MacInterfacemode - new radio modepublic void peek(Message msg)
peek in interface MacInterfacemsg - packet currently in flightpublic void receive(Message msg)
receive in interface MacInterfacemsg - packet receivedprivate long transmitTime(Message msg)
msg - packet to transmit
public void send(Message msg,
MacAddress nextHop)
send in interface MacInterfacemsg - packet to sendnextHop - destination mac
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||