"""
<Started>
  February 8, 2009

<Purpose>
  Provides packet types for easy use
  during testing.
"""
include packet.repy

class TestPacketSender:

  def __init__(self, ip, port):
    self.ip = ip
    # loopback skeleton
    self.packet = TcpPacket(port, port, 0, 0, "", 0, "test")
    self.timeout = .01
   
  def send(self, control_bits):
    syn_packet = self.packet.copy()
    syn_packet.control_bits = control_bits
    sendmess(self.ip, syn_packet.destport, syn_packet.pack())
    sleep(self.timeout)
