#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "rpcclt_openapi.h"
#include "proc_util.h"
uint32_t intfNum)
{
uint32_t vlan;
int i;
while (true)
{
{
printf("Could not set DOT1Q Port Mode. Error = %d\n", rc);
}
{
printf("Could not get DOT1Q Port Mode. Mode = %u, Error = %d\n", mode, rc);
}
{
printf("Could not set DOT1Q Access VLAN. Error = %d\n", rc);
}
{
printf("Could not get DOT1Q Access VLAN. VLAN = %u, Error = %d\n", vlan, rc);
}
{
printf("Could not set DOT1Q Native VLAN. Error = %d\n", rc);
}
vlan = 0;
{
printf("Could not get DOT1Q Native VLAN. VLAN = %u, Error = %d\n", vlan, rc);
}
memset(&vidList, 0, sizeof(vidList));
printf("Try to set trunk mode allowed VLANs list.\n");
{
printf("Could not set Allowed VLANs list. Error = %d\n", rc);
}
memset(&vidListRetrieved, 0, sizeof(vidListRetrieved));
{
printf("Could not get trunk mode allowed VLANs list. Error = %d\n", rc);
}
else
{
{
printf("Retrieved VLAN list has different number of entries from list set. (number set = %d, number retrieved = %d)\n",
}
printf("VLAN list set: ");
{
printf(
"%d", vidList.
ids[i]);
{
printf(", ");
}
}
printf("\n");
printf("VLAN list retrieved: ");
{
printf(
"%d", vidListRetrieved.
ids[i]);
{
printf(", ");
}
}
printf("\n");
}
printf("INFORMATION: All configuration done\n");
break;
}
}
int main(int argc, char **argv)
{
char switch_os_revision_string[100];
uint32_t vlanId = 1;
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 SWITCHPORT 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");
dot1qSwPortExampleStart(&clientHandle, vlanId, 5);
L7PROC_LOGF(L7PROC_LOG_SEVERITY_INFO, 0, "Stopping SWITCHPORT API example application");
return 0;
}