Replace tabs with spaces.
diff --git a/oemhandler.C b/oemhandler.C
index ffff6c6..c62958d 100644
--- a/oemhandler.C
+++ b/oemhandler.C
@@ -13,19 +13,19 @@
///////////////////////////////////////////////////////////////////////////////
-// For the First partial add eSEL the SEL Record ID and offset
-// value should be 0x0000. The extended data needs to be in
-// the form of an IPMI SEL Event Record, with Event sensor type
-// of 0xDF and Event Message format of 0x04. The returned
+// For the First partial add eSEL the SEL Record ID and offset
+// value should be 0x0000. The extended data needs to be in
+// the form of an IPMI SEL Event Record, with Event sensor type
+// of 0xDF and Event Message format of 0x04. The returned
// Record ID should be used for all partial eSEL adds.
//
-// This function creates a /tmp/esel# file to store the
+// This function creates a /tmp/esel# file to store the
// incoming partial esel. It is the role of some other
-// function to commit the error log in to long term
-// storage. Likely via the ipmi add_sel command.
+// function to commit the error log in to long term
+// storage. Likely via the ipmi add_sel command.
///////////////////////////////////////////////////////////////////////////////
-ipmi_ret_t ipmi_ibm_oem_partial_esel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- ipmi_request_t request, ipmi_response_t response,
+ipmi_ret_t ipmi_ibm_oem_partial_esel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
+ ipmi_request_t request, ipmi_response_t response,
ipmi_data_len_t data_len, ipmi_context_t context)
{
esel_request_t *reqptr = (esel_request_t*) request;
@@ -36,7 +36,7 @@
char string[64];
const char *pio;
-
+
offset = LSMSSWAP(reqptr->offsetls, reqptr->offsetms);
snprintf(string, sizeof(string), "%s%s%02x%02x", g_esel_path, "esel", reqptr->selrecordms, reqptr->selrecordls);
@@ -49,7 +49,7 @@
rlen = (*data_len) - (uint8_t) (sizeof(esel_request_t));
- printf("IPMI PARTIAL ESEL for %s Offset = %d Length = %d\n",
+ printf("IPMI PARTIAL ESEL for %s Offset = %d Length = %d\n",
string, offset, rlen);
@@ -78,7 +78,7 @@
rc = IPMI_CC_INVALID;
*data_len = 0;
}
-
+
return rc;
}
diff --git a/oemhandler.h b/oemhandler.h
index 59c2a42..9cc397f 100644
--- a/oemhandler.h
+++ b/oemhandler.h
@@ -13,8 +13,8 @@
-ipmi_ret_t ipmi_ibm_oem_partial_esel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- ipmi_request_t request, ipmi_response_t response,
+ipmi_ret_t ipmi_ibm_oem_partial_esel(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
+ ipmi_request_t request, ipmi_response_t response,
ipmi_data_len_t data_len, ipmi_context_t context);
diff --git a/testit.C b/testit.C
index f42d4a8..79dfd6a 100644
--- a/testit.C
+++ b/testit.C
@@ -10,7 +10,7 @@
const char* g_filepath = "/tmp/";
-const char * getFilePath(void) { return g_filepath; }
+const char * getFilePath(void) { return g_filepath; }
// Number of bytes without the IPMI completion code
#define MAXRESPONSE 2
@@ -21,25 +21,25 @@
std::ifstream::pos_type filesize(const char* filename)
{
std::ifstream in(filename, std::ifstream::ate | std::ifstream::binary);
- return in.tellg();
+ return in.tellg();
}
// Compares a string to the data in a file.
// Returns 0 if complete match
-int compareData(const char *filename, const char *string, size_t len)
+int compareData(const char *filename, const char *string, size_t len)
{
- std::ifstream in(filename, std::ifstream::ate | std::ifstream::binary);
- std::streamsize size = in.tellg();
+ std::ifstream in(filename, std::ifstream::ate | std::ifstream::binary);
+ std::streamsize size = in.tellg();
- std::vector<char> buffer(size);
+ std::vector<char> buffer(size);
- in.read(buffer.data(), size);
+ in.read(buffer.data(), size);
- if (!std::memcmp(string, buffer.data(), len))
- return -1;
-
+ if (!std::memcmp(string, buffer.data(), len))
+ return -1;
+
return 0;
}
@@ -47,73 +47,73 @@
void test_multiwrite(unsigned int segment, const char *pString) {
- uint8_t request[1024];
- uint8_t response[MAXRESPONSE];
- size_t len, totalString;
- ipmi_ret_t rc;
- uint16_t i=0, j;
-
- esel_request_t requestheader[] = {0,0,0,0,0,0};
- esel_request_t *pReqHdr = requestheader;
- uint8_t firstime[] = { 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x20,
- 0x00, 0x04, 0x0c, 0x1e, 0x07, 0xaa, 0x00, 0x00};
+ uint8_t request[1024];
+ uint8_t response[MAXRESPONSE];
+ size_t len, totalString;
+ ipmi_ret_t rc;
+ uint16_t i=0, j;
- ipmi_request_t pRequest = request;
- ipmi_response_t pResponse = response;
- ipmi_data_len_t pLen = &len;
+ esel_request_t requestheader[] = {0,0,0,0,0,0};
+ esel_request_t *pReqHdr = requestheader;
+ uint8_t firstime[] = { 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x20,
+ 0x00, 0x04, 0x0c, 0x1e, 0x07, 0xaa, 0x00, 0x00};
- totalString = strlen(pString);
+ ipmi_request_t pRequest = request;
+ ipmi_response_t pResponse = response;
+ ipmi_data_len_t pLen = &len;
- std::memcpy(pRequest, requestheader, sizeof(requestheader));
- std::memcpy(&request[sizeof(requestheader)], firstime, sizeof(firstime));
+ totalString = strlen(pString);
- *pLen = sizeof(requestheader) + sizeof(firstime);
+ std::memcpy(pRequest, requestheader, sizeof(requestheader));
+ std::memcpy(&request[sizeof(requestheader)], firstime, sizeof(firstime));
- rc = ipmi_ibm_oem_partial_esel(0x3E, 0xF0, pRequest, pResponse, pLen, NULL);
- if (rc != IPMI_CC_OK) { printf("Error completion code returned %d\n", rc);}
- if (len != 2) { printf("Error data buffer length failed len\n");}
+ *pLen = sizeof(requestheader) + sizeof(firstime);
- pReqHdr->selrecordls = response[0];
- pReqHdr->selrecordms = response[1];
+ rc = ipmi_ibm_oem_partial_esel(0x3E, 0xF0, pRequest, pResponse, pLen, NULL);
+ if (rc != IPMI_CC_OK) { printf("Error completion code returned %d\n", rc);}
+ if (len != 2) { printf("Error data buffer length failed len\n");}
+
+ pReqHdr->selrecordls = response[0];
+ pReqHdr->selrecordms = response[1];
- for (i=0; i<totalString; i+=segment) {
+ for (i=0; i<totalString; i+=segment) {
- pReqHdr->offsetls = (i&0x00FF);
- pReqHdr->offsetms = ((i&0xFF00) >> 8);
+ pReqHdr->offsetls = (i&0x00FF);
+ pReqHdr->offsetms = ((i&0xFF00) >> 8);
- // printf("Record id msls 0x%02x%02x\n", pReqHdr->selrecordms, pReqHdr->selrecordls);
- // printf("Offset 0x%04x , msls = 0x%02x%02x\n", i, pReqHdr->offsetms , pReqHdr->offsetls);
+ // printf("Record id msls 0x%02x%02x\n", pReqHdr->selrecordms, pReqHdr->selrecordls);
+ // printf("Offset 0x%04x , msls = 0x%02x%02x\n", i, pReqHdr->offsetms , pReqHdr->offsetls);
- if (i+segment > totalString) {
- j = totalString-i;
- } else {
- j = segment;
- }
+ if (i+segment > totalString) {
+ j = totalString-i;
+ } else {
+ j = segment;
+ }
- std::memcpy(pRequest, requestheader, sizeof(requestheader));
- std::memcpy(&request[sizeof(requestheader)], pString+i, j);
- len = sizeof(*requestheader) + j;
+ std::memcpy(pRequest, requestheader, sizeof(requestheader));
+ std::memcpy(&request[sizeof(requestheader)], pString+i, j);
+ len = sizeof(*requestheader) + j;
- rc = ipmi_ibm_oem_partial_esel(0x3E, 0xF0, pRequest, pResponse, pLen, NULL);
+ rc = ipmi_ibm_oem_partial_esel(0x3E, 0xF0, pRequest, pResponse, pLen, NULL);
- if (rc != IPMI_CC_OK) { printf("Error completion code returned %d\n", rc);}
- if (len != 2) { printf("Error data buffer length failed\n");}
+ if (rc != IPMI_CC_OK) { printf("Error completion code returned %d\n", rc);}
+ if (len != 2) { printf("Error data buffer length failed\n");}
- pReqHdr->selrecordls = response[0];
- pReqHdr->selrecordms = response[1];
+ pReqHdr->selrecordls = response[0];
+ pReqHdr->selrecordms = response[1];
- }
-
+ }
- if (filesize("/tmp/esel0100") != (unsigned int) strlen(pString)) { printf("Error fileszie mismatch\n");}
- // /tmp/esel000 should be identical to the incoming string
- rc = compareData("/tmp/esel0100",pString,strlen(pString));
- if (rc != 0) {printf("Data miscompare %d\n",rc);}
+ if (filesize("/tmp/esel0100") != (unsigned int) strlen(pString)) { printf("Error fileszie mismatch\n");}
- return;
+ // /tmp/esel000 should be identical to the incoming string
+ rc = compareData("/tmp/esel0100",pString,strlen(pString));
+ if (rc != 0) {printf("Data miscompare %d\n",rc);}
+
+ return;
}
@@ -128,14 +128,14 @@
int main()
{
- const char* shortstring = "C";
- const char* longstring = "The President is very much a figurehead - he wields no real power whatsoever. He is apparently chosen by the government, but the qualities he is required to display are not those of leadership but those of finely judged outrage. For this reason the President is always a controversial choice, always an infuriating but fascinating character. His job is not to wield power but to draw attention away from it.";
+ const char* shortstring = "C";
+ const char* longstring = "The President is very much a figurehead - he wields no real power whatsoever. He is apparently chosen by the government, but the qualities he is required to display are not those of leadership but those of finely judged outrage. For this reason the President is always a controversial choice, always an infuriating but fascinating character. His job is not to wield power but to draw attention away from it.";
- test_multiwrite(1, shortstring);
+ test_multiwrite(1, shortstring);
- test_multiwrite(10, longstring);
- test_multiwrite(1, longstring);
- test_multiwrite(100, longstring);
+ test_multiwrite(10, longstring);
+ test_multiwrite(1, longstring);
+ test_multiwrite(100, longstring);
- return 0;
+ return 0;
}