OpenNSL API Guide and Reference Manual
|
Go to the source code of this file.
Macros | |
#define | OPENNSL_BOOT_F_DEFAULT 0x000000 |
#define | OPENNSL_BOOT_F_WARM_BOOT 0x200000 |
Functions | |
int | example_is_dnx_device (int unit) |
Returns true if the device belongs to DNX family of devices. | |
int | example_is_qmx_device (int unit) |
Returns true if the device is Qumran-MX device. | |
int | example_max_port_count_get (int unit, int *count) |
To get the number of front panel ports. | |
int | example_port_default_config (int unit) |
Set default configuration (like STP state, speed/duplex) for all ports. | |
int | example_read_user_choice (int *choice) |
Read numeric menu choice from user. | |
char * | example_read_user_string (char *buf, size_t buflen) |
Read a string from user. | |
int | example_switch_default_vlan_config (int unit) |
Add all ports to default vlan. | |
void | l2_print_mac (char *str, opennsl_mac_t mac_address) |
To print the MAC address. | |
int | opennsl_ip_parse (char *ip_str, unsigned int *ip_val) |
Parse IP string into a IP value. | |
int | opennsl_mac_parse (char *buf, unsigned char *macp) |
Parse MAC address string. | |
void | print_ip_addr (char *str, unsigned int host) |
To print IP address in dotted decimal format. | |
#define OPENNSL_BOOT_F_WARM_BOOT 0x200000 |
int example_is_dnx_device | ( | int | unit | ) |
Returns true if the device belongs to DNX family of devices.
unit | [IN] unit number |
This API needs to be invoked after initializing the OpenNSL driver
Definition at line 51 of file util.c.
References opennsl_info_s::device, FALSE, opennsl_info_get(), and TRUE.
Referenced by example_port_default_config().
int example_is_qmx_device | ( | int | unit | ) |
Returns true if the device is Qumran-MX device.
unit | [IN] unit number |
This API needs to be invoked after initializing the OpenNSL driver
Definition at line 75 of file util.c.
References opennsl_info_s::device, FALSE, opennsl_info_get(), and TRUE.
Referenced by example_l3_intf_rif_create(), and init_portmap().
int example_max_port_count_get | ( | int | unit, |
int * | count | ||
) |
To get the number of front panel ports.
unit | [IN] unit number |
int | [OUT] Number of front panel ports |
Definition at line 495 of file util.c.
References opennsl_port_config_s::ge, OPENNSL_E_NONE, opennsl_errmsg, OPENNSL_PBMP_COUNT, opennsl_port_config_get(), and opennsl_port_config_s::xe.
int example_port_default_config | ( | int | unit | ) |
Set default configuration (like STP state, speed/duplex) for all ports.
unit | [IN] unit number |
Definition at line 97 of file util.c.
References opennsl_port_info_s::action_mask, opennsl_port_info_s::autoneg, opennsl_port_info_s::duplex, opennsl_port_config_s::e, opennsl_port_info_s::enable, example_is_dnx_device(), FALSE, opennsl_port_info_s::linkscan, OPENNSL_E_NONE, opennsl_errmsg, OPENNSL_FAILURE, OPENNSL_LINKSCAN_MODE_SW, OPENNSL_PBMP_ITER, OPENNSL_PORT_ABILITY_PAUSE_RX, OPENNSL_PORT_ABILITY_PAUSE_TX, OPENNSL_PORT_ATTR_AUTONEG_MASK, OPENNSL_PORT_ATTR_DUPLEX_MASK, OPENNSL_PORT_ATTR_ENABLE_MASK, OPENNSL_PORT_ATTR_LINKSCAN_MASK, OPENNSL_PORT_ATTR_PAUSE_RX_MASK, OPENNSL_PORT_ATTR_PAUSE_TX_MASK, OPENNSL_PORT_ATTR_SPEED_MASK, opennsl_port_config_get(), opennsl_port_config_t_init(), OPENNSL_PORT_DUPLEX_FULL, opennsl_port_info_t_init(), opennsl_port_selective_set(), OPENNSL_STG_STP_FORWARD, opennsl_stg_stp_set(), opennsl_port_info_s::pause_rx, opennsl_port_info_s::pause_tx, port(), and opennsl_port_info_s::speed.
Referenced by main().
int example_read_user_choice | ( | int * | choice | ) |
Read numeric menu choice from user.
choice | [IN/OUT] choice |
Definition at line 252 of file util.c.
References FALSE, MAX_DIGITS_IN_CHOICE, OPENNSL_E_FAIL, OPENNSL_E_NONE, and TRUE.
Referenced by example_knet_intf_create(), and main().
char* example_read_user_string | ( | char * | buf, |
size_t | buflen | ||
) |
Read a string from user.
buf | [IN/OUT] Buffer to store the string |
buflen | [IN] Buffer length |
Definition at line 225 of file util.c.
Referenced by example_knet_intf_create(), example_knet_intf_delete(), and main().
int example_switch_default_vlan_config | ( | int | unit | ) |
Add all ports to default vlan.
unit | [IN] unit number |
Definition at line 180 of file util.c.
References DEFAULT_VLAN, opennsl_port_config_s::e, OPENNSL_E_NONE, opennsl_errmsg, OPENNSL_FAILURE, OPENNSL_PBMP_ITER, opennsl_port_config_get(), opennsl_port_untagged_vlan_set(), opennsl_vlan_port_add(), and port().
Referenced by main().
void l2_print_mac | ( | char * | str, |
opennsl_mac_t | mac_address | ||
) |
To print the MAC address.
Definition at line 358 of file util.c.
Referenced by example_create_l3_intf(), example_fp_redirect(), and example_l2_addr_add().
int opennsl_ip_parse | ( | char * | ip_str, |
unsigned int * | ip_val | ||
) |
int opennsl_mac_parse | ( | char * | buf, |
unsigned char * | macp | ||
) |
Parse MAC address string.
buf | [IN] MAC address in string format |
macp | [OUT] MAC address in integer format |
Definition at line 293 of file util.c.
References MAC_ADDR_LEN, NULL, OPENNSL_E_FAIL, and OPENNSL_E_NONE.
Referenced by main().
void print_ip_addr | ( | char * | str, |
unsigned int | host | ||
) |
To print IP address in dotted decimal format.
str | [OUT] Buffer to store the IP address |
host | [IN] MAC address in integer format |
Definition at line 425 of file util.c.
Referenced by example_add_host(), example_fp_ip_block(), example_ip_tunnel_term_print_key(), example_set_default_route(), example_vxlan_egress_tunnel_create(), print_host(), and print_route().