aboutsummaryrefslogtreecommitdiff
path: root/src/sg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sg.c')
-rw-r--r--src/sg.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/sg.c b/src/sg.c
index 8166f18..c8e6af1 100644
--- a/src/sg.c
+++ b/src/sg.c
@@ -22,13 +22,13 @@
struct groupkw groupkw[] = {
{ "GroupId", MAP_GROUPID },
{ "GroupName", MAP_GROUPNAME }
};
-static struct ec2_query *query;
+static struct ec2_request *request;
static char *command;
static int list_option;
static int dest_n = GROUP_ID;
static char *proto = "tcp";
static int rule_n = 1;
static char *user;
@@ -118,13 +118,13 @@ add_source_cidr(char *str, int i)
if (s) {
snprintf(cidrbuf, sizeof cidrbuf,
"%s/%s", s, masklen);
grecs_asprintf(&bufptr, &bufsize,
"IpPermissions.%d.IpRanges.%d.CidrIp",
rule_n, i);
- eclat_query_add_param(query, bufptr, cidrbuf);
+ eclat_request_add_param(request, bufptr, cidrbuf);
i++;
}
}
freeaddrinfo(res);
return i;
@@ -159,28 +159,28 @@ flush_rule()
{
int i;
struct grecs_list_entry *ep;
grecs_asprintf(&bufptr, &bufsize, "IpPermissions.%d.IpProtocol",
rule_n);
- eclat_query_add_param(query, bufptr, proto);
+ eclat_request_add_param(request, bufptr, proto);
if (group_list) {
for (i = 1, ep = group_list->head; ep; ep = ep->next, i++) {
struct group_arg *a = ep->data;
grecs_asprintf(&bufptr, &bufsize,
"IpPermissions.%d.Groups.%d.%s",
rule_n, i,
groupkw[a->type].resid);
- eclat_query_add_param(query, bufptr, a->str);
+ eclat_request_add_param(request, bufptr, a->str);
if (a->usr) {
grecs_asprintf(&bufptr, &bufsize,
"IpPermissions.%d.Groups.%d.UserId",
rule_n, i);
- eclat_query_add_param(query, bufptr, a->usr);
+ eclat_request_add_param(request, bufptr, a->usr);
}
}
grecs_list_clear(group_list);
}
if (source_list) {
int j = 1;
@@ -189,36 +189,36 @@ flush_rule()
j = add_source_cidr((char*) ep->data, j);
grecs_list_clear(source_list);
} else if (!group_list) {
grecs_asprintf(&bufptr, &bufsize,
"IpPermissions.%d.IpRanges.1.CidrIp",
rule_n);
- eclat_query_add_param(query, bufptr, "0.0.0.0/0");
+ eclat_request_add_param(request, bufptr, "0.0.0.0/0");
}
if (from_port) {
char *pbuf = NULL;
size_t psize = 0;
grecs_asprintf(&bufptr, &bufsize, "IpPermissions.%d.FromPort",
rule_n);
- eclat_query_add_param(query, bufptr,
+ eclat_request_add_param(request, bufptr,
str2port(from_port, &pbuf, &psize));
grecs_asprintf(&bufptr, &bufsize, "IpPermissions.%d.ToPort",
rule_n);
- eclat_query_add_param(query, bufptr,
+ eclat_request_add_param(request, bufptr,
str2port(to_port, &pbuf, &psize));
free(pbuf);
}
from_port = to_port = NULL;
++rule_n;
}
#include "sg-cl.h"
int
eclat_sg(eclat_command_env_t *env, int argc, char **argv)
{
- query = env->query;
+ request = env->request;
parse_options(env, argc, argv);
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.