class PacketGen::Header::IPv6::Extension
Base
class to handle IPv6
extensions @abstract You should not use this class but its subclasses. A IPv6
extension header has the following format:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Hdr Ext Len | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | . . . Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Such a header consists of:
-
a {#next} header field ({Types::Int8}),
-
a {#length} field ({Types::Int8}),
-
an {#options} field ({Types::String}),
-
and a {#body}, containing next header.
@author Sylvain Daubert
Public Instance Methods
calc_length()
click to toggle source
Compute length and set len
field @return [Integer]
# File lib/packetgen/header/ipv6/extension.rb, line 59 def calc_length self.length = (options.sz + 2) / 8 - 1 end
real_length()
click to toggle source
Get real extension header length @return [Integer]
# File lib/packetgen/header/ipv6/extension.rb, line 53 def real_length (length + 1) * 8 end