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
Version:
$Id: NetInterface.java,v 1.18 2004/04/06 16:07:49 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Nested Class Summary
static interface NetInterface.NetHandler
          Network layer callback interface.
 
Method Summary
 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