#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <stdlib.h>
#include <ctype.h>
#include <arpa/inet.h>
#include <unistd.h>
#include "rpcclt_openapi.h"
#include "proc_util.h"
{
uint32_t ip4_addr;
uint8_t addr8[16];
int af;
{
af = AF_INET;
ip4_addr = htonl(addr->
addr.
ipv4);
memcpy(addr8, &ip4_addr, sizeof(ip4_addr));
break;
af = AF_INET6;
memcpy(addr8, addr->addr.
ipv6.
u.
addr8,
sizeof(addr8));
break;
default:
return(NULL);
}
return(inet_ntop(af, addr8, buffer, INET6_ADDRSTRLEN));
}
static OPEN_BOOL_t rtrUtilConvertMac(
unsigned char * buf,
unsigned char * mac)
{
uint32_t i, j, digit_count = 0;
unsigned char mac_address[256];
if (strlen ((const char *)buf) != 17)
{
}
for (i = 0, j = 0; i < 17; i++, j++)
{
digit_count++;
switch (buf[i])
{
case '0':
mac_address[j] = 0x0;
break;
case '1':
mac_address[j] = 0x1;
break;
case '2':
mac_address[j] = 0x2;
break;
case '3':
mac_address[j] = 0x3;
break;
case '4':
mac_address[j] = 0x4;
break;
case '5':
mac_address[j] = 0x5;
break;
case '6':
mac_address[j] = 0x6;
break;
case '7':
mac_address[j] = 0x7;
break;
case '8':
mac_address[j] = 0x8;
break;
case '9':
mac_address[j] = 0x9;
break;
case 'a':
case 'A':
mac_address[j] = 0xA;
break;
case 'b':
case 'B':
mac_address[j] = 0xB;
break;
case 'c':
case 'C':
mac_address[j] = 0xC;
break;
case 'd':
case 'D':
mac_address[j] = 0xD;
break;
case 'e':
case 'E':
mac_address[j] = 0xE;
break;
case 'f':
case 'F':
mac_address[j] = 0xF;
break;
case ':':
if (digit_count != 3)
{
}
j--;
digit_count = 0;
break;
default:
break;
}
}
for (i = 0; i < 6; i++)
{
mac[i] = ((mac_address[(i * 2)] << 4) + mac_address[(i * 2) + 1]);
}
}
void printRoutingAppMenu()
{
printf("Usage: routing_example API <test number> [<arg1>][<arg2>] ... \n");
printf("Test API 1: Add IP address on an interface: routing_example API 1 <interface> "
"<address family> <address type> <IP Address> <Pfx length> <arg1>\n");
printf("Test API 2: Delete IP address on an interface: routing_example API 2 <interface> "
"<address family> <address type> <IP Address> <Pfx length> <arg1>\n");
printf("Test API 3: Enable/Disable IP Routing Globally: routing_example API 3 <address family> <mode>\n");
printf("Test API 4: Add a test static ARP entry {192.168.1.1 00:11:22:33:44:55} : routing_example API 4\n");
printf("Test API 5: Delete the test static ARP entry {192.168.1.1 00:11:22:33:44:55}: routing_example API 5\n");
printf("Test API 6: Display all ARP entries: routing_example API 6\n");
printf("Test API 7: Enable/Disable IP Redirects mode: routing_example API 7 <mode>\n");
printf("Test API 8: Enable/Disable IP ICMP Echo Reply mode: routing_example API 8 <mode>\n");
printf("Test API 9: Enable/Disable IP Helper mode: routing_example API 9 <mode>\n");
printf("Test API 10: Add IP Helper address: routing_example API 10 <IP Address> <UDP Port>\n");
printf("Test API 11: Delete IP Helper address: routing_example API 11 <IP Address> <UDP Port>\n");
printf("Test API 12: Configure Interface MTU: routing_example API 12 <interface> <address family> <MTU>\n");
printf("Test API 13: Enable/Disable IP Net Directed BCast mode: routing_example API 13 <interface> <mode>\n");
printf("Test API 14: Enable/Disable IP Proxy ARP mode: routing_example API 14 <interface> <mode>\n");
printf("Test API 15: Enable/Disable IP Redirects mode: routing_example API 15 <interface> <mode>\n");
printf("Test API 16: Enable/Disable IP Destination Unreachable mode: routing_example API 16 <interface> <mode>\n");
printf("Test API 17: Enable/Disable IP Interface Routing mode: routing_example API 17 <interface> <mode>\n");
printf("Test API 18: Add Interface IP Helper address: routing_example API 18 <interface> <IP Address> <UDP Port>\n");
printf("Test API 19: Delete Interface IP Helper address: routing_example API 19 <interface> <IP Address> <UDP Port>\n");
printf("Test API 20: Add Interface IP Helper Discard entry: routing_example API 20 <interface> <UDP Port>\n");
printf("Test API 21: Delete Interface IP Helper Discard entry: routing_example API 21 <interface> <UDP Port>\n");
printf("Test API 22: Add an IP route: routing_example API 22 <Address Family> <IP Address> <Pfx length> "
"<Next Hop> <rtePref> <interface> <mpls-label1> <mpls-label2> <mpls-label3>\n");
printf("Test API 23: Delete an IP route: routing_example API 23 <Address Family> <IP Address> <Pfx length> "
"<Next Hop> <interface> <mpls-label1> <mpls-label2> <mpls-label3>\n");
printf("Test API 24: Create a VLAN Routing Interface: routing_example API 24 <VLAN Id> \n");
printf("Test API 25: Delete a VLAN Routing Interface: routing_example API 25 <VLAN Id> \n");
printf("Test API 26: Test Routing Configuration OpEN APIs sanity: routing_example API 26 \n");
printf("Test API 27: Create a BFD session: routing_example API 27 <Address family> <Intf> <Dest IP> <Src IP> \n");
printf("Test API 28: Delete a BFD session: routing_example API 28 <Address family> <Intf> <Dest IP> <Src IP> \n");
printf("Test API 29: Show BFD neighbors: routing_example API 29\n");
printf("Test API 30: Find a BFD session: routing_example API 30 <Address family> <Dest IP>\n");
printf("Test API 31: Iterate the configured VRFs\n");
printf("Test API 32: Show the ifnum for a VLAN Routing Interface: routing_example API 32 <VLAN Id>\n");
printf("Test API 34: Get the router discovery mode on given interface: routing_example API 34 <interface>\n");
printf("Test API 35: Enable/Disable the router discovery mode on given interface: routing_example API 35 <interface> <mode>\n");
printf("Test API 36: Get advertisement packet's destination address: routing_example API 36 <interface>\n");
printf("Test API 37: Set advertisement packet's destination address: routing_example API 37 <interface> <address>\n");
printf("Test API 38: Get max time allowed between router advertisements from interface: routing_example API 38 <interface>\n");
printf("Test API 39: Set max time allowed between router advertisements from interface: routing_example API 39 <interface> <time>\n");
printf("Test API 40: Get min time allowed between router advertisements from interface: routing_example API 40 <interface>\n");
printf("Test API 41: Set min time allowed between router advertisements from interface: routing_example API 41 <interface> <time>\n");
printf("Test API 42: Get the default minimum advertisement interval on interface: routing_example API 42 <interface>\n");
printf("Test API 43: Revert MinAdvertisementInterval to its default value on interface: routing_example API 43 <interface>\n");
printf("Test API 44: Get lifetime field value of router advertisement sent from given interface: routing_example API 44 <interface>\n");
printf("Test API 45: Set lifetime field value of router advertisement sent from given interface: routing_example API 45 <interface> <time>\n");
printf("Test API 46: Get the default value of lifetime field of router advertisement sent from interface: routing_example API 46 <interface>\n");
printf("Test API 47: Revert AdvertisementLifetime to its default value on interface: routing_example API 47 <interface>\n");
printf("Test API 48: Get the preferability of the address as a default router address: routing_example API 48 <interface>\n");
printf("Test API 49: Set the preferability of the address as a default router address: routing_example API 49 <interface> <pref-level>\n");
printf("Test API 50: Get the Grat ARP mode on given unnumbered interface: routing_example API 50 <interface>\n");
printf("Test API 51: Set the Grat ARP mode on given unnumbered interface: routing_example API 51 <interface> <grat-arp-mode>\n");
printf("Test API 52: Enable or disable gratitious ARP on an interface: routing_example API 52 <interface> <grat-arp-mode>\n");
printf("Test API 53: Enable or disable the ARP dynamic entry renew mode: routing_example API 53 <mode>\n");
printf("Test API 54: Displays the ARP dynamic entry renew mode: routing_example API 54\n");
printf("Test API 55: Sets the maximum number of entries in the ARP cache: routing_example API 55 <cache-size>\n");
printf("Test API 56: Sets the ARP request max retries count: routing_example API 56 <count>\n");
printf("Test API 57: Displays whether local proxy ARP is enabled on an interface: routing_example API 57 <interface>\n");
printf("Test API 58: Enable or disable the local proxy ARP on an interface: routing_example API 58 <interface> <mode>\n");
printf("Test API 59: Displays whether proxy ARP is enabled on an interface: routing_example API 59 <interface>\n");
printf("Test API 60: Sets the ARP request response timeout: routing_example API 60 <timeout>\n");
printf("Test API 61: Sets the ARP entry ageout time: routing_example API 61 <timeout>\n");
printf("Test API 62: Retrieve various ARP cache statistics: routing_example API 62 <vrfName>>\n");
printf("Test API 63: Purges a specific dynamic/gateway entry from the ARP cache: routing_example API 63 <vrfName> <ipAddress> <interface>\n");
printf("Test API 64: Clears the ARP cache of all dynamic/gateway entries: routing_example API 64 <vrfName> <gateway-flag>\n");
printf("Test API 65: Delete a static ARP entry of a given VRF instance: routing_example API 65 <vrfName> <ipAddress> <interface>\n");
printf("Test API 66: Add a static ARP entry of a given VRF instance: routing_example API 66 <vrfName> <ipAddress> <interface> <mac-addr-str>\n");
printf("Test API 67: Display all static ARP entries currently configured:routing_example API 67 <vrfName>>\n");
printf("Test API 68: Get the configured IP MTU value on the given interface: routing_example API 68 <ifNum>\n");
printf("Test API 69: Get the maximum IP MTU that may be set on a given interface: routing_example API 69 <ifNum>\n");
printf("Test API 70: Get the IP MTU value being enforced on a given interface: routing_example API 70 <ifNum>\n");
printf("Test API 71: Set the current IP ECMP global load balancing mode: routing_example API 71 <lbMode>\n");
printf("Test API 72: Determines the current IP ECMP global load balancing mode: routing_example API 72 \n");
printf("Test API 73: Set the current IP ECMP IPSEC SPI Hashing mode: routing_example API 73 <spiMode>\n");
printf("Test API 74: Determines the current IP ECMP IPSEC SPI Mode: routing_example API 74 \n");
printf("Test API 75: Get the admin mode for IP forwarding of net-directed broadcasts: routing_example API 75 <ifNum>\n");
printf("Test API 76: Set the unnumbered status of an interface: routing_example API 76 <ifNum> <isUnnumbered> <numberedIfc>\n");
printf("Test API 77: Determine whether given interface is unnumbered and if so, determine the interface whose address it borrows: routing_example API 77 <ifNum>\n");
printf("Test API 78: Determine whether an interface is configured to forward multicast packets: routing_example API 78 <ifNum>\n");
printf("Test API 79: Get the router interface mode: routing_example API 79 <ifNum>\n");
printf("Test API 80: Get the mode of AutoState feature of an interface: routing_example API 80 <ifNum>\n");
printf("Test API 81: Enable or disable the mode of AutoState feature of an interface: routing_example API 81 <ifNum><mode>\n");
printf("Test API 82: Determine whether a given IP interface is up for IPv4: routing_example API 82 <ifNum>\n");
printf("Test API 83: Get the next vlan after this vlan on which routing is enabled: routing_example API 83 <vlanId>\n");
printf("Test API 84: Get the VLAN ID corresponding to the given internal interface number: routing_example API 84 <ifNum>\n");
printf("Test API 85: Get the interface ID for a given VLAN: routing_example API 85 <vlanId>\n");
printf("Test API 86: Get the internal interface number associated with the port-based routing interface corresponding to this internal VLAN: routing_example API 86 <vlanId>\n");
printf("Test API 87: Get the first valid interface: routing_example API 87 \n");
printf("Test API 88: Get the next valid interface: routing_example API 88 <prevIfNum>\n");
printf("Test API 89: Get the administrative mode of sending ICMP Unreachables: routing_example API 89 <ifNum>\n");
printf("Test API 90: Get the interface mode of sending ICMP Redirects: routing_example API 90 <ifNum>\n");
printf("Test API 91: Get the bandwidth of the specified interface: routing_example API 91 <ifNum>\n");
printf("Test API 92: Set the bandwidth of the specified interface: routing_example API 92 <ifNum>\n");
printf("Test API 93: Get the bandwidth of the specified interface without making any modification to the SET bandwidth: routing_example API 93 <ifNum>\n");
printf("Test API 94: Get the routing max equal cost entries: routing_example API 94 \n");
printf("Test API 95: Get the routing max routes entries: routing_example API 95 \n");
printf("Test API 96: Invokes the IPMAP API funciton to get the dampening operational values: routing_example API 96 <ifNum>\n");
printf("Test API 97: Get the next protocol ID by iterating through all registered protocols: routing_example API 97 <protoId>\n");
printf("Test API 98: Get the protocol ID for a given route type: routing_example API 98 <routeType>\n");
printf("Test API 99: Get the global resilient hashing mode for ECMP trunks: routing_example API 99 \n");
printf("Test API 100: Set the global resilient hashing mode for ECMP trunks: routing_example API 100 <resHashMode>\n");
printf("Test API 101: Get the packets forwarded by CPU: routing_example API 101 \n");
printf("Test API 102: Get the IP packets count received by IP-Stack: routing_example API 102 \n");
printf("Test API 103: Get source IP interface from Syslog, SNMP Traps, SNTP, DNS Client, RADIUS, TACACS+ and sFlow apps: routing_example API 103 \n");
printf("Test API 104: Set source IP interface for Syslog, SNMP Traps, SNTP, DNS Client, RADIUS, TACACS+ and sFlow apps: routing_example API 104 <ifNum> \n");
printf("Test API 105: Get the configured IPv4 Management interface: routing_example API 105 \n");
printf("Test API 106: Set the IPv4 Management interface: routing_example API 106 <ifNum> \n");
printf("Test API 107: Set the IPv4 Management interface and enable dhcp or configure static IP on the management interface: routing_example API 107 <ifNum> <dhcpEnabled> <ipAddr> <subnetMask>\n");
printf("Test API 108: Get the System mode for uRPF: routing_example API 108 \n");
printf("Test API 109: Set the System mode for uRPF: routing_example API 109 <urpfEnabled> \n");
printf("Test API 110: Get the interface uRPF mode and allowDefault option: routing_example API 110 <ifNum> \n");
printf("Test API 111: Set the interface uRPF mode and allowDefault option: routing_example API 111 <ifNum> <mode> <allowDefault> \n");
printf("Test API 112: Get the administrative mode of sending ICMP Echo Replies: routing_example API 112 <vrfName> \n");
printf("Test API 113: Get the ICMP Rate Limiting parameters like burst size and interval: routing_example API 113 <vrfName> \n");
printf("Test API 114: Get the internal interface number of the given VRF and IPv4 address: routing_example API 114 <vrfName> <ipAddr> \n");
printf("Test API 115: Get the Router preference for the given protocol and VRF name: routing_example API 115 <vrfName> <origin> \n");
printf("Test API 116: Set the Router preference for the given protocol and VRF name: routing_example API 116 <vrfName> <origin> <pref> \n");
printf("Test API 117: Get the administrative mode of sending ICMP Redirects: routing_example API 117 <vrfName> \n");
printf("Test API 118: Set the administrative mode of sending ICMP Redirects: routing_example API 118 <vrfName> <mode> \n");
printf("Test API 119: Set ignore mode for ICMP ECHO Requests: routing_example API 119 <vrfName> <mode> \n");
printf("Test API 120: Set the ICMP Rate Limiting parameters like burst size and interval: routing_example API 120 <vrfName> <burstSize> <interval> \n");
printf("Test API 121: Clear the Address Conflict Detection Status of a given VRF instance: routing_example API 121 <vrfName> \n");
printf("Test API 122: Get the Address Conflict Detection Status of a VRF instance: routing_example API 122 <vrfName> \n");
printf("Test API 123: Get the MAC Address of the last detected address conflict in a VRF instance: routing_example API 123 <vrfName> \n");
printf("Test API 124: Get the time in seconds since the last address conflict was detected in a VRF instance: routing_example API 124 <vrfName> \n");
printf("Test API 125: Delete all net-prototype route entries: routing_example API 125 <vrfName> <protoId> \n");
printf("Test API 126: Unset the VRF participation on an interface: routing_example API 126 <ifNum> \n");
printf("Test API 127: Set the VRF participation of an interface: routing_example API 127 <ifNum> <vrfName> \n");
printf("Test API 128: Clear the switch/management ARP entries: routing_example API 128 \n");
printf("Test API 129: Set or reset the IPv6 address mode on a given router interface: routing_example API 129 <ifNum> <addrMode> <setFlag> \n");
return;
}
{
uint32_t val = 0;
switch(result)
{
printf("\nThe number of packets forwarded by CPU is %u.\n", val);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the number of packets forwarded by CPU. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t val = 0;
switch(result)
{
printf("\nThe number of IP packets received by IP-Stack is %u.\n", val);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the number of IP packets received by IP-Stack. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t ifNum = 0;
switch(result)
{
printf("\nThe source IP interface from Syslog, SNMP Traps, SNTP, DNS Client, RADIUS, TACACS+ and sFlow apps is %u.\n", ifNum);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the source IP interface from Syslog, SNMP Traps, SNTP, DNS Client, RADIUS, TACACS+ and sFlow apps. (result = %d)\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nSuccessfully set the source IP interface for Syslog, SNMP Traps, SNTP, DNS Client, RADIUS, TACACS+ and sFlow apps.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set source IP interface for Syslog, SNMP Traps, SNTP, DNS Client, RADIUS, TACACS+ and sFlow apps. (result = %d).\n", result);
break;
}
return;
}
{
uint32_t ifNum = 0;
switch(result)
{
printf("\nThe configured IPv4 Management interface is %u.\n", ifNum);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the configured IPv4 Management interface. (result = %d)\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nSuccessfully set the IPv4 Management interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the configured IPv4 Management interface. (result = %d)\n", result);
break;
}
return;
}
void ipManagementInterfaceParamsSet(
openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t isDhcpEnabled,
char* ipAddrStr,
char* maskStr)
{
uint32_t ipAddr = 0;
uint32_t subnetMask = 0;
char str[40];
memset(str, 0, sizeof(str));
strncpy(str, ipAddrStr, sizeof(str) - 1);
ipBuffdesc.
size = strlen(str) + 1;
{
printf("ERROR: Bad return code trying to convert internet address string to a 32 bit integer. result = %d.\n", result);
return;
}
memset(str, 0, sizeof(str));
strncpy(str, maskStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
{
printf("ERROR: Bad return code trying to convert internet address string to a 32 bit integer. result = %d.\n", result);
return;
}
if (1 < isDhcpEnabled)
{
printf("\n Invalid isDhcpEnabled value. Expected 0(for Disable) or 1(for Enable).");
return;
}
if (1 == isDhcpEnabled)
{
}
switch(result)
{
printf("\nSuccessfully set the IPv4 Management interface and set the given enable dhcp or configure static IP on the management interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the IPv4 Management interface and enable dhcp or configure static IP on the management interface. (result = %d)\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe system mode for uRPF is %u (1-Enabled, 0-Disabled).\n", urpfMode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the System mode for uRPF. (result = %d).\n", result);
break;
}
return;
}
{
if (1 < urpfMode)
{
printf("\n Invalid mode value. Expected 0(for Disable) or 1(for Enable).");
return;
}
if (1 == urpfMode)
{
}
switch(result)
{
printf("\nSuccessfully set the system mode for uRPF.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the system mode for uRPF. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe given interface's uRPF mode is %u (0-Disabled,1-Loose,2-Strict) and allowDefault option is %u (1-TRUE,0-FALSE).\n", mode, allowDefault);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the interface uRPF mode and allowDefault option. (result = %d).\n", result);
break;
}
return;
}
void ipMapIntfUrpfModeSet(
openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t mode, uint32_t allowDefault)
{
if (mode > 2)
{
printf("\n Invalid mode value. Expected 0(for no uRPF) or 1(for Loose Mode uRPF) or 2(Strict Mode uRPF).");
return;
}
if (allowDefault > 1)
{
printf("\n Invalid allowDefault value. Expected 0 (for FALSE) or 1 (for TRUE).");
return;
}
switch (mode)
{
break;
break;
default:
break;
}
if (allowDefault == 1)
{
}
switch(result)
{
printf("\nSuccessfully set the interface uRPF mode and allowDefault option.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the interface uRPF mode and allowDefault option. (result = %d).\n", result);
break;
}
return;
}
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nThe administrative mode of sending ICMP Echo Replies for the given VRF instance is %u.\n", mode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the administrative mode of sending ICMP Echo Replies for the given VRF instance. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t burstSize = 0;
uint32_t interval = 0;
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nThe ICMP Rate Limiting parameters for given VRF are: burst size %u and interval %u.\n", burstSize, interval);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the ICMP Rate Limiting parameters like burst size and interval for the given VRF instance. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t ipAddr = 0;
uint32_t ifNum = 0;
char str[40];
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
memset(str, 0, sizeof(str));
strncpy(str, ipAddrStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
{
printf("ERROR: Bad return code trying to convert internet address string to a 32 bit integer. result = %d.\n", result);
return;
}
switch(result)
{
printf("\nThe internal interface number of the given VRF and IPv4 address is %u. \n", ifNum);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the internal interface number of the given VRF and IPv4 address. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t pref = 0;
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nThe Router preference for the given protocol and VRF name is %u.\n", pref);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the Router preference for the given protocol and VRF name. (result = %d)\n", result);
break;
}
return;
}
void ipVrRouterPreferenceSet(
openapiClientHandle_t *client_handle,
char *vrfName, uint32_t origin, uint32_t pref)
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nSuccessfully set the Router preference for the given protocol and VRF name.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the Router preference for the given protocol and VRF name. (result = %d)\n", result);
break;
}
return;
}
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nThe administrative mode of sending ICMP Redirects for the given VRF instance is %u.\n", mode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the administrative mode of sending ICMP Redirects for the given VRF instance. (result = %d)\n", result);
break;
}
return;
}
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
if (1 < mode)
{
printf("\n Invalid mode value. Expected 0(for Disable) or 1(for Enable).");
return;
}
if (1 == mode)
{
}
switch(result)
{
printf("\nSuccessfully set the the administrative mode of sending ICMP Redirects for given VRF.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the administrative mode of sending ICMP Redirects. (result = %d)\n", result);
break;
}
return;
}
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
if (1 < mode)
{
printf("\n Invalid mode value. Expected 0(for Disable) or 1(for Enable).");
return;
}
if (1 == mode)
{
}
switch(result)
{
printf("\nSuccessfully set the ignore mode for ICMP ECHO Requests for given VRF.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set ignore mode for ICMP ECHO Requests. (result = %d)\n", result);
break;
}
return;
}
void ipMapRtrICMPRatelimitSet(
openapiClientHandle_t *client_handle,
char *vrfName, uint32_t burstSize, uint32_t interval)
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nSuccessfully set the ICMP Rate Limiting parameters like burst size and interval for given VRF instance.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the ICMP Rate Limiting parameters like burst size and interval. (result = %d)\n", result);
break;
}
return;
}
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nSuccessfully cleared the Address Conflict Detection Status of given VRF instance.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to clear the Address Conflict Detection Status of the given VRF instance. (result = %d)\n", result);
break;
}
return;
}
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nThe Address Conflict Detection Status of given VRF instance is %u.\n", conflictDetectStatus);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the Address Conflict Detection Status of the given VRF instance. (result = %d)\n", result);
break;
}
return;
}
{
char str[OPEN_MAC_ADDR_LEN+1] = "";
memset(str, 0, sizeof(str));
conflictMAC.pstart = str;
conflictMAC.size = OPEN_MAC_ADDR_LEN+1;
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
if (conflictMAC.size < OPEN_MAC_ADDR_LEN)
{
printf("\nERROR: Invalid MAC address string length received %u.",conflictMAC.size);
}
else
{
printf("\nThe MAC Address of the last detected address conflict in given VRF is 0x%02x:%02x:%02x:%02x:%02x:%02x .\n",
str[0], str[1], str[2], str[3], str[4], str[5]);
}
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the Address Conflict Detection Status of the given VRF instance. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t conflictDetectTime = 0;
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nThe time since the last address conflict was detected in given VRF is %u seconds.\n", conflictDetectTime);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the time in seconds since the last address conflict was detected for the given VRF instance. (result = %d)\n", result);
break;
}
return;
}
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nSuccessfully deleted all net-prototype route entries.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to delete all net-prototype route entries. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nSuccessfully reset the VRF participation on the given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to reset the VRF participation on the given interface. (result = %d).\n", result);
break;
}
return;
}
{
OPEN_VRF_SET_ERROR_t vrfSetError = 0;
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nSuccessfully set the VRF participation on the given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
printf("\nERROR: Subnet conflict between interface IP address and IP address in the virtual router.\n");
break;
printf("\nERROR: Unable to add connected route as RTO is FULL.\n");
break;
printf("\nERROR: Earlier operation on the interface is in progress. Try again later.\n");
break;
switch(vrfSetError)
{
case OPEN_LOOPBACK_ERROR:
printf("\nERROR: Loopback interface is used by unnumbered interface and so cannot be part of non-default VRF.\n");
break;
case OPEN_UNNUMBERED_ERROR:
printf("\nERROR: Unnumbered interface cannot be part of a non-default VRF.\n");
break;
case OPEN_SYSLOG_ERROR:
printf("\nERROR: This routing interface is being used as a syslog source interface, cannot be part of non-default VRF.\n");
break;
case OPEN_IPV6_ERROR:
printf("\nERROR: This routing interface has IPv6 address config, cannot be part of non-default VRF.\n");
break;
default:
printf("\nERROR: Unable to set vrf forwarding.\n");
break;
}
break;
default:
printf("\nERROR: Bad return code trying to set the VRF participation on the given interface. (result = %d).\n", result);
break;
}
return;
}
{
uint32_t ipMtu = 0;
switch(result)
{
printf("\nThe configured IP MTU value on the given interface(%u) is %u.\n", ifNum, ipMtu);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the configured IP MTU value on the given interface. (result = %d).\n", result);
break;
}
return;
}
{
uint32_t maxIpMtu = 0;
switch(result)
{
printf("\nThe maximum IP MTU that can be sent on the given interface(%u) is %u.\n", ifNum, maxIpMtu);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the maximum IP MTU that can be sent on the given interface. (result = %d).\n", result);
break;
}
return;
}
{
uint32_t ipMtu = 0;
switch(result)
{
printf("\nThe IP MTU value being enforced on the given interface(%u) is %u.\n", ifNum, ipMtu);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the IP MTU value being enforced on a given interface. (result = %d).\n", result);
break;
}
return;
}
{
OPEN_IP_ECMP_LB_MODE_t mode = 0;
if (mode >= OPEN_IP_ECMP_LB_MAX)
{
printf("\nERROR: Invalid argument passed. lbMode input valid range is [0..10..\n");
return;
}
mode = lbMode;
switch(result)
{
printf("\nSuccessfully set the current IP ECMP global load balancing mode.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the current IP ECMP global load balancing mode. (result = %d).\n", result);
break;
}
return;
}
{
OPEN_IP_ECMP_LB_MODE_t lbMode = OPEN_IP_ECMP_LB_MIN;
switch(result)
{
printf("\nThe current IP ECMP global load balancing mode is %u.\n", lbMode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to determine the current IP ECMP global load balancing mode. (result = %d).\n", result);
break;
}
return;
}
{
if (mode)
{
}
switch(result)
{
printf("\nSuccessfully set the current IP ECMP IPSEC SPI Hashing mode.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the current IP ECMP IPSEC SPI Hashing mode. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe current IP ECMP IPSEC SPI mode is %u.\n", spiMode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to determine the current IP ECMP IPSEC SPI mode. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe admin mode for IP forwarding of net-directed broadcasts for the given interface is %u.\n", adminMode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the admin mode for IP forwarding of net-directed broadcasts for the given interface. (result = %d).\n", result);
break;
}
return;
}
void ipUnnumberedSet(
openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t isUnnumbered, uint32_t numberedIfc)
{
if (isUnnumbered)
{
}
switch(result)
{
printf("\nSuccessfully set the unnumbered status of an interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
printf("\nERROR: The interface has IP address is already configured.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the unnumbered status of an interface. (result = %d).\n", result);
break;
}
return;
}
{
uint32_t numberedIfc = 0;
switch(result)
{
{
printf("\nThe given interface %u is an unnumbered and the interface whose address it borrows is %u.\n", ifNum, numberedIfc);
}
else
{
printf("\nThe given interface %u is not an unnumbered interface.\n", ifNum);
}
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to determine whether given interface is unnumbered. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe Multicast packets forwarding admin mode for the given interface is %u.\n", mode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to determine the multicast packets forwarding mode for given interface. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe router interface mode is %u.\n", mode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the router interface mode for the given interface. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe interface's autostate mode is %u.\n", mode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the autostate mode for the given interface. (result = %d).\n", result);
break;
}
return;
}
{
if (mode)
{
}
switch(result)
{
printf("\nSuccessfully set the mode of AutoState feature of the given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to enable or disable the mode of AutoState feature of an interface. (result = %d)\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe IPv4 mode of given interface is %u.\n", mode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the IPv4 mode for the given interface. (result = %d).\n", result);
break;
}
return;
}
{
uint32_t vlanId = 0;
vlanId = currVlanId;
switch(result)
{
printf("\nThe next vlan after the given vlan on which routing is enabled is %u.\n", vlanId);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the next vlan after the given vlan on which routing is enabled. (result = %d).\n", result);
break;
}
return;
}
{
uint32_t vlanId = 0;
switch(result)
{
printf("\nThe VLAN ID corresponding to the given internal interface number is %u.\n", vlanId);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the VLAN ID corresponding to the given internal interface number. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t ifNum = 0;
switch(result)
{
printf("\nThe interface ID for the given VLAN ID is %u.\n", ifNum);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the interface ID for a given VLAN. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t ifNum = 0;
switch(result)
{
printf("\nThe internal interface number associated with port-based routing interface corresponding to given internal VLAN is %u.\n", ifNum);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get internal interface number associated with port-based routing interface corresponding to this internal VLAN. (result = %d)\n",result);
break;
}
return;
}
{
uint32_t ifNum = 0;
switch(result)
{
printf("\nThe first valid interface is %u.\n", ifNum);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the first valid interface. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t ifNum = 0;
switch(result)
{
printf("\nThe next valid interface of the given interface is %u.\n", ifNum);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the next valid interface. (result = %d)\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe interface's autostate mode is %u.\n", mode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the administrative mode of sending ICMP Unreachables. (result = %d)\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe interface mode of sending ICMP Redirects is %u.\n", mode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the interface mode of sending ICMP Redirects. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t bandwidth = 0;
switch(result)
{
printf("\nThe bandwidth of the specified interface is %u.\n", bandwidth);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the bandwidth of the specified interface. (result = %d)\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nSuccessfully set the bandwidth of the specified interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the bandwidth of the specified interface. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t bandwidth = 0;
switch(result)
{
printf("\nThe bandwidth of the specified interface is %u.\n", bandwidth);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the bandwidth of the specified interface without making any modification to the SET bandwidth. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t maxhops = 0;
switch(result)
{
printf("\nThe routing max equal cost entries is %u.\n", maxhops);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the routing max equal cost entries. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t maxroutes = 0;
switch(result)
{
printf("\nThe routing max routes entries is %u.\n", maxroutes);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the routing max routes entries. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t flaps = 0;
uint32_t penalty = 0;
uint32_t isSuppressed = 0;
uint32_t reuseTime = 0;
uint32_t maxPenalty = 0;
switch(result)
{
printf("\nThe dampening operational values are: flaps[%u], penalty[%u], isSuppressed[%u], reuseTime[%u], maxPenalty[%u].\n",flaps,penalty,isSuppressed,reuseTime,maxPenalty);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the dampening operational values. (result = %d)\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe next protocol ID is %u.\n", protoId);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the next protocol ID. (result = %d)\n", result);
break;
}
return;
}
{
uint32_t protoId = 0;
switch(result)
{
printf("\nThe protocol ID is %u for the given route-type %u.\n", protoId, routeType);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the protocol ID for a given route type. (result = %d)\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe global resilient hashing mode value for ECMP trunks is %u.\n", resHashMode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the global resilient hashing mode for ECMP trunks. (result = %d)\n", result);
break;
}
return;
}
{
if (mode)
{
}
switch(result)
{
printf("\nThe global resilient hashing mode value for ECMP trunks is %u.\n", resHashMode);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the global resilient hashing mode for ECMP trunks. (result = %d)\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
switch(result)
{
printf("\nThe router discovery mode on the given interface is %u. \n", flag);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get router discovery mode for given interface. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nSuccessfully set the given router discovery mode on given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set router discovery mode for given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
char ipDescStr[32];
memset(&openAddr, 0, sizeof(openAddr));
switch(result)
{
{
printf("\nERROR: Family type value not OPEN_AF_INET. Family type value returned is %u.\n", openAddr.family);
return;
}
memset(ipDescStr, 0, sizeof(ipDescStr));
ipDesc.pstart = ipDescStr;
ipDesc.size = sizeof(ipDescStr)-1;
printf("\nThe advertisement packet's destination address for the given interface is 0x%x (%s). \n", openAddr.addr.ipv4, (char *)ipDesc.pstart);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get advertisement packet's destination address for given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum, char *ipAddrStr)
{
uint32_t intIpAddr = 0;
char str[40];
memset(str, 0, sizeof(str));
strncpy(str, ipAddrStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
{
printf("ERROR: Bad return code trying to convert internet address string to a 32 bit integer. result = %d.\n", result);
return;
}
memset(&openAddr, 0, sizeof(openAddr));
openAddr.addr.ipv4 = intIpAddr;
switch(result)
{
printf("\nSuccessfully set the given advertisement packet's destination address for given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set advertisement packet's destination address for given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
uint32_t time = 0;
switch(result)
{
printf("\nThe max time allowed between router advertisements from the given interface is %u seconds. \n", time);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get max time allowed between router advertisements from given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum, uint32_t time)
{
switch(result)
{
printf("\nSuccessfully set the max time allowed between router advertisements from given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
printf("\nERROR: The maximum advertisement interval given is out of range.\n");
break;
printf("\nERROR: The given maximum advertisement interval is less than configured minimum advertisement interval.\n");
break;
default:
printf("\nERROR: Bad return code trying to set max time allowed between router advertisements from given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
uint32_t time = 0;
switch(result)
{
printf("\nThe min time allowed between router advertisements from the given interface is %u seconds. \n", time);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get min time allowed between router advertisements from given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum, uint32_t time)
{
switch(result)
{
printf("\nSuccessfully set the min time allowed between router advertisements from given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
printf("\nERROR: The minimum advertisement interval given is out of range.\n");
break;
printf("\nERROR: The given minimum advertisement interval is greater than configured maximum advertisement interval.\n");
break;
default:
printf("\nERROR: Bad return code trying to set min time allowed between router advertisements from given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
uint32_t time = 0;
switch(result)
{
printf("\nThe default value of the min time allowed between router advertisements from the given interface is %u seconds. \n", time);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the default value of min time allowed between router advertisements from given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
switch(result)
{
printf("\nSuccessfully reset the min time allowed between router advertisements to its default value.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to reset min time allowed between router advertisements to its default value. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
uint32_t time = 0;
switch(result)
{
printf("\nThe value of lifetime field of router advertisement sent from the given interface is %u seconds. \n", time);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the value of lifetime field of router advertisement sent from given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum, uint32_t time)
{
switch(result)
{
printf("\nSuccessfully set the value of lifetime field of router advertisement sent from given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
printf("\nERROR: The given lifetime value is greater than the max lifetime value.\n");
break;
printf("\nERROR: The given lifetime value is less than the maximum advertisement interval.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the value of lifetime field of router advertisement sent from given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
uint32_t defLifetime = 0;
switch(result)
{
printf("\nThe default value of the lifetime field of router advertisement sent from the given interface is %u seconds. \n", defLifetime);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the default value of the lifetime field of router advertisement sent from given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
switch(result)
{
printf("\nSuccessfully reset the advertisement lifetime to its default value on to the given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to reset the advertisement lifetime to its default value on the given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
int32_t prefLevel = 0;
switch(result)
{
printf("\nThe value of the preferability of the address as a default router address for the given interface is %d. \n", prefLevel);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the value of the preferability of the address as a default router address for the given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum, int32_t prefLevel)
{
switch(result)
{
printf("\nSuccessfully set the preferability value of the address as a default router address for the given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the preferability value of the address as a default router address for the given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
switch(result)
{
printf("\nThe value of the Grat ARP mode for the given interface is %u. \n", isEnabled);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the value of the Grat ARP mode for the given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum, uint32_t mode)
{
if (mode)
{
}
switch(result)
{
printf("\nSuccessfully set the Grat ARP mode for the given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the Grat ARP mode for the given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum, uint32_t mode)
{
if (mode)
{
}
switch(result)
{
printf("\nSuccessfully set the Grat ARP mode for the given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the Grat ARP mode for the given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t mode)
{
if (mode)
{
}
switch(result)
{
printf("\nSuccessfully set the ARP dynamic entry renew mode.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the ARP dynamic entry renew mode. (result = %d).\n", result);
break;
}
return;
}
uint32_t cacheSize)
{
switch(result)
{
printf("\nSuccessfully set the maximum number of entries in the ARP cache.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the maximum number of entries in the ARP cache. (result = %d).\n", result);
break;
}
return;
}
uint32_t count)
{
switch(result)
{
printf("\nSuccessfully set the ARP request max retries count.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the ARP request max retries count. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nThe value of the ARP dynamic entry renew mode is %u. \n", isEnabled);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the ARP dynamic entry renew mode value. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum, uint32_t mode)
{
if (mode)
{
}
switch(result)
{
printf("\nSuccessfully set the local proxy ARP on the given interface.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the local proxy ARP on the given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
switch(result)
{
printf("\nThe value of the local proxy ARP mode for the given interface is %u. \n", isEnabled);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the value of local proxy ARP mode for the given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t intIfNum)
{
switch(result)
{
printf("\nThe value of the proxy ARP mode for the given interface is %u. \n", isEnabled);
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the value of proxy ARP mode for the given interface. (result = %d).\n", result);
break;
}
return;
}
uint32_t timeout)
{
switch(result)
{
printf("\nSuccessfully set the ARP request responce timeout.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the ARP request responce timeout. (result = %d).\n", result);
break;
}
return;
}
uint32_t timeout)
{
switch(result)
{
printf("\nSuccessfully set the ARP entry ageout time.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to set the ARP entry ageout time. (result = %d).\n", result);
break;
}
return;
}
char *vrfName)
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
memset(&arpStats, 0, sizeof(arpStats));
switch(result)
{
printf("\nFollowing the ARP cache statistics for the given VRF instance - %s:",vrfNameStr);
printf(
"\nPeak overall count %u",arpStats.
cachePeak);
printf(
"\nMaximum (configured) overall count %u",arpStats.
cacheMax);
printf(
"\nCurrent static entry count %u",arpStats.
staticCurrent);
printf(
"\nMaximum allowed static entry count %u",arpStats.
staticMax);
printf("\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to get the ARP stats for the given VRF instance. (result = %d).\n", result);
break;
}
return;
}
char *vrfName, char *ipAddrStr, uint32_t intIfNum)
{
char str[40];
memset(str, 0, sizeof(str));
strncpy(str, ipAddrStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
memset(&ipAddr, 0, sizeof(ipAddr));
{
printf("ERROR: Bad return code trying to convert IP address. (result = %d).\n", result);
return;
}
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nSuccessfully purged the specific dynamic/gateway entry for the given VRF instance.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to purge a specific dynamic/gateway entry for the given VRF instance. (result = %d).\n", result);
break;
}
return;
}
char *vrfName, uint32_t flag)
{
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
if (flag)
{
}
switch(result)
{
printf("\nSuccessfully cleared the ARP cache of all dynamic/gateway entries for the given VRF instance.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to clear the ARP cache of all dynamic/gateway entries for the given VRF instance. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
printf("\nSuccessfully cleared the switch/management ARP entries.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to clear the switch/management ARP entries. (result = %d).\n", result);
break;
}
return;
}
char *vrfName, char *ipAddrStr, uint32_t intIfNum)
{
char str[40];
memset(str, 0, sizeof(str));
strncpy(str, ipAddrStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
memset(&ipAddr, 0, sizeof(ipAddr));
{
printf("ERROR: Bad return code trying to convert IP address. (result = %d).\n", result);
return;
}
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
switch(result)
{
printf("\nSuccessfully deleted a static ARP entry of the given VRF instance.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
printf("\nERROR: Entry not found.\n");
break;
default:
printf("\nERROR: Bad return code trying to delete a static ARP entry for the given VRF instance. (result = %d).\n", result);
break;
}
return;
}
char *vrfName, char *ipAddrStr, uint32_t intIfNum, char *macAddrStr)
{
char str[40];
char macStr[OPEN_MAC_ADDR_LEN+1];
memset(str, 0, sizeof(str));
strncpy(str, ipAddrStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
memset(&ipAddr, 0, sizeof(ipAddr));
{
printf("ERROR: Bad return code trying to convert IP address. (result = %d).\n", result);
return;
}
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
memset(macStr, 0, sizeof(macStr));
if (
OPEN_FALSE == rtrUtilConvertMac((
unsigned char *)macAddrStr, (
unsigned char *)&macStr))
{
printf("\nERROR: Invalid MAC address string. Expected in ascii string format xx:xx:xx:xx:xx:xx.\n");
return;
}
macAddrBufd.pstart = macStr;
macAddrBufd.size = strlen(macStr) + 1;
switch(result)
{
printf("\nSuccessfully added given static ARP entry for the given VRF instance.\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
printf("\nERROR: Maximum static ARP entries already configured.\n");
break;
printf("\nERROR: Address is assigned to a local interface.\n");
break;
printf("\nERROR: If there is not yet a router interface in the same subnet as the target. Config is applied in this case.\n");
break;
printf("\nERROR: Address can neither be network directed broadcast nor subnet address.\n");
break;
default:
printf("\nERROR: Bad return code trying to add a static ARP entry for the given VRF instance. (result = %d).\n", result);
break;
}
return;
}
char *vrfName)
{
char ipAddrStr[80] = {0};
uint32_t i=0;
memset(vrfNameStr, 0, sizeof(vrfNameStr));
{
printf("ERROR: Invalid VRF name string.\n");
return;
}
strncpy(vrfNameStr, vrfName, sizeof(vrfNameStr) - 1);
vrfNameBufd.pstart = vrfNameStr;
vrfNameBufd.size = strlen(vrfNameStr) + 1;
memset(&openArpEntries, 0, sizeof(openArpEntries));
switch(result)
{
printf("\nFollowing is the list of all static ARP entries currently configured for given VRF %s:\n",vrfNameStr);
printf(
"\nCount of entries received is %u.\n",openArpEntries.
count);
{
{
break;
}
memset(ipAddrStr, 0x0, sizeof(ipAddrStr));
printf("\nARP entry index %u:",i+1);
printf(
"\n\tARP entry type bitmask.......... 0x%x\n",openArpEntries.
arpEntries[i].
type);
printf("\t\tLOCAL: %s, RESOLVED: %s, GATEWAY: %s, NET_DIR_BCAST: %s\n",
printf("\t\tSTATIC: %s, DISCARD_WHEN_SOURCE: %s, KERNEL: %s, UNNUMBERED: %s\n",
printf(
"\n\tARP entry age in seconds........ %u", openArpEntries.
arpEntries[i].
age);
printf("\n\tIP Address of ARP entry......... %s", ipAddrStr);
printf(
"\n\tVRF ID of the ARP entry......... %u", openArpEntries.
arpEntries[i].
vrfId);
printf("\n\tMAC address..................... %02x:%02x:%02x:%02x:%02x:%02x",
printf(
"\n\tVLAN ID of the ARP entry........ %u", openArpEntries.
arpEntries[i].
vlanId);
printf(
"\n\tHits............................ %u", openArpEntries.
arpEntries[i].
hits);
printf("\n");
}
printf("\n");
break;
printf("\nERROR: Invalid argument passed.\n");
break;
default:
printf("\nERROR: Bad return code trying to list of all static ARP entries currently configured for the given VRF instance. (result = %d).\n", result);
break;
}
return;
}
{
switch(result)
{
{
printf("\nSuccessfully set the given IPv6 address mode for the given interface.\n");
}
else
{
printf("\nSuccessfully reset the given IPv6 address mode for the given interface.\n");
}
break;
printf("\nERROR: Invalid argument passed.\n");
break;
printf("\nERROR: IPv6 package is not supported.\n");
break;
default:
{
printf("\nERROR: Bad return code trying to set the given IPv6 address mode for the given interface. (result = %d)\n", result);
}
else
{
printf("\nERROR: Bad return code trying to reset the given IPv6 address mode for the given interface. (result = %d)\n", result);
}
break;
}
return;
}
char *IPStr, uint32_t pfxLen,
{
char str[40];
memset(str, 0, sizeof(str));
strncpy(str, IPStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
memset(&ipAddr, 0, sizeof(ipAddr));
{
{
{
printf("Bad return code trying to convert IP address. (result = %d)\n", result);
return;
}
printf("IP = %u, PfxLen = %u\n", ipAddr.ipAddr.addr.ipv4, pfxLen);
}
else
{
if (inet_pton(AF_INET6, IPStr, (void*)&(ipAddr.ipAddr.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert IP.\n");
}
ipAddr.pfxLen = pfxLen;
}
}
{
printf("Bad return code trying to add Interface IP. (result = %d)\n", result);
}
else
{
printf("Interface IP added successfully \n");
}
return;
}
char *IPStr, uint32_t pfxLen,
{
char str[40];
memset(str, 0, sizeof(str));
strncpy(str, IPStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
memset(&ipAddr, 0, sizeof(ipAddr));
{
{
if (strcmp(IPStr, "all") != 0)
{
{
printf("Bad return code trying to convert IP address. (result = %d)\n", result);
return;
}
printf("IP = %u, PfxLen = %u\n", ipAddr.ipAddr.addr.ipv4, pfxLen);
ipAddr.pfxLen = pfxLen;
}
}
else
{
if (strcmp(IPStr, "all") != 0)
{
if (inet_pton(AF_INET6, IPStr, (void*)&(ipAddr.ipAddr.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
ipAddr.pfxLen = pfxLen;
}
}
}
if (strcmp(IPStr, "all") == 0)
{
}
else
{
}
{
printf("Bad return code trying to delete Interface IP. (result = %d)\n", result);
}
else
{
printf("Interface IP deleted successfully \n");
}
return;
}
{
{
printf("Bad return code trying to configure Global Routing Mode. (result = %d)\n", result);
}
else
{
printf("Global Routing Mode configured successfully \n");
}
return;
}
{
char IPStr[] = "192.168.1.1";
char mac_address[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55};
memset(&ipAddr, 0, sizeof(ipAddr));
if (inet_pton(AF_INET, IPStr, (void*)&(ipAddr.addr.ipv4)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
ipAddr.addr.ipv4 = ntohl(ipAddr.addr.ipv4);
mac_addr.pstart = mac_address;
mac_addr.size = 6;
{
printf("Bad return code trying to add ARP entry. (result = %d)\n", result);
}
else
{
printf("ARP entry added successfully \n");
}
return;
}
{
char IPStr[] = "192.168.1.1";
memset(&ipAddr, 0, sizeof(ipAddr));
if (inet_pton(AF_INET, IPStr, (void*)&(ipAddr.addr.ipv4)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
ipAddr.addr.ipv4 = ntohl(ipAddr.addr.ipv4);
{
printf("Bad return code trying to delete ARP entry. (result = %d)\n", result);
}
else
{
printf("ARP entry deleted successfully \n");
}
return;
}
{
uint32_t intf = 0;
char ipAddrStr[24];
char macStr[18];
memset(&ipAddr, 0, sizeof(ipAddr));
memset(macStr, 0, 18);
mac_addr.pstart = macStr;
mac_addr.size = 18;
{
ipv4Addr = htonl(ipAddr.addr.ipv4);
if (inet_ntop(AF_INET, &ipv4Addr, ipAddrStr, sizeof(ipAddrStr)) == 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
printf("IP: %s, MAC: %s Intf:%d \n", ipAddrStr, macStr, intf);
}
return;
}
{
{
printf("Bad return code trying to configure IP Redirects Mode. (result = %d)\n", result);
}
else
{
printf("IP Redirects Mode configured successfully \n");
}
return;
}
{
{
printf("Bad return code trying to configure IP ICMP Echo Reply Mode. (result = %d)\n", result);
}
else
{
printf("IP ICMP Echo Reply Mode configured successfully \n");
}
return;
}
{
{
printf("Bad return code trying to configure IP Helper Mode. (result = %d)\n", result);
}
else
{
printf("IP Helper Mode configured successfully \n");
}
return;
}
char *IPStr, uint32_t udpPort)
{
char str[40];
memset(str, 0, sizeof(str));
strncpy(str, IPStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
{
printf("Bad return code trying to convert IP address. (result = %d)\n", result);
return;
}
{
printf("Bad return code trying to add IP Helper Address. (result = %d)\n", result);
}
else
{
printf("IP Helper Address configured successfully \n");
}
return;
}
char *IPStr, uint32_t udpPort)
{
char str[40];
memset(str, 0, sizeof(str));
strncpy(str, IPStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
memset(&ipAddr, 0, sizeof(ipAddr));
{
printf("Bad return code trying to convert IP address. (result = %d)\n", result);
return;
}
{
printf("Bad return code trying to delete IP Helper Address. (result = %d)\n", result);
}
else
{
printf("IP Helper Address deleted successfully \n");
}
return;
}
{
{
printf("Bad return code trying to configure IP interface MTU. (result = %d)\n", result);
}
else
{
printf("IP interface MTU configured successfully \n");
}
return;
}
{
{
printf("Bad return code trying to configure IP interface Net Directed BCast Mode. (result = %d)\n", result);
}
else
{
printf("IP interface Net Directed BCast Mode configured successfully \n");
}
return;
}
{
{
printf("Bad return code trying to configure IP interface Proxy ARP Mode. (result = %d)\n", result);
}
else
{
printf("IP interface Proxy ARP Mode configured successfully \n");
}
return;
}
{
{
printf("Bad return code trying to configure IP interface Redirects Mode. (result = %d)\n", result);
}
else
{
printf("IP interface Redirects Mode configured successfully \n");
}
return;
}
{
{
printf("Bad return code trying to configure IP interface Destination Unreachable Mode. (result = %d)\n", result);
}
else
{
printf("IP interface Unreachable Mode configured successfully \n");
}
return;
}
{
{
printf("Bad return code trying to configure IP interface Routing Mode. (result = %d)\n", result);
}
else
{
printf("IP interface Routing Mode configured successfully \n");
}
return;
}
uint32_t intf, char *IPStr, uint32_t udpPort)
{
char str[40];
memset(str, 0, sizeof(str));
strncpy(str, IPStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
memset(&ipAddr, 0, sizeof(ipAddr));
{
printf("Bad return code trying to convert IP address. (result = %d)\n", result);
return;
}
{
printf("Bad return code trying to add IP Helper Address. (result = %d)\n", result);
}
else
{
printf("IP Helper Address configured successfully \n");
}
return;
}
uint32_t intf, char *IPStr, uint32_t udpPort)
{
char str[40];
memset(str, 0, sizeof(str));
strncpy(str, IPStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
memset(&ipAddr, 0, sizeof(ipAddr));
{
printf("Bad return code trying to convert IP address. (result = %d)\n", result);
return;
}
{
printf("Bad return code trying to delete IP Helper Address. (result = %d)\n", result);
}
else
{
printf("IP Helper Address deleted successfully \n");
}
return;
}
uint32_t intf, uint32_t udpPort)
{
{
printf("Bad return code trying to add IP Helper Discard. (result = %d)\n", result);
}
else
{
printf("IP Helper Discard configured successfully \n");
}
return;
}
uint32_t intf, uint32_t udpPort)
{
{
printf("Bad return code trying to delete IP Helper Discard. (result = %d)\n", result);
}
else
{
printf("IP Helper Discard deleted successfully \n");
}
return;
}
char *NextHopStr, uint32_t rtPref,
{
char str[40], str1[40];
memset(str, 0, sizeof(str));
strncpy(str, IPStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
memset(str1, 0, sizeof(str1));
strncpy(str1, NextHopStr, sizeof(str1) - 1);
nextHopBuffdesc.pstart = str1;
nextHopBuffdesc.size = strlen(str1) + 1;
memset(&ipAddr, 0, sizeof(ipAddr));
{
{
printf("Bad return code trying to convert IP address. (result = %d)\n", result);
return;
}
printf("IP = %u, PfxLen = %u\n", ipAddr.ipAddr.addr.ipv4, pfxLen);
ipAddr.pfxLen = pfxLen;
if (strcmp(NextHopStr, "null0") == 0)
{
nHptr = (void*)0;
intf = 0;
}
else if ((strcmp(NextHopStr, "0") == 0) || (strcmp(NextHopStr, "0.0.0.0") == 0))
{
nHptr = (void*)0;
}
else
{
{
printf("Bad return code trying to convert IP address. (result = %d)\n", result);
return;
}
nHptr = &nextHop;
}
printf("Next Hop = %u\n", nextHop.addr.ipv4);
}
else
{
if (inet_pton(AF_INET6, IPStr, (void*)&(ipAddr.ipAddr.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert IP.\n");
}
ipAddr.pfxLen = pfxLen;
if (strcmp(NextHopStr, "null0") == 0)
{
nHptr = (void*)0;
intf = 0;
}
else if (strcmp(NextHopStr, "0") == 0)
{
nHptr = (void*)0;
}
else
{
memset(&nextHop, 0, sizeof(nextHop));
if (inet_pton(AF_INET6, NextHopStr, (void*)&(nextHop.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert Next Hop.\n");
}
nHptr = &nextHop;
}
}
{
printf("IP route added successfully \n");
}
else
{
printf("Bad return code trying to add IP route. (result = %d)\n", result);
}
return;
}
{
char str[40], str1[40];
memset(str, 0, sizeof(str));
strncpy(str, IPStr, sizeof(str) - 1);
ipBuffdesc.pstart = str;
ipBuffdesc.size = strlen(str) + 1;
memset(str1, 0, sizeof(str1));
strncpy(str1, NextHopStr, sizeof(str1) - 1);
nextHopBuffdesc.pstart = str1;
nextHopBuffdesc.size = strlen(str1) + 1;
memset(&ipAddr, 0, sizeof(ipAddr));
{
{
printf("Bad return code trying to convert IP address. (result = %d)\n", result);
return;
}
printf("IP = %u, PfxLen = %u\n", ipAddr.ipAddr.addr.ipv4, pfxLen);
ipAddr.pfxLen = pfxLen;
if (strcmp(NextHopStr, "null0") == 0)
{
nHptr = (void*)0;
intf = 0;
}
else if ((strcmp(NextHopStr, "0") == 0) || (strcmp(NextHopStr, "0.0.0.0") == 0))
{
nHptr = (void*)0;
}
else
{
{
printf("Bad return code trying to convert IP address. (result = %d)\n", result);
return;
}
nHptr = &nextHop;
}
printf("Next Hop = %u\n", nextHop.addr.ipv4);
}
else
{
if (inet_pton(AF_INET6, IPStr, (void*)&(ipAddr.ipAddr.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert IP.\n");
}
ipAddr.pfxLen = pfxLen;
if (strcmp(NextHopStr, "null0") == 0)
{
nHptr = (void*)0;
intf = 0;
}
else if (strcmp(NextHopStr, "0") == 0)
{
nHptr = (void*)0;
}
else
{
memset(&nextHop, 0, sizeof(nextHop));
if (inet_pton(AF_INET6, NextHopStr, (void*)&(nextHop.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert Next Hop.\n");
}
nHptr = &nextHop;
}
}
{
printf("Bad return code trying to delete IP route. (result = %d)\n", result);
}
else
{
printf("IP route deleted successfully \n");
}
return;
}
uint32_t vlanId)
{
{
printf("Bad return code trying to create VLAN Routing Interface %u. (result = %d)\n", vlanId, result);
}
else
{
printf("VLAN Routing Interface created successfully \n");
}
return;
}
uint32_t vlanId)
{
{
printf("Bad return code trying to delete VLAN Routing Interface %u. (result = %d)\n", vlanId, result);
}
else
{
printf("VLAN Routing Interface deleted successfully \n");
}
return;
}
uint32_t vlanId)
{
uint32_t ifNum;
char ifNameStr[OPEN_INTF_NAME_MAX_LENGTH];
ifName.pstart = ifNameStr;
ifName.size = sizeof(ifNameStr);
{
printf("Bad return code trying to get Interface Number for VLAN %u. (result = %d)\n", vlanId, result);
}
else
{
printf("VLAN Routing Interface Number for VLAN %u is %d\n", vlanId, ifNum);
{
printf("Logical interface name for interface %u is %s\n", ifNum, ifNameStr);
}
else
{
printf("Bad return code trying to get interface name for ifNum %u. (result = %d)\n", ifNum, result);
}
}
return;
}
uint32_t ifNum, char *dstIpStr , char *srcIpStr)
{
uint32_t sessId;
memset(&ep, 0x0, sizeof(ep));
ep.
dstIpAddr.family = af;
ep.
srcIpAddr.family = af;
ep.
type = OPEN_BFD_TUNNEL_TYPE_UDP;
{
if (inet_pton(AF_INET, dstIpStr, (void*)&(ep.dstIpAddr.addr.ipv4)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
if (inet_pton(AF_INET, srcIpStr, (void*)&(ep.srcIpAddr.addr.ipv4)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
ep.dstIpAddr.addr.ipv4 = ntohl(ep.dstIpAddr.addr.ipv4);
ep.srcIpAddr.addr.ipv4 = ntohl(ep.srcIpAddr.addr.ipv4);
}
{
if (inet_pton(AF_INET6, dstIpStr, (void*)&(ep.dstIpAddr.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
if (inet_pton(AF_INET6, srcIpStr, (void*)&(ep.srcIpAddr.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
}
{
printf("Failed to enable BFD %d\n", rc);
}
{
printf("Successfully created BFD session %d\n", sessId);
}
else
{
printf("Failed to create BFD session %d \n", rc);
}
}
{
uint32_t sessIdOut;
memset(&ipAddr, 0x0, sizeof(ipAddr));
ipAddr.family = af;
{
if (inet_pton(AF_INET, dstIpStr, (void*)&(ipAddr.addr.ipv4)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
ipAddr.addr.ipv4 = ntohl(ipAddr.addr.ipv4);
}
{
if (inet_pton(AF_INET6, dstIpStr, (void*)&(ipAddr.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
}
{
printf("Failed to find BFD session rc=%d\n", rc);
}
else
{
printf("Successfully found BFD session %d\n", sessIdOut);
}
}
{
int count = 0;
vrfNameBuf.pstart = vrfName;
vrfNameBuf.size = 1;
vrfNameNextBuf.pstart = vrfNameNext;
printf("List of VRFs\n");
printf("************\n\n");
while (1)
{
{
{
printf("%s: invalid argument passed to openapiVrfNameNextGet\n",
__FUNCTION__);
}
break;
}
printf("%d: %s\n", ++count, vrfNameNext);
strncpy(vrfName, vrfNameNext, sizeof(vrfName));
vrfNameBuf.size = strlen(vrfName) + 1;
}
printf("\n%d VRFs found\n", count);
}
uint32_t ifNum, char *dstIpStr , char *srcIpStr)
{
uint32_t sessId;
memset(&ep, 0x0, sizeof(ep));
ep.compId = 0;
ep.vrfId = 0;
ep.intIfNum = ifNum;
ep.dstIpAddr.family = af;
ep.srcIpAddr.family = af;
ep.type = OPEN_BFD_TUNNEL_TYPE_UDP;
sessId = OPEN_BFD_SESSION_ID_INVALID;
{
if (inet_pton(AF_INET, dstIpStr, (void*)&(ep.dstIpAddr.addr.ipv4)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
if (inet_pton(AF_INET, srcIpStr, (void*)&(ep.srcIpAddr.addr.ipv4)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
ep.dstIpAddr.addr.ipv4 = ntohl(ep.dstIpAddr.addr.ipv4);
ep.srcIpAddr.addr.ipv4 = ntohl(ep.srcIpAddr.addr.ipv4);
}
{
if (inet_pton(AF_INET6, dstIpStr, (void*)&(ep.dstIpAddr.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
if (inet_pton(AF_INET6, srcIpStr, (void*)&(ep.srcIpAddr.addr.ipv6)) < 0)
{
printf("Bad return code trying to convert IP.\n");
return;
}
}
{
printf("Successfully deleted BFD session\n");
}
else
{
printf("Failed to delete BFD session %d\n", rc);
}
}
{
uint32_t sessId;
uint32_t count = 0;
char *pStrInfo_bfd_header_1 = "SessionId:%u State:%s Local Disc:%u Remote Disc:%u\r\n";
char *pStrInfo_bfd_header_2 = " Destination IP:%s \r\n";
char *pStrInfo_bfd_header_3 = " Source IP:%s \r\n";
char *pStrInfo_bfd_header_4 = " Interface:%u VrfId:%u Uptime:%u secs\r\n";
char *pStrInfo_bfd_header_5 = " Min Transmit Interval:%u milliseconds\r\n";
char *pStrInfo_bfd_header_6 = " Min Receive Interval:%u milliseconds\r\n";
char *pStrInfo_bfd_header_7 = " Detection interval multiplier:%u \r\n";
char *pStrInfo_bfd_header_8 = " In Packets:%u Out Packets:%u Dropped Packets:%u\r\n";
char *pStrInfo_bfd_header_9 = " Echo In Packets:%u Echo Out Packets:%u \r\n";
char strSrcIp[80] = {0};
char strDstIp[80] = {0};
char strState[80] = {0};
for (sessId=1; sessId < 96; sessId++)
{
memset(&info, 0x0, sizeof(info));
memset(&stats, 0x0, sizeof(stats));
{
count++;
ipAddressFormat(&info.
key.
srcIpAddr, strSrcIp);
ipAddressFormat(&info.
key.
dstIpAddr, strDstIp);
snprintf(strState, sizeof(strState), "%s",
(info.
state == OPEN_BFD_SESSION_STATE_UP) ?
"UP" :
"DOWN");
printf(pStrInfo_bfd_header_2, strDstIp);
printf(pStrInfo_bfd_header_3, strSrcIp);
printf(pStrInfo_bfd_header_4, info.
key.
intIfNum, info.
key.
vrfId, info.
upTime );
printf(pStrInfo_bfd_header_8, stats.
inPkts, stats.
outPkts, stats.
dropPkts );
printf(pStrInfo_bfd_header_9, stats.
echoInPkts, stats.
echoOutPkts);
}
}
if (count == 0)
{
printf("No BFD sessions found.\r\n");
}
}
{
uint32_t invalidControlMode = 10;
uint32_t invalidAddressFamily = 10;
uint32_t invalidIntfAddressType = 10;
uint32_t intf = 1, udpPort = 10, mtu = 1500;
char str[32];
printf("Testing Routing Configuration OpEN APIs sanity:\n\n");
printf("Testing openapiRtrAdminModeSet():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Address family NONE :(result = %d)\n", result);
printf("Invalid Address family :(result = %d)\n", result);
printf("Invalid Control Mode:(result = %d)\n", result);
printf("openapiRtrAdminModeSet() sanity successful\n\n");
printf("Testing openapiRtrIntfIpAddrAdd():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Address family NONE :(result = %d)\n", result);
printf("Invalid Address family :(result = %d)\n", result);
invalidIntfAddressType,
printf("Invalid Address Type:(result = %d)\n", result);
printf("NULL IP Address:(result = %d)\n", result);
&ipAddrPfx, invalidControlMode);
printf("NULL Ext Mode:(result = %d)\n", result);
printf("openapiRtrIntfIpAddrAdd() sanity successful\n\n");
printf("Testing openapiRtrIntfIpAddrDel():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Address family NONE :(result = %d)\n", result);
printf("Invalid Address family :(result = %d)\n", result);
invalidIntfAddressType,
printf("Invalid Address Type:(result = %d)\n", result);
printf("NULL IP Address:(result = %d)\n", result);
&ipAddrPfx, invalidControlMode);
printf("NULL Ext Mode:(result = %d)\n", result);
printf("openapiRtrIntfIpAddrDel() sanity successful\n\n");
printf("Testing openapiArpEntryAdd():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("NULL Mac Address:(result = %d)\n", result);
buffDesc.pstart = NULL;
buffDesc.size = 6;
printf("NULL Mac Address buffer:(result = %d)\n", result);
buffDesc.pstart = str;
buffDesc.size = 0;
printf("NULL Mac Address buffer length:(result = %d)\n", result);
printf("openapiArpEntryAdd() sanity successful\n\n");
printf("Testing openapiArpEntryDel():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("openapiArpEntryDel() sanity successful\n\n");
printf("Testing openapiArpEntryNextGet():\n");
buffDesc.pstart = str;
buffDesc.size = 18;
printf("NULL Client Handle:(result = %d)\n", result);
printf("NULL Intf:(result = %d)\n", result);
printf("NULL ipAddr:(result = %d)\n", result);
printf("NULL Mac Address:(result = %d)\n", result);
buffDesc.pstart = NULL;
buffDesc.size = 18;
printf("NULL Mac Address buffer:(result = %d)\n", result);
buffDesc.pstart = str;
buffDesc.size = 0;
printf("NULL Mac Address buffer length:(result = %d)\n", result);
printf("openapiArpEntryNextGet() sanity successful\n\n");
printf("Testing openapiIpRedirectsModeSet():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Invalid Control Mode:(result = %d)\n", result);
printf("openapiIpRedirectsModeSet() sanity successful\n\n");
printf("Testing openapiIpICMPEchoReplyModeSet():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Invalid Control Mode:(result = %d)\n", result);
printf("openapiIpICMPEchoReplyModeSet() sanity successful\n\n");
printf("Testing openapiIpHelperModeSet():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Invalid Control Mode:(result = %d)\n", result);
printf("openapiIpHelperModeSet() sanity successful\n\n");
printf("Testing openapiIpHelperAddressAdd():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("openapiIpHelperAddressAdd() sanity successful\n\n");
printf("Testing openapiIpHelperAddressDel():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("openapiIpHelperAddressDel() sanity successful\n\n");
printf("Testing openapiRtrIntfIpHelperAddressAdd():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("openapiRtrIntfIpHelperAddressAdd() sanity successful\n\n");
printf("Testing openapiRtrIntfIpHelperAddressDel():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("openapiRtrIntfIpHelperAddressDel() sanity successful\n\n");
printf("Testing openapiRtrIntfIpHelperDiscardAdd():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("openapiRtrIntfIpHelperDiscardAdd() sanity successful\n\n");
printf("Testing openapiRtrIntfIpHelperDiscardDel():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("openapiRtrIntfIpHelperDiscardDel() sanity successful\n\n");
printf("Testing openapiRtrIntfMTUSet():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Invalid Address family :(result = %d)\n", result);
printf("openapiRtrIntfMTUSet() sanity successful\n\n");
printf("Testing openapiRtrIntfIpNetDirBroadcastModeSet():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Invalid Control Mode:(result = %d)\n", result);
printf("openapiRtrIntfIpNetDirBroadcastModeSet() sanity successful\n\n");
printf("Testing openapiRtrIntfIpProxyArpModeSet():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Invalid Control Mode:(result = %d)\n", result);
printf("openapiRtrIntfIpProxyArpModeSet() sanity successful\n\n");
printf("Testing openapiRtrIntfIpRedirectsModeSet():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Invalid Control Mode:(result = %d)\n", result);
printf("openapiRtrIntfIpRedirectsModeSet() sanity successful\n\n");
printf("Testing openapiRtrIntfIpDestUnreachableModeSet():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Invalid Control Mode:(result = %d)\n", result);
printf("openapiRtrIntfIpDestUnreachableModeSet() sanity successful\n\n");
printf("Testing openapiRtrIntfRtrAdminModeSet():\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("Invalid Control Mode:(result = %d)\n", result);
printf("openapiRtrIntfRtrAdminModeSet() sanity successful\n\n");
printf("Testing openapiIpRouteAdd():\n");
printf("NULL Client Handle:(result = %d)\n", result);
result =
openapiIpRouteAdd(clientHandle, invalidAddressFamily, &ipAddrPfx, &ipAddr, 0, intf, NULL);
printf("Invalid Address Family:(result = %d)\n", result);
printf("NULL IP Address Pfx:(result = %d)\n", result);
printf("NULL Next Hop:(result = %d)\n", result);
printf("openapiIpRouteAdd() sanity successful\n\n");
printf("Testing openapiIpRouteDel():\n");
printf("NULL Client Handle:(result = %d)\n", result);
result =
openapiIpRouteDel(clientHandle, invalidAddressFamily, &ipAddrPfx, &ipAddr, intf, NULL);
printf("Invalid Address Family:(result = %d)\n", result);
printf("NULL IP Address Pfx:(result = %d)\n", result);
printf("NULL Next Hop:(result = %d)\n", result);
printf("openapiIpRouteDel() sanity successful\n\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("openapiRtrVlanIntfCreate() sanity successful\n\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("NULL ifnum: (result = %d)\n", result);
printf("Invalid VLAN ifnum: (result = %d)\n", result);
printf("openapiRtrVlanIntfIfNumGet() sanity successful\n\n");
printf("NULL Client Handle:(result = %d)\n", result);
printf("openapiRtrVlanIntfDelete() sanity successful\n\n");
return;
}
int main(int argc, char **argv)
{
int rc;
int32_t prefLevel;
uint32_t ifNum, testNum, addrFamily, time;
uint32_t addrType, pfxLen, extArg, mode;
uint32_t udpPort, mtu, pref, vlanId, value;
if (argc < 2 )
{
printRoutingAppMenu();
exit(1);
}
l7proc_crashlog_register();
{
printf("\nFailed to initialize RPC to OpEN. Exiting (result = %d)\n", rc);
exit(2);
}
{
sleep(1);
}
if (strcmp("API", argv[1]) == 0)
{
if (argc < 3 )
{
printRoutingAppMenu();
exit(1);
}
testNum = atoi(argv[2]);
switch (testNum)
{
case 1:
if (argc != 9)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
addrFamily = atoi(argv[4]);
addrType = atoi(argv[5]);
pfxLen = atoi(argv[7]);
extArg = atoi(argv[8]);
rtrIntfIpAddrAdd(&clientHandle, addrFamily, ifNum, addrType, argv[6], pfxLen, extArg);
break;
case 2:
if (argc != 9)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
addrFamily = atoi(argv[4]);
addrType = atoi(argv[5]);
pfxLen = atoi(argv[7]);
extArg = atoi(argv[8]);
rtrIntfIpAddrDel(&clientHandle, addrFamily, ifNum, addrType, argv[6], pfxLen, extArg);
break;
case 3:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
addrFamily = atoi(argv[3]);
mode = atoi(argv[4]);
rtrAdminModeSet(&clientHandle, addrFamily, mode);
break;
case 4:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
arpEntryAdd(&clientHandle);
break;
case 5:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
arpEntryDel(&clientHandle);
break;
case 6:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
arpEntryShow(&clientHandle);
break;
case 7:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[3]);
ipRedirectsModeSet(&clientHandle, mode);
break;
case 8:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[3]);
ipICMPEchoReplyModeSet(&clientHandle, mode);
break;
case 9:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[3]);
ipHelperModeSet(&clientHandle, mode);
break;
case 10:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
udpPort = atoi(argv[4]);
ipHelperAddressAdd(&clientHandle, argv[3], udpPort);
break;
case 11:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
udpPort = atoi(argv[4]);
ipHelperAddressDel(&clientHandle, argv[3], udpPort);
break;
case 12:
if (argc != 6)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
addrFamily = atoi(argv[4]);
mtu = atoi(argv[5]);
rtrIntfMTUSet(&clientHandle, addrFamily, ifNum, mtu);
break;
case 13:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
rtrIntfIpNetDirBroadcastModeSet(&clientHandle, ifNum, mode);
break;
case 14:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
rtrIntfIpProxyArpModeSet(&clientHandle, ifNum, mode);
break;
case 15:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
rtrIntfIpRefirectsModeSet(&clientHandle, ifNum, mode);
break;
case 16:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
rtrIntfIpDestUnreachableModeSet(&clientHandle, ifNum, mode);
break;
case 17:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
rtrIntfRtrAdminModeSet(&clientHandle, ifNum, mode);
break;
case 18:
if (argc != 6)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
udpPort = atoi(argv[5]);
rtrIntfIpHelperAddressAdd(&clientHandle, ifNum, argv[4], udpPort);
break;
case 19:
if (argc != 6)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
udpPort = atoi(argv[5]);
rtrIntfIpHelperAddressDel(&clientHandle, ifNum, argv[4], udpPort);
break;
case 20:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
udpPort = atoi(argv[4]);
rtrIntfIpHelperDiscardAdd(&clientHandle, ifNum, udpPort);
break;
case 21:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
udpPort = atoi(argv[4]);
rtrIntfIpHelperDiscardDel(&clientHandle, ifNum, udpPort);
break;
case 22:
if ((argc < 9) || (argc > 12))
{
printRoutingAppMenu();
exit(1);
}
addrFamily = atoi(argv[3]);
pfxLen = atoi(argv[5]);
pref = atoi(argv[7]);
ifNum = atoi(argv[8]);
memset(&mpls, 0, sizeof(mpls));
if (argc >= 10)
{
mpls.
label[0] = atoi(argv[9]);
}
if (argc >= 11)
{
mpls.label[1] = atoi(argv[10]);
}
if (argc == 12)
{
mpls.label[2] = atoi(argv[11]);
}
rtrIpRouteAdd(&clientHandle, addrFamily, argv[4],
pfxLen, argv[6], pref, ifNum, &mpls);
break;
case 23:
if ((argc < 8) || (argc > 11))
{
printRoutingAppMenu();
exit(1);
}
addrFamily = atoi(argv[3]);
pfxLen = atoi(argv[5]);
ifNum = atoi(argv[7]);
memset(&mpls, 0, sizeof(mpls));
if (argc >= 9)
{
mpls.label[0] = atoi(argv[8]);
}
if (argc >= 10)
{
mpls.label[1] = atoi(argv[9]);
}
if (argc == 11)
{
mpls.label[2] = atoi(argv[10]);
}
rtrIpRouteDel(&clientHandle, addrFamily, argv[4],
pfxLen, argv[6], ifNum, &mpls);
break;
case 24:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
vlanId = atoi(argv[3]);
rtrVlanIntfCreate(&clientHandle, vlanId);
break;
case 25:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
vlanId = atoi(argv[3]);
rtrVlanIntfDelete(&clientHandle, vlanId);
break;
case 26:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
routingOpENAPIsTestSanity(&clientHandle);
break;
case 27:
case 28:
if (argc != 7)
{
printRoutingAppMenu();
exit(1);
}
addrFamily = atoi(argv[3]);
ifNum = atoi(argv[4]);
if (testNum == 27)
rtrBfdSessionCreate(&clientHandle, addrFamily, ifNum, argv[5], argv[6]);
else
rtrBfdSessionDelete(&clientHandle, addrFamily, ifNum, argv[5], argv[6]);
break;
case 29:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
rtrBfdSessionShow(&clientHandle);
break;
case 30:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
addrFamily = atoi(argv[3]);
rtrBfdSessionFind(&clientHandle, addrFamily, argv[4]);
break;
case 31:
iterateVRFs(&clientHandle);
break;
case 32:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
vlanId = atoi(argv[3]);
rtrVlanIfNumShow(&clientHandle, vlanId);
break;
case 34:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscIntfAdvertiseModeShow(&clientHandle, ifNum);
break;
case 35:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
rtrDiscIntfAdvertiseModeSet(&clientHandle, ifNum, mode);
break;
case 36:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscIntfAdvAddrShow(&clientHandle, ifNum);
break;
case 37:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscIntfAdvAddrSet(&clientHandle, ifNum, argv[4]);
break;
case 38:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscMaxAdvIntervalShow(&clientHandle, ifNum);
break;
case 39:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
time = atoi(argv[4]);
rtrDiscMaxAdvIntervalSet(&clientHandle, ifNum, time);
break;
case 40:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscMinAdvIntervalShow(&clientHandle, ifNum);
break;
case 41:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
time = atoi(argv[4]);
rtrDiscMinAdvIntervalSet(&clientHandle, ifNum, time);
break;
case 42:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscMinAdvIntervalDefaultShow(&clientHandle, ifNum);
break;
case 43:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscMinAdvIntervalRevert(&clientHandle, ifNum);
break;
case 44:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscAdvLifetimeShow(&clientHandle, ifNum);
break;
case 45:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
time = atoi(argv[4]);
rtrDiscAdvLifetimeSet(&clientHandle, ifNum, time);
break;
case 46:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscAdvLifetimeDefaultShow(&clientHandle, ifNum);
break;
case 47:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscAdvLifetimeRevert(&clientHandle, ifNum);
break;
case 48:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrDiscPreferenceLevelShow(&clientHandle, ifNum);
break;
case 49:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
prefLevel = atoi(argv[4]);
rtrDiscPreferenceLevelSet(&clientHandle, ifNum, prefLevel);
break;
case 50:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrIpUnnumberedGratArpModeShow(&clientHandle, ifNum);
break;
case 51:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
rtrIpUnnumberedGratArpSet(&clientHandle, ifNum, mode);
break;
case 52:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
rtrGratArpSet(&clientHandle, ifNum, mode);
break;
case 53:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[3]);
rtrIpArpDynamicRenewSet(&clientHandle, mode);
break;
case 54:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
rtrIpArpDynamicRenewGet(&clientHandle);
break;
case 55:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
value = atoi(argv[3]);
rtrIpArpCacheSizeSet(&clientHandle, value);
break;
case 56:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
value = atoi(argv[3]);
rtrIpArpRetriesSet(&clientHandle, value);
break;
case 57:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrLocalProxyArpModeShow(&clientHandle, ifNum);
break;
case 58:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
rtrLocalProxyArpModeSet(&clientHandle, ifNum, mode);
break;
case 59:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
rtrIntfIpProxyArpModeShow(&clientHandle, ifNum);
break;
case 60:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
value = atoi(argv[3]);
rtrIpArpRespTimeSet(&clientHandle, value);
break;
case 61:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
value = atoi(argv[3]);
rtrIpArpAgeTimeSet(&clientHandle, value);
break;
case 62:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
rtrIpArpCacheStatsShow(&clientHandle, argv[3]);
break;
case 63:
if (argc != 6)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[5]);
rtrIpArpEntryPurge(&clientHandle, argv[3], argv[4], ifNum);
break;
case 64:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[4]);
rtrIpArpCacheClear(&clientHandle, argv[3], mode);
break;
case 65:
if (argc != 6)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[5]);
rtrIpMapStaticArpDelete(&clientHandle, argv[3], argv[4], ifNum);
break;
case 66:
if (argc != 7)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[5]);
rtrIpMapStaticArpAdd(&clientHandle, argv[3], argv[4], ifNum, argv[6]);
break;
case 67:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
rtrIpMapStaticArpGetAll(&clientHandle, argv[3]);
break;
case 68:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
intfIPv4MtuGet(&clientHandle, ifNum);
break;
case 69:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
intfMaxIpMtuGet(&clientHandle, ifNum);
break;
case 70:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
intfEffectiveIpMtuGet(&clientHandle, ifNum);
break;
case 71:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[3]);
ipEcmpLbSet(&clientHandle, mode);
break;
case 72:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
ipEcmpLbGet(&clientHandle);
break;
case 73:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[3]);
ipEcmpIpsecSpiSet(&clientHandle, mode);
break;
case 74:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
ipEcmpIpsecSpiGet(&clientHandle);
break;
case 75:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipNetDirectBcastsGet(&clientHandle, ifNum);
break;
case 76:
if (argc != 6)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
value = atoi(argv[5]);
ipUnnumberedSet(&clientHandle, ifNum, mode, value);
break;
case 77:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipUnnumberedGet(&clientHandle, ifNum);
break;
case 78:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipMcastsFwdModeGet(&clientHandle, ifNum);
break;
case 79:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipRtrIntfModeGet(&clientHandle, ifNum);
break;
case 80:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipRtrIntfAutoStateModeGet(&clientHandle, ifNum);
break;
case 81:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
ipRtrIntfAutoStateModeSet(&clientHandle, ifNum, mode);
break;
case 82:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipRtrIntfOperModeGet(&clientHandle, ifNum);
break;
case 83:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
vlanId = atoi(argv[3]);
ipVlanRtrVlanIdGetNext(&clientHandle, vlanId);
break;
case 84:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipVlanRtrIntIfNumToVlanId(&clientHandle, ifNum);
break;
case 85:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
value = atoi(argv[3]);
vlanIntfIdGet(&clientHandle, value);
break;
case 86:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
value = atoi(argv[3]);
ipRtrInternalVlanIdToIntIfNum(&clientHandle, value);
break;
case 87:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
ipMapValidIntfFirstGet(&clientHandle);
break;
case 88:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipMapValidIntfNextGet(&clientHandle, ifNum);
break;
case 89:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipMapICMPUnreachablesModeGet(&clientHandle, ifNum);
break;
case 90:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipMapIfICMPRedirectsModeGet(&clientHandle, ifNum);
break;
case 91:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ifBandwidthGet(&clientHandle, ifNum);
break;
case 92:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
value = atoi(argv[4]);
ifBandwidthSet(&clientHandle, ifNum, value);
break;
case 93:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ifBWGet(&clientHandle, ifNum);
break;
case 94:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
rtrRouteMaxEqualCostEntriesGet(&clientHandle);
break;
case 95:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
rtrRouteMaxRouteEntriesGet(&clientHandle);
break;
case 96:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipMapIpEvtDampGetDampParams(&clientHandle, ifNum);
break;
case 97:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
value = atoi(argv[3]);
ipMapProtoNextGet(&clientHandle, value);
break;
case 98:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
value = atoi(argv[3]);
ipMapRouteTypeToProtoId(&clientHandle, value);
break;
case 99:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
ipMapResilientHashingModeGet(&clientHandle);
break;
case 100:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[3]);
ipMapResilientHashingModeSet(&clientHandle, mode);
break;
case 101:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
ipMapForwardingStatsGet(&clientHandle);
break;
case 102:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
ipMapIpPacketsReceivedGet(&clientHandle);
break;
case 103:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
sourceInterfacesGet(&clientHandle);
break;
case 104:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
sourceInterfacesSet(&clientHandle, ifNum);
break;
case 105:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
ipManagementInterfaceGet(&clientHandle);
break;
case 106:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipManagementInterfaceSet(&clientHandle, ifNum);
break;
case 107:
if (argc != 7)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
ipManagementInterfaceParamsSet(&clientHandle, ifNum, mode, argv[5], argv[6]);
break;
case 108:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
ipMapSystemUrpfModeGet(&clientHandle);
break;
case 109:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[3]);
ipMapSystemUrpfModeSet(&clientHandle, mode);
break;
case 110:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipMapIntfUrpfModeGet(&clientHandle, ifNum);
break;
case 111:
if (argc != 6)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
mode = atoi(argv[4]);
value = atoi(argv[5]);
ipMapIntfUrpfModeSet(&clientHandle, ifNum, mode, value);
break;
case 112:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ipMapRtrICMPEchoReplyModeGet(&clientHandle, argv[3]);
break;
case 113:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ipMapRtrICMPRatelimitGet(&clientHandle, argv[3]);
break;
case 114:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
iPAddrToIntIf(&clientHandle, argv[3], argv[4]);
break;
case 115:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[4]);
ipVrRouterPreferenceGet(&clientHandle, argv[3], mode);
break;
case 116:
if (argc != 6)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[4]);
value = atoi(argv[5]);
ipVrRouterPreferenceSet(&clientHandle, argv[3], mode, value);
break;
case 117:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ipMapRtrICMPRedirectsModeGet(&clientHandle, argv[3]);
break;
case 118:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[4]);
ipMapRtrICMPRedirectsModeSet(&clientHandle, argv[3], mode);
break;
case 119:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[4]);
ipMapRtrICMPEchoReplyModeSet(&clientHandle, argv[3], mode);
break;
case 120:
if (argc != 6)
{
printRoutingAppMenu();
exit(1);
}
mode = atoi(argv[4]);
value = atoi(argv[5]);
ipMapRtrICMPRatelimitSet(&clientHandle, argv[3], mode, value);
break;
case 121:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
vrAddrConflictDetectStatusClear(&clientHandle, argv[3]);
break;
case 122:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
vrAddrConflictDetectStatusGet(&clientHandle, argv[3]);
break;
case 123:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
vrAddrConflictLastDetectMACGet(&clientHandle, argv[3]);
break;
case 124:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
vrAddrConflictLastDetectTimeGet(&clientHandle, argv[3]);
break;
case 125:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
value = atoi(argv[4]);
ipNetPrototypeRoutesDelete(&clientHandle, argv[3], value);
break;
case 126:
if (argc != 4)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipMapRtrIntfVrfReset(&clientHandle, ifNum);
break;
case 127:
if (argc != 5)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
ipMapRtrIntfVrfSet(&clientHandle, ifNum, argv[4]);
break;
case 128:
if (argc != 3)
{
printRoutingAppMenu();
exit(1);
}
rtrArpSwitchClear(&clientHandle);
break;
case 129:
if (argc != 6)
{
printRoutingAppMenu();
exit(1);
}
ifNum = atoi(argv[3]);
addrType = atoi(argv[4]);
extArg = atoi(argv[5]);
rtrIntfIpv6AddressModeSet(&clientHandle, ifNum, addrType, extArg);
break;
default:
printRoutingAppMenu();
break;
}
}
else
{
printRoutingAppMenu();
}
return 0;
}