// vim: sw=8 ts=8
char const *cvs_name = "$Name: $";
-char const *cvs_id_cli = "$Id: cli.c,v 1.18 2004/10/28 03:31:11 bodea Exp $";
+char const *cvs_id_cli = "$Id: cli.c,v 1.19 2004/10/30 07:35:31 bodea Exp $";
#include <stdio.h>
#include <stdarg.h>
"IP",
"State",
"Sessions");
+
for (i = 1; i < MAXTUNNEL; i++)
{
int sessions = 0;
states[tunnel[i].state],
sessions);
}
+
return CLI_OK;
}
}
if (sargc > 0)
- return cmd_show_session(cli, "users", sargv, sargc);
+ return cmd_show_session(cli, "users", sargv, sargc);
return CLI_OK;
}
cli_print(cli, "Plugins currently loaded:");
for (i = 0; i < MAXPLUGINS; i++)
- {
if (*config->plugins[i])
- {
cli_print(cli, " %s", config->plugins[i]);
- }
- }
+
return CLI_OK;
}
session[i].tbf_in,
session[i].tbf_out);
}
+
return CLI_OK;
}
if (argc < 3)
{
- cli_print(cli, "Specify username ip port");
+ cli_print(cli, "Specify username, ip and port");
return CLI_OK;
}
if (CLI_HELP_REQUESTED)
return cli_arg_help(cli, argc > 1,
- "USER", "Username of session to un-snoop", NULL);
+ "USER", "Username of session to unsnoop", NULL);
if (!config->cluster_iam_master)
{
if (!argc)
{
- cli_print(cli, "Specify a user");
+ cli_print(cli, "Specify a user to unsnoop");
return CLI_OK;
}
cli_print(cli, "Not snooping user %s", argv[i]);
cli_session_actions[s].action |= CLI_SESS_NOSNOOP;
}
+
return CLI_OK;
}
if (argc == 0)
{
- cli_print(cli, "You must specify at least a username");
+ cli_print(cli, "Specify a user to throttle");
return CLI_OK;
}
if (CLI_HELP_REQUESTED)
return cli_arg_help(cli, argc > 1,
- "USER", "Username of session to un-throttle", NULL);
+ "USER", "Username of session to unthrottle", NULL);
if (!config->cluster_iam_master)
{
if (!argc)
{
- cli_print(cli, "Specify a user");
+ cli_print(cli, "Specify a user to unthrottle");
return CLI_OK;
}
#include "plugin.h"
#include "control.h"
-char const *cvs_id = "$Id: garden.c,v 1.7 2004/06/28 02:43:13 fred_nerk Exp $";
+char const *cvs_id = "$Id: garden.c,v 1.8 2004/10/30 07:35:31 bodea Exp $";
int __plugin_api_version = 1;
static struct pluginfuncs *p = 0;
static int iam_master = 0; // We're all slaves! Slaves I tell you!
char *up_commands[] = {
- "iptables -t nat -N garden >/dev/null 2>&1", // Create a chain that all gardened users will go through
+ "iptables -t nat -N garden >/dev/null 2>&1", // Create a chain that all gardened users will go through
"iptables -t nat -F garden",
- ". " PLUGINCONF "/build-garden", // Populate with site-specific DNAT rules
- "iptables -t nat -N garden_users >/dev/null 2>&1",// Empty chain, users added/removed by garden_session
+ ". " PLUGINCONF "/build-garden", // Populate with site-specific DNAT rules
+ "iptables -t nat -N garden_users >/dev/null 2>&1", // Empty chain, users added/removed by garden_session
"iptables -t nat -F garden_users",
- "iptables -t nat -A PREROUTING -j garden_users", // DNAT any users on the garden_users chain
+ "iptables -t nat -A PREROUTING -j garden_users", // DNAT any users on the garden_users chain
"sysctl -w net.ipv4.ip_conntrack_max=256000 >/dev/null", // lots of entries
NULL,
};
if (flag == 1)
{
p->log(2, 0, 0, s->tunnel, "Garden user %s (%s)\n", s->user, p->inet_toa(htonl(s->ip)));
- snprintf(cmd, 2048, "iptables -t nat -A garden_users -s %s -j garden", p->inet_toa(htonl(s->ip)));
+ snprintf(cmd, sizeof(cmd), "iptables -t nat -A garden_users -s %s -j garden", p->inet_toa(htonl(s->ip)));
p->log(3, 0, 0, s->tunnel, "%s\n", cmd);
system(cmd);
s->walled_garden = 1;
s->cin = s->cout = 0;
s->pin = s->pout = 0;
- snprintf(cmd, 2048, "iptables -t nat -D garden_users -s %s -j garden", p->inet_toa(htonl(s->ip)));
+ snprintf(cmd, sizeof(cmd), "iptables -t nat -D garden_users -s %s -j garden", p->inet_toa(htonl(s->ip)));
p->log(3, 0, 0, s->tunnel, "%s\n", cmd);
while (--count)
{