verinec.netsim.entities.packets
Class UDPPacket

java.lang.Object
  extended by desmoj.core.simulator.NamedObject
      extended by desmoj.core.simulator.ModelComponent
          extended by desmoj.core.simulator.Schedulable
              extended by desmoj.core.simulator.Entity
                  extended by verinec.netsim.entities.packets.Packet
                      extended by verinec.netsim.entities.packets.Leaf
                          extended by verinec.netsim.entities.packets.UDPPacket
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DNSPacket, TCPPacket

public class UDPPacket
extends Leaf

A UDP Packet

Version:
$Revision:835 $
Author:
Dominik Jungo

Field Summary
private  int dstPort
           
private  int srcPort
           
 
Constructor Summary
UDPPacket(Model owner, IPAddress srcaddress, IPAddress dstaddress, int srcPort, int dstPort)
          Creates a new UDP Packet
 
Method Summary
 void byteArrayToPayload(byte[] bytes)
           
protected  String createString()
          Creates a String, including classname, source, destination, processor and age, used by toString() representing this UDP Packet.
 int getDstPort()
          gets the destinaton port
 String getProcessorName()
          gets the name of the processor that will process this packet
 int getSrcPort()
          gets the source port
 byte[] payloadToByteArray()
           
protected  Leaf selfClone()
           
 void setDstPort(int dstPort)
          sets the destination port
 void setSrcPort(int srcPort)
          sets the source port
 String toString()
          This returns a String representation of the Packet.
 
Methods inherited from class verinec.netsim.entities.packets.Leaf
clone, getPayload, setPayload
 
Methods inherited from class verinec.netsim.entities.packets.Packet
getAge, getDstAddress, getPacketID, getSrcAddress, incrAge, setAge, setDstAddress, setPacketID, setSrcAddress
 
Methods inherited from class desmoj.core.simulator.Entity
getPriority, isEqual, isLarger, isLargerOrEqual, isNotEqual, isSimProcess, isSmaller, isSmallerOrEqual, numQueues, schedule, scheduleAfter, scheduleBefore, setPriority
 
Methods inherited from class desmoj.core.simulator.Schedulable
cancel, isCurrent, isScheduled, nextEntity, nextEvent, nextSchedulable, rename, reSchedule, scheduledAt
 
Methods inherited from class desmoj.core.simulator.ModelComponent
current, currentEntity, currentEvent, currentModel, currentSimProcess, currentTime, debugIsOn, debugOff, debugOn, epsilon, getModel, isExperimentCompatible, isModelCompatible, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
 
Methods inherited from class desmoj.core.simulator.NamedObject
getName, getQuotedName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dstPort

private int dstPort

srcPort

private int srcPort
Constructor Detail

UDPPacket

public UDPPacket(Model owner,
                 IPAddress srcaddress,
                 IPAddress dstaddress,
                 int srcPort,
                 int dstPort)
Creates a new UDP Packet

Parameters:
owner - a model
srcaddress - source of the packet
dstaddress - destination of the packet
srcPort - the source port
dstPort - the destination port
Method Detail

getDstPort

public int getDstPort()
gets the destinaton port

Returns:
the destinaton port

getProcessorName

public String getProcessorName()
Description copied from class: Packet
gets the name of the processor that will process this packet

Specified by:
getProcessorName in class Packet
Returns:
the name of the processor that will process this packet
See Also:
Packet.getProcessorName()

getSrcPort

public int getSrcPort()
gets the source port

Returns:
the source port

setDstPort

public void setDstPort(int dstPort)
sets the destination port

Parameters:
dstPort - a port number

setSrcPort

public void setSrcPort(int srcPort)
sets the source port

Parameters:
srcPort - a port number

createString

protected String createString()
Creates a String, including classname, source, destination, processor and age, used by toString() representing this UDP Packet.

Returns:
Creates a String, used by toString() representing this UDP Packet

toString

public String toString()
Description copied from class: Packet
This returns a String representation of the Packet.

Overrides:
toString in class Leaf
Returns:
the a String representation of the Packet
See Also:
Leaf.toString()

payloadToByteArray

public byte[] payloadToByteArray()
                          throws Exception
Throws:
Exception

byteArrayToPayload

public void byteArrayToPayload(byte[] bytes)
                        throws Exception
Throws:
Exception

selfClone

protected Leaf selfClone()
Specified by:
selfClone in class Leaf

Copyright © 2005 Verinec, DIUF