Class: Nl::Core::NlMsgHdr

Inherits:
Struct
  • Object
show all
Defined in:
lib/nl/core.rb,
lib/nl/core.rb

Overview

Message header

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#flagsObject

Returns the value of attribute flags

Returns:

  • (Object)

    the current value of flags



47
48
49
# File 'lib/nl/core.rb', line 47

def flags
  @flags
end

#lenObject

Returns the value of attribute len

Returns:

  • (Object)

    the current value of len



47
48
49
# File 'lib/nl/core.rb', line 47

def len
  @len
end

#pidObject

Returns the value of attribute pid

Returns:

  • (Object)

    the current value of pid



47
48
49
# File 'lib/nl/core.rb', line 47

def pid
  @pid
end

#seqObject

Returns the value of attribute seq

Returns:

  • (Object)

    the current value of seq



47
48
49
# File 'lib/nl/core.rb', line 47

def seq
  @seq
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



47
48
49
# File 'lib/nl/core.rb', line 47

def type
  @type
end

Class Method Details

.decode(decoder) ⇒ Object



59
60
61
62
63
# File 'lib/nl/core.rb', line 59

def self.decode(decoder)
  obj = new(*decoder.get_values(FORMAT))
  decoder.align_to(Constants::NLMSG_ALIGNTO)
  obj
end

Instance Method Details

#encode(encoder) ⇒ Object



65
66
67
68
69
# File 'lib/nl/core.rb', line 65

def encode(encoder)
  encoder.reserve(Constants::NLMSG_HDRLEN)
  encoder.put_values(FORMAT, to_a)
  encoder.align_to(Constants::NLMSG_ALIGNTO)
end