-extern int clifd, udpfd, tapfd, snoopfd, ifrfd, cluster_sockfd;
+extern int clifd, udpfd, tunfd, snoopfd, ifrfd, cluster_sockfd;
extern struct configt *config;
extern struct config_descriptt config_values[];
#ifdef RINGBUFFER
extern struct Tringbuffer *ringbuffer;
#endif
extern struct configt *config;
extern struct config_descriptt config_values[];
#ifdef RINGBUFFER
extern struct Tringbuffer *ringbuffer;
#endif
if (snoopfd) close(snoopfd); snoopfd = 0;
for (i = 0; i < config->num_radfds; i++)
if (radfds[i]) close(radfds[i]);
if (snoopfd) close(snoopfd); snoopfd = 0;
for (i = 0; i < config->num_radfds; i++)
if (radfds[i]) close(radfds[i]);
memset(&debug_flags, 0, sizeof(debug_flags));
debug_flags.critical = 1;
memset(&debug_flags, 0, sizeof(debug_flags));
debug_flags.critical = 1;
close(sockfd);
log(3, 0, 0, 0, "Closed CLI connection\n");
close(sockfd);
log(3, 0, 0, 0, "Closed CLI connection\n");
cli_print(cli, "%-10s %-8s %-10s %-8s", "Ethernet", "Bytes", "Packets", "Errors");
cli_print(cli, "%-10s %8lu %8lu %8lu", "RX",
cli_print(cli, "%-10s %-8s %-10s %-8s", "Ethernet", "Bytes", "Packets", "Errors");
cli_print(cli, "%-10s %8lu %8lu %8lu", "RX",
- GET_STAT(tap_rx_bytes),
- GET_STAT(tap_rx_packets),
- GET_STAT(tap_rx_errors));
+ GET_STAT(tun_rx_bytes),
+ GET_STAT(tun_rx_packets),
+ GET_STAT(tun_rx_errors));
cli_print(cli, "%-10s %8lu %8lu %8lu", "TX",
cli_print(cli, "%-10s %8lu %8lu %8lu", "TX",
- GET_STAT(tap_tx_bytes),
- GET_STAT(tap_tx_packets),
- GET_STAT(tap_tx_errors));
+ GET_STAT(tun_tx_bytes),
+ GET_STAT(tun_tx_packets),
+ GET_STAT(tun_tx_errors));
cli_print(cli, "");
cli_print(cli, "%-10s %-8s %-10s %-8s %-8s", "Tunnel", "Bytes", "Packets", "Errors", "Retries");
cli_print(cli, "");
cli_print(cli, "%-10s %-8s %-10s %-8s %-8s", "Tunnel", "Bytes", "Packets", "Errors", "Retries");
cli_print(cli, "%-30s%-10s", "Counter", "Value");
cli_print(cli, "-----------------------------------------");
cli_print(cli, "%-30s%lu", "radius_retries", GET_STAT(radius_retries));
cli_print(cli, "%-30s%-10s", "Counter", "Value");
cli_print(cli, "-----------------------------------------");
cli_print(cli, "%-30s%lu", "radius_retries", GET_STAT(radius_retries));
- cli_print(cli, "%-30s%lu", "arp_errors", GET_STAT(arp_errors));
- cli_print(cli, "%-30s%lu", "arp_replies", GET_STAT(arp_replies));
- cli_print(cli, "%-30s%lu", "arp_discarded", GET_STAT(arp_discarded));
cli_print(cli, "%-30s%lu", "arp_sent", GET_STAT(arp_sent));
cli_print(cli, "%-30s%lu", "arp_sent", GET_STAT(arp_sent));
cli_print(cli, "%-30s%lu", "packets_snooped", GET_STAT(packets_snooped));
cli_print(cli, "%-30s%lu", "tunnel_created", GET_STAT(tunnel_created));
cli_print(cli, "%-30s%lu", "session_created", GET_STAT(session_created));
cli_print(cli, "%-30s%lu", "packets_snooped", GET_STAT(packets_snooped));
cli_print(cli, "%-30s%lu", "tunnel_created", GET_STAT(tunnel_created));
cli_print(cli, "%-30s%lu", "session_created", GET_STAT(session_created));
#ifdef STATISTICS
cli_print(cli, "\n%-30s%-10s", "Counter", "Value");
cli_print(cli, "-----------------------------------------");
#ifdef STATISTICS
cli_print(cli, "\n%-30s%-10s", "Counter", "Value");
cli_print(cli, "-----------------------------------------");
- cli_print(cli, "%-30s%lu", "call_processtap", GET_STAT(call_processtap));
- cli_print(cli, "%-30s%lu", "call_processarp", GET_STAT(call_processarp));
+ cli_print(cli, "%-30s%lu", "call_processtun", GET_STAT(call_processtun));
cli_print(cli, "%-30s%lu", "call_processipout", GET_STAT(call_processipout));
cli_print(cli, "%-30s%lu", "call_processudp", GET_STAT(call_processudp));
cli_print(cli, "%-30s%lu", "call_processpap", GET_STAT(call_processpap));
cli_print(cli, "%-30s%lu", "call_processipout", GET_STAT(call_processipout));
cli_print(cli, "%-30s%lu", "call_processudp", GET_STAT(call_processudp));
cli_print(cli, "%-30s%lu", "call_processpap", GET_STAT(call_processpap));
int cmd_drop_tunnel(struct cli_def *cli, char *command, char **argv, int argc)
{
int i;
int cmd_drop_tunnel(struct cli_def *cli, char *command, char **argv, int argc)
{
int i;
- for (x = 0; x < MAXTUNNEL; x++)
- {
- if (!cli_tunnel_kill[x])
- {
- cli_tunnel_kill[x] = tid;
- cli_print(cli, "Tunnel %d shut down (%s)", tid, tunnel[tid].hostname);
- break;
- }
- }
+ cli_print(cli, "Tunnel %d shut down (%s)", t, tunnel[t].hostname);
+ cli_tunnel_actions[t].action |= CLI_TUN_KILL;
cli_print(cli, "Snooping user %s to %s:%d", argv[0], inet_toa(session[s].snoop_ip), session[s].snoop_port);
cli_print(cli, "Snooping user %s to %s:%d", argv[0], inet_toa(session[s].snoop_ip), session[s].snoop_port);
- if (!throttle_session(s, config->rl_rate))
- cli_print(cli, "Error throttling %s", argv[i]);
- else
- cli_print(cli, "Throttling user %s", argv[i]);
+
+ if (session[s].throttle)
+ {
+ cli_print(cli, "User %s already throttled", argv[i]);
+ continue;
+ }
+
+ cli_print(cli, "Throttling user %s", argv[i]);
+ cli_session_actions[s].throttle = config->rl_rate; // could be configurable at some stage
+ cli_session_actions[s].action |= CLI_SESS_THROTTLE;
- throttle_session(s, 0);
+
+ if (!session[s].throttle)
+ {
+ cli_print(cli, "User %s not throttled", argv[i]);
+ continue;
+ }