Class: Trema::PortStatus
- Inherits:
-
Object
- Object
- Trema::PortStatus
- Defined in:
- ruby/trema/port-status.c
Direct Known Subclasses
Constant Summary collapse
- OFPPR_ADD =
INT2NUM( OFPPR_ADD )
- OFPPR_DELETE =
INT2NUM( OFPPR_DELETE )
- OFPPR_MODIFY =
INT2NUM( OFPPR_MODIFY )
Instance Method Summary collapse
-
#datapath_id ⇒ Number
Message originator identifier.
-
#initialize(options) ⇒ PortStatus
constructor
Creates a port status message.
-
#phy_port ⇒ Port
Port detailed description, state.
-
#reason ⇒ Number
The reason value specifies an addition, deletion or modification to a port.
-
#transaction_id ⇒ Number
For this asynchronous message the transaction_id is set to zero.
Constructor Details
#initialize(options) ⇒ PortStatus
Creates a port status message.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'ruby/trema/port-status.c', line 57 static VALUE port_status_init( VALUE self, VALUE ) { if ( rb_hash_aref( , ID2SYM( rb_intern( "datapath_id" ) ) ) == Qnil ) { rb_raise( rb_eArgError, ":datapath_id is a mandatory option" ); } if ( rb_hash_aref( , ID2SYM( rb_intern( "transaction_id" ) ) ) == Qnil ) { rb_raise( rb_eArgError, ":transaction_id is a mandatory option" ); } if ( rb_hash_aref( , ID2SYM( rb_intern( "reason" ) ) ) == Qnil ) { rb_raise( rb_eArgError, ":reason is a mandatory option" ); } if ( rb_hash_aref( , ID2SYM( rb_intern( "phy_port" ) ) ) == Qnil ) { rb_raise( rb_eArgError, ":phy_port is a mandatory option" ); } rb_iv_set( self, "@attribute", ); return self; } |
Instance Method Details
#datapath_id ⇒ Number
Message originator identifier.
82 83 84 85 |
# File 'ruby/trema/port-status.c', line 82 static VALUE port_status_datapath_id( VALUE self ) { return rb_hash_aref( rb_iv_get( self, "@attribute" ), ID2SYM( rb_intern( "datapath_id" ) ) ); } |
#phy_port ⇒ Port
Port detailed description, state.
115 116 117 118 |
# File 'ruby/trema/port-status.c', line 115 static VALUE port_status_phy_port( VALUE self ) { return rb_hash_aref( rb_iv_get( self, "@attribute" ), ID2SYM( rb_intern( "phy_port" ) ) ); } |
#reason ⇒ Number
The reason value specifies an addition, deletion or modification to a port.
104 105 106 107 |
# File 'ruby/trema/port-status.c', line 104 static VALUE port_status_reason( VALUE self ) { return rb_hash_aref( rb_iv_get( self, "@attribute" ), ID2SYM( rb_intern( "reason" ) ) ); } |
#transaction_id ⇒ Number
For this asynchronous message the transaction_id is set to zero.
93 94 95 96 |
# File 'ruby/trema/port-status.c', line 93 static VALUE port_status_transaction_id( VALUE self ) { return rb_hash_aref( rb_iv_get( self, "@attribute" ), ID2SYM( rb_intern( "transaction_id" ) ) ); } |