#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include "zlib.h"
#include "rpcclt_openapi.h"
#include "proc_util.h"
#define ASIC_CELL_SIZE 208
#define SAMPLE_PORT_1 1
#define SAMPLE_PORT_2 2
#define SAMPLE_PORT_3 3
#define SAMPLE_LAG_1 0
#define SAMPLE_PG_1 1
#define SAMPLE_PG_2 2
#define SAMPLE_SP_1 0
#define SAMPLE_SP_2 1
#define SAMPLE_UCQ_1 16
#define SAMPLE_UCQ_2 48
#define SAMPLE_UCQG_1 10
#define SAMPLE_UCQG_2 12
#define SAMPLE_MCQ_1 15
#define SAMPLE_MCQ_2 22
#define SAMPLE_CPUQ_1 5
#define SAMPLE_CPUQ_2 4
#define SAMPLE_RQE_1 8
#define SAMPLE_RQE_2 5
#define DEVICE_THRESH_SAMPLE_1 832
#define IPPG_THRESH_SHARED_SAMPLE_1 1001
#define IPPG_THRESH_HEADROOM_SAMPLE_1 1002
#define IPSP_THRESHOLD_SAMPLE_1 2001
#define ISP_THRESHOLD_SAMPLE_1 2402
#define EPSP_UC_THRESHOLD_SAMPLE_1 1664
#define EPSP_UM_THRESHOLD_SAMPLE_1 3328
#define EPSP_MC_THRESHOLD_SAMPLE_1 4992
#define EPSP_MC_SHARE_THRESHOLD_SAMPLE_1 6001
#define ESP_UM_THRESHOLD_SAMPLE_1 1664
#define ESP_MC_THRESHOLD_SAMPLE_1 4992
#define ESP_MC_SHARE_THRESHOLD_SAMPLE_1 3903
#define UCQ_THRESHOLD_SAMPLE_1 4801
#define UCQG_THRESHOLD_SAMPLE_1 4801
#define MCQB_THRESHOLD_SAMPLE_1 4982
#define MCQQ_THRESHOLD_SAMPLE_1 502
#define CPUQB_THRESHOLD_SAMPLE_1 600
#define CPUQQ_THRESHOLD_SAMPLE_1 601
#define RQEB_THRESHOLD_SAMPLE_1 50
#define RQEQ_THRESHOLD_SAMPLE_1 51
#define BST_RPC_PARM_DATA_AREA_MAX (256 * 1024)
#define BST_RPC_DEVMSG_DATA_MAX (BST_RPC_PARM_DATA_AREA_MAX * 2)
#define BST_MAX_COMPRESSED_LEN (BST_RPC_DEVMSG_DATA_MAX - 1024)
void *cookie;
uint32_t cb_cookie;
bool trigger_event = false;
{
printf("Testing API -- openapiBstAsicCapabilityGet\n");
printf("------------------------------------------\n\n");
{
printf("Displaying Basic ASIC Capabilities\n");
printf("---------------------------------- \n");
printf(
"Number of ports %d\n", asicInfo.
numPorts);
}
return result;
}
{
uint32_t port;
printf("\n\n");
printf("Testing API -- openapiPortMappingGet\n");
printf("-------------------------------------------\n");
{
printf("Ports mapped to this ASIC\n");
for(port = 0; port < asicInfo.
numPorts; port++)
{
printf(
"0/%d, ", portMapData.
portMap[port]);
}
}
return result;
}
{
char lagName[32];
printf("\n\n");
printf("Testing API -- openapiLagTranslateToNotation\n");
printf("---------------------------------------------\n");
memset(lagName, 0, sizeof(lagName));
lagbuf.
size =
sizeof(lagName);
{
printf("Lag string for lag number=%d is %s\n", SAMPLE_LAG_1, lagName);
}
return result;
}
{
int get_result,set_result;
printf("\n\n");
printf("Testing API -- openapiBstConfigSet\n");
printf("------------------------------------\n");
bstConfig.
enableIngressStatsMonitoring =
true;
bstConfig.
enableEgressStatsMonitoring =
true;
bstConfig.
mode = OPEN_BST_MODE_CURRENT;
{
printf("Setting basic BST configuration failed, result = %d\n", result);
printf("Parameters, mode = current, ingress = enable, egress = enable, device = enable\n");
}
{
printf("Reading basic BST configuration failed, result = %d\n", result);
}
{
}
{
printf("Setting basic BST configuration failed mismatch in get and set \n");
printf(
"Set parameters mode = %d, device = %d, ingress = %d , egress = %d\n", bstConfig.
mode,
bstConfig.enableEgressStatsMonitoring);
printf(
"Read parameters mode = %d, device = %d, ingress = %d , egress = %d\n", bstReadConfig.
mode,
bstReadConfig.enableEgressStatsMonitoring);
}
bstConfig.
mode = OPEN_BST_MODE_PEAK;
bstConfig.enableIngressStatsMonitoring = false;
bstConfig.enableEgressStatsMonitoring = true;
{
printf("Setting basic BST configuration failed, result =%d \n", result);
printf("Parameters, mode = peak, ingress = false, egress = enable, device = enable\n");
}
{
printf("Reading basic BST configuration failed, result = %d\n", result);
}
if ((bstConfig.enableIngressStatsMonitoring != bstReadConfig.enableIngressStatsMonitoring) ||
{
printf("Setting basic BST configuration failed, mismatch in get and set \n");
printf(
"Set parameters mode = %d, device = %d, ingress = %d , egress = %d\n", bstConfig.
mode,
bstConfig.enableEgressStatsMonitoring);
printf(
"Read parameters mode = %d, device = %d, ingress = %d , egress = %d\n", bstReadConfig.
mode,
bstReadConfig.enableEgressStatsMonitoring);
}
{
printf("Disabling BST failed, result = %d\n", result);
}
{
{
printf("Disabling BST configuration failed, result = %d\n", result);
}
}
else
{
printf("Reading basic BST configuration failed, result = %d\n", result);
}
printf("BST configuration for current and peak successful\n");
printf("BST configuration to enable and disable successful\n");
bstConfig.enableIngressStatsMonitoring = true;
bstConfig.enableEgressStatsMonitoring = true;
bstConfig.
mode = OPEN_BST_MODE_CURRENT;
{
printf("BST is Enabled for other tests\n");
}
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstDeviceDataGet\n");
printf("---------------------------------------\n");
{
printf(
"Device buffer count = %llu\n", (
unsigned long long) devicedata.
bufferCount);
}
else
{
printf("Failed to read Device buffer count, result = %d\n", result);
}
return result;
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstIspDataGet\n");
printf("------------------------------------\n");
{
printf(
"Ingress service pool buffer count = %llu \n", (
unsigned long long) ispData.
data[0].
umShareBufferCount);
}
else
{
printf("Failed to read Ingress service pool count, result = %d\n", result);
}
return result;
}
uint32_t pgNum)
{
int num;
char space[24]={" "};
if (portData == NULL)
{
printf("Port Data buffer is null for port = %d\n", port);
return;
}
printf("Ingress Port priority group, port = %d\n\n", port);
printf("Priority group UM Share count UM Headroom count\n");
printf("-------------- -------------- -----------------\n");
if (pgNum == -1)
{
{
printf("%d%-13.13s %-14d %-18d\n",
num, space, portData->
data[port][num].
umShareBufferCount,
portData->data[port][num].
umHeadroomBufferCount);
}
}
else
{
printf("%d%-13.13s %-14d %-18d\n",
pgNum, space, portData->data[port][pgNum].umShareBufferCount,
portData->data[port][pgNum].umHeadroomBufferCount);
}
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstIppgDataGet\n");
printf("---------------------------------------\n");
{
printIppg(&ippgData, SAMPLE_PORT_1, SAMPLE_PG_1);
printf("\n\n");
printIppg(&ippgData, SAMPLE_PORT_2, SAMPLE_PG_1);
printf("\n\n");
printIppg(&ippgData, SAMPLE_PORT_2, -1);
printf("\n\n");
}
else
{
printf("Failed to read Ingress port priority group buffer data, result = %d\n", result);
}
return result;
}
{
if (portData == NULL)
{
printf("Port Data buffer is null for port = %d\n", port);
return;
}
printf("Ingress Port service pool, port = %d\n", port);
printf(
"Unicast Multicast shared buffer = %d\n", portData->
data[port][SAMPLE_SP_1].
umShareBufferCount);
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstIpspDataGet\n");
printf("---------------------------------------\n");
{
printIpsp(&ipspData, SAMPLE_PORT_1);
printf("\n\n");
printIpsp(&ipspData, SAMPLE_PORT_2);
printf("\n\n");
}
else
{
printf("Failed to read Ingress port service pool buffer data, result = %d\n\n", result);
}
return result;
}
{
if (ucqData == NULL)
{
printf("Egress unicast queue buffer is null \n");
return;
}
{
printf("Invaild input for Egress unicast queue, number = %d\n", queue);
return;
}
printf("Egress unicast queue = %d associated port = %llu buffer count = %llu\n",
queue, (
unsigned long long) ucqData->
data[queue].
port, (
unsigned long long) ucqData->data[queue].
ucBufferCount);
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstEucqDataGet\n");
printf("------------------------------------\n");
{
printUcq(&ucqData, SAMPLE_UCQ_1);
printf("\n");
printUcq(&ucqData, SAMPLE_UCQ_2);
printf("\n");
}
else
{
printf("Failed to read Egress unicast queue buffer data, result = %d\n", result);
}
return result;
}
{
if (ucqgData == NULL)
{
printf("Egress unicast queue group buffer is null \n");
return;
}
{
printf("Invaild input for Egress unicast queue group, number = %d\n", queue);
return;
}
printf("Egress unicast queue group = %d buffer count = %llu\n",
queue, (
unsigned long long) ucqgData->
data[queue].
ucBufferCount);
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstEucqgDataGet\n");
printf("------------------------------------\n");
{
printUcqg(&ucqgData, SAMPLE_UCQG_1);
printf("\n\n");
printUcqg(&ucqgData, SAMPLE_UCQG_2);
printf("\n\n");
}
else
{
printf("Failed to read Egress unicast queue group buffer data, result = %d\n\n", result);
}
return result;
}
{
if (mcqData == NULL)
{
printf("Egress unicast queue buffer is null \n");
return;
}
{
printf("Invaild input for Egress unicast queue, number = %d\n", queue);
return;
}
printf("Egress multicast queue = %d associated port = %llu buffer count = %llu"
" queue entries = %llu\n", queue,
(
unsigned long long) mcqData->
data[queue].
port, (
unsigned long long) mcqData->data[queue].
mcBufferCount,
(
unsigned long long) mcqData->data[queue].
mcQueueEntries);
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstEmcqDataGet\n");
printf("------------------------------------\n");
{
printMcq(&mcqData, SAMPLE_MCQ_1);
printf("\n");
printMcq(&mcqData, SAMPLE_MCQ_2);
printf("\n");
}
else
{
printf("Failed to read Egress multicast queue group buffer data, result = %d\n", result);
}
return result;
}
{
if (cpuData == NULL)
{
printf("CPU queue buffer is null \n");
return;
}
{
printf("Invaild input for CPU queue, number = %d\n", queue);
return;
}
printf("CPU queue = %d cpu buffer count = %llu"
" cpu queue entries = %llu\n", queue,
(
unsigned long long) cpuData->
data[queue].
cpuBufferCount,
(
unsigned long long) cpuData->data[queue].
cpuQueueEntries);
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstCpuqDataGet\n");
printf("------------------------------------\n");
{
printCpuq(&cpuData, SAMPLE_CPUQ_1);
printf("\n");
printCpuq(&cpuData, SAMPLE_CPUQ_2);
printf("\n");
}
else
{
printf("Failed to read Egress CPU queue group buffer data, result = %d\n\n", result);
}
return result;
}
{
if (rqeData == NULL)
{
printf("RQE queue buffer is null \n");
return;
}
{
printf("Invaild input for RQE queue, number = %d\n", queue);
return;
}
printf("RQE queue = %d rqe buffer count = %llu"
" rqe queue entries = %llu\n", queue,
(
long long unsigned) rqeData->
data[queue].
rqeBufferCount,
(
long long unsigned) rqeData->data[queue].
rqeQueueEntries);
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstRqeqDataGet\n");
printf("------------------------------------\n");
{
printRqeq(&rqeData, SAMPLE_RQE_1);
printf("\n");
printRqeq(&rqeData, SAMPLE_RQE_2);
printf("\n");
}
else
{
printf("Failed to read Egress RQE queue buffer data, result = %d\n\n", result);
}
return result;
}
uint32_t spNum)
{
if (portData == NULL)
{
printf("Egress port service pool buffer is null for port = %d\n", port);
return;
}
if ((spNum < 0) || (spNum > 3))
{
printf("Invaild input for Egress port service pool, port = %d, service pool = %d\n", port, spNum);
return;
}
printf("Egress Port service pool buffer counts, port = %d\n", port);
printf(
"Unicast shared = %d\n", portData->
data[port][spNum].
ucShareBufferCount);
printf(
"Unicast Multicast shared = %d\n", portData->data[port][spNum].
umShareBufferCount);
printf(
"Multicast shared = %d\n", portData->data[port][spNum].
mcShareBufferCount);
printf(
"Multicast shared queue entries = %d\n", portData->data[port][spNum].
mcShareQueueEntries);
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstEpspDataGet\n");
printf("------------------------------------\n");
{
printEpsp(&epspData, SAMPLE_PORT_1, SAMPLE_SP_1);
printf("\n");
printEpsp(&epspData, SAMPLE_PORT_2, SAMPLE_SP_1);
printf("\n");
printEpsp(&epspData, SAMPLE_PORT_2, SAMPLE_SP_1);
printf("\n");
}
else
{
printf("Failed to read Egress port serivce pool buffer data, result =%d\n", result);
}
return result;
}
{
time_t time;
printf("\n\n");
printf("Testing API -- openapiBstEspDataGet\n");
printf("------------------------------------\n");
{
printf("Buffer counts of Egress service poool\n");
printf(
"Unicast Multicast shared = %llu\n", (
unsigned long long) espData.
data[0].
umShareBufferCount);
printf(
"Multicast shared = %llu\n", (
unsigned long long) espData.data[0].
mcShareBufferCount);
printf(
"Multicast shared queue entries = %llu\n", (
unsigned long long) espData.data[0].
mcShareQueueEntries);
}
else
{
printf("Failed to read Egress port serivce pool buffer data, result =%d\n", result);
}
return result;
}
{
time_t time;
open_error_t snap_get, snap_max_get, thresh_clear, stats_clear, cgsn_drop_ctr_clear;
{
printf("Reading of entire snapshot of all buffers succeeded\n");
}
else
{
printf("Reading of entire snapshot of all buffers failed\n");
}
{
printf("Reading of entire maximum snapshot of all buffers succeeded\n");
}
else
{
printf("Reading of entire maximum default snapshot of all buffers failed\n");
}
{
printf("Clearing of thresholds succeeded\n");
}
else
{
printf("Clearing of thresholds failed\n");
}
{
printf("Clearing of statistics succeeded\n");
}
else
{
printf("Clearing of statistics failed\n");
}
{
printf("Clearing of congestion drop counters succeeded\n");
}
else
{
printf("Clearing of congestion drop counters failed, error = %d \n", cgsn_drop_ctr_clear);
}
return result;
}
uint64_t getSystemthresh(uint64_t threshold)
{
if (threshold % ASIC_CELL_SIZE == 0)
{
return threshold;
}
return ( ((threshold/ASIC_CELL_SIZE)+1) * ASIC_CELL_SIZE);
}
{
time_t time;
printf("\n\nTesting the thresholds of various resorces\n");
printf("------------------------------------------\n\n");
device.
threshold = DEVICE_THRESH_SAMPLE_1;
ippg.
umShareThreshold = IPPG_THRESH_SHARED_SAMPLE_1;
ippg.
umHeadroomThreshold = IPPG_THRESH_HEADROOM_SAMPLE_1;
ipsp.
umShareThreshold = IPSP_THRESHOLD_SAMPLE_1;
isp.
umShareThreshold = ISP_THRESHOLD_SAMPLE_1;
epsp.
ucShareThreshold = EPSP_UC_THRESHOLD_SAMPLE_1;
epsp.
umShareThreshold = EPSP_UM_THRESHOLD_SAMPLE_1;
epsp.
mcShareThreshold = EPSP_MC_THRESHOLD_SAMPLE_1;
epsp.
mcShareQueueEntriesThreshold = EPSP_MC_SHARE_THRESHOLD_SAMPLE_1;
SAMPLE_SP_1, &epsp);
esp.
umShareThreshold = ESP_UM_THRESHOLD_SAMPLE_1;
esp.
mcShareThreshold = ESP_MC_THRESHOLD_SAMPLE_1;
ucq.
ucBufferThreshold = UCQ_THRESHOLD_SAMPLE_1;
ucqg.
ucBufferThreshold = UCQG_THRESHOLD_SAMPLE_1;
mcq.
mcBufferThreshold = MCQB_THRESHOLD_SAMPLE_1;
mcq.
mcQueueThreshold = MCQQ_THRESHOLD_SAMPLE_1;
cpuq.
cpuBufferThreshold = CPUQB_THRESHOLD_SAMPLE_1;
cpuq.
cpuQueueThreshold = CPUQQ_THRESHOLD_SAMPLE_1;
rqeq.
rqeBufferThreshold = RQEB_THRESHOLD_SAMPLE_1;
rqeq.
rqeQueueThreshold = RQEQ_THRESHOLD_SAMPLE_1;
&thMcq, &time);
{
printf("Reading of threshold configuration has failed.\n");
}
printf("Testing API -- openapiBstDeviceThresholdSet\n");
{
if (getSystemthresh(device.threshold) == thSnapshot.
device.bufferCount)
{
printf("Device threshold configuration succeeded.\n");
}
else
{
printf("Device threshold configuration failed.\n");
}
}
printf("\n\n");
printf("Testing API -- openapiBstIppgThresholdSet\n");
{
if ((getSystemthresh(ippg.umShareThreshold) ==
thSnapshot.
iPortPg.data[SAMPLE_PORT_1-1][SAMPLE_PG_1].umShareBufferCount) &&
(getSystemthresh(ippg.umHeadroomThreshold) ==
thSnapshot.
iPortPg.data[SAMPLE_PORT_1-1][SAMPLE_PG_1].umHeadroomBufferCount))
{
printf("Ingress port priority group threshold configuration succeeded.\n");
}
else
{
printf("Ingress port priority group threshold configuration failed.\n");
}
}
printf("\n\n");
printf("Testing API -- openapiBstIpspThresholdSet\n");
{
if ((getSystemthresh(ipsp.umShareThreshold) ==
thSnapshot.
iPortSp.data[SAMPLE_PORT_2-1][SAMPLE_SP_1].umShareBufferCount))
{
printf("Ingress per port service pool threshold configuration succeeded.\n");
}
else
{
printf("Ingress per port service pool threshold configuration failed.\n");
}
}
printf("\n\n");
printf("Testing API -- openapiBstIspThresholdSet\n");
{
if ((getSystemthresh(isp.umShareThreshold) ==
thSnapshot.
iSp.data[SAMPLE_SP_1].umShareBufferCount))
{
printf("Ingress service pool threshold configuration succeeded.\n");
}
else
{
printf("Ingress service pool threshold configuration failed.\n");
}
}
printf("\n\n");
printf("Testing API -- openapiBstEpspThresholdSet\n");
{
if ((getSystemthresh(epsp.ucShareThreshold) ==
thSnapshot.
ePortSp.data[SAMPLE_PORT_3-1][SAMPLE_SP_1].ucShareBufferCount))
{
printf("Egress per port service pool threshold configuration succeeded.\n");
}
else
{
printf("Egress per port service pool threshold configuration failed.\n");
}
}
printf("\n\n");
printf("Testing API -- openapiBstEspThresholdSet\n");
{
if ((getSystemthresh(esp.umShareThreshold) ==
thSnapshot.
eSp.data[SAMPLE_SP_1].umShareBufferCount) &&
(getSystemthresh(epsp.mcShareThreshold) ==
thSnapshot.eSp.data[SAMPLE_SP_1].mcShareBufferCount))
{
printf("Egress service pool threshold configuration succeeded.\n");
}
else
{
printf("Egress service pool threshold configuration failed.\n");
}
}
printf("\n\n");
printf("Testing API -- openapiBstEucqThresholdSet\n");
{
if (getSystemthresh(ucq.ucBufferThreshold) == thUcq.data[SAMPLE_UCQ_1].ucBufferCount)
{
printf("Egress unicast queue threshold configuration succeeded.\n");
}
else
{
printf("Egress unicast queue threshold configuration failed.\n");
}
}
printf("\n\n");
printf("Testing API -- openapiBstEucqgThresholdSet\n");
{
if (getSystemthresh(ucqg.ucBufferThreshold) == thSnapshot.
eUcQg.data[SAMPLE_UCQG_1].ucBufferCount)
{
printf("Egress unicast queue group threshold configuration succeeded.\n");
}
else
{
printf("Egress unicast queue group threshold configuration failed.\n");
}
}
printf("\n\n");
printf("Testing API -- openapiBstEmcqThresholdSet\n");
{
if (getSystemthresh(mcq.mcBufferThreshold) == thMcq.data[SAMPLE_MCQ_1].mcBufferCount)
{
printf("Egress multicast queue threshold configuration succeeded.\n");
}
else
{
printf("Egress multicast queue threshold configuration failed.\n");
}
}
printf("\n\n");
printf("Testing API -- openapiBstCpuqThresholdSet\n");
{
if (getSystemthresh(cpuq.cpuBufferThreshold) == thSnapshot.
cpqQ.data[SAMPLE_CPUQ_1].cpuBufferCount)
{
printf("Egress CPU queue threshold configuration succeeded.\n");
}
else
{
printf("Egress CPU queue threshold configuration failed.\n");
}
}
printf("\n\n");
printf("Testing API -- openapiBstRqeqThresholdSet\n");
{
if (getSystemthresh(rqeq.rqeBufferThreshold) == thSnapshot.
rqeQ.data[SAMPLE_RQE_1].rqeBufferCount)
{
printf("Egress RQE queue threshold configuration succeeded.\n");
}
else
{
printf("Egress RQE queue threshold configuration failed.\n");
}
}
printf("\n\n");
return result;
}
void bst_trigger_callback(void)
{
printf("Threshold breached, trigger function called\n");
trigger_event = true;
}
{
uint32_t enable = 1;
int clientId;
cookie = &cb_cookie;
&clientId);
{
cookie);
}
return tenable;
}
{
unsigned char compData[BST_MAX_COMPRESSED_LEN];
time_t time;
uLongf uncompressedLength = 0;
int retCode;
memset(&snapshot, 0, sizeof(snapshot));
memset(&compData, 0, sizeof(compData));
compSnapshot.pstart = compData;
compSnapshot.size = sizeof(compData);
{
printf("Reading of compressed threshold of all buffers succeeded\n");
uncompressedLength = sizeof(snapshot);
retCode = uncompress((unsigned char *)&snapshot, &uncompressedLength,
(unsigned char *)compSnapshot.pstart, compSnapshot.size);
if (Z_OK == retCode)
{
printf("Successfully decompressed data\n");
}
else
{
printf("Unable to decompress data\n");
}
}
else
{
printf("Reading of compressed threshold of all buffers failed\n");
}
return result;
}
{
unsigned char compData[BST_MAX_COMPRESSED_LEN];
time_t time;
uLongf uncompressedLength = 0;
int retCode;
memset(&snapshot, 0, sizeof(snapshot));
memset(&compData, 0, sizeof(compData));
compSnapshot.pstart = compData;
compSnapshot.size = sizeof(compData);
{
printf("Reading of compressed snapshot of all buffers succeeded\n");
uncompressedLength = sizeof(snapshot);
retCode = uncompress((unsigned char *)&snapshot, &uncompressedLength,
(unsigned char *)compSnapshot.pstart, compSnapshot.size);
if (Z_OK == retCode)
{
printf("Successfully decompressed data\n");
}
else
{
printf("Unable to decompress data\n");
}
}
else
{
printf("Reading of compressed snapshot of all buffers failed\n");
}
return result;
}
int main (int argc, char **argv)
{
uint32_t asicId = 0;
l7proc_crashlog_register();
if ((result =
{
printf ("\nFailed to initialize RPC to OpEN. result = %d exit test\n", result);
exit (2);
}
{
sleep (1);
}
L7PROC_LOGF (L7PROC_LOG_SEVERITY_INFO, 0, "Starting BST API example application");
printf ("\n");
printf ("Begin Sanity tests...\n");
result = testAsicBasic(&clientHandle, asicId);
{
printf("Reading of ASIC capabilities failed, exit test\n");
exit(1);
}
result = testAsicPortMap(&clientHandle, asicId);
{
printf("Reading of ASIC port mapping failed\n");
}
result = testLagToNotation(&clientHandle, asicId);
{
printf("Reading of Lag string failed\n");
}
result = testBstConfig(&clientHandle, asicId);
{
printf("BST configuration setting/getting failed, exit test\n");
exit(1);
}
testDeviceData(&clientHandle, asicId);
testIspData(&clientHandle, asicId);
testIppgData(&clientHandle, asicId);
testIpspData(&clientHandle, asicId);
testEpspData(&clientHandle, asicId);
testEspData(&clientHandle, asicId);
testUcqData(&clientHandle, asicId);
testMcqData(&clientHandle, asicId);
testCpuqData(&clientHandle, asicId);
testRqeData(&clientHandle, asicId);
testThresholds(&clientHandle, asicId);
testGlobalData(&clientHandle, asicId);
testBstSnapshotCompressedGet(&clientHandle, asicId);
testBstThresholdCompressedGet(&clientHandle, asicId);
trigger_test = testTrigger(&clientHandle, asicId);
{
printf("Waiting for 30 seconds for threshold to trigger\n");
sleep(30);
{
printf("Unable to de-register trigger function\n");
}
}
printf ("\nComplete.\n");
L7PROC_LOGF (L7PROC_LOG_SEVERITY_INFO, 0, "Stopping BST API example application");
return 0;
}