#include <stdlib.h>
#include <unistd.h>
#include "rpcclt_openapi.h"
#include "proc_util.h"
static void printAppMenu(char *name)
{
printf("Usage: %s <test#> <arg1> <arg2> ... \n", name);
printf("Test 1: Determine next sequential row in the Policy Table: %s 1 <prevPolicyIndex>\n", name);
printf("Test 2: Get the policy name: %s 2 <policyIndex>\n", name);
printf("Test 3: Set the policy name: %s 3 <policyIndex><policy-name>\n", name);
printf("Test 4: Translate a policy name into its associated Policy id in Table index: %s 4 <stringPtr>\n", name);
printf("Test 5: Check if class definition is suitable for inclusion by specified policy: %s 5 <classIndex><policyIndex>\n", name);
printf("Test 6: Get the current status of the specified Policy: %s 6 <policyIndex>\n", name);
printf("Test 7: Create a policy in the Policy Table for the specified index: %s 7 <policyIndex>\n", name);
printf("Test 8: Delete a Policy in Table for the specified index: %s 8 <policyIndex>\n", name);
printf("Test 9: Get the Policy type/direction of policy definition: %s 9 <policyIndex>\n", name);
printf("Test 10: Set the type of policy : %s 10 <policyIndex><policyType>\n", name);
printf("Test 11: Obtain the next available index value to be used when creating a new row in the Policy-Class Instance Table: %s 11 <policyIndex>\n", name);
printf("Test 12: Get the L3 protocol of class definition: %s 12 <classIndex><pClassL3Proto>\n", name);
printf("Test 13: Determine next sequential row in the Policy-Class Instance Table: %s 13 <prevPolicyIndex><prevPolicyInstIndex>\n", name);
printf("Test 14: Get the class index referenced as the policy class instance: %s 14 <policyIndex><policyInstIndex>\n", name);
printf("Test 15: Set the class index referenced as the policy class instance: %s 15 <policyIndex><policyInstIndex><classIndex>\n", name);
printf("Test 16: Find the policy instance index from the policy and class indexes: %s 16 <policyIndex><classIndex>\n", name);
printf("Test 17: Create a new row in the Policy-Class Instance Table for the specified index: %s 17 <policyIndex><policyInstIndex><activateRow>\n", name);
printf("Test 18: Delete a row from the Policy-Class Instance Table for the specified index: %s 18 <policyIndex><policyInstIndex>\n", name);
printf("Test 19: Get the current status of the specified Policy-Class Instance Table row: %s 19 <policyIndex><policyInstIndex>\n", name);
printf("Test 20: Obtain the next available index value to be used when creating a new row in the Policy Table: %s 20 <pPolicyIndex>\n", name);
printf("Test 21: Get the storage type for the specified Policy Attribute Table row: %s 21 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 22: Get the current status of the specified Policy Attribute Table row: %s 22 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 23: Obtain the next available index value to be used when creating a new row in the Policy Attribute Table: %s 23 <policyIndex><policyInstIndex>\n", name);
printf("Test 24: Retrieve the maximum policy attribute index value allowed for the Policy Attribute Table: %s 24 \n", name);
printf("Test 25: Get the Policy Attribute statement entry type: %s 25 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 26: Get the Policy Attribute statement entry associated data: %s 26 <policyIndex><policyInstIndex><policyAttrIndex><entryType>\n", name);
printf("Test 27: Create a new row in the Policy Attribute Table for the specified index: %s 27 <policyIndex><policyInstIndex><policyAttrIndex><activateRow>\n", name);
printf("Test 28: Delete a row from the Policy Attribute Table for the specified index: %s 28 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 29: Set the Policy Attribute statement entry type and associated data: %s 29 <policyIndex><policyInstIndex><policyAttrIndex><entryType><data>\n", name);
printf("Test 30: Find the Policy Attribute index for the specified attribute: %s 30 <policyIndex><policyInstIndex><inEntry>\n", name);
printf("Test 31: Set the simple policing committed rate attribute statement value: %s 31 <policyIndex><policyInstIndex><policyAttrIndex><entryType><rate_unit><rate>\n", name);
printf("Test 32: Get the policing committed rate unit attribute statement value: %s 32 <policyIndex><policyInstIndex><policyAttrIndex><entryType>\n", name);
printf("Test 33: Set the policing committed burst size attribute statement value: %s 33 <policyIndex><policyInstIndex><policyAttrIndex><entryType><burstType><burst>\n", name);
printf("Test 34: Get the policing committed burst size attribute statement value: %s 34 <policyIndex><policyInstIndex><policyAttrIndex><entryType><burstType>\n", name);
printf("Test 35: Get the policing committed rate attribute statement value: %s 35 <policyIndex><policyInstIndex><policyAttrIndex><entryType>\n", name);
printf("Test 36: Set the policing exceed value attribute statement value: %s 36 <policyIndex><policyInstIndex><policyAttrIndex><value>\n", name);
printf("Test 37: Get the policing exceed value attribute statement value: %s 37 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 38: Set the policing exceed action attribute statement value: %s 38 <policyIndex><policyInstIndex><policyAttrIndex><action>\n", name);
printf("Test 39: Get the policing exceed action attribute statement value: %s 39 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 40: Determine if a DiffServ class is valid for use as a policing color aware designation: %s 40 <policyIndex><policyInstIndex><classIndex>\n", name);
printf("Test 41: Get the policing color conform value attribute statement value: %s 41 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 42: Set the policing color conform attribute class index value: %s 42 <policyIndex><policyInstIndex><policyAttrIndex><classIndex>\n", name);
printf("Test 43: Get the policing color conform attribute class index value: %s 43 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 44: Set the policing nonconform action attribute statement value: %s 44 <policyIndex><policyInstIndex><policyAttrIndex><action>\n", name);
printf("Test 45: Get the policing nonconform action attribute statement value: %s 45 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 46: Set the policing nonconform value attribute statement value: %s 46 <policyIndex><policyInstIndex><policyAttrIndex><value>\n", name);
printf("Test 47: Get the policing nonconform value attribute statement value: %s 47 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 48: Set the policing conform value attribute statement value: %s 48 <policyIndex><policyInstIndex><policyAttrIndex><value>\n", name);
printf("Test 49: Get the policing conform value attribute statement value: %s 49 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 50: Determine next sequential row in the Policy Attribute Table: %s 50 <prevPolicyIndex><prevPolicyInstIndex><prevPolicyAttrIndex>\n", name);
printf("Test 51: Set the policing conform action attribute statement value: %s 51 <policyIndex><policyInstIndex><policyAttrIndex><action>\n", name);
printf("Test 52: Get the policing conform action attribute statement value: %s 52 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 53: Set the two-rate policing peak rate attribute statement value: %s 53 <policyIndex><policyInstIndex><policyAttrIndex><rate>\n", name);
printf("Test 54: Set the simple policing committed rate attribute statement value: %s 54 <policyIndex><policyInstIndex><policyAttrIndex><rate>\n", name);
printf("Test 55: Get the two-rate policing peak rate attribute statement value: %s 55 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 56: Get the simple policing committed rate attribute statement value: %s 56 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 57: Set the two-rate policing peak rate attribute statement value as per unit: %s 57 <policyIndex><policyInstIndex><policyAttrIndex><rate_unit><rate>\n", name);
printf("Test 58: Get the two-rate policing peak rate attribute statement value as per unit: %s 58 <policyIndex><policyInstIndex><policyAttrIndex><rate_unit>\n", name);
printf("Test 59: Get the policing peak rate attribute statement value: %s 59 <policyIndex><policyInstIndex><policyAttrIndex><entryType>\n", name);
printf("Test 60: Get the two-rate policing committed rate attribute statement value: %s 60 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 61: Set the two-rate policing committed rate attribute statement value: %s 61 <policyIndex><policyInstIndex><policyAttrIndex><rate>\n", name);
printf("Test 62: Set the policing color exceed attribute class index value: %s 62 <policyIndex><policyInstIndex><policyAttrIndex><classIndex>\n", name);
printf("Test 63: Get the policing color exceed attribute class index value: %s 63 <policyIndex><policyInstIndex><policyAttrIndex>\n", name);
printf("Test 64: Run API sanity checks: %s 64 \n", name);
return;
}
{
uint32_t pClassIndex = 0;
uint32_t prevPolicyInstIndex = 0;
uint32_t rate = 0;
uint32_t pPolicyIndex = 0;
uint32_t prevPolicyIndex = 0;
uint32_t pRate = 0;
uint32_t burst = 0;
uint32_t policyIndex = 0;
uint32_t prevPolicyAttrIndex = 0;
uint32_t pRate_percent = 0;
uint32_t policyAttrIndex = 0;
uint32_t pIndexMax = 0;
uint32_t classIndex = 0;
uint32_t data = 0;
uint32_t pPolicyInstIndex = 0;
uint32_t policyInstIndex = 0;
uint32_t value = 0;
uint32_t pVal = 0;
uint32_t pPolicyAttrIndex = 0;
char buffer[128];
badBufdescPointer.
pstart = (
void *) NULL;
badBufdescPointer.
size =
sizeof(buffer);
badBufdescPointer.size = 0;
bufd.pstart = buffer;
bufd.size = sizeof(buffer);
zeroLenBuf.pstart = buffer;
zeroLenBuf.size = 0;
printf("Testing diffServPolicy OpEN APIs sanity:\n");
printf("Testing openapiDiffServPolicyGetNext():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyNameGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyNameSet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyNameToIndex():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("NULL buffdesc pstart argument 3:(result = %d)\n", result);
printf("buffdesc 0 length size argument 3:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyRowStatusGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyTypeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyInstIndexNext():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 3:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyInstGetNext():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyInstClassIndexGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyInstIndexFromClass():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyInstRowStatusGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyIndexNext():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 2:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStorageTypeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrRowStatusGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrIndexNext():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 4:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrIndexMaxGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 2:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtEntryTypeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtEntryDataGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 6:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrIndexFind():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceDataRateUnitGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 6:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceBurstGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 7:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceDataRatePercentGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 6:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceExceedValGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceExceedActGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceColorConformValGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceColorConformIndexGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceNonconformActGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceNonconformValGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceConformValGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrGetNext():\n");
result =
openapiDiffServPolicyAttrGetNext(NULL, prevPolicyIndex, prevPolicyInstIndex, prevPolicyAttrIndex, &pPolicyIndex, &pPolicyInstIndex, &pPolicyAttrIndex);
printf("NULL client handle:(result = %d)\n", result);
result =
openapiDiffServPolicyAttrGetNext(client_handle, prevPolicyIndex, prevPolicyInstIndex, prevPolicyAttrIndex, NULL, &pPolicyInstIndex, &pPolicyAttrIndex);
printf("NULL argument 7:(result = %d)\n", result);
printf("NULL argument 7:(result = %d)\n", result);
printf("NULL argument 7:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceConformActGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceTworatePrateGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceSimpleCrateGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPolicePdataRatePercentGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 6:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceTworateCrateGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
printf("Testing openapiDiffServPolicyAttrStmtPoliceColorExceedIndexGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 5:(result = %d)\n", result);
return;
}
void diffServPolicyGetNext(
openapiClientHandle_t *client_handle, uint32_t prevPolicyIndex, uint32_t *pPolicyIndex)
{
{
printf("Bad return code trying to determine next sequential row in the Policy Table. (result = %d)\n", result);
}
else
{
printf("PolicyIndex Get Next is successful next index is %d\n", *pPolicyIndex);
}
return;
}
{
{
printf("Bad return code trying to get the policy name (result = %d)\n", result);
}
else
{
printf("Policy Name received is successful. Name %s\n", (char *)bufd->pstart);
}
return;
}
{
{
printf("Bad return code trying to set the policy name (result = %d)\n", result);
}
else
{
printf("Policy Name set is successful. Name %s\n", (char *)bufd->pstart);
}
return;
}
{
{
printf("Bad return code trying to translate a policy name into its associated Policy Table index (result = %d)\n", result);
}
else
{
printf("Policy Name to Index is successful name %s Index %d\n", (char *)stringPtr->pstart, *pPolicyIndex);
}
return;
}
void diffServClassValidForPolicyCheck(
openapiClientHandle_t *client_handle, uint32_t classIndex, uint32_t policyIndex)
{
{
printf("Bad return code trying to check if class definition is suitable for inclusion by specified policy (result = %d)\n", result);
}
else
{
printf("Policy Check is valid for diffserv class\n");
}
return;
}
{
{
printf("Bad return code trying to get the current status of the specified Policy Table row (result = %d)\n", result);
}
else
{
printf("Policy Row status value %d\n", *pValue);
}
return;
}
{
{
printf("Bad return code trying to create a new row in the Policy Table for the specified index (result = %d)\n", result);
}
else
{
printf("Policy Create is successful\n");
}
return;
}
{
{
printf("Bad return code trying to delete a row from the Policy Table for the specified index (result = %d)\n", result);
}
else
{
printf("Policy deletion is successful\n");
}
return;
}
{
{
printf("Bad return code trying to get the type of policy definition (result = %d)\n", result);
}
else
{
printf("Policy type is %d\n", *pPolicyType);
}
return;
}
{
{
printf("Bad return code trying to get the type of policy definition (result = %d)\n", result);
}
else
{
printf("policy type is successfully set to %d\n", policyType);
}
return;
}
void diffServPolicyInstIndexNext(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t *pPolicyInstIndex)
{
{
printf("Bad return code trying to obtain the next available index value to be used when creating a new row in the Policy-Class Instance Table (result = %d)\n", result);
}
else
{
printf("Policy Inst index received is %d\n", *pPolicyInstIndex);
}
return;
}
void diffServPolicyInstGetNext(
openapiClientHandle_t *client_handle, uint32_t prevPolicyIndex, uint32_t prevPolicyInstIndex, uint32_t *pPolicyIndex, uint32_t *pPolicyInstIndex)
{
{
printf("Bad return code trying to determine next sequential row in the Policy-Class Instance Table (result = %d)\n", result);
}
else
{
printf("Next policy Index %d and next policy inst index %d\n", *pPolicyIndex, *pPolicyInstIndex);
}
return;
}
void diffServPolicyInstClassIndexGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t *pClassIndex)
{
{
printf("Bad return code trying to get the class index referenced as the policy class instance (result = %d)\n", result);
}
else
{
printf("next Inst class Index %d\n", *pClassIndex);
}
return;
}
void diffServPolicyInstClassIndexSet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t classIndex)
{
{
printf("Bad return code trying to set the class index referenced as the policy class instance (result = %d)\n", result);
}
else
{
printf("Diff serv policy Inst classIndex set is successful\n");
}
return;
}
void diffServPolicyInstIndexFromClass(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t classIndex, uint32_t *pPolicyInstIndex)
{
{
printf("Bad return code trying to find the policy instance index from the policy and class indexes (result = %d)\n", result);
}
else
{
printf("policy inst index for policy Index and class index is %d\n", *pPolicyInstIndex);
}
return;
}
{
{
printf("Bad return code trying to create a new row in the Policy-Class Instance Table for the specified index (result = %d)\n", result);
}
else
{
printf("policy Inst Creation is successful\n");
}
return;
}
void diffServPolicyInstDelete(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex)
{
{
printf("Bad return code trying to delete a row from the Policy-Class Instance Table for the specified index (result = %d)\n", result);
}
else
{
printf("Policy Instance delete is successful\n");
}
return;
}
{
{
printf("Bad return code trying to get the current status of the specified Policy-Class Instance Table row (result = %d)\n", result);
}
else
{
printf("Policy Inst row status is %d\n", *pValue);
}
return;
}
{
{
printf("Bad return code trying to obtain the next available index value to be used when creating a new row in the Policy Table (result = %d)\n", result);
}
else
{
printf("Next policy Index is %d\n", *pPolicyIndex);
}
return;
}
{
{
printf("Bad return code trying to get the storage type for the specified Policy Attribute Table row (result = %d)\n", result);
}
else
{
printf("Storage Type received is %d\n", *pValue);
}
return;
}
{
{
printf("Bad return code trying to get the current status of the specified Policy Attribute Table row (result = %d)\n", result);
}
else
{
printf("Diff serv poicy Attr Row Status value is %d\n", *pValue);
}
return;
}
void diffServPolicyAttrIndexNext(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t *pPolicyAttrIndex)
{
{
printf("Bad return code trying to obtain the next available index value to be used when creating a new row in the Policy Attribute Table (result = %d)\n", result);
}
else
{
printf("Next attr Index is %d\n", *pPolicyAttrIndex);
}
return;
}
{
{
printf("Bad return code trying to retrieve the maximum policy attribute index value allowed for the Policy Attribute Table (result = %d)\n", result);
}
else
{
printf("Diffserv Policy Attr Index max is %d\n", *pIndexMax);
}
return;
}
{
{
printf("Bad return code trying to get the Policy Attribute statement entry type (result = %d)\n", result);
}
else
{
printf("Diff serv Policy Attr Statement Entry type is %d\n", *pEntryType);
}
return;
}
{
{
printf("Bad return code trying to get the Policy Attribute statement entry associated data (result = %d)\n", result);
}
else
{
printf("data associated with Statement entry is %d\n", *data);
}
return;
}
void diffServPolicyAttrCreate(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex,
OPEN_BOOL_t activateRow)
{
{
printf("Bad return code trying to create a new row in the Policy Attribute Table for the specified index (result = %d)\n", result);
}
else
{
printf("Diff serv policy Attr Create is successful\n");
}
return;
}
void diffServPolicyAttrDelete(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex)
{
{
printf("Bad return code trying to delete a row from the Policy Attribute Table for the specified index (result = %d)\n", result);
}
else
{
printf("Diff serv policy attr delete is successful\n");
}
return;
}
{
{
printf("Bad return code trying to set the Policy Attribute statement entry type and associated data (result = %d)\n", result);
}
else
{
printf("Diffserv Policy Attr Statement data set is successful\n");
}
return;
}
{
{
printf("Bad return code trying to find the Policy Attribute index for the specified attribute (result = %d)\n", result);
}
else
{
printf("Found policy Attr Index %d for policy Index %d, policy Inst %d, entry Type %d\n", *pPolicyAttrIndex, policyIndex, policyInstIndex, inEntry);
}
return;
}
{
{
printf("Bad return code trying to set the simple policing committed rate attribute statement value (result = %d)\n", result);
}
else
{
printf("simple policing committed rate attribute statement value set is successful\n");
}
return;
}
{
{
printf("Bad return code trying to get the policing committed rate unit attribute statement value (result = %d)\n", result);
}
else
{
printf("Getting the policing committed rate unit attribute statement value is successful "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d entryType:%d rate_unit:%d.\n",
policyIndex, policyInstIndex, policyAttrIndex, entryType, *pRate_unit);
}
return;
}
{
{
printf("Bad return code trying to set the policing committed burst size attribute statement value (result = %d)\n", result);
}
else
{
printf("Set the policing committed burst size attribute statement value is successful\n");
}
return;
}
{
{
printf("Bad return code trying to get the policing committed burst size attribute statement value (result = %d)\n", result);
}
else
{
printf("policing committed burst size attribute statement value get is successful "
"policyIndex:%d policyInstIndex:%d policyAttrIndex:%d entryType:%d burstType:%d burst:%d.\n",
policyIndex, policyInstIndex, policyAttrIndex, entryType, burstType, *burst);
}
return;
}
{
{
printf("Bad return code trying to get the policing committed rate attribute statement value (result = %d)\n", result);
}
else
{
printf("policing committed rate attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d entryType:%d] is %d.\n",
policyIndex, policyInstIndex, policyAttrIndex, entryType, *pRate_percent);
}
return;
}
void diffServPolicyAttrStmtPoliceExceedValSet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t value)
{
{
printf("Bad return code trying to set the policing exceed value attribute statement value (result = %d)\n", result);
}
else
{
printf("Set of the policing exceed value attribute statement value to %d is successful\n", value);
}
return;
}
void diffServPolicyAttrStmtPoliceExceedValGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t *pValue)
{
{
printf("Bad return code trying to et the policing exceed value attribute statement value (result = %d)\n", result);
}
else
{
printf("policing exceed value attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *pValue);
}
return;
}
{
{
printf("Bad return code trying to set the policing exceed action attribute statement value (result = %d)\n", result);
}
else
{
printf("Set the policing exceed action %d successful\n", action);
}
return;
}
{
{
printf("Bad return code trying to get the policing exceed action attribute statement value (result = %d)\n", result);
}
else
{
printf("The policing exceed action for [policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *action);
}
return;
}
void diffServPolicyAttrStmtPoliceColorAwareClassValidate(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t classIndex)
{
{
printf("Bad return code trying to determine if a DiffServ class is valid for use as a policing color aware designation (result = %d)\n", result);
}
else
{
printf("DiffServ class is valid for use as a policing color aware designation for "
"[policyIndex:%d policyInstIndex:%d classIndex:%d.\n",
policyIndex, policyInstIndex, classIndex);
}
return;
}
void diffServPolicyAttrStmtPoliceColorConformValGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t *pVal)
{
{
printf("Bad return code trying to get the policing color conform value attribute statement value (result = %d)\n", result);
}
else
{
printf("policing color conform value attribute statement value "
" for [policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *pVal);
}
return;
}
void diffServPolicyAttrStmtPoliceColorConformIndexSet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t classIndex)
{
{
printf("Bad return code trying to set the policing color conform attribute class index value (result = %d)\n", result);
}
else
{
printf("policing color conform attribute class index value is set to %d\n", classIndex);
}
return;
}
void diffServPolicyAttrStmtPoliceColorConformIndexGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t *pClassIndex)
{
{
printf("Bad return code trying to get the policing color conform attribute class index value (result = %d)\n", result);
}
else
{
printf("olicing color conform attribute class index value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *pClassIndex);
}
return;
}
{
{
printf("Bad return code trying to set the policing nonconform action attribute statement value (result = %d)\n", result);
}
else
{
printf("policing nonconform action attribute statement value is set to %d\n", action);
}
return;
}
{
{
printf("Bad return code trying to get the policing nonconform action attribute statement value (result = %d)\n", result);
}
else
{
printf("Policing nonconform action attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *action);
}
return;
}
void diffServPolicyAttrStmtPoliceNonconformValSet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t value)
{
{
printf("Bad return code trying to set the policing nonconform value attribute statement value (result = %d)\n", result);
}
else
{
printf("policing nonconform value attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex%d] is set to %d\n",
policyIndex, policyInstIndex, policyAttrIndex, value);
}
return;
}
void diffServPolicyAttrStmtPoliceNonconformValGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t *value)
{
{
printf("Bad return code trying to get the policing nonconform value attribute statement value (result = %d)\n", result);
}
else
{
printf("policing nonconform value attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *value);
}
return;
}
void diffServPolicyAttrStmtPoliceConformValSet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t value)
{
{
printf("Bad return code trying to set the policing conform value attribute statement value (result = %d)\n", result);
}
else
{
printf("policing conform value attribute statement value is set to %d\n", value);
}
return;
}
void diffServPolicyAttrStmtPoliceConformValGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t *value)
{
{
printf("Bad return code trying to get the policing conform value attribute statement value (result = %d)\n", result);
}
else
{
printf("policing conform value attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *value);
}
return;
}
void diffServPolicyAttrGetNext(
openapiClientHandle_t *client_handle, uint32_t prevPolicyIndex, uint32_t prevPolicyInstIndex, uint32_t prevPolicyAttrIndex, uint32_t *pPolicyIndex, uint32_t *pPolicyInstIndex, uint32_t *pPolicyAttrIndex)
{
{
printf("Bad return code trying to determine next sequential row in the Policy Attribute Table (result = %d)\n", result);
}
else
{
printf("next policy Id %d next Policy Inst Index %d next Attr Index %d\n", *pPolicyIndex, *pPolicyInstIndex, *pPolicyAttrIndex);
}
return;
}
{
{
printf("Bad return code trying to set the policing conform action attribute statement value (result = %d)\n", result);
}
else
{
printf("policing conform action attribute statement value is set to %d\n", action);
}
return;
}
{
{
printf("Bad return code trying to get the policing conform action attribute statement value (result = %d)\n", result);
}
else
{
printf("policing conform action attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *action);
}
return;
}
void diffServPolicyAttrStmtPoliceTworatePrateSet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t rate)
{
{
printf("Bad return code trying to set the two-rate policing peak rate attribute statement value (result = %d)\n", result);
}
else
{
printf("two-rate policing peak rate attribute statement value is set to %d\n", rate);
}
return;
}
void diffServPolicyAttrStmtPoliceSimpleCrateSet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t rate)
{
{
printf("Bad return code trying to set the simple policing committed rate attribute statement value (result = %d)\n", result);
}
else
{
printf("Simple policing committed rate attribute statement value to %d\n", rate);
}
return;
}
void diffServPolicyAttrStmtPoliceTworatePrateGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t *rate)
{
{
printf("Bad return code trying to get the two-rate policing peak rate attribute statement value (result = %d)\n", result);
}
else
{
printf("two-rate policing peak rate attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *rate);
}
return;
}
void diffServPolicyAttrStmtPoliceSimpleCrateGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t *rate)
{
{
printf("Bad return code trying to get the simple policing committed rate attribute statement value (result = %d)\n", result);
}
else
{
printf("simple policing committed rate attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *rate);
}
return;
}
void diffServPolicyAttrStmtPoliceTworatePdataRateSet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex,
OPEN_RATE_UNIT_t rate_unit, uint32_t rate)
{
{
printf("Bad return code trying to set the two-rate policing peak rate attribute statement value as per unit (result = %d)\n", result);
}
else
{
printf("two-rate policing peak rate attribute statement value as per unit %d is %d\n", rate_unit, rate);
}
return;
}
#if 0
void diffServPolicyAttrStmtPoliceTworatePdataRateGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex,
OPEN_RATE_UNIT_t rate_unit, uint32_t *rate)
{
if ((result = openapiDiffServPolicyAttrStmtPoliceTworatePdataRateGet(client_handle, policyIndex, policyInstIndex, policyAttrIndex, rate_unit, rate)) !=
OPEN_E_NONE)
{
printf("Bad return code trying to get the two-rate policing peak rate attribute statement value as per unit (result = %d)\n", result);
}
else
{
printf("two-rate policing peak rate attribute statement value as per unit %d is %d\n", rate_unit, *rate);
}
return;
}
#endif
{
{
printf("Bad return code trying to get the policing peak rate attribute statement value (result = %d)\n", result);
}
else
{
printf("policing peak rate attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d entryType:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, entryType, *pRate_percent);
}
return;
}
void diffServPolicyAttrStmtPoliceTworateCrateGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t *pRate)
{
{
printf("Bad return code trying to get the two-rate policing committed rate attribute statement value (result = %d)\n", result);
}
else
{
printf("two-rate policing committed rate attribute statement value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d] is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *pRate);
}
return;
}
void diffServPolicyAttrStmtPoliceTworateCrateSet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t rate)
{
{
printf("Bad return code trying to set the two-rate policing committed rate attribute statement value (result = %d)\n", result);
}
else
{
printf("two-rate policing committed rate attribute statement value is %d\n", rate);
}
return;
}
void diffServPolicyAttrStmtPoliceColorExceedIndexSet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t classIndex)
{
{
printf("Bad return code trying to set the policing color exceed attribute class index value (result = %d)\n", result);
}
else
{
printf("policing color exceed attribute class index value is set to %d\n", classIndex);
}
return;
}
void diffServPolicyAttrStmtPoliceColorExceedIndexGet(
openapiClientHandle_t *client_handle, uint32_t policyIndex, uint32_t policyInstIndex, uint32_t policyAttrIndex, uint32_t *pClassIndex)
{
{
printf("Bad return code trying to get the policing color exceed attribute class index value (result = %d)\n", result);
}
else
{
printf("policing color exceed attribute class index value for "
"[policyIndex:%d policyInstIndex:%d policyAttrIndex:%d is %d\n",
policyIndex, policyInstIndex, policyAttrIndex, *pClassIndex);
}
return;
}
int main(int argc, char **argv)
{
uint32_t testNum;
char switch_os_revision_string[100];
int show_help = 1;
char policyName[256] = {0};
uint32_t policyIndex = 0, prevPolicyIndex = 0;
uint32_t classIndex = 0;
uint32_t policyInstIndex = 0, prevPolicyInstIndex = 0;
uint32_t policyAttrIndex = 0, prevPolicyAttrIndex = 0;;
uint32_t indexMax = 0, data = 0;
uint32_t rate = 0;
uint32_t ratePercent = 0;
uint32_t burst = 0;
open_buffdesc bufd = {.pstart = policyName, .size =
sizeof(policyName)};
if (argc < 2)
{
printAppMenu(argv[0]);
return -1;
}
testNum = atoi(argv[1]);
l7proc_crashlog_register();
{
printf("\nFailed to initialize RPC to OpEN. Exiting (result = %d)\n", result);
return -1;
}
{
sleep(1);
}
L7PROC_LOGF(L7PROC_LOG_SEVERITY_INFO, 0, "Starting diffServPolicy API example application");
printf("\n");
switch_os_revision.pstart = switch_os_revision_string;
switch_os_revision.size = sizeof(switch_os_revision_string);
printf("Network OS version = %s\n", switch_os_revision_string);
else
printf("Network OS version retrieve error\n");
printf("\n");
switch (testNum)
{
case 1:
if (argc == 3)
{
prevPolicyIndex = atoi(argv[2]);
diffServPolicyGetNext(&client_handle, prevPolicyIndex, &policyIndex);
show_help = 0;
}
break;
case 2:
if (argc == 3)
{
policyIndex = atoi(argv[2]);
memset(policyName, 0, sizeof(policyName));
diffServPolicyNameGet(&client_handle, policyIndex, &bufd);
show_help = 0;
}
break;
case 3:
if (argc == 4)
{
policyIndex = atoi(argv[2]);
memset(policyName, 0, sizeof(policyName));
strncpy(policyName, argv[3], sizeof(policyName)-1);
bufd.size = strlen(policyName);
diffServPolicyNameSet(&client_handle, policyIndex, &bufd);
show_help = 0;
}
break;
case 4:
if (argc == 3)
{
memset(policyName, 0, sizeof(policyName));
strncpy(policyName, argv[2], sizeof(policyName)-1);
bufd.size = strlen(policyName);
policyIndex = 0;
diffServPolicyNameToIndex(&client_handle, &bufd, &policyIndex);
show_help = 0;
}
break;
case 5:
if (argc == 4)
{
classIndex = atoi(argv[2]);
policyIndex = atoi(argv[3]);
diffServClassValidForPolicyCheck(&client_handle, classIndex, policyIndex);
show_help = 0;
}
break;
case 6:
if (argc == 3)
{
policyIndex = atoi(argv[2]);
diffServPolicyRowStatusGet(&client_handle, policyIndex, &rowVal);
show_help = 0;
}
break;
case 7:
if (argc == 3)
{
policyIndex = atoi(argv[2]);
activateRow = 1;
diffServPolicyCreate(&client_handle, policyIndex, activateRow);
show_help = 0;
}
break;
case 8:
if (argc == 3)
{
policyIndex = atoi(argv[2]);
diffServPolicyDelete(&client_handle, policyIndex);
show_help = 0;
}
break;
case 9:
if (argc == 3)
{
policyIndex = atoi(argv[2]);
diffServPolicyTypeGet(&client_handle, policyIndex, &policyType);
show_help = 0;
}
break;
case 10:
if (argc == 4)
{
policyIndex = atoi(argv[2]);
policyType = atoi(argv[3]);
diffServPolicyTypeSet(&client_handle, policyIndex, policyType);
show_help = 0;
}
break;
case 11:
if (argc == 3)
{
policyIndex = atoi(argv[2]);
diffServPolicyInstIndexNext(&client_handle, policyIndex, &policyInstIndex);
show_help = 0;
}
break;
case 12:
if (argc == 4)
{
show_help = 0;
}
break;
case 13:
if (argc == 4)
{
prevPolicyIndex = atoi(argv[2]);
prevPolicyInstIndex = atoi(argv[3]);
diffServPolicyInstGetNext(&client_handle, prevPolicyIndex, prevPolicyInstIndex, &policyIndex, &policyInstIndex);
show_help = 0;
}
break;
case 14:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
diffServPolicyInstClassIndexGet(&client_handle, policyIndex, policyInstIndex, &classIndex);
show_help = 0;
}
break;
case 15:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
classIndex = atoi(argv[4]);
diffServPolicyInstClassIndexSet(&client_handle, policyIndex, policyInstIndex, classIndex);
show_help = 0;
}
break;
case 16:
if (argc == 4)
{
policyIndex = atoi(argv[2]);
classIndex = atoi(argv[3]);
diffServPolicyInstIndexFromClass(&client_handle, policyIndex, classIndex, &policyInstIndex);
show_help = 0;
}
break;
case 17:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
activateRow = atoi(argv[4]);
diffServPolicyInstCreate(&client_handle, policyIndex, policyInstIndex, activateRow);
show_help = 0;
}
break;
case 18:
if (argc == 4)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
diffServPolicyInstDelete(&client_handle, policyIndex, policyInstIndex);
show_help = 0;
}
break;
case 19:
if (argc == 4)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
diffServPolicyInstRowStatusGet(&client_handle, policyIndex, policyInstIndex, &rowVal);
show_help = 0;
}
break;
case 20:
if (argc == 3)
{
policyIndex = atoi(argv[2]);
diffServPolicyIndexNext(&client_handle, &policyIndex);
show_help = 0;
}
break;
case 21:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStorageTypeGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &storageVal);
show_help = 0;
}
break;
case 22:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrRowStatusGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &rowVal);
show_help = 0;
}
break;
case 23:
if (argc == 4)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
diffServPolicyAttrIndexNext(&client_handle, policyIndex, policyInstIndex, &policyAttrIndex);
show_help = 0;
}
break;
case 24:
if (argc == 2)
{
diffServPolicyAttrIndexMaxGet(&client_handle, &indexMax);
show_help = 0;
}
break;
case 25:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtEntryTypeGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &entryType);
show_help = 0;
}
break;
case 26:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
entryType = atoi(argv[5]);
diffServPolicyAttrStmtEntryDataGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, entryType, &data);
show_help = 0;
}
break;
case 27:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
activateRow = atoi(argv[5]);
diffServPolicyAttrCreate(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, activateRow);
show_help = 0;
}
break;
case 28:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrDelete(&client_handle, policyIndex, policyInstIndex, policyAttrIndex);
show_help = 0;
}
break;
case 29:
if (argc == 7)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
entryType = atoi(argv[5]);
data = atoi(argv[6]);
diffServPolicyAttrStmtEntryTypeDataSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, entryType, data);
show_help = 0;
}
break;
case 30:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
entryType = atoi(argv[4]);
diffServPolicyAttrIndexFind(&client_handle, policyIndex, policyInstIndex, entryType, &policyAttrIndex);
show_help = 0;
}
break;
case 31:
if (argc == 8)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
entryType = atoi(argv[5]);
rateUnit = atoi(argv[6]);
rate = atoi(argv[7]);
diffServPolicyAttrStmtPoliceDataRateSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, entryType, rateUnit, rate);
show_help = 0;
}
break;
case 32:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
entryType = atoi(argv[5]);
diffServPolicyAttrStmtPoliceDataRateUnitGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, entryType, &rateUnit);
show_help = 0;
}
break;
case 33:
if (argc == 8)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
entryType = atoi(argv[5]);
burstType = atoi(argv[6]);
burst = atoi(argv[7]);
diffServPolicyAttrStmtPoliceBurstSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, entryType, burstType, burst);
show_help = 0;
}
break;
case 34:
if (argc == 7)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
entryType = atoi(argv[5]);
burstType = atoi(argv[6]);
diffServPolicyAttrStmtPoliceBurstGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, entryType, burstType, &burst);
show_help = 0;
}
break;
case 35:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
entryType = atoi(argv[5]);
diffServPolicyAttrStmtPoliceDataRatePercentGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, entryType, &ratePercent);
show_help = 0;
}
break;
case 36:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
data = atoi(argv[5]);
diffServPolicyAttrStmtPoliceExceedValSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, data);
show_help = 0;
}
break;
case 37:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceExceedValGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &data);
show_help = 0;
}
break;
case 38:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
action = atoi(argv[5]);
diffServPolicyAttrStmtPoliceExceedActSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, action);
show_help = 0;
}
break;
case 39:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceExceedActGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &action);
show_help = 0;
}
break;
case 40:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
classIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceColorAwareClassValidate(&client_handle, policyIndex, policyInstIndex, classIndex);
show_help = 0;
}
break;
case 41:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceColorConformValGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &data);
show_help = 0;
}
break;
case 42:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
classIndex = atoi(argv[5]);
diffServPolicyAttrStmtPoliceColorConformIndexSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, classIndex);
show_help = 0;
}
break;
case 43:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceColorConformIndexGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &classIndex);
show_help = 0;
}
break;
case 44:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
action = atoi(argv[5]);
diffServPolicyAttrStmtPoliceNonconformActSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, action);
show_help = 0;
}
break;
case 45:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceNonconformActGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &action);
show_help = 0;
}
break;
case 46:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
data = atoi(argv[5]);
diffServPolicyAttrStmtPoliceNonconformValSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, data);
show_help = 0;
}
break;
case 47:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceNonconformValGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &data);
show_help = 0;
}
break;
case 48:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
data = atoi(argv[5]);
diffServPolicyAttrStmtPoliceConformValSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, data);
show_help = 0;
}
break;
case 49:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceConformValGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &data);
show_help = 0;
}
break;
case 50:
if (argc == 5)
{
prevPolicyIndex = atoi(argv[2]);
prevPolicyInstIndex = atoi(argv[3]);
prevPolicyAttrIndex = atoi(argv[4]);
diffServPolicyAttrGetNext(&client_handle, prevPolicyIndex, prevPolicyInstIndex, prevPolicyAttrIndex, &policyIndex, &policyInstIndex, &policyAttrIndex);
show_help = 0;
}
break;
case 51:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
action = atoi(argv[5]);
diffServPolicyAttrStmtPoliceConformActSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, action);
show_help = 0;
}
break;
case 52:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceConformActGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &action);
show_help = 0;
}
break;
case 53:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
rate = atoi(argv[5]);
diffServPolicyAttrStmtPoliceTworatePrateSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, rate);
show_help = 0;
}
break;
case 54:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
rate = atoi(argv[5]);
diffServPolicyAttrStmtPoliceSimpleCrateSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, rate);
show_help = 0;
}
break;
case 55:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceTworatePrateGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &rate);
show_help = 0;
}
break;
case 56:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceSimpleCrateGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &rate);
show_help = 0;
}
break;
case 57:
if (argc == 7)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
rateUnit = atoi(argv[5]);
rate = atoi(argv[6]);
diffServPolicyAttrStmtPoliceTworatePdataRateSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, rateUnit, rate);
show_help = 0;
}
break;
case 58:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
rateUnit = atoi(argv[5]);
show_help = 0;
}
break;
case 59:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
entryType = atoi(argv[5]);
diffServPolicyAttrStmtPolicePdataRatePercentGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, entryType, &ratePercent);
show_help = 0;
}
break;
case 60:
if (argc == 5)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceTworateCrateGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &rate);
show_help = 0;
}
break;
case 61:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
rate = atoi(argv[5]);
diffServPolicyAttrStmtPoliceTworateCrateSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, rate);
show_help = 0;
}
break;
case 62:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
classIndex = atoi(argv[5]);
diffServPolicyAttrStmtPoliceColorExceedIndexSet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, classIndex);
show_help = 0;
}
break;
case 63:
if (argc == 6)
{
policyIndex = atoi(argv[2]);
policyInstIndex = atoi(argv[3]);
policyAttrIndex = atoi(argv[4]);
diffServPolicyAttrStmtPoliceColorExceedIndexGet(&client_handle, policyIndex, policyInstIndex, policyAttrIndex, &classIndex);
show_help = 0;
}
break;
case 64:
if (argc == 2)
{
runSanity(&client_handle);
show_help = 0;
}
break;
default:
break;
}
if (show_help == 1)
{
printAppMenu(argv[0]);
}
L7PROC_LOGF(L7PROC_LOG_SEVERITY_INFO, 0, "Stopping diffServPolicy API example application");
return 0;
}