#include <stdlib.h>
#include <unistd.h>
#include "rpcclt_openapi.h"
#include "proc_util.h"
#define VLAN_ID_MIN 1
#define VLAN_ID_MAX 1024
#define IF_PRIORITY 3
#define RETRY_COUNT 10
#define RETRY_INTERVAL_MSEC 100000
{
uint32_t i;
uint32_t vlanNameLen;
char *vlanName = NULL;
{
printf(" Bad return code trying to create VLAN %u. (result = %d)\n", vlanId, result);
}
else
{
for (i=0; i < RETRY_COUNT; i++)
{
{
break;
}
else
{
usleep(RETRY_INTERVAL_MSEC);
}
}
{
{
printf(" Bad return code trying to get VLAN Name Length. (result = %d)\n", result);
}
else
{
vlanName = (char*)malloc(vlanNameLen);
if (vlanName == NULL)
{
printf(" Could not allocate memory for VLAN name.\n");
}
else
{
memset(vlanName, 0, vlanNameLen);
sprintf(vlanName, "vlanName%u", vlanId);
vlanNameDesc.
pstart = vlanName;
vlanNameDesc.
size = strlen(vlanName) + 1;
{
printf(" Bad return code trying to set VLAN %u name. (result = %d)\n", vlanId, result);
}
else
{
memset(vlanName, 0, vlanNameLen);
vlanNameDesc.size = vlanNameLen;
{
printf(" Bad return code trying to get VLAN %u name. (result = %d)\n", vlanId, result);
}
else
{
printf(" VLAN %u name = %s\n", vlanId, vlanName);
}
}
}
}
}
else
{
printf(" Could not verify that VLAN %u is created. (result = %d)\n", vlanId, result);
}
}
if (vlanName)
{
free(vlanName);
}
return(result);
}
{
uint32_t i;
{
printf(" Bad return code trying to create VLAN %u. (result = %d)\n", vlanId, result);
}
else
{
for (i=0; i < RETRY_COUNT; i++)
{
{
break;
}
else
{
usleep(RETRY_INTERVAL_MSEC);
}
}
}
{
}
return(result);
}
uint32_t ifNum,
{
uint32_t newType;
uint32_t i;
{
printf(" Bad return code trying to set Accept Frame Type. (result = %d)\n", result);
}
else
{
for (i=0; i < RETRY_COUNT; i++)
{
{
printf(" Bad return code trying to get Accept Frame Type. (result = %d)\n", result);
break;
}
else
{
if (newType != type)
{
usleep(RETRY_INTERVAL_MSEC);
}
else
{
break;
}
}
}
if (newType != type)
{
}
}
return(result);
}
{
uint32_t newVlanId;
uint32_t i;
{
printf(" Bad return code trying to set PVID. (result = %d)\n", result);
}
else
{
for (i=0; i < RETRY_COUNT; i++)
{
{
printf(" Bad return code trying to get PVID. (result = %d)\n", result);
break;
}
else
{
if (newVlanId != vlanId)
{
usleep(RETRY_INTERVAL_MSEC);
}
else
{
break;
}
}
}
if (newVlanId != vlanId)
{
}
}
return(result);
}
{
uint32_t i;
{
printf(" Bad return code trying to set VLAN participation configuration. (result = %d, ifNum = %u, partStatus = %u)\n", result, ifNum, partStatus);
}
else
{
for (i=0; i < RETRY_COUNT; i++)
{
{
printf(" Bad return code trying to get VLAN participation configuration. (result = %d, ifNum = %u, partStatus = %u)\n", result, ifNum, partStatus);
break;
}
else
{
if (newPartStatus != partStatus)
{
usleep(RETRY_INTERVAL_MSEC);
}
else
{
break;
}
}
}
if (newPartStatus != partStatus)
{
}
}
return(result);
}
{
uint32_t i;
{
printf(" Bad return code trying to set VLAN tagging configuration. (result = %d, ifNum = %u, taggingMode = %u)\n", result, ifNum, taggingMode);
}
else
{
for (i=0; i < RETRY_COUNT; i++)
{
{
printf(" Bad return code trying to get VLAN tagging configuration. (result = %d, ifNum = %u, taggingMode = %u)\n", result, ifNum, taggingMode);
break;
}
else
{
if (newTaggingMode != taggingMode)
{
usleep(RETRY_INTERVAL_MSEC);
}
else
{
break;
}
}
}
if (newTaggingMode != taggingMode)
{
}
}
return(result);
}
uint32_t priority)
{
uint32_t i;
uint32_t numTrafficClasses;
uint32_t newPriority;
{
printf(" Bad return code trying to the number of traffic classes supported. (result = %d, ifNum = %u)\n", result, ifNum);
}
if (priority > numTrafficClasses)
{
printf(" Parameter value for priority out of accepted range. (priority = %u, numTrafficClasses = %u)\n", priority, numTrafficClasses);
}
{
printf(" Bad return code trying to set user priority. (result = %d, ifNum = %u, priority = %u)\n", result, ifNum, priority);
}
else
{
for (i=0; i < RETRY_COUNT; i++)
{
{
printf(" Bad return code trying to get user priority. (result = %d, ifNum = %u)\n", result, ifNum);
break;
}
else
{
if (newPriority != priority)
{
usleep(RETRY_INTERVAL_MSEC);
}
else
{
break;
}
}
}
if (newPriority != priority)
{
}
}
return(result);
}
uint32_t primary_vlan,
uint32_t isolated_vlan,
uint32_t community_vlan)
{
uint32_t i;
{
printf("Bad return code trying to create VLAN %u. (result = %d)\n", primary_vlan, result);
}
else
{
{
printf("Bad return code trying to configure a VLAN as Primary VLAN %u. (result = %d)\n", primary_vlan, result);
}
{
for (i=0; i < RETRY_COUNT; i++)
{
{
printf("Bad return code trying to get Type for VLAN %u. (result = %d)\n", primary_vlan, result);
}
else
{
if (tmpVal != pvlanType)
{
usleep(RETRY_INTERVAL_MSEC);
}
else
{
break;
}
}
}
if (tmpVal != pvlanType)
{
printf("Failure configuring Primary VLAN %u. \n", primary_vlan);
}
else
{
printf("Successfully configured and verified Primary VLAN %u. \n", primary_vlan);
}
}
}
{
printf("Bad return code trying to create VLAN %u. (result = %d)\n", isolated_vlan, result);
}
else
{
{
printf("Bad return code trying to configure a VLAN as Isolated VLAN %u. (result = %d)\n", isolated_vlan, result);
}
{
for (i=0; i < RETRY_COUNT; i++)
{
{
printf("Bad return code trying to get Type for VLAN %u. (result = %d)\n", isolated_vlan, result);
}
else
{
if (tmpVal != pvlanType)
{
usleep(RETRY_INTERVAL_MSEC);
}
else
{
break;
}
}
}
if (tmpVal != pvlanType)
{
printf("Failure configuring Isolated VLAN %u. \n", isolated_vlan);
}
else
{
printf("Successfully configured and verified Isolated VLAN %u. \n", isolated_vlan);
}
}
}
{
printf("Bad return code trying to create VLAN %u. (result = %d)\n", community_vlan, result);
}
else
{
{
printf("Bad return code trying to configure a VLAN as Community VLAN %u. (result = %d)\n", community_vlan, result);
}
{
for (i=0; i < RETRY_COUNT; i++)
{
{
printf("Bad return code trying to get Type for VLAN %u. (result = %d)\n", community_vlan, result);
}
else
{
if (tmpVal != pvlanType)
{
usleep(RETRY_INTERVAL_MSEC);
}
else
{
break;
}
}
}
if (tmpVal != pvlanType)
{
printf("Failure configuring Community VLAN %u. \n", community_vlan);
}
else
{
printf("Successfully configured and verified Community VLAN %u. \n", community_vlan);
}
}
}
memset(&vidList, 0, sizeof(vidList));
vidList.
ids[0] = isolated_vlan;
vidList.
ids[1] = community_vlan;
{
printf("Bad return code trying to associate VLANs with Primary VLAN %u. (result = %d)\n", primary_vlan, result);
}
else
{
memset(&tmpList, 0, sizeof(tmpList));
{
printf("Bad return code trying to get associated VLANs with Primary VLAN %u. (result = %d)\n", primary_vlan, result);
}
else
{
printf("VLAN list set: ");
{
printf(
"%d", vidList.
ids[i]);
{
printf(", ");
}
}
printf("\n");
printf("VLAN list retrieved: ");
{
printf(
"%d", tmpList.
ids[i]);
{
printf(", ");
}
}
printf("\n");
}
{
printf("Bad return code trying to remove VLANs associated with Primary VLAN %u. (result = %d)\n", primary_vlan, result);
}
else
{
printf("Successfully removed VLANs associated with Primary VLAN %u. \n", primary_vlan);
}
}
printf("Successfully configured and verified VLAN association with Primary VLAN. \n");
return;
}
uint32_t ifNum,
uint32_t primary_vlan,
uint32_t secondary_vlan)
{
uint32_t tmpVal1, tmpVal2;
{
printf("Bad return code trying to bind VLANs for Private VLAN interface %u. (result = %d)\n", ifNum, result);
}
else
{
printf("Successfully set VLAN bindings for Private VLAN interface %u. \n", ifNum);
}
{
printf("Bad return code trying to get VLAN bindings for Private VLAN interface %u. (result = %d)\n", ifNum, result);
}
else
{
if (tmpVal1 == primary_vlan)
{
printf("Successfully binded Primary VLAN to Private VLAN interface %u. \n", ifNum);
}
if (tmpVal2 == secondary_vlan)
{
printf("Successfully binded Secondary VLAN to Private VLAN interface %u. \n", ifNum);
}
}
{
printf("Bad return code trying to remove VLAN bindings for Private VLAN interface %u. (result = %d)\n", ifNum, result);
}
else
{
printf("Successfully removed VLAN bindings on interface %u \n", ifNum);
}
printf("Successfully configured and verified VLAN bindings for Private VLAN interface %u \n", ifNum);
return;
}
uint32_t ifNum,
uint32_t primary_vlan,
{
uint32_t tmpVal, i = 0;
{
printf("Bad return code trying to bind VLANs for Private VLAN interface %u. (result = %d)\n", ifNum, result);
}
else
{
printf("Successfully set VLAN bindings for Private VLAN interface %u. \n", ifNum);
}
{
printf("Bad return code trying to get VLAN bindings for Private VLAN interface %u. (result = %d)\n", ifNum, result);
}
else
{
if (tmpVal == primary_vlan)
{
printf("Successfully binded Primary VLAN to Private VLAN interface %u. \n", ifNum);
}
printf("VLAN list set: ");
{
printf(
"%d", tmpList.
ids[i]);
{
printf(", ");
}
}
printf("\n");
}
{
printf("Bad return code trying to remove VLAN bindings for Private VLAN interface %u. (result = %d)\n", ifNum, result);
}
else
{
printf("Successfully removed VLAN bindings on interface %u \n", ifNum);
}
printf("Successfully configured and verified VLAN bindings for Private VLAN interface %u \n", ifNum);
return;
}
{
uint32_t ifNum;
{
printf("Failed to verify parameter error while setting global Auto-Trunk mode. (result = %d)\n", result);
}
else
{
printf("Successfully verified parameter error while setting global Auto-Trunk mode. \n");
}
{
printf("Failed to verify parameter error while getting global Auto-Trunk mode. (result = %d)\n", result);
}
else
{
printf("Successfully verified parameter error while getting global Auto-Trunk mode. \n");
}
{
printf("Failed to verify parameter error while getting global Auto-Trunk mode. (result = %d)\n", result);
}
else
{
printf("Successfully verified parameter error while getting global Auto-Trunk mode. \n");
}
{
printf("Bad return code trying to enable Auto-Trunk. (result = %d)\n", result);
}
else
{
printf("Successfully set global Auto-Trunk mode to enable. \n");
}
{
printf("Successfully verified that global Auto-Trunk mode is enabled. \n");
}
else
{
printf("Bad return code trying to get global Auto-Trunk mode. (result = %d)\n", result);
}
{
printf("Bad return code trying to disable Auto-Trunk. (result = %d)\n", result);
}
else
{
printf("Successfully set global Auto-Trunk mode to disable. \n");
}
{
printf("Successfully verified that global Auto-Trunk mode is disabled. \n");
}
else
{
printf("Bad return code trying to get global Auto-Trunk mode. (result = %d)\n", result);
}
printf("Successfully configured and verified global Auto-Trunk mode \n");
{
printf(" Bad return code trying to get first physical interface. (result = %d)\n",result);
}
printf("Using physical interface %d\n", ifNum);
{
printf("Successfully fetched the operational auto-trunk mode on interface %d. \n", ifNum);
}
else
{
printf("Bad return code trying to fetch the operational auto-trunk mode on interface %d. (result = %d)\n", ifNum, result);
}
printf("Successfully fetched the operational auto-trunk mode \n");
return;
}
uint32_t *val)
{
{
printf("Bad return code trying to get dot1q Max Supported VLANs. "
"(result = %d)\n", result);
}
else
{
printf("\nMaximum supported VLANs: %d\n", *val);
}
return;
}
{
{
printf("Bad return code trying to get the max VLAN entries allowed. "
"(result = %d)\n", result);
}
else
{
printf("Number of VLANs in use: %d\n", *val);
}
return;
}
{
{
printf("Bad return code trying to get the number of static VLANs. "
"(result = %d)\n", result);
}
else
{
printf("Number of static VLANs: %d\n", *val);
}
return;
}
{
{
printf("Bad return code trying to get the number of dynamic VLANs. "
"(result = %d)\n", result);
}
else
{
printf("Number of dynamic VLANs: %d\n", *val);
}
return;
}
{
{
printf("Bad return code trying to get the number of times a VLAN entry "
"has been deleted from DOT1Q table. (result = %d)\n", result);
}
else
{
printf("Number of times VLANs are deleted: %d\n", *val);
}
return;
}
uint32_t index, uint32_t *val)
{
{
printf("Bad return code trying to get the tagging configuration for a "
"member port. (result = %d)\n", result);
}
else
{
printf("Tagged status of interface %d in VLAN %d is %s\n", index, vindex,
(*val == OPEN_DOT1Q_UNTAGGED)? "untagged":"tagged");
}
return;
}
uint32_t *nextVid)
{
{
printf("Bad return code trying to gets the next VLAN ID. (result = %d)\n",
result);
}
else
{
printf("Given VLAN: %d Next VLAN: %d\n", vid, *nextVid);
}
return;
}
uint32_t index, uint32_t *val)
{
{
printf("Bad return code trying to get the Ingress Filtering configuration "
"for a port. (result = %d)\n", result);
}
else
{
printf("Ingress filtering mode of interface %d is %s\n", index,
}
return;
}
uint32_t interface, uint32_t mode)
{
{
printf("Bad return code trying to set the Ingress Filtering "
"configuration for a port. (result = %d)\n", result);
}
else
{
printf("Ingress filtering mode for interface %d is set successfully.\n",
interface);
}
return;
}
uint32_t basePort, uint32_t *val)
{
{
printf("Bad return code trying to get VLAN ingress filtering status per port."
" (result = %d)\n", result);
}
else
{
printf("Ingress filtering of interface %d is %s\n", basePort,
}
return;
}
uint32_t index, uint32_t *val)
{
{
printf("Bad return code trying to get the Current Ingress Filtering "
"configuration for a port. (result = %d)\n", result);
}
else
{
printf("Current ingress filtering mode of interface %d is %s\n", index,
}
return;
}
{
uint8_t i;
{
printf("Bad return code trying to get a list of VLANs an interface is a "
"member of. (result = %d)\n", result);
}
else
{
printf("Interface %d is member of %d VLANs: ", intfNum, *numOfElements);
{
printf(
"%d", data->
ids[i]);
if (i < data->numEntries - 1)
{
printf(", ");
}
}
printf("\n");
}
return;
}
uint32_t ifNum)
{
uint64_t ctrValue;
char intfName[256];
open_buffdesc intfNameBuff = {.pstart = intfName, .size =
sizeof(intfName)};
memset(intfName, 0, sizeof(intfName));
intfNameBuff.pstart = intfName;
intfNameBuff.size = sizeof(intfName);
{
printf("Bad return code trying to get the interface name for "
"interface %d. (result = %d)\n", ifNum, result);
return;
}
{
printf("Bad return code trying to get the packets that are not forwarded on "
"interface %s(%d). (result = %d)\n", intfName, ifNum, result);
}
else
{
printf("Number of packets that are not forwarded on interface %s(%d) - 0x%016llx\n",
intfName, ifNum, ctrValue);
}
return;
}
{
char *ret = "Unknown";
switch (type)
{
ret = "Not participating";
break;
ret = "Default VLAN";
break;
ret = "Static VLAN";
break;
ret = "GVRP VLAN";
break;
ret = "L2 Tunnel VLAN";
break;
ret = "IP VLAN";
break;
ret = "Auth Manager/DOT1X VLAN";
break;
ret = "MVRP VLAN";
break;
ret = "OPENFLOW VLAN";
break;
ret = "Auto-Video VLAN";
break;
ret = "EVC VLAN";
break;
ret = "PBB VLAN";
break;
default:
break;
}
return ret;
}
int main(int argc, char **argv)
{
uint32_t ifNum, i;
char switch_os_revision_string[100];
uint32_t partStatus;
uint32_t vlanId, nextVlanId;
uint32_t vlanFlag = 0;
uint32_t vlanId1 = 0, vlanId2 = 0, vlanId3 = 0;
uint32_t val, numOfElements;
l7proc_crashlog_register();
{
printf("\nFailed to initialize RPC to OpEN. Exiting (result = %d)\n", result);
exit(2);
}
{
sleep(1);
}
L7PROC_LOGF(L7PROC_LOG_SEVERITY_INFO, 0, "Starting VLAN 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");
do
{
for (vlanId = VLAN_ID_MIN; vlanId < VLAN_ID_MAX; vlanId++)
{
{
break;
}
}
if (vlanId >= VLAN_ID_MAX)
{
printf(" Could not find an unused VLAN to configure.\n");
break;
}
printf("Using VLAN ID %u.\n", vlanId);
printf("\n");
printf("Testing VLAN create/delete/check APIs.\n");
printf("Attempting to create VLAN %u.\n", vlanId);
if (vlanCreateAndVerify(&clientHandle, vlanId) !=
OPEN_E_NONE)
{
printf(" Failure creating VLAN %u.\n", vlanId);
break;
}
printf(" Successfully created VLAN %u.\n", vlanId);
printf("Attempting to delete VLAN %u.\n", vlanId);
if (vlanDeleteAndVerify(&clientHandle, vlanId) !=
OPEN_E_NONE)
{
printf(" Failure deleting VLAN %u.\n", vlanId);
break;
}
printf(" Successfully deleted VLAN %u.\n", vlanId);
printf("\n");
printf("Testing PVID set/get APIs.\n");
printf("Attempting to create VLAN %u.\n", vlanId);
if (vlanCreateAndVerify(&clientHandle, vlanId) !=
OPEN_E_NONE)
{
printf(" Failure creating VLAN %u.\n", vlanId);
break;
}
printf(" Successfully created VLAN %u.\n", vlanId);
printf("Attempting to set the first physical interface to participate in VLAN %u.\n", vlanId);
{
printf(" Bad return code trying to get first physical interface. (result = %d)\n", result);
break;
}
printf("Using physical interface with ifNum = %u.\n", ifNum);
printf("\n");
{
printf(" Failure setting Acceptable Frame Type for ifNum %u.\n", ifNum);
break;
}
printf(" Successfully set Acceptable Frame Type for ifNum %u.\n", ifNum);
printf("\n");
printf("Attempting to set PVID for interface to %u.\n", vlanId);
if (interfacePvidSetAndVerify(&clientHandle, ifNum, vlanId) !=
OPEN_E_NONE)
{
printf(" Failure setting PVID for ifNum %u to VLAN %u.\n", ifNum, vlanId);
break;
}
printf(" Successfully set PVID for ifNum %u to VLAN %u.\n", ifNum, vlanId);
printf("\n");
printf("Attempting to set participation mode for interface %u on VLAN %u to INCLUDE.\n", ifNum, vlanId);
{
printf(" Failure setting VLAN participation mode for ifNum %u on VLAN %u.\n", ifNum, vlanId);
break;
}
printf(" Successfully set VLAN participation mode for ifNum %u on VLAN %u.\n", ifNum, vlanId);
printf("Attempting to get the VLAN participation status.\n");
for (i=0; i < RETRY_COUNT; i++)
{
{
break;
}
else
{
{
usleep(RETRY_INTERVAL_MSEC);
}
else
{
break;
}
}
}
{
printf(" Bad return code trying to get participation status. (result = %d)\n", result);
break;
}
else
{
printf(" Successfully retrieved participation status for ifNum = %u. - ", ifNum);
printf(
"This is %sas expected.\n", (partStatus ==
OPEN_ENABLE) ?
"":
"NOT ");
}
printf("\n");
printf("Attempting to set tagging mode for interface %u on VLAN %u to ENABLE.\n", ifNum, vlanId);
{
printf(" Failure setting VLAN tagging mode for ifNum %u on VLAN %u.\n", ifNum, vlanId);
break;
}
printf(" Successfully set VLAN tagging mode for ifNum %u on VLAN %u.\n", ifNum, vlanId);
printf("Attempting to set tagging mode for interface %u on VLAN %u to DISABLE.\n", ifNum, vlanId);
{
printf(" Failure setting VLAN tagging mode for ifNum %u on VLAN %u.\n", ifNum, vlanId);
break;
}
printf(" Successfully set VLAN tagging mode for ifNum %u on VLAN %u.\n", ifNum, vlanId);
printf("\n");
printf("Attempting to delete VLAN %u.\n", vlanId);
if (vlanDeleteAndVerify(&clientHandle, vlanId) !=
OPEN_E_NONE)
{
printf(" Failure deleting VLAN %u.\n", vlanId);
break;
}
printf(" Successfully deleted VLAN %u.\n", vlanId);
printf("\n");
printf("Attempting to set default priority for interface %u to %u.\n", ifNum, IF_PRIORITY);
if (interfacePrioritySetAndVerify(&clientHandle, ifNum, IF_PRIORITY) !=
OPEN_E_NONE)
{
printf(" Failure setting default priority for interface %u.\n", ifNum);
break;
}
printf(" Successfully set default priority for interface %u.\n", ifNum);
} while (0);
printf("\n");
printf("Testing vlan get next API.\n");
printf("Attempting to check if there are any vlans.\n");
for (vlanId = VLAN_ID_MIN+1; vlanId < VLAN_ID_MAX; vlanId++)
{
{
vlanFlag = 1;
break;
}
}
if (!vlanFlag)
{
printf(" Creating vlans as there are no vlans other than default vlan.\n");
for (vlanId = VLAN_ID_MIN+1; vlanId <= 10; vlanId++)
{
if ((result = vlanCreateAndVerify(&clientHandle, vlanId)) !=
OPEN_E_NONE)
{
printf(" Bad return code trying to create VLAN %u. (result = %d)\n", vlanId, result);
break;
}
}
}
{
printf(" Vlans present: ");
}
else
{
printf(" Failed to get next vlan.(result = %d)\n", result);
}
{
printf(" %u", nextVlanId);
}
printf("\n\n");
if (!vlanFlag)
{
printf("Attempting to delete created vlans.\n");
nextVlanId = VLAN_ID_MIN;
{
{
printf(" Bad return code trying to delete VLAN %u. (result = %d)\n", nextVlanId, result);
break;
}
}
{
printf(" Successfully deleted the created vlans.\n");
}
}
vlanId1 = 10;
vlanId2 = 20;
vlanId3 = 30;
privateVlanCreateAndVerify(&clientHandle, vlanId1, vlanId2, vlanId3);
ifNum = 5;
interfaceHostPrivateVlanCreateAndVerify(&clientHandle, ifNum, vlanId1, vlanId2);
ifNum = 6;
interfacePromiscPrivateVlanCreateAndVerify(&clientHandle, ifNum, vlanId1, vidList);
autoTrunkConfigAndVerify(&clientHandle);
dot1qMaxSupportedVlansGet(&clientHandle, &val);
mostVlanEntriesGet(&clientHandle, &val);
staticVlanEntriesGet(&clientHandle, &val);
dynamicVlanEntriesGet(&clientHandle, &val);
dot1qVlanNumDeletesGet(&clientHandle, &val);
vlanTaggedSetGet(&clientHandle, 1, 1, &val);
nextVlanGet(&clientHandle, 1, &val);
qportsEnableIngressFilteringGet(&clientHandle, 1, &val);
qportsEnableIngressFilteringSet(&clientHandle, 1, 1);
qportsEnableIngressFilteringGet(&clientHandle, 1, &val);
dot1qPortIngressFiltering(&clientHandle, 1, &val);
qportsCurrentIngressFilteringGet(&clientHandle, 1, &val);
memset(&vidList, 0, sizeof(vidList));
vlanVIDListGet(&clientHandle, 1, &vidList, &numOfElements);
{
dot1qRxPacketsNotForwardedCountGet(&clientHandle, ifNum);
}
vlanType = 0;
nextVlanId = 0;
{
printf("\r\nVLAN and VLAN Type:\r\n");
}
{
vlanType = 0;
printf(" VLAN: %u\r\n", nextVlanId);
{
printf(" VLAN Type: %s(%u)\r\n\r\n", vlanTypeStr(vlanType), vlanType);
}
}
printf("\r\n");
L7PROC_LOGF(L7PROC_LOG_SEVERITY_INFO, 0, "Stopping VLAN API example application");
return 0;
}