#include <stdlib.h>
#include <unistd.h>
#include "rpcclt_openapi.h"
#include "proc_util.h"
static void printAppMenu(char *name)
{
printf("Usage: %s <test#> <arg1> <arg2> ... \n", name);
printf("Test 1: Sets source IP address=destination IP address (SIP=DIP) denial of service protection: %s 1 <mode>\n", name);
printf("Test 2: Sets source MAC address=destination MAC address (SMAC=DMAC) denial of service protection: %s 2 <mode>\n", name);
printf("Test 3: Sets first fragment denial of service protection: %s 3 <mode>\n", name);
printf("Test 4: Sets minimum TCP header size denial of service protection: %s 4 <minTCPHdrSize>\n", name);
printf("Test 5: Sets TCP fragment denial of service protection: %s 5 <mode>\n", name);
printf("Test 6: Sets TCP offset denial of service protection: %s 6 <mode>\n", name);
printf("Test 7: Sets TCP flag denial of service protection: %s 7 <mode>\n", name);
printf("Test 8: Sets TCP flag and sequence denial of service protection: %s 8 <mode>\n", name);
printf("Test 9: Sets TCP port denial of service protection: %s 9 <mode>\n", name);
printf("Test 10: Sets UDP port denial of service protection: %s 10 <mode>\n", name);
printf("Test 11: Sets TCP SYN denial of service protection: %s 11 <mode>\n", name);
printf("Test 12: Sets TCP SYN and FIN denial of service protection: %s 12 <mode>\n", name);
printf("Test 13: Sets TCP FIN,URG and PSH denial of service protection: %s 13 <mode>\n", name);
printf("Test 14: Sets L4 Port denial of service protection: %s 14 <mode>\n", name);
printf("Test 15: Sets ICMP denial of service protection: %s 15 <mode>\n", name);
printf("Test 16: Sets maximum ICMP size denial of service protection: %s 16 <maxICMPSize>\n", name);
printf("Test 17: Sets maximum ICMPv6 size denial of service protection: %s 17 <maxICMPv6Size>\n", name);
printf("Test 18: Sets ICMP Fragment denial of service protection: %s 18 <mode>\n", name);
printf("Test 19: Gets source IP address=destination IP address (SIP=DIP) denial of service protection mode: %s 19\n", name);
printf("Test 20: Gets source MAC address=destination MAC address (SMAC=DMAC) denial of service protection mode: %s 20\n", name);
printf("Test 21: Gets first fragment denial of service protection mode: %s 21\n", name);
printf("Test 22: Gets TCP Partial denial of service protection mode: %s 22\n", name);
printf("Test 23: Gets denial of service protection Minimum TCP Header Size: %s 23\n", name);
printf("Test 24: Gets TCP Offset denial of service protection mode: %s 24\n", name);
printf("Test 25: Gets TCP port denial of service protection mode: %s 25\n", name);
printf("Test 26: Gets UDP port denial of service protection mode: %s 26\n", name);
printf("Test 27: Gets TCP Fragment denial of service protection mode: %s 27\n", name);
printf("Test 28: Gets TCP flag denial of service protection mode: %s 28\n", name);
printf("Test 29: Gets TCP flag and sequence denial of service protection mode: %s 29\n", name);
printf("Test 30: Gets TCP SYN denial of service protection mode: %s 30\n", name);
printf("Test 31: Gets TCP SYN and FIN denial of service protection mode: %s 31\n", name);
printf("Test 32: Gets TCP FIN,URG and PSH denial of service protection mode: %s 32\n", name);
printf("Test 33: Gets L4 Port denial of service protection mode: %s 33\n", name);
printf("Test 34: Gets ICMP denial of service protection mode: %s 34\n", name);
printf("Test 35: Gets denial of service protection maximum ICMP size: %s 35\n", name);
printf("Test 36: Sets ping flooding denial of service protection on an interface: %s 36 <interface><mode><param>\n", name);
printf("Test 37: Gets ping flooding denial of service protection mode on an interface: %s 37 <interface>\n", name);
printf("Test 38: Sets preventing Smurf denial of service protection on an interface: %s 38 <interface><mode>\n", name);
printf("Test 39: Gets Smurf denial of service protection mode on an interface: %s 39 <interface>\n", name);
printf("Test 40: Gets SynAck Flooding denial of service protection mode on an interface: %s 40 <interface>\n", name);
printf("Test 41: Sets ping flooding denial of service protection: %s 41 <mode><param>\n", name);
printf("Test 42: Gets ping flooding denial of service protection mode: %s 42\n", name);
printf("Test 43: Sets preventing Smurf denial of service protection: %s 43 <mode>\n", name);
printf("Test 44: Gets Smurf denial of service protection mode: %s 44\n", name);
printf("Test 45: Sets preventing SynAck Flooding denial of service protection: %s 45 <mode><param>\n", name);
printf("Test 46: Gets preventing SynAck Flooding denial of service protection mode: %s46\n", name);
printf("Test 47: Gets denial of service protection Maximum ICMPv4 payload size: %s 47\n", name);
printf("Test 48: Gets denial of service protection Maximum ICMPv6 payload size: %s 48\n", name);
printf("Test 49: Gets ICMP Fragment denial of service protection mode: %s 49\n", name);
printf("Test 50: Gets ICMPv6 denial of service protection mode: %s 50\n", name);
printf("Test 51: Sets ICMPv6 denial of service protection: %s 51 <mode>\n", name);
printf("Test 52: Gets port D-disable state for denial of service protection: %s 52\n", name);
printf("Test 53: Sets port D-disable for denial of service protection: %s 53 <mode>\n", name);
printf("Test 54: Gets Auto denial of service protection mode: %s 54\n", name);
printf("Test 55: Sets Auto denial of service protection: %s 55 <mode>\n", name);
printf("Test 56: Gets Vlan0 Tagged and SNAP Drop denial of service protection mode: %s 56\n", name);
printf("Test 57: Sets Vlan0 Tagged and SNAP Drop denial of service protection: %s 57 <mode>\n", name);
printf("Test 58: Run API sanity checks: %s 58 \n", name);
return;
}
{
uint32_t maxICMPSize;
uint32_t minTCPHdrSize;
uint32_t param;
uint32_t interface=10;
printf("Testing DoS OpEN APIs sanity:\n");
printf("Testing openapiDoSSIPDIPModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSSMACDMACModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL argument 2:(result = %d)\n", result);
printf("Testing openapiDoSFirstFragModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSTCPPartialModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSFirstFragSizeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL first Frag Size argument:(result = %d)\n", result);
printf("Testing openapiDoSTCPOffsetModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSTCPPortModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSUDPPortModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSTCPFragModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSTCPFlagModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSTCPFlagSeqModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSTCPSynModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSTCPSynFinModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSTCPFinUrgPshModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSL4PortModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSICMPModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSICMPSizeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL min ICMP size argument 2:(result = %d)\n", result);
printf("Testing openapiDoSIntfPingFloodingModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("NULL param argument:(result = %d)\n", result);
printf("Testing openapiDoSIntfSmurfAttackModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSIntfSynAckFloodingModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("NULL param argument:(result = %d)\n", result);
printf("Testing openapiDoSGlobalPingFloodingModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("NULL param argument:(result = %d)\n", result);
printf("Testing openapiDoSGlobalSmurfAttackModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSGlobalSynAckFloodingModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("NULL param argument:(result = %d)\n", result);
printf("Testing openapiDoSICMPv4SizeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL max ICMPv4 size argument :(result = %d)\n", result);
printf("Testing openapiDoSICMPv6SizeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL max ICMPv6 size argument:(result = %d)\n", result);
printf("Testing openapiDoSICMPFragModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSICMPv6ModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSPortDdisableModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSAutoModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
printf("Testing openapiDoSVlan0TaggedSnapDropModeGet():\n");
printf("NULL client handle:(result = %d)\n", result);
printf("NULL mode argument:(result = %d)\n", result);
return;
}
{
{
printf("Bad return code trying to sets source IP address=destination IP address (SIP=DIP) denial of service protection. (result = %d)\n", result);
}
else
{
printf("Source IP address=destination IP address (SIP=DIP) denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets source MAC address=destination MAC address (SMAC=DMAC) denial of service protection. (result = %d)\n", result);
}
else
{
printf("Source MAC address=destination MAC address (SMAC=DMAC) denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets first fragment denial of service protection. (result = %d)\n", result);
}
else
{
printf("First fragment denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets minimum TCP header size denial of service protection. (result = %d)\n", result);
}
else
{
printf("Minimum TCP header size for denial of service protection is set to %d\n", minTCPHdrSize);
}
return;
}
{
{
printf("Bad return code trying to sets TCP fragment denial of service protection. (result = %d)\n", result);
}
else
{
printf("TCP fragment denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets TCP offset denial of service protection. (result = %d)\n", result);
}
else
{
printf("TCP offset denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets TCP flag denial of service protection. (result = %d)\n", result);
}
else
{
printf("TCP flag denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets TCP flag and sequence denial of service protection. (result = %d)\n", result);
}
else
{
printf("TCP flag and sequence denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets TCP port denial of service protection. (result = %d)\n", result);
}
else
{
printf("TCP port denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets UDP port denial of service protection. (result = %d)\n", result);
}
else
{
printf("UDP port denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets TCP SYN denial of service protection. (result = %d)\n", result);
}
else
{
printf("TCP SYN denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets TCP SYN and FIN denial of service protection. (result = %d)\n", result);
}
else
{
printf("TCP SYN and FIN denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets TCP FIN,URG and PSH denial of service protection. (result = %d)\n", result);
}
else
{
printf("TCP FIN,URG and PSH denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets L4 Port denial of service protection. (result = %d)\n", result);
}
else
{
printf("L4 Port denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets ICMP denial of service protection. (result = %d)\n", result);
}
else
{
printf("ICMP denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to sets maximum ICMP size denial of service protection. (result = %d)\n", result);
}
else
{
printf("Maximum ICMPv4 size denial of service protection is set to %d\n", maxICMPSize);
}
return;
}
{
{
printf("Bad return code trying to sets maximum ICMPv6 size denial of service protection. (result = %d)\n", result);
}
else
{
printf("Maximum ICMPv6 size denial of service protection is set to %d\n", maxICMPv6Size);
}
return;
}
{
{
printf("Bad return code trying to sets ICMP Fragment denial of service protection. (result = %d)\n", result);
}
else
{
printf("ICMP Fragment denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to gets source IP address=destination IP address (SIP=DIP) denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("Source IP address=destination IP address (SIP=DIP) denial of service protection is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets source MAC address=destination MAC address (SMAC=DMAC) denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("Source MAC address=destination MAC address (SMAC=DMAC) denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets first fragment denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("First fragment denial of service protection is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets TCP Partial denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("TCP Partial denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets denial of service protection Minimum TCP Header Size. (result = %d)\n", result);
}
else
{
printf("Denial of service protection Minimum TCP Header Size is %d\n", *pMinTCPHdrSize);
}
return;
}
{
{
printf("Bad return code trying to gets TCP Offset denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("TCP Offset denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets TCP port denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("TCP port denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets UDP port denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("UDP port denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets TCP Fragment denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("TCP Fragment denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets TCP flag denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("TCP flag denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets TCP flag and sequence denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("TCP flag and sequence denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets TCP SYN denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("TCP SYN denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets TCP SYN and FIN denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("TCP SYN and FIN denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets TCP FIN,URG and PSH denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("TCP FIN,URG and PSH denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets L4 Port denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("L4 Port denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets ICMP denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("ICMP denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets denial of service protection maximum ICMP size. (result = %d)\n", result);
}
else
{
printf("Denial of service protection maximum ICMP size is %d\n", *pMaxICMPSize);
}
return;
}
{
{
printf("Bad return code trying to sets ping flooding denial of service protection on an interface. (result = %d)\n", result);
}
else
{
printf("Ping flooding denial of service protection on an interface is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to gets ping flooding denial of service protection mode on an interface. (result = %d)\n", result);
}
else
{
printf("Ping flooding denial of service protection on an interface is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to sets preventing Smurf denial of service protection on an interface. (result = %d)\n", result);
}
else
{
printf("Preventing Smurf denial of service protection on an interface is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to gets Smurf denial of service protection mode on an interface. (result = %d)\n", result);
}
else
{
printf("Preventing Smurf denial of service protection on an interface is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets SynAck Flooding denial of service protection mode on an interface. (result = %d)\n", result);
}
else
{
printf("SynAck Flooding denial of service protection mode on an interface is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to sets ping flooding denial of service protection. (result = %d)\n", result);
}
else
{
printf("Ping flooding denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to gets ping flooding denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("Ping flooding denial of service protection is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to sets preventing Smurf denial of service protection. (result = %d)\n", result);
}
else
{
printf("Preventing Smurf denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to gets Smurf denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("Preventing Smurf denial of service protection is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to sets preventing SynAck Flooding denial of service protection. (result = %d)\n", result);
}
else
{
printf("Preventing SynAck Flooding denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to gets preventing SynAck Flooding denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("Preventing SynAck Flooding denial of service protection is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets denial of service protection Maximum ICMPv4 payload size. (result = %d)\n", result);
}
else
{
printf("Denial of service protection Maximum ICMPv4 payload size is %d\n", *pMaxICMPSize);
}
return;
}
{
{
printf("Bad return code trying to gets denial of service protection Maximum ICMPv6 payload size. (result = %d)\n", result);
}
else
{
printf("Denial of service protection Maximum ICMPv6 payload size is %d\n", *pMaxICMPSize);
}
return;
}
{
{
printf("Bad return code trying to gets ICMP Fragment denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("ICMP Fragment denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to gets ICMPv6 denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("ICMPv6 denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to sets ICMPv6 denial of service protection. (result = %d)\n", result);
}
else
{
printf("ICMPv6 denial of service protection mode is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to gets port D-disable state for denial of service protection. (result = %d)\n", result);
}
else
{
printf("Port D-disable state for denial of service protection is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to sets port D-disable for denial of service protection. (result = %d)\n", result);
}
else
{
printf("Port D-disable state for denial of service protection is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to gets Auto denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("Auto denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to sets Auto denial of service protection. (result = %d)\n", result);
}
else
{
printf("Auto denial of service protection mode is successfully %s\n",
}
return;
}
{
{
printf("Bad return code trying to gets Vlan0 Tagged and SNAP Drop denial of service protection mode. (result = %d)\n", result);
}
else
{
printf("Vlan0 Tagged and SNAP Drop denial of service protection mode is in %s state\n",
}
return;
}
{
{
printf("Bad return code trying to sets Vlan0 Tagged and SNAP Drop denial of service protection. (result = %d)\n", result);
}
else
{
printf("Vlan0 Tagged and SNAP Drop denial of service protection mode is successfully %s\n",
}
return;
}
int main(int argc, char **argv)
{
uint32_t testNum;
char switch_os_revision_string[100];
int show_help = 1;
uint32_t recvMode;
uint32_t minTCPHdrSize;
uint32_t maxICMPSize;
uint32_t param;
if (argc < 2)
{
printAppMenu(argv[0]);
return -1;
}
testNum = atoi(argv[1]);
l7proc_crashlog_register();
{
printf("\nFailed to initialize RPC to OpEN. Exiting (result = %d)\n", result);
return -1;
}
{
sleep(1);
}
L7PROC_LOGF(L7PROC_LOG_SEVERITY_INFO, 0, "Starting DoS API example application");
printf("\n");
switch_os_revision.
pstart = switch_os_revision_string;
switch_os_revision.
size =
sizeof(switch_os_revision_string);
printf("Network OS version = %s\n", switch_os_revision_string);
else
printf("Network OS version retrieve error\n");
printf("\n");
switch (testNum)
{
case 1:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSSIPDIPModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 2:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSSMACDMACModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 3:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSFirstFragModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 4:
if (argc == 3)
{
doSFirstFragSizeSet(&clientHandle, atoi(argv[2]));
show_help = 0;
}
break;
case 5:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSTCPFragModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 6:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSTCPOffsetModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 7:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSTCPFlagModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 8:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSTCPFlagSeqModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 9:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSTCPPortModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 10:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSUDPPortModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 11:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSTCPSynModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 12:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSTCPSynFinModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 13:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSTCPFinUrgPshModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 14:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSL4PortModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 15:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSICMPModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 16:
if (argc == 3)
{
doSICMPSizeSet(&clientHandle, atoi(argv[2]));
show_help = 0;
}
break;
case 17:
if (argc == 3)
{
doSICMPv6SizeSet(&clientHandle, atoi(argv[2]));
show_help = 0;
}
break;
case 18:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSICMPFragModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 19:
if (argc == 2)
{
doSSIPDIPModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 20:
if (argc == 2)
{
doSSMACDMACModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 21:
if (argc == 2)
{
doSFirstFragModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 22:
if (argc == 2)
{
doSTCPPartialModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 23:
if (argc == 2)
{
doSFirstFragSizeGet(&clientHandle, &minTCPHdrSize);
show_help = 0;
}
break;
case 24:
if (argc == 2)
{
doSTCPOffsetModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 25:
if (argc == 2)
{
doSTCPPortModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 26:
if (argc == 2)
{
doSUDPPortModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 27:
if (argc == 2)
{
doSTCPFragModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 28:
if (argc == 2)
{
doSTCPFlagModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 29:
if (argc == 2)
{
doSTCPFlagSeqModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 30:
if (argc == 2)
{
doSTCPSynModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 31:
if (argc == 2)
{
doSTCPSynFinModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 32:
if (argc == 2)
{
doSTCPFinUrgPshModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 33:
if (argc == 2)
{
doSL4PortModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 34:
if (argc == 2)
{
doSICMPModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 35:
if (argc == 2)
{
doSICMPSizeGet(&clientHandle, &maxICMPSize);
show_help = 0;
}
break;
case 36:
if (argc == 5)
{
recvMode = atoi(argv[3]);
if ((0 == recvMode) || (1 == recvMode))
{
doSIntfPingFloodingModeSet(&clientHandle, atoi(argv[2]), mode, atoi(argv[4]));
}
show_help = 0;
}
break;
case 37:
if (argc == 3)
{
doSIntfPingFloodingModeGet(&clientHandle, atoi(argv[2]), &mode, ¶m);
show_help = 0;
}
break;
case 38:
if (argc == 4)
{
recvMode = atoi(argv[3]);
if ((0 == recvMode) || (1 == recvMode))
{
doSIntfSmurfAttackModeSet(&clientHandle, atoi(argv[2]), mode);
}
show_help = 0;
}
break;
case 39:
if (argc == 3)
{
doSIntfSmurfAttackModeGet(&clientHandle, atoi(argv[2]), &mode);
show_help = 0;
}
break;
case 40:
if (argc == 3)
{
doSIntfSynAckFloodingModeGet(&clientHandle, atoi(argv[2]), &mode, ¶m);
show_help = 0;
}
break;
case 41:
if (argc == 4)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSGlobalPingFloodingModeSet(&clientHandle, mode, atoi(argv[3]));
}
show_help = 0;
}
break;
case 42:
if (argc == 2)
{
doSGlobalPingFloodingModeGet(&clientHandle, &mode, ¶m);
show_help = 0;
}
break;
case 43:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSGlobalSmurfAttackModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 44:
if (argc == 2)
{
doSGlobalSmurfAttackModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 45:
if (argc == 4)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSGlobalSynAckFloodingModeSet(&clientHandle, mode, atoi(argv[3]));
}
show_help = 0;
}
break;
case 46:
if (argc == 2)
{
doSGlobalSynAckFloodingModeGet(&clientHandle, &mode, ¶m);
show_help = 0;
}
break;
case 47:
if (argc == 2)
{
doSICMPv4SizeGet(&clientHandle, &maxICMPSize);
show_help = 0;
}
break;
case 48:
if (argc == 2)
{
doSICMPv6SizeGet(&clientHandle, &maxICMPSize);
show_help = 0;
}
break;
case 49:
if (argc == 2)
{
doSICMPFragModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 50:
if (argc == 2)
{
doSICMPv6ModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 51:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSICMPv6ModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 52:
if (argc == 2)
{
doSPortDdisableModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 53:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSPortDdisableModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 54:
if (argc == 2)
{
doSAutoModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 55:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSAutoModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 56:
if (argc == 2)
{
doSVlan0TaggedSnapDropModeGet(&clientHandle, &mode);
show_help = 0;
}
break;
case 57:
if (argc == 3)
{
recvMode = atoi(argv[2]);
if ((0 == recvMode) || (1 == recvMode))
{
doSVlan0TaggedSnapDropModeSet(&clientHandle, mode);
}
show_help = 0;
}
break;
case 58:
if (argc == 2)
{
runSanity(&clientHandle);
show_help = 0;
}
break;
default:
break;
}
if (show_help == 1)
{
printAppMenu(argv[0]);
}
L7PROC_LOGF(L7PROC_LOG_SEVERITY_INFO, 0, "Stopping DoS API example application");
return 0;
}