jist.swans.mac
Class MacLoop

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

public class MacLoop
extends java.lang.Object
implements MacInterface

A loopback mac implementation.

Since:
SWANS1.0
Version:
$Id: MacLoop.java,v 1.5 2004/04/06 16:07:48 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Nested Class Summary
 
Nested classes/interfaces inherited from interface jist.swans.mac.MacInterface
MacInterface.Mac802_11
 
Field Summary
private  NetInterface netEntity
          network entity.
private  byte netId
          network interface number.
private  MacInterface self
          self-referencing proxy entity.
 
Constructor Summary
MacLoop()
          Create new loopback interface.
 
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 setRadioMode(byte mode)
          Update mac regarding new mode of its radio.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

self

private final MacInterface self
self-referencing proxy entity.


netEntity

private NetInterface netEntity
network entity.


netId

private byte netId
network interface number.

Constructor Detail

MacLoop

public MacLoop()
Create new loopback interface.

Method Detail

setNetEntity

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

Parameters:
net - network entity
netid - network interface number

getProxy

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

Returns:
proxy entity

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

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

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

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