Class: IPQueue::Packet

Inherits:
Object
  • Object
show all
Defined in:
lib/ipqueuepacket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue, packet_id, mark, timestamp_sec, timestamp_usec, hook, indev_name, outdev_name, hw_protocol, hw_type, hw_addr, payload) ⇒ Packet

Returns a new instance of Packet.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ipqueuepacket.rb', line 13

def initialize queue, packet_id, mark, timestamp_sec, timestamp_usec, hook, indev_name, outdev_name, hw_protocol, hw_type, hw_addr, payload
  @queue = queue
  @packet_id = packet_id
  @mark = mark
  @timestamp_sec = timestamp_sec
  @timestamp_usec = timestamp_usec
  @hook = hook
  @indev_name = indev_name
  @outdev_name = outdev_name
  @hw_protocol = hw_protocol
  @hw_type = hw_type
  @hw_addr = hw_addr
  @payload = payload
end

Instance Attribute Details

#hw_addrObject (readonly)

Returns the value of attribute hw_addr.



10
11
12
# File 'lib/ipqueuepacket.rb', line 10

def hw_addr
  @hw_addr
end

#hw_protocolObject (readonly)

Returns the value of attribute hw_protocol.



8
9
10
# File 'lib/ipqueuepacket.rb', line 8

def hw_protocol
  @hw_protocol
end

#hw_typeObject (readonly)

Returns the value of attribute hw_type.



9
10
11
# File 'lib/ipqueuepacket.rb', line 9

def hw_type
  @hw_type
end

#indev_nameObject (readonly)

Returns the value of attribute indev_name.



6
7
8
# File 'lib/ipqueuepacket.rb', line 6

def indev_name
  @indev_name
end

#markObject (readonly)

Returns the value of attribute mark.



3
4
5
# File 'lib/ipqueuepacket.rb', line 3

def mark
  @mark
end

#outdev_nameObject (readonly)

Returns the value of attribute outdev_name.



7
8
9
# File 'lib/ipqueuepacket.rb', line 7

def outdev_name
  @outdev_name
end

#packet_idObject (readonly)

Returns the value of attribute packet_id.



2
3
4
# File 'lib/ipqueuepacket.rb', line 2

def packet_id
  @packet_id
end

#payloadObject (readonly)

Returns the value of attribute payload.



11
12
13
# File 'lib/ipqueuepacket.rb', line 11

def payload
  @payload
end

#timestamp_secObject (readonly)

Returns the value of attribute timestamp_sec.



4
5
6
# File 'lib/ipqueuepacket.rb', line 4

def timestamp_sec
  @timestamp_sec
end

#timestamp_usecObject (readonly)

Returns the value of attribute timestamp_usec.



5
6
7
# File 'lib/ipqueuepacket.rb', line 5

def timestamp_usec
  @timestamp_usec
end

Instance Method Details

#accept(modify = false) ⇒ Object



27
28
29
# File 'lib/ipqueuepacket.rb', line 27

def accept(modify = false)
  if modify then @queue.accept(@packet_id, @payload) else @queue.accept(@packet_id) end
end

#dropObject



30
31
32
# File 'lib/ipqueuepacket.rb', line 30

def drop
  @queue.drop(@packet_id)
end