Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Command Line Parsing and Execution

Command parsing and execution in the elxsdkutil is table driven. The elxu_commands.h file contains an array (cmd_table[]), which describes the available commands. Each entry in this table has the name of the command, a pointer to a command handler function, and help text that describes the function.

Command Handlers are located in elxu_commands.c. Each of these functions parses additional options as needed, validates the options given, then calls the appropriate function to execute the command.

The main() function simply compares the first command line argument to each of the commands in the command table. If a match is found, then the corresponding handler function is called. If no match is found, then an error message is displayed.

List of Commands with Associated Command Handlers

CommandNameCommand Handler
add-ipAdd IPelxu_cmd_add_ip()
cmpCompareelxu_cmd_cmp()
connection-infoConnection Informationelxu_cmd_connection_info()
create-vportCreate VPortelxu_cmd_create_vport()
driver-dumpDriver Dumpelxu_cmd_driver_dump()
driver-infoDriver Informationelxu_cmd_driver_info()
dumpFirmware Dumpelxu_cmd_dump()
dump-to-hostGenerate Dump to Hostelxu_cmd_dump_to_host()
efdcEFD Capabilitieselxu_cmd_efdc()
file-infoFile Information of UFIelxu_cmd_file_info()
gendumpGenerate Dumpelxu_cmd_gendump()
helpHelpelxu_cmd_help()
linkcfg-getGet Link Configurationelxu_cmd_linkcfg_get()
linkcfg-getSet Link Configurationelxu_cmd_linkcfg_set()
listList Adapterselxu_cmd_list()
mgmt-infoManagement Informationelxu_cmd_mgmt_info()
objenumObjects Enumerateelxu_cmd_objenum()
read-link-statusRead Link Statuselxu_cmd_read_link_status()
read-revRead Adapter Versionelxu_cmd_read_rev()>
read-statusRead Device Statuselxu_cmd_read_status()
readRead Object Fileelxu_cmd_read()
remove-vportRemove VPortelxu_cmd_remove_vport()
set-macSet MAC Addresselxu_cmd_set_mac()
sfpSFP EEPROM Dataelxu_cmd_sfp()
show-ipsShow IPselxu_cmd_show_ips()
show-macShow MACelxu_cmd_show_mac()
versionVersion of Programelxu_cmd_version()
writeWrite Firmware Imageelxu_cmd_write()