Class: IPQueue::Packet
- Inherits:
-
Object
- Object
- IPQueue::Packet
- Defined in:
- lib/ipqueuepacket.rb
Instance Attribute Summary collapse
-
#hw_addr ⇒ Object
readonly
Returns the value of attribute hw_addr.
-
#hw_protocol ⇒ Object
readonly
Returns the value of attribute hw_protocol.
-
#hw_type ⇒ Object
readonly
Returns the value of attribute hw_type.
-
#indev_name ⇒ Object
readonly
Returns the value of attribute indev_name.
-
#mark ⇒ Object
readonly
Returns the value of attribute mark.
-
#outdev_name ⇒ Object
readonly
Returns the value of attribute outdev_name.
-
#packet_id ⇒ Object
readonly
Returns the value of attribute packet_id.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#timestamp_sec ⇒ Object
readonly
Returns the value of attribute timestamp_sec.
-
#timestamp_usec ⇒ Object
readonly
Returns the value of attribute timestamp_usec.
Instance Method Summary collapse
- #accept(modify = false) ⇒ Object
- #drop ⇒ Object
-
#initialize(queue, packet_id, mark, timestamp_sec, timestamp_usec, hook, indev_name, outdev_name, hw_protocol, hw_type, hw_addr, payload) ⇒ Packet
constructor
A new instance of Packet.
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, , , hook, indev_name, outdev_name, hw_protocol, hw_type, hw_addr, payload @queue = queue @packet_id = packet_id @mark = mark @timestamp_sec = @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_addr ⇒ Object (readonly)
Returns the value of attribute hw_addr.
10 11 12 |
# File 'lib/ipqueuepacket.rb', line 10 def hw_addr @hw_addr end |
#hw_protocol ⇒ Object (readonly)
Returns the value of attribute hw_protocol.
8 9 10 |
# File 'lib/ipqueuepacket.rb', line 8 def hw_protocol @hw_protocol end |
#hw_type ⇒ Object (readonly)
Returns the value of attribute hw_type.
9 10 11 |
# File 'lib/ipqueuepacket.rb', line 9 def hw_type @hw_type end |
#indev_name ⇒ Object (readonly)
Returns the value of attribute indev_name.
6 7 8 |
# File 'lib/ipqueuepacket.rb', line 6 def indev_name @indev_name end |
#mark ⇒ Object (readonly)
Returns the value of attribute mark.
3 4 5 |
# File 'lib/ipqueuepacket.rb', line 3 def mark @mark end |
#outdev_name ⇒ Object (readonly)
Returns the value of attribute outdev_name.
7 8 9 |
# File 'lib/ipqueuepacket.rb', line 7 def outdev_name @outdev_name end |
#packet_id ⇒ Object (readonly)
Returns the value of attribute packet_id.
2 3 4 |
# File 'lib/ipqueuepacket.rb', line 2 def packet_id @packet_id end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
11 12 13 |
# File 'lib/ipqueuepacket.rb', line 11 def payload @payload end |
#timestamp_sec ⇒ Object (readonly)
Returns the value of attribute timestamp_sec.
4 5 6 |
# File 'lib/ipqueuepacket.rb', line 4 def @timestamp_sec end |
#timestamp_usec ⇒ Object (readonly)
Returns the value of attribute timestamp_usec.
5 6 7 |
# File 'lib/ipqueuepacket.rb', line 5 def @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 |
#drop ⇒ Object
30 31 32 |
# File 'lib/ipqueuepacket.rb', line 30 def drop @queue.drop(@packet_id) end |