Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class fi.hut.tcm.jacob.tcpip.ethernet.EthernetAdaptor

java.lang.Object
  |
  +--fi.hut.tcm.jacob.conduits.BaseConduit
        |
        +--fi.hut.tcm.jacob.conduits.Sedaptor
              |
              +--fi.hut.tcm.jacob.conduits.Adaptor
                    |
                    +--fi.hut.tcm.jacob.tcpip.ethernet.EthernetAdaptor

public class EthernetAdaptor
extends fi.hut.tcm.jacob.conduits.Adaptor
implements java.lang.Runnable
EthernetAdaptor


Field Summary
static int ETHER_ADDR_LEN
           
static int ETHER_HEADER_LEN
          Source and destination addresses, ethernet type.
static int ETHER_MTU
           
static byte[] ETHERTYPE_ARP
           
static byte[] ETHERTYPE_IP
           
static byte[] ETHERTYPE_IPV6
           
static byte[] ETHERTYPE_RARP
           
byte[] ownEtherAddr
           
 
Fields inherited from class fi.hut.tcm.jacob.conduits.BaseConduit
id, SIDE_NUMBER, sides
 
Constructor Summary
EthernetAdaptor(EthernetAddress hwAddr, java.util.Vector filterIpAddrs, java.lang.String device, int ppa)
          Creates new EthernetAdaptor and binds it to receive messages of the given protocol.
 
Method Summary
void adapt(fi.hut.tcm.jacob.conduits.Message message)
           
void bind(byte[] ethertype, boolean promisc)
          Binds this EthernetAdaptor to the actual underlying Ethernet driver.
void finalize()
          Stops the internal thread and releases the physical ethernet connection.
byte[] getHardwareAddress()
           
void run()
          Called on adaptorThread.
 
Methods inherited from class fi.hut.tcm.jacob.conduits.Adaptor
accept, adapt, filter, getSideCount
 
Methods inherited from class fi.hut.tcm.jacob.conduits.Sedaptor
addTimeout, cancelTimeout, getMessageSource, newMessage, releaseMessage, returnMessage, sendMessage, stopMessage
 
Methods inherited from class fi.hut.tcm.jacob.conduits.BaseConduit
accept, clone, dump, getId, getSide, getSideCount, initialSideCount, initSides
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

ETHERTYPE_IP

public static final byte[] ETHERTYPE_IP

ETHERTYPE_ARP

public static final byte[] ETHERTYPE_ARP

ETHERTYPE_RARP

public static final byte[] ETHERTYPE_RARP

ETHERTYPE_IPV6

public static final byte[] ETHERTYPE_IPV6

ETHER_MTU

public static final int ETHER_MTU

ETHER_ADDR_LEN

public static final int ETHER_ADDR_LEN

ETHER_HEADER_LEN

public static int ETHER_HEADER_LEN
Source and destination addresses, ethernet type.

ownEtherAddr

public byte[] ownEtherAddr
Constructor Detail

EthernetAdaptor

public EthernetAdaptor(EthernetAddress hwAddr,
                       java.util.Vector filterIpAddrs,
                       java.lang.String device,
                       int ppa)
Creates new EthernetAdaptor and binds it to receive messages of the given protocol.
Parameters:
hwAddr - The ethernet address of the adaptor
filterIpAddrs - A vector of IP addresses to filter out from the incoming traffic. The address(es) of the machine we are running on should be included in this list.
device - Name of the underlying device driver, e.g. "/dev/le"
ppa - Physical point of attachement, usually 0
Method Detail

bind

public void bind(byte[] ethertype,
                 boolean promisc)
Binds this EthernetAdaptor to the actual underlying Ethernet driver. The Adaptor will start to deliver messages of the given ethertype, or, if promisc == true, all messages.

getHardwareAddress

public byte[] getHardwareAddress()

finalize

public void finalize()
Stops the internal thread and releases the physical ethernet connection.
Overrides:
finalize in class java.lang.Object

adapt

public void adapt(fi.hut.tcm.jacob.conduits.Message message)
Overrides:
adapt in class fi.hut.tcm.jacob.conduits.Adaptor

run

public void run()
Called on adaptorThread. Tries to receive packets from the physical interface and insert them into the runqueue.
Specified by:
run() in interface java.lang.Runnable

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD