/* * Copyright (c) 2014 Pigeon Point Systems. All right reserved * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Pigeon Point Systems, or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS, " without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * PIGEON POINT SYSTEMS ("PPS") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * PPS OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #include #include #include #include #include #include /* Handled VITA 46.11 commands */ #define VITA_CMD_HELP 0 #define VITA_CMD_PROPERTIES 1 #define VITA_CMD_FRUCONTROL 2 #define VITA_CMD_ADDRINFO 3 #define VITA_CMD_ACTIVATE 4 #define VITA_CMD_DEACTIVATE 5 #define VITA_CMD_POLICY_GET 6 #define VITA_CMD_POLICY_SET 7 #define VITA_CMD_LED_PROP 8 #define VITA_CMD_LED_CAP 9 #define VITA_CMD_LED_GET 10 #define VITA_CMD_LED_SET 11 #define VITA_CMD_UNKNOWN 255 /* VITA 46.11 Site Type strings */ static struct valstr vita_site_types[] = { { VITA_FRONT_VPX_MODULE, "Front Loading VPX Plug-In Module" }, { VITA_POWER_ENTRY, "Power Entry Module" }, { VITA_CHASSIS_FRU, "Chassic FRU Information Module" }, { VITA_DEDICATED_CHMC, "Dedicated Chassis Manager" }, { VITA_FAN_TRAY, "Fan Tray" }, { VITA_FAN_TRAY_FILTER, "Fan Tray Filter" }, { VITA_ALARM_PANEL, "Alarm Panel" }, { VITA_XMC, "XMC" }, { VITA_VPX_RTM, "VPX Rear Transition Module" }, { VITA_FRONT_VME_MODULE, "Front Loading VME Plug-In Module" }, { VITA_FRONT_VXS_MODULE, "Front Loading VXS Plug-In Module" }, { VITA_POWER_SUPPLY, "Power Supply" }, { VITA_FRONT_VITA62_MODULE, "Front Loading VITA 62 Module\n" }, { VITA_71_MODULE, "VITA 71 Module\n" }, { VITA_FMC, "FMC\n" }, { 0, NULL } }; /* VITA 46.11 command help strings */ static struct valstr vita_help_strings[] = { { VITA_CMD_HELP, "VITA commands:\n" " properties - get VSO properties\n" " frucontrol - FRU control\n" " addrinfo - get address information\n" " activate - activate a FRU\n" " deactivate - deactivate a FRU\n" " policy get - get the FRU activation policy\n" " policy set - set the FRU activation policy\n" " led prop - get led properties\n" " led cap - get led color capabilities\n" " led get - get led state\n" " led set - set led state" }, { VITA_CMD_FRUCONTROL, "usage: frucontrol