09-07-2017 02:42 AM
Hi developers,
I'm really very confused with the values of these parameters.
For example, promiscuous should be bool(True or False).
But its default value is None.
What does None mean?
Could we set it to None when we use it?
Here is the definitions of this function.
def set_port_attr (self,
ports = None,
promiscuous = None,
link_up = None,
led_on = None,
flow_ctrl = None,
resolve = True,
multicast = None):
"""
Set port attributes
:parameters:
promiscuous - True or False
link_up - True or False
led_on - True or False
flow_ctrl - 0: disable all, 1: enable tx side, 2: enable rx side, 3: full enable
resolve - if true, in case a destination address is configured as IPv4 try to resolve it
multicast - enable receiving multicast, True or False
:raises:
+ :exe:'STLError'
"""
Thanks,
Yufeng.
09-07-2017 02:56 AM
Hi,
Don't be confused
None means "no change".
When using this function, you don't have to specify all the arguments, only relevant ones.
The rest will be untouched.
Thanks,
Yaroslav.
09-07-2017 11:22 PM
Hi,
So None means no change?
what's the default value of these port attr? And could they all be defined to be None?
attr: promiscuous, link_up ,led_on,flow_ctrl ,resolv,multicast , service
Thanks,
Yufeng.
09-09-2017 10:25 AM
The default value is written in function, and it's "no change".
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide