18#include "../Firewall/Firewall.h"
32 status ?
"enable" :
"disable");
44 send_message(info,
"%s is not a valid option for ACL command.\n"
45 "It must be either ENABLE or DISABLE.\n",
51 if (command->
length - index < 2)
53 send_message(info,
"Too less argument for ACL command\n");
100 if (command->
length - index < 8)
102 send_message(info,
"Usage: [PERMIT,DENY] [INBOUND,OUTBOUND,BOTH]"
103 " PROTO SRC DEST SPORT DPORT IFID\n");
110 send_message(info,
"First command must be either PERMIT or DENY.\n");
111 send_message(info,
"Usage: [PERMIT,DENY] [INBOUND,OUTBOUND,BOTH]"
112 " PROTO SRC DEST SPORT DPORT IFID\n");
120 send_message(info,
"Second command must be INBOUND, OUTBOUND or BOTH.\n");
121 send_message(info,
"Usage: [PERMIT,DENY] [INBOUND,OUTBOUND,BOTH]"
122 " PROTO SRC DEST SPORT DPORT IFID\n");
128 send_message(info,
"Protocol is not valid. Valid protocol is TCP, UDP, or ANY\n");
129 send_message(info,
"Usage: [PERMIT,DENY] [INBOUND,OUTBOUND,BOTH]"
130 " PROTO SRC DEST SPORT DPORT IFID\n");
151 char* action = command->
commands[index++];
152 char* direction = command->
commands[index++];
153 char* proto = command->
commands[index++];
154 char* srcIP = command->
commands[index++];
155 char* destIP = command->
commands[index++];
156 char* sport = command->
commands[index++];
157 char* dport = command->
commands[index++];
158 char* in = command->
commands[index++];
161 sprintf(s,
"%s %s %s %s %s %s %s %s",
static bool isProto(char *s)
void execute_acl_command(ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index, NETSIM_ID d)
bool validate_aclconfig_command(ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index)
static void execute_acl_status_command(ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index, NETSIM_ID d, bool status)
void execute_prompt_aclconfig_command(ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index, NETSIM_ID d)
void execute_aclconfig_command(ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index, NETSIM_ID d)
bool validate_acl_command(ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index)
void send_message(ptrCLIENTINFO info, char *msg,...)
static struct stru_802_11_Phy_Parameters_HT a
#define DEVICE_NAME(DeviceId)
void acl_add_new_line(NETSIM_ID d, char *s)
char * acl_print(NETSIM_ID d)
Structure to store the device ip details.
bool isFirewallConfigured