This patch adds Dell specific Licensing feature



Thanks,
Srinivas.G
diff -Naurp 04-ipmitool_dell_windbg/lib/ipmi_delloem.c 
05-ipmitool_dell_license_feature/lib/ipmi_delloem.c
--- 04-ipmitool_dell_windbg/lib/ipmi_delloem.c  2011-08-04 16:48:42.000000000 
+0530
+++ 05-ipmitool_dell_license_feature/lib/ipmi_delloem.c 2011-08-04 
16:48:43.000000000 +0530
@@ -2716,6 +2716,11 @@ static int ipmi_lan_set_nic_selection_12
                lprintf(LOG_ERR, " Error in setting nic selection");
                return -1;
        }
+       // Check license only for setting the dedicated nic.
+       else if( (nic_selection[0] == 1) && ((iDRAC_FLAG == IDRAC_12G) && 
(rsp->ccode == LICENSE_NOT_SUPPORTED))) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
+       } 
        else if (rsp->ccode > 0) 
        {
                lprintf(LOG_ERR, " Error in setting nic selection (%s) \n",
@@ -3198,7 +3203,10 @@ ipmi_get_power_capstatus_command (struct
     rsp = intf->sendrecv(intf, &req);
     if (rsp == NULL) {
         lprintf(LOG_ERR, " Error getting powercap status");
-        return -1;
+               return -1;
+       } else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == 
LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      // Return Error as unlicensed
     } else if (rsp->ccode > 0) {
         lprintf(LOG_ERR, " Error getting powercap statusr: %s",
             val2str(rsp->ccode, completion_code_vals));
@@ -3250,6 +3258,9 @@ ipmi_set_power_capstatus_command (struct
     if (rsp == NULL) {
         lprintf(LOG_ERR, " Error setting powercap status");
         return -1;
+       } else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == 
LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      //return unlicensed Error code
     } else if (rsp->ccode > 0) {
         lprintf(LOG_ERR, " Error setting powercap statusr: %s",
             val2str(rsp->ccode, completion_code_vals));
@@ -3341,7 +3352,11 @@ static int ipmi_powermgmt(struct ipmi_in
         lprintf(LOG_ERR, " Error getting power management information.\n");
         return -1;
     } 
-    if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)) {
+
+       if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
+       } else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)) {
         lprintf(LOG_ERR, " Error getting power management information: Command 
not supported on this system.");
         return -1;
     }else if (rsp->ccode != 0) {
@@ -3451,6 +3466,9 @@ ipmi_powermgmt_clear(struct ipmi_intf* i
     if (rsp == NULL) {
         lprintf(LOG_ERR, " Error clearing power values.\n");
         return -1;
+} else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
     } else if (rsp->ccode == 0xc1) {
         lprintf(LOG_ERR, " Error clearing power values, command not supported 
on this system.\n");
         return -1;
@@ -3530,6 +3548,9 @@ static int ipmi_get_power_headroom_comma
     if (rsp == NULL) {
         lprintf(LOG_ERR, " Error getting power headroom status");
         return -1;
+} else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
     } else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)){
         lprintf(LOG_ERR, " Error getting power headroom status: Command not 
supported on this system ");
         return -1;
@@ -3687,6 +3708,9 @@ static int ipmi_get_instan_power_consmpt
         lprintf(LOG_ERR, " Error getting instantaneous power consumption data 
.\n");
 
         return -1;
+       } else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == 
LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
     } else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)) {
         lprintf(LOG_ERR, "  Error getting instantaneous power consumption 
data: Command not supported on this system.");
         return -1;
@@ -3810,7 +3834,10 @@ static int ipmi_get_avgpower_consmpt_his
         lprintf(LOG_ERR, " Error getting average power consumption history 
data .\n");
         return -1;
     } 
-    else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
+       else if((iDRAC_FLAG == IDRAC_12G) &&  (rsp->ccode == 
LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
+       } else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
     {
         lprintf(LOG_ERR, "  Error getting average power consumption  history 
data: Command not supported on this system.");
         return -1;
@@ -3870,7 +3897,10 @@ static int ipmi_get_peakpower_consmpt_hi
         lprintf(LOG_ERR, " Error getting  peak power consumption history data 
.\n");
         return -1;
     }
-    else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
+       else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == 
LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
+       } else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
     {
         lprintf(LOG_ERR, "  Error getting peak power consumption history data: 
Command not supported on this system.");
         return -1;
@@ -3933,7 +3963,10 @@ static int ipmi_get_minpower_consmpt_his
         lprintf(LOG_ERR, " Error getting  peak power consumption history data 
.\n");
         return -1;
     }
-    else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
+       else if((iDRAC_FLAG == IDRAC_12G) &&  (rsp->ccode == 
LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
+       } else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
     {
         lprintf(LOG_ERR, "  Error getting peak power consumption history data: 
Command not supported on this system.");
         return -1;
@@ -4160,6 +4193,9 @@ static int ipmi_get_power_cap(struct ipm
         }
         return -1;
 
+       } else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == 
LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
     } else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)) {
 
         lprintf(LOG_ERR, "  Error getting power cap: Command not supported on 
this system.");
@@ -4295,8 +4331,12 @@ static int ipmi_set_power_cap(struct ipm
                 rsp->data[8], rsp->data[9], rsp->data[10],rsp->data[11]);
         }
         return -1;
-
-    }
+                       
+       }
+       else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == 
LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
+       } 
     else if (rsp->ccode == 0xc1) 
     {
 
@@ -4406,6 +4446,10 @@ static int ipmi_set_power_cap(struct ipm
         lprintf(LOG_ERR, " Error setting power cap");
         return -1;
     }
+       else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == 
LICENSE_NOT_SUPPORTED)) {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
+       } 
     else if (rsp->ccode > 0) 
     {
         lprintf(LOG_ERR, " Error setting power cap: %s",
@@ -4650,7 +4694,12 @@ ipmi_get_sd_card_info(struct ipmi_intf* 
 
        sdcardinfoblock = (IPMI_DELL_SDCARD_INFO *) (void *) rsp->data;
 
-       if (sdcardinfoblock->vflashcompcode != 0x00)
+       if( (iDRAC_FLAG == IDRAC_12G) && (sdcardinfoblock->vflashcompcode == 
VFL_NOT_LICENSED))
+       {
+               printf("FM001 : A required license is missing or expired\n");
+               return -1;      
+       }
+       else if (sdcardinfoblock->vflashcompcode != 0x00)
        {
                lprintf(LOG_ERR, " Error in getting SD Card Extended 
Information (%s) \n", get_vFlash_compcode_str(sdcardinfoblock->vflashcompcode,
                                        vFlash_completion_code_vals));
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to