Class: Trema::GetConfigReply

Inherits:
Object
  • Object
show all
Defined in:
ruby/trema/get-config-reply.c

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ GetConfigReply

Handles the response to OFPT_GET_CONFIG_REQUEST message. The user would not explicitly instantiate a Trema::GetConfigReply object but would be created while parsing the OFPT_GET_CONFIG_REPLY message. The Trema::GetConfigReply object is an object whose attributes represent the return values of the message.

Returns an object that encapsulates the OFPT_GET_CONFIG_REPLY OpenFlow message.

Examples:

GetConfigReply.new(
  :datapath_id => 2748
  :transaction_id => 1,
  :flags => 0
  :miss_send_len => 65535
)

Parameters:

  • options (Hash) (defaults to: {})

    the options to create a message with.

Options Hash (options):

  • :datapath_id (Number)

    message originator identifier.

  • :transaction_id (Number)

    the saved transaction_id from OFPT_GET_CONFIG_REQUEST message.

  • :flags (Number)

    indicates how IP fragments are treated.

  • :miss_send_len (Number)

    the maximum number of bytes to send on a flow table miss or flow destined to controller.



62
63
64
65
66
# File 'ruby/trema/get-config-reply.c', line 62

static VALUE
get_config_reply_init( VALUE self, VALUE options ) {
  rb_iv_set( self, "@attribute", options );
  return self;
}

Instance Method Details

#datapath_idNumber

Message originator identifier.

Returns:

  • (Number)

    the value of datapath_id.



74
75
76
77
# File 'ruby/trema/get-config-reply.c', line 74

static VALUE
get_config_reply_datapath_id( VALUE self ) {
  return rb_hash_aref( rb_iv_get( self, "@attribute" ), ID2SYM( rb_intern( "datapath_id" ) ) );
}

#flagsNumber

Flags indicate how IP fragments should be treated (no special handling, dropped or reassembled).

Returns:

  • (Number)

    the value of flags.



97
98
99
100
# File 'ruby/trema/get-config-reply.c', line 97

static VALUE
get_config_reply_flags( VALUE self ) {
  return rb_hash_aref( rb_iv_get( self, "@attribute" ), ID2SYM( rb_intern( "flags" ) ) );
}

#miss_send_lenNumber

The maximum number of bytes to send on flow table miss or flow destined to controller.

Returns:

  • (Number)

    the value of miss_send_len.



108
109
110
111
# File 'ruby/trema/get-config-reply.c', line 108

static VALUE
get_config_reply_miss_send_len( VALUE self ) {
  return rb_hash_aref( rb_iv_get( self, "@attribute" ), ID2SYM( rb_intern( "miss_send_len" ) ) );
}

#transaction_idNumber

Transaction ids, message sequence numbers matching requests to replies.

Returns:

  • (Number)

    the value of transaction id.



85
86
87
88
# File 'ruby/trema/get-config-reply.c', line 85

static VALUE
get_config_reply_transaction_id( VALUE self ) {
  return rb_hash_aref( rb_iv_get( self, "@attribute" ), ID2SYM( rb_intern( "transaction_id" ) ) );
}