diff options
Diffstat (limited to 'src/mvaddr.c')
-rw-r--r-- | src/mvaddr.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mvaddr.c b/src/mvaddr.c new file mode 100644 index 0000000..dbe9986 --- /dev/null +++ b/src/mvaddr.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* This file is part of Eclat. | ||
2 | Copyright (C) 2019 Sergey Poznyakoff. | ||
3 | |||
4 | Eclat is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation; either version 3, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | Eclat is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ | ||
16 | |||
17 | #include "eclat.h" | ||
18 | |||
19 | int | ||
20 | eclat_move_address(eclat_command_env_t *env, int argc, char **argv) | ||
21 | { | ||
22 | int i; | ||
23 | |||
24 | generic_proginfo->args_doc = "IP"; | ||
25 | generic_parse_options(env->cmd, | ||
26 | strcmp(env->cmd->tag, "MoveAddressToVpc") == 0 | ||
27 | ? "Move IP address from EC2-Classic to EC2-VPC" | ||
28 | : "Restore a VPC address back to EC2-Classic", | ||
29 | argc, argv, &i); | ||
30 | argc -= i; | ||
31 | argv += i; | ||
32 | |||
33 | if (argc != 1) | ||
34 | die(EX_USAGE, "wrong number of arguments to move-address-to-vpc"); | ||
35 | |||
36 | eclat_request_add_param(env->request, "PublicIp", argv[0]); | ||
37 | |||
38 | return 0; | ||
39 | } | ||