Class: Trema::GetConfigRequest
- Inherits:
-
Object
- Object
- Trema::GetConfigRequest
- Defined in:
- ruby/trema/get-config-request.c
Instance Method Summary collapse
-
#initialize(*args) ⇒ GetConfigRequest
constructor
Creates a GetConfigRequest instance to query configuration parameters from the switch.
-
#transaction_id ⇒ Number
Transaction ids, message sequence numbers matching requests to replies.
Constructor Details
#initialize ⇒ GetConfigRequest #initialize(transaction_id) ⇒ GetConfigRequest #initialize(options) ⇒ GetConfigRequest
Creates a Trema::GetConfigRequest instance to query configuration parameters from the switch.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'ruby/trema/get-config-request.c', line 63 static VALUE get_config_request_init( int argc, VALUE *argv, VALUE self ) { buffer *get_config_request; Data_Get_Struct( self, buffer, get_config_request ); VALUE = Qnil; if ( rb_scan_args( argc, argv, "01", & ) == 0 ) { set_xid( get_config_request, get_transaction_id() ); } else { if ( == Qnil ) { set_xid( get_config_request, get_transaction_id() ); } else if ( rb_obj_is_kind_of( , rb_cInteger ) == Qtrue ) { validate_xid( ); set_xid( get_config_request, ( uint32_t ) NUM2UINT( ) ); } else { Check_Type( , T_HASH ); VALUE tmp = Qnil; VALUE xid = Qnil; tmp = rb_hash_aref( , ID2SYM( rb_intern( "transaction_id" ) ) ); if ( tmp != Qnil ) { xid = tmp; } tmp = rb_hash_aref( , ID2SYM( rb_intern( "xid" ) ) ); if ( tmp != Qnil ) { xid = tmp; } if ( xid != Qnil ) { validate_xid( xid ); set_xid( get_config_request, ( uint32_t ) NUM2UINT( xid ) ); } else { set_xid( get_config_request, get_transaction_id() ); } } } return self; } |
Instance Method Details
#transaction_id ⇒ Number
Transaction ids, message sequence numbers matching requests to replies.
114 115 116 117 |
# File 'ruby/trema/get-config-request.c', line 114 static VALUE get_config_request_transaction_id( VALUE self ) { return get_xid( self ); } |