jist.swans.net
Interface NetInterface

All Superinterfaces:
JistAPI.Proxiable, JistAPI.Timeless
All Known Implementing Classes:
NetIp

public interface NetInterface
extends JistAPI.Proxiable

Defines the interface of all Network layer entity implementations.

Since:
SWANS1.0

Nested Class Summary
static interface NetInterface.NetHandler
          Network layer callback interface.
 
Method Summary
 void dropNotify(Message msg, MacAddress nextHopMac, Reason reason)
          Notification mechanism for packet dropped due to various "Reasons"
 NetAddress getAddress()
          Return local network address.
 void pump(int netid)
          Request next packet to send, if one exists; indicate that interface has completed processing previous request.
 void receive(Message msg, MacAddress lastHop, byte macId, boolean promiscuous)
          Receive a message from the link layer.
 void send(Message msg, NetAddress dst, short protocol, byte priority, byte ttl)
          Route, if necessary, and send a message (from TRANSPORT).
 void send(NetMessage.Ip msg, int interfaceId, MacAddress nextHop)
          Send a message along given interface (usually from ROUTING).
 

Method Detail

getAddress

NetAddress getAddress()
                      throws JistAPI.Continuation
Return local network address.

Returns:
local network address
Throws:
JistAPI.Continuation - never (blocking event)

receive

void receive(Message msg,
             MacAddress lastHop,
             byte macId,
             boolean promiscuous)
Receive a message from the link layer.

Parameters:
msg - incoming network packet
lastHop - link-level source of incoming packet
macId - incoming interface
promiscuous - whether network interface is in promisc. mode

send

void send(Message msg,
          NetAddress dst,
          short protocol,
          byte priority,
          byte ttl)
Route, if necessary, and send a message (from TRANSPORT).

Parameters:
msg - packet payload (usually from transport or routing layers)
dst - packet destination address
protocol - packet protocol identifier
priority - packet priority
ttl - packet time-to-live value

send

void send(NetMessage.Ip msg,
          int interfaceId,
          MacAddress nextHop)
Send a message along given interface (usually from ROUTING).

Parameters:
msg - packet (usually from routing layer)
interfaceId - interface along which to send packet
nextHop - packet next hop address

pump

void pump(int netid)
Request next packet to send, if one exists; indicate that interface has completed processing previous request.

Parameters:
netid - interface identifier

dropNotify

void dropNotify(Message msg,
                MacAddress nextHopMac,
                Reason reason)
Notification mechanism for packet dropped due to various "Reasons"