Class: TCWrapper::Qdisc
- Inherits:
-
Wrapper
- Object
- Wrapper
- TCWrapper::Qdisc
- Defined in:
- lib/distem/wrapper/tc/qdisc.rb
Direct Known Subclasses
Constant Summary
- WTYPE =
"qdisc"
Constants inherited from Wrapper
Instance Attribute Summary (collapse)
-
- (Object) id
readonly
Returns the value of attribute id.
-
- (Object) parentid
readonly
Returns the value of attribute parentid.
Instance Method Summary (collapse)
- - (Object) get_cmd(*args)
-
- (Qdisc) initialize(iface, parent, type, params)
constructor
A new instance of Qdisc.
Methods inherited from Wrapper
Constructor Details
- (Qdisc) initialize(iface, parent, type, params)
Returns a new instance of Qdisc
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/distem/wrapper/tc/qdisc.rb', line 9 def initialize(iface,parent,type,params) super(iface,WTYPE,type,params) @parent = parent #Here @id corresponds to the handle of the current qdisc if (@parent.kind_of? QdiscRoot) @id = Id.new(@parent.id.major,0) else @id = Id.new(Id.get_unique_major_id(iface),0) end if (@parent.kind_of? Class) @parentid = @parent.id else @parentid = Id.new(@parent.id.major,@parent.id.next_minor_id) end end |
Instance Attribute Details
- (Object) id (readonly)
Returns the value of attribute id
8 9 10 |
# File 'lib/distem/wrapper/tc/qdisc.rb', line 8 def id @id end |
- (Object) parentid (readonly)
Returns the value of attribute parentid
8 9 10 |
# File 'lib/distem/wrapper/tc/qdisc.rb', line 8 def parentid @parentid end |
Instance Method Details
- (Object) get_cmd(*args)
26 27 28 29 30 31 |
# File 'lib/distem/wrapper/tc/qdisc.rb', line 26 def get_cmd(*args) super(*args) \ + ((@parent.kind_of? QdiscRoot) ? \ "root" : "parent " + @parentid.to_s) \ + " handle " + @id.to_s + " " + @type + " " + get_params end |