Class: Trema::QueueStatsRequest
- Inherits:
-
StatsRequest
- Object
- StatsRequest
- Trema::QueueStatsRequest
- Defined in:
- ruby/trema/stats-request.c
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ QueueStatsRequest
constructor
A QueueStatsRequest object instance to request queue statistics.
-
#port_no ⇒ Number
Restrict port statistics to a specific port_no or to all ports.
-
#queue_id ⇒ Number
Restrict queue statistics to a specific queue_id or to all queues.
Methods inherited from StatsRequest
Constructor Details
#initialize(options = {}) ⇒ QueueStatsRequest
A Trema::QueueStatsRequest object instance to request queue statistics. Request queue statistics.
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 |
# File 'ruby/trema/stats-request.c', line 535 static VALUE queue_stats_request_init( int argc, VALUE *argv, VALUE self ) { VALUE ; if ( !rb_scan_args( argc, argv, "01", & ) ) { = rb_hash_new(); } rb_call_super( 1, & ); VALUE port_no = rb_hash_aref( , ID2SYM( rb_intern( "port_no" ) ) ); if ( port_no == Qnil ) { port_no = UINT2NUM( OFPP_ALL ); } rb_iv_set( self, "@port_no", port_no ); VALUE queue_id = rb_hash_aref( , ID2SYM( rb_intern( "queue_id" ) ) ); if ( queue_id == Qnil ) { queue_id = UINT2NUM( OFPQ_ALL ); } rb_iv_set( self, "@queue_id", queue_id ); buffer *; Data_Get_Struct( self, buffer, ); ( ( struct ofp_header * ) ( ->data ) )->xid = htonl( get_stats_request_num2uint( self, "@transaction_id" ) ); struct ofp_stats_request *stats_request; stats_request = ( struct ofp_stats_request * ) ->data; stats_request->flags = htons ( get_stats_request_num2uint16( self, "@flags" ) ); stats_request = ( struct ofp_stats_request * ) ->data; struct ofp_queue_stats_request *queue_stats_request; queue_stats_request = ( struct ofp_queue_stats_request * ) stats_request->body; queue_stats_request->port_no = htons( get_stats_request_num2uint16( self, "@port_no" ) ); queue_stats_request->queue_id = htonl( get_stats_request_num2uint( self, "@queue_id" ) ); return self; } |
Instance Method Details
#port_no ⇒ Number
Restrict port statistics to a specific port_no or to all ports.
237 238 239 240 |
# File 'ruby/trema/stats-request.c', line 237 static VALUE stats_port_no( VALUE self ) { return rb_iv_get( self, "@port_no" ); } |
#queue_id ⇒ Number
Restrict queue statistics to a specific queue_id or to all queues.
248 249 250 251 |
# File 'ruby/trema/stats-request.c', line 248 static VALUE stats_queue_id( VALUE self ) { return rb_iv_get( self, "@queue_id" ); } |