cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1707
Views
0
Helpful
3
Replies

confused value for set_port_attr in trex_stl_client

yufenwan
Level 1
Level 1

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.

3 Replies 3

ybrustin
Cisco Employee
Cisco Employee

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.

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.

The default value is written in function, and it's "no change".