jist.swans.mac
Class MacDumb

java.lang.Object
  extended by jist.swans.mac.MacDumb
All Implemented Interfaces:
JistAPI.Proxiable, JistAPI.Timeless, MacInterface

public class MacDumb
extends java.lang.Object
implements MacInterface

A dumb, pass-through mac implementation.

Since:
SWANS1.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface jist.swans.mac.MacInterface
MacInterface.Mac802_11
 
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()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MacDumb

public MacDumb(MacAddress addr,
               RadioInfo radioInfo)
Create a new "dumb" mac entity. Does not perform any collision avoidance or detection. Simply does not transmit (drops) packet if it is current receiving.

Parameters:
addr - local mac address
radioInfo - radio information
Method Detail

setPromiscuous

public void setPromiscuous(boolean promisc)
Set promiscuous mode (whether to pass all packets through).

Parameters:
promisc - promiscuous flag

setNetEntity

public void setNetEntity(NetInterface net,
                         byte netid)
Hook up with the network entity.

Parameters:
net - network entity
netid - network interface number

setRadioEntity

public void setRadioEntity(RadioInterface radio)
Hook up with the radio entity.

Parameters:
radio - radio entity

getProxy

public MacInterface getProxy()
Return self-referencing proxy entity.

Returns:
proxy entity

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

setRadioMode

public void setRadioMode(byte mode)
Update mac regarding new mode of its radio.

Specified by:
setRadioMode in interface MacInterface
Parameters:
mode - new radio mode

peek

public void peek(Message msg)
Radio has locked onto a packet signal; mac may have a peek.

Specified by:
peek in interface MacInterface
Parameters:
msg - packet currently in flight

receive

public void receive(Message msg)
Radio has received a packet for mac to process.

Specified by:
receive in interface MacInterface
Parameters:
msg - packet received

send

public void send(Message msg,
                 MacAddress nextHop)
Network layer would like to send the following packet. Should be called only after Mac has notified that it is wants a packet.

Specified by:
send in interface MacInterface
Parameters:
msg - packet to send
nextHop - destination mac