#include <unistd.h>
#include <stdlib.h>
#include "rpcclt_openapi.h"
#include "proc_util.h"
#define MAC_STRING_SIZE 18
{
{
printf("%s: openapiPmlGlobalAdminModeGet failed (%d)\n",
__FUNCTION__, ret);
}
else
{
printf(
"global admin mode %s\n", (mode ==
OPEN_ENABLE ?
"enable" :
"disable"));
}
}
{
{
printf("%s: openapiPmlIntfIsValid failed (%d)\n",
__FUNCTION__, ret);
}
else
{
printf(
"interface %d is %svalid\n", ifNum, (isValid ==
OPEN_TRUE ?
"" :
"not "));
}
}
{
{
printf("%s: openapiPmlIntfModeGet failed (%d)\n",
__FUNCTION__, ret);
}
else
{
printf(
"interface %d mode %s\n", ifNum, (mode ==
OPEN_ENABLE ?
"enable" :
"disable"));
}
}
{
uint32_t limit;
{
printf("%s: openapiPmlIntfDynamicLimitGet failed (%d)\n",
__FUNCTION__, ret);
}
else
{
printf("interface %d dynamic limit %u\n", ifNum, limit);
}
}
{
uint32_t limit;
{
printf("%s: openapiPmlIntfStaticLimitGet failed (%d)\n",
__FUNCTION__, ret);
}
else
{
printf("interface %d static limit %u\n", ifNum, limit);
}
}
{
{
printf("%s: openapiPmlIntfViolationTrapModeGet failed (%d)\n",
__FUNCTION__, ret);
}
else
{
printf(
"interface %d violation trap mode %s\n", ifNum, (mode ==
OPEN_ENABLE ?
"enable" :
"disable"));
}
}
{
{
printf("%s: openapiPmlIntfViolationDDisableModeGet failed (%d)\n",
__FUNCTION__, ret);
}
else
{
printf(
"interface %d violation D-Disable mode %s\n", ifNum, (mode ==
OPEN_ENABLE ?
"enable" :
"disable"));
}
}
{
{
printf("%s: openapiPmlIntfStickyModeGet failed (%d)\n",
__FUNCTION__, ret);
}
else
{
printf(
"interface %d sticky mode %s\n", ifNum, (mode ==
OPEN_ENABLE ?
"enable" :
"disable"));
}
}
{
char mac[MAC_STRING_SIZE] = "";
uint32_t vlanId;
macAddr.
size = MAC_STRING_SIZE;
ifNum, &macAddr,
&vlanId, &isSticky))
{
printf ("Statically configured MAC Address VLAN ID Sticky\n");
printf ("--------------------------------- ------- ------\n");
do
{
printf ("%-33s %7u %6s\n", (char *) macAddr.pstart, vlanId,
ifNum, &macAddr,
vlanId, &macAddr,
&vlanId, &isSticky));
}
else
{
printf ("No statically locked MAC entries.\n");
}
}
{
char mac[MAC_STRING_SIZE] = "";
uint32_t vlanId;
macAddr.pstart = mac;
macAddr.size = MAC_STRING_SIZE;
ifNum, &macAddr,
&vlanId))
{
printf ("Dynamically configured MAC Address VLAN ID\n");
printf ("---------------------------------- -------\n");
do
{
printf ("%-34s %7u\n", (char *) macAddr.pstart, vlanId);
ifNum, &macAddr,
vlanId, &macAddr,
&vlanId));
}
else
{
printf ("No dynamically learned MAC entries.\n");
}
}
{
{
printf("Bad return code trying to set the PML global admin mode."
" (result = %d)\n", result);
}
else
{
printf("PML global admin mode set successfully.\n");
}
return;
}
{
{
printf("Bad return code trying to set the Port MAC Locking mode for "
"the specified interface. (result = %d)\n", result);
}
else
{
printf("PML interface mode set successfully.\n");
}
return;
}
uint32_t ifNum, uint32_t *limit)
{
{
printf("Bad return code trying to get the Port MAC Locking maximum"
" dynamic limit for the specified interface. (result = %d)\n",
result);
}
else
{
printf ("PML interface maximum dynamic limit is %u.\n", *limit);
}
return;
}
uint32_t ifNum, uint32_t limit)
{
{
printf("Bad return code trying to set the Port MAC Locking dynamic "
"limit for the specified interface. (result = %d)\n", result);
}
else
{
printf("PML interface dynamic limit set successfully.\n");
}
return;
}
uint32_t ifNum, uint32_t *limit)
{
{
printf("Bad return code trying to get the Port MAC Locking maximum "
"static limit for the specified interface. (result = %d)\n", result);
}
else
{
printf("PML interface max static limit is %u.\n", *limit);
}
return;
}
uint32_t ifNum, uint32_t *limit)
{
{
printf("Bad return code trying to get the Port MAC Locking static "
"count for the specified interface. (result = %d)\n", result);
}
else
{
printf("PML interface static count is %u.\n", *limit);
}
return;
}
uint32_t ifNum, uint32_t limit)
{
{
printf("Bad return code trying to set the Port MAC Locking static "
"limit for the specified interface. (result = %d)\n", result);
}
else
{
printf("PML interface static limit set successfully.\n");
}
return;
}
uint32_t ifNum, uint32_t *interval)
{
{
printf("Bad return code trying to get the frequency interval between "
"successive SNMP traps. (result = %d)\n", result);
}
else
{
printf("PML interface trap frequency is %u.\n", *interval);
}
return;
}
uint32_t ifNum, uint32_t interval)
{
{
printf("Bad return code trying to set the frequency interval between "
"successive SNMP traps. (result = %d)\n", result);
}
else
{
printf("PML interface trap frequency set successfully.\n");
}
return;
}
{
{
printf("Bad return code trying to adds a statically locked entry to "
"an interface. (result = %d)\n", result);
}
else
{
printf("PML static entry added successfully.\n");
}
return;
}
uint32_t vlanId)
{
{
printf("Bad return code trying to deletes a statically locked entry "
"from an interface. (result = %d)\n", result);
}
else
{
printf("PML static entry deleted successfully.\n");
}
return;
}
uint32_t ifNum)
{
{
printf("Bad return code trying to converts dynamically locked entries "
"to statically locked entries on this interface. (result = %d)\n",
result);
}
else
{
printf("Dynamic entries are moved to static.\n");
}
return;
}
{
{
printf("Bad return code trying to configures PML sticky mode on "
"this interface. (result = %d)\n", result);
}
else
{
printf("PML sticky mode set successfully.\n");
}
return;
}
uint32_t *vlanId)
{
{
printf("Bad return code trying to get the last violation entry "
"for an interface. (result = %d)\n", result);
}
else
{
printf("Last violation entry details are MAC address : %s, VLAN id %u.\n",
(char *) macAddr->pstart, *vlanId);
}
return;
}
uint32_t ifNum, uint32_t *count)
{
{
printf("Bad return code trying to get the count of dynamcially "
"learned mac Addresses. (result = %d)\n", result);
}
else
{
printf("PML dynamic learned address count is %u.\n", *count);
}
return;
}
uint32_t ifNum, uint32_t *count)
{
{
printf("Bad return code trying to get the count of statically "
"learned mac Addresses. (result = %d)\n", result);
}
else
{
printf("PML static address count is %u.\n", *count);
}
return;
}
uint32_t vlanId, uint32_t *count)
{
{
printf("Bad return code trying to get the count of statically learned "
"mac Addresses. (result = %d)\n", result);
}
else
{
printf("PML static address count for a vlan is %u.\n", *count);
}
return;
}
uint32_t *count)
{
{
printf("Bad return code trying to get the global count of statically"
" learned mac Addresses. (result = %d)\n", result);
}
else
{
printf("PML global static address count is %u.\n", *count);
}
return;
}
{
{
printf("Bad return code trying to set the port MAC locking violation"
" D-Disable mode for the specified interface. (result = %d)\n", result);
}
else
{
printf("PML interface violation D-Disable mode set successfully.\n");
}
return;
}
{
{
printf("Bad return code trying to get the PML vlan admin mode. "
"(result = %d)\n", result);
}
else
{
printf("PML vlan admin mode is %u.\n", *adminMode);
}
return;
}
{
{
printf("Bad return code trying to set the PML vlan admin mode."
" (result = %d)\n", result);
}
else
{
printf("PML VLAN admin mode set successfully.\n");
}
return;
}
uint32_t vlanId, uint32_t *limit)
{
{
printf("Bad return code trying to get the MAC limit per Vlan. "
"(result = %d)\n", result);
}
else
{
printf("PML vlan dynamic limit is %u.\n", *limit);
}
return;
}
uint32_t vlanId, uint32_t limit)
{
{
printf("Bad return code trying to set the vlan MAC Locking limit."
" (result = %d)\n", result);
}
else
{
printf("PML vlan dynamic limit set successfully.\n");
}
return;
}
uint32_t vlanId, uint32_t *limit)
{
{
printf("Bad return code trying to get operational vlan MAC locking limit."
" (result = %d)\n", result);
}
else
{
printf("PML vlan operational count is %u.\n", *limit);
}
return;
}
{
{
printf("Bad return code trying to get the MAC Locking violation "
"D-Disable mode for the specified vlan. (result = %d)\n", result);
}
else
{
printf("PML vlan d-disable mode is %u.\n", *mode);
}
return;
}
{
{
printf("Bad return code trying to set the MAC Locking violation "
"D-Disable mode for the specified vlan. (result = %d)\n", result);
}
else
{
printf("PML vlan d-disable mode set successfully.\n");
}
return;
}
{
{
printf("Bad return code trying to get the MAC Locking violation trap"
" mode for the specified vlan. (result = %d)\n", result);
}
else
{
printf("PML vlan violation trap mode is %u.\n", *mode);
}
return;
}
{
{
printf("Bad return code trying to set the MAC Locking violation "
"trap mode for the specified vlan. (result = %d)\n", result);
}
else
{
printf("PML vlan violation trap mode set successfully.\n");
}
return;
}
uint32_t *mode)
{
{
printf("Bad return code trying to get the MAC Locking mode "
"for the specified vlan. (result = %d)\n", result);
}
else
{
printf("PML vlan mode is %u.\n", *mode);
}
return;
}
uint32_t mode)
{
{
printf("Bad return code trying to set the MAC Locking mode for the "
"specified vlan. (result = %d)\n", result);
}
else
{
printf("PML vlan mode set successfully.\n");
}
return;
}
uint32_t ifNum, uint32_t vlanId,
uint32_t *limit)
{
{
printf("Bad return code trying to get the Port MAC Locking vlan dynamic"
" limit for the specified interface. (result = %d)\n", result);
}
else
{
printf("PML interface vlan dynamic limit is %u.\n", *limit);
}
return;
}
uint32_t ifNum, uint32_t vlanId, uint32_t limit)
{
{
printf("Bad return code trying to set the Port MAC Locking vlan dynamic"
" limit for the specified interface. (result = %d)\n", result);
}
else
{
printf("PML interface vlan dynamic limit set successfully.\n");
}
return;
}
uint32_t ifNum, uint32_t vlanId,
uint32_t *count)
{
vlanId, count))
{
printf("Bad return code trying to get the Port MAC Locking vlan dynamic "
"learned address count for the specified interface and vlan. "
"(result = %d)\n", result);
}
else
{
printf("PML vlan dynamic learned address count is %u.\n", *count);
}
return;
}
uint32_t *ageTime)
{
{
printf("Bad return code trying to get secure MAC address aging time "
"for the specified interface. (result = %d)\n", result);
}
else
{
printf("PML interface age time is %u.\n", *ageTime);
}
return;
}
uint32_t ageTime)
{
{
printf("Bad return code trying to set secure MAC address aging time "
"for the specified interface. (result = %d)\n", result);
}
else
{
printf("PML interface age time set successfully.\n");
}
return;
}
uint32_t *nextIfNum)
{
{
printf("Bad return code trying to get the next valid PML interface."
" (result = %d)\n", result);
}
else
{
printf("PML next valid interface is %u.\n", *nextIfNum);
}
return;
}
uint32_t ifNum)
{
char mac[MAC_STRING_SIZE] = "";
uint32_t vlanId;
macAddr.pstart = mac;
macAddr.size = MAC_STRING_SIZE;
ifNum, &macAddr,
&vlanId))
{
printf ("Dynamically configured MAC Address VLAN ID\n");
printf ("---------------------------------- -------\n");
do
{
printf ("%-34s %7u\n", (char *) macAddr.pstart, vlanId);
ifNum, &macAddr,
&macAddr, &vlanId));
}
else
{
printf ("No dynamically learned MAC entries.\n");
}
}
uint32_t streamID)
{
{
printf("Bad return code trying to associate the 802.1Qci stream with static "
"PML entry. (result = %d)\n", result);
}
else
{
printf("Association of 802.1Qci stream with static PML entry is successful.\n");
}
return;
}
uint32_t vlanId, uint32_t streamID)
{
{
printf("Bad return code trying to deassociate the 802.1Qci stream with "
"static PML entry. (result = %d)\n", result);
}
else
{
printf("Deassociation of 802.1Qci stream with static PML entry is "
"successful.\n");
}
return;
}
uint32_t *streamID)
{
{
printf("Bad return code trying to get the 802.1Qci stream ID associated "
"with static PML entry. (result = %d)\n", result);
}
else
{
printf("802.1Qci stream ID associated with static PML entry is %u.\n",
*streamID);
}
return;
}
void printAppMenu(char *name)
{
printf("\nUsage: %s <test#> <arg1> <arg2> ...\n\n", name);
printf("Test 1: get the global admin mode: %s 1\n", name);
printf("Test 2: get whether interface is valid PML interface: %s 2 <intf>\n", name);
printf("Test 3: get the mode for a valid PML interface: %s 3 <intf>\n", name);
printf("Test 4: get the dynamic limit for a valid PML interface: %s 4 <intf>\n", name);
printf("Test 5: get the static limit for a valid PML interface: %s 5 <intf>\n", name);
printf("Test 6: get the violation trap mode for a valid PML interface: %s 6 <intf>\n", name);
printf("Test 7: get the violation D-Disable mode for a valid PML interface: %s 7 <intf>\n", name);
printf("Test 8: get the sticky mode for a valid PML interface: %s 8 <intf>\n", name);
printf("Test 9: Display statically locked MAC addresses on an interface.: %s 9 <intf>\n", name);
printf("Test 10: Display dynamically learned MAC addresses on an interface.: %s 10 <intf>\n", name);
printf("Test 11: Sets the PML global admin mode: %s 11 <adminMode>\n", name);
printf("Test 12: Set the Port MAC Locking mode for the specified interface: %s 12 <ifNum> <intfMode>\n", name);
printf("Test 13: Gets the Port MAC Locking maximum dynamic limit for the specified interface: %s 13 <ifNum>\n", name);
printf("Test 14: Sets the Port MAC Locking dynamic limit for the specified interface: %s 14 <ifNum> <limit>\n", name);
printf("Test 15: Gets the Port MAC Locking maximum static limit for the specified interface: %s 15 <ifNum>\n", name);
printf("Test 16: Gets the Port MAC Locking static count for the specified interface: %s 16 <ifNum>\n", name);
printf("Test 17: Sets the Port MAC Locking static limit for the specified interface: %s 17 <ifNum> <limit>\n", name);
printf("Test 18: Gets the frequency interval between successive SNMP traps: %s 18 <ifNum>\n", name);
printf("Test 19: Sets the frequency interval between successive SNMP traps: %s 19 <ifNum> <interval>\n", name);
printf("Test 20: Adds a statically locked entry to an interface: %s 20 <ifNum> <macAddr> <vlanId> <sticky>\n", name);
printf("Test 21: Deletes a statically locked entry from an interface: %s 21 <ifNum> <macAddr> <vlanId>\n", name);
printf("Test 22: Converts dynamically locked entries to statically locked entries on this interface: %s 22 <ifNum>\n", name);
printf("Test 23: Configures PML sticky mode on this interface: %s 23 <ifNum> <sticky>\n", name);
printf("Test 24: Gets the last violation entry for an interface: %s 24 <ifNum>\n", name);
printf("Test 25: Gets the count of dynamcially learned mac Addresses: %s 25 <ifNum>\n", name);
printf("Test 26: Gets the count of statically learned mac Addresses: %s 26 <ifNum>\n", name);
printf("Test 27: Gets the count of statically learned mac Addresses: %s 27 <vlanId>\n", name);
printf("Test 28: Gets the global count of statically learned mac Addresses: %s 28\n", name);
printf("Test 29: Sets the port MAC locking violation D-Disable mode for the specified interface: %s 29 <ifNum> <mode>\n", name);
printf("Test 30: Gets the PML vlan admin mode: %s 30\n", name);
printf("Test 31: Sets the PML vlan admin mode: %s 31 <adminMode>\n", name);
printf("Test 32: Gets the MAC limit per Vlan: %s 32 <vlanId>\n", name);
printf("Test 33: Sets the vlan MAC Locking limit: %s 33 <vlanId> <limit>\n", name);
printf("Test 34: Gets operational vlan MAC locking limit: %s 34 <vlanId>\n", name);
printf("Test 35: Gets the MAC Locking violation D-Disable mode for the specified vlan: %s 35 <vlanId>\n", name);
printf("Test 36: Sets the MAC Locking violation D-Disable mode for the specified vlan: %s 36 <vlanId> <mode>\n", name);
printf("Test 37: Gets the MAC Locking violation trap mode for the specified vlan: %s 37 <vlanId>\n", name);
printf("Test 38: Sets the MAC Locking violation trap mode for the specified vlan: %s 38 <vlanId> <mode>\n", name);
printf("Test 39: Gets the MAC Locking mode for the specified vlan: %s 39 <vlanId>\n", name);
printf("Test 40: Sets the MAC Locking mode for the specified vlan: %s 40 <vlanId> <mode>\n", name);
printf("Test 41: Gets the Port MAC Locking vlan dynamic limit for the specified interface: %s 41 <ifNum> <vlanId>\n", name);
printf("Test 42: Sets the Port MAC Locking vlan dynamic limit for the specified interface: %s 42 <ifNum> <vlanId> <limit>\n", name);
printf("Test 43: Gets the Port MAC Locking vlan dynamic learned address count for the specified interface and vlan: %s 43 <ifNum> <vlanId>\n", name);
printf("Test 44: Gets secure MAC address aging time for the specified interface: %s 44 <ifNum>\n", name);
printf("Test 45: Sets secure MAC address aging time for the specified interface: %s 45 <ifNum> <ageTime>\n", name);
printf("Test 46: Gets the next valid PML interface: %s 46 <ifNum>\n", name);
printf("Test 47: Display dynamically learned MAC addresses on an interface.: %s 47 <intf>\n", name);
printf("Test 48: Associate the 802.1Qci stream with static PML entry: %s 48 <ifNum> <macAddr> <vlanId> <streamID>\n", name);
printf("Test 49: Deassociate the 802.1Qci stream with static PML entry: %s 49 <ifNum> <macAddr> <vlanId> <streamID>\n", name);
printf("Test 50: Get the 802.1Qci stream ID associated with static PML entry: %s 50 <ifNum> <macAddr> <vlanId> <streamID>\n", name);
printf("Test 51: run negative tests: %s 51 <intf>\n", name);
return;
}
{
uint32_t invalidIntf = 0xffffffff;
uint32_t value;
printf("\nTesting openapiPmlGlobalAdminModeGet(): \n");
printf("NULL Client Handle. (result = %d)\n", result);
printf("NULL mode arg. (result = %d)\n", result);
printf("\nTesting openapiPmlIntfIsValid(): \n");
printf("NULL Client Handle. (result = %d)\n", result);
printf("NULL valid arg. (result = %d)\n", result);
printf("Likely invalid intf arg. (result = %d)\n", result);
printf("\nTesting openapiPmlIntfModeGet(): \n");
printf("NULL Client Handle. (result = %d)\n", result);
printf("NULL mode arg. (result = %d)\n", result);
printf("Likely invalid intf arg. (result = %d)\n", result);
printf("\nTesting openapiPmlIntfDynamicLimitGet(): \n");
printf("NULL Client Handle. (result = %d)\n", result);
printf("NULL limit argument. (result = %d)\n", result);
printf("Likely invalid intf arg. (result = %d)\n", result);
printf("\nTesting openapiPmlIntfStaticLimitGet(): \n");
printf("NULL Client Handle. (result = %d)\n", result);
printf("NULL limit argument. (result = %d)\n", result);
printf("Likely invalid intf arg. (result = %d)\n", result);
printf("\nTesting openapiPmlIntfViolationTrapModeGet(): \n");
printf("NULL Client Handle. (result = %d)\n", result);
printf("NULL mode arg. (result = %d)\n", result);
printf("Likely invalid intf arg. (result = %d)\n", result);
printf("\nTesting openapiPmlIntfViolationDDisableModeGet(): \n");
printf("NULL Client Handle. (result = %d)\n", result);
printf("NULL mode arg. (result = %d)\n", result);
printf("Likely invalid intf arg. (result = %d)\n", result);
printf("\nTesting openapiPmlIntfStickyModeGet(): \n");
printf("NULL Client Handle. (result = %d)\n", result);
printf("NULL mode arg. (result = %d)\n", result);
printf("Likely invalid intf arg. (result = %d)\n", result);
return;
}
int main(int argc, char *argv[])
{
uint32_t testNum;
uint32_t intf;
char switch_os_revision_string[100];
uint32_t show_help = 1, val = 0, vlanId = 0;
char mac[MAC_STRING_SIZE] = {0};
macAddr.pstart = mac;
macAddr.size = MAC_STRING_SIZE;
if (argc < 2)
{
printAppMenu(argv[0]);
return -1;
}
testNum = atoi(argv[1]);
if (argc >= 3)
{
intf = atoi(argv[2]);
vlanId = atoi(argv[2]);
}
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 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 == 2)
{
getGlobalAdminMode(&clientHandle);
show_help = 0;
}
break;
case 2:
if (argc == 3)
{
getPmlInterfaceIsValid(&clientHandle, intf);
show_help = 0;
}
break;
case 3:
if (argc == 3)
{
getMode(&clientHandle, intf);
show_help = 0;
}
break;
case 4:
if (argc == 3)
{
getDynamicLimit(&clientHandle, intf);
show_help = 0;
}
break;
case 5:
if (argc == 3)
{
getStaticLimit(&clientHandle, intf);
show_help = 0;
}
break;
case 6:
if (argc == 3)
{
getViolationTrapMode(&clientHandle, intf);
show_help = 0;
}
break;
case 7:
if (argc == 3)
{
getViolationDDisableMode(&clientHandle, intf);
show_help = 0;
}
break;
case 8:
if (argc == 3)
{
getStickyMode(&clientHandle, intf);
show_help = 0;
}
break;
case 9:
if (argc == 3)
{
displayStaticEntries(&clientHandle, intf);
show_help = 0;
}
break;
case 10:
if (argc == 3)
{
displayDynamicEntries(&clientHandle, intf);
show_help = 0;
}
break;
case 11:
if (argc == 3)
{
pmlGlobalAdminModeSet(&clientHandle, atoi(argv[2]));
show_help = 0;
}
break;
case 12:
if (argc == 4)
{
pmlIntfModeSet(&clientHandle, intf, atoi(argv[3]));
show_help = 0;
}
break;
case 13:
if (argc == 3)
{
pmlIntfDynamicMaxLimitGet(&clientHandle, intf, &val);
show_help = 0;
}
break;
case 14:
if (argc == 4)
{
pmlIntfDynamicLimitSet(&clientHandle, intf, atoi(argv[3]));
show_help = 0;
}
break;
case 15:
if (argc == 3)
{
pmlIntfStaticMaxLimitGet(&clientHandle, intf, &val);
show_help = 0;
}
break;
case 16:
if (argc == 3)
{
pmlIntfStaticCountGet(&clientHandle, intf, &val);
show_help = 0;
}
break;
case 17:
if (argc == 4)
{
pmlIntfStaticLimitSet(&clientHandle, intf, atoi(argv[3]));
show_help = 0;
}
break;
case 18:
if (argc == 3)
{
pmlIntfTrapFrequencyGet(&clientHandle, intf, &val);
show_help = 0;
}
break;
case 19:
if (argc == 4)
{
pmlIntfTrapFrequencySet(&clientHandle, intf, atoi(argv[3]));
show_help = 0;
}
break;
case 20:
if (argc == 6)
{
strncpy (mac, argv[3], MAC_STRING_SIZE-1);
pmlIntfStaticEntryAdd(&clientHandle, intf, &macAddr, atoi(argv[4]),
atoi(argv[5]));
show_help = 0;
}
break;
case 21:
if (argc == 5)
{
strncpy (mac, argv[3], MAC_STRING_SIZE-1);
pmlIntfStaticEntryDelete(&clientHandle, intf, &macAddr, atoi(argv[4]));
show_help = 0;
}
break;
case 22:
if (argc == 3)
{
pmlIntfDynamicToStaticMove(&clientHandle, intf);
show_help = 0;
}
break;
case 23:
if (argc == 4)
{
pmlIntfStickyModeSet(&clientHandle, intf, atoi(argv[3]));
show_help = 0;
}
break;
case 24:
if (argc == 3)
{
pmlIntfLastViolationAddrGet(&clientHandle, intf, &macAddr, &val);
show_help = 0;
}
break;
case 25:
if (argc == 3)
{
pmlIntfDynamicLearnedAddrCountGet(&clientHandle, intf, &val);
show_help = 0;
}
break;
case 26:
if (argc == 3)
{
pmlIntfStaticLearnedAddrCountGet(&clientHandle, intf, &val);
show_help = 0;
}
break;
case 27:
if (argc == 3)
{
pmlStaticAddrCountByVlanGet(&clientHandle, vlanId, &val);
show_help = 0;
}
break;
case 28:
if (argc == 2)
{
pmlStaticAddrGlobalCountGet(&clientHandle, &val);
show_help = 0;
}
break;
case 29:
if (argc == 4)
{
pmlIntfViolationDDisableModeSet(&clientHandle, intf, atoi(argv[3]));
show_help = 0;
}
break;
case 30:
if (argc == 2)
{
pmlVlanAdminModeGet(&clientHandle, &val);
show_help = 0;
}
break;
case 31:
if (argc == 3)
{
pmlVlanAdminModeSet(&clientHandle, atoi(argv[2]));
show_help = 0;
}
break;
case 32:
if (argc == 3)
{
pmlVlanDynamicLimitGet(&clientHandle, vlanId, &val);
show_help = 0;
}
break;
case 33:
if (argc == 4)
{
pmlVlanDynamicLimitSet(&clientHandle, vlanId, atoi(argv[3]));
show_help = 0;
}
break;
case 34:
if (argc == 3)
{
pmlVlanOperationalLimitGet(&clientHandle, vlanId, &val);
show_help = 0;
}
break;
case 35:
if (argc == 3)
{
pmlVlanViolationDDisableModeGet(&clientHandle, vlanId, &val);
show_help = 0;
}
break;
case 36:
if (argc == 4)
{
pmlVlanViolationDDisableModeSet(&clientHandle, vlanId, atoi(argv[3]));
show_help = 0;
}
break;
case 37:
if (argc == 3)
{
pmlVlanViolationTrapModeGet(&clientHandle, vlanId, &val);
show_help = 0;
}
break;
case 38:
if (argc == 4)
{
pmlVlanViolationTrapModeSet(&clientHandle, vlanId, atoi(argv[3]));
show_help = 0;
}
break;
case 39:
if (argc == 3)
{
pmlVlanModeGet(&clientHandle, vlanId, &val);
show_help = 0;
}
break;
case 40:
if (argc == 4)
{
pmlVlanModeSet(&clientHandle, vlanId, atoi(argv[3]));
show_help = 0;
}
break;
case 41:
if (argc == 4)
{
pmlIntfVlanDynamicLimitGet(&clientHandle, intf, atoi(argv[3]), &val);
show_help = 0;
}
break;
case 42:
if (argc == 5)
{
pmlIntfVlanDynamicLimitSet(&clientHandle, intf, atoi(argv[3]),
atoi(argv[4]));
show_help = 0;
}
break;
case 43:
if (argc == 4)
{
pmlIntfVlanDynamicLearnedAddrCountGet(&clientHandle, intf,
atoi(argv[3]), &val);
show_help = 0;
}
break;
case 44:
if (argc == 3)
{
pmlIntfAgeTimeGet(&clientHandle, intf, &val);
show_help = 0;
}
break;
case 45:
if (argc == 4)
{
pmlIntfAgeTimeSet(&clientHandle, intf, atoi(argv[3]));
show_help = 0;
}
break;
case 46:
if (argc == 3)
{
pmlNextValidIntfGet(&clientHandle, intf, &val);
show_help = 0;
}
break;
case 47:
if (argc == 3)
{
displayVlanDynamicEntries(&clientHandle, intf);
show_help = 0;
}
break;
case 48:
if (argc == 6)
{
strncpy (mac, argv[3], MAC_STRING_SIZE-1);
pmlDot1qciStreamSet(&clientHandle, intf, &macAddr,
atoi(argv[4]), atoi(argv[5]));
show_help = 0;
}
break;
case 49:
if (argc == 6)
{
strncpy (mac, argv[3], MAC_STRING_SIZE-1);
pmlDot1qciStreamDelete(&clientHandle, intf, &macAddr,
atoi(argv[4]), atoi(argv[5]));
show_help = 0;
}
break;
case 50:
if (argc == 5)
{
strncpy (mac, argv[3], MAC_STRING_SIZE-1);
pmlDot1qciStreamGet(&clientHandle, intf, &macAddr, atoi(argv[4]), &val);
show_help = 0;
}
break;
case 51:
if (argc == 3)
{
runNegativeTests(&clientHandle, intf);
show_help = 0;
}
break;
default:
break;
}
if (show_help == 1)
{
printAppMenu(argv[0]);
}
L7PROC_LOGF(L7PROC_LOG_SEVERITY_INFO, 0, "Stopping PML API example application");
return 0;
}