diff options
Diffstat (limited to 'src/sg-cl.opt')
-rw-r--r-- | src/sg-cl.opt | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/sg-cl.opt b/src/sg-cl.opt index 6b223b2..a54192a 100644 --- a/src/sg-cl.opt +++ b/src/sg-cl.opt @@ -14,20 +14,48 @@ You should have received a copy of the GNU General Public License along with Eclat. If not, see <http://www.gnu.org/licenses/>. */ +#define DIR_INGRESS 0 +#define DIR_EGRESS 1 + +static char const *authorize_comtab[] = { + "AuthorizeSecurityGroupIngress", + "AuthorizeSecurityGroupEgress" +}; +static char const *revoke_comtab[] = { + "RevokeSecurityGroupIngress", + "RevokeSecurityGroupEgress" +}; +static int direction = DIR_INGRESS; + ECLAT_CL_BEGIN([<modify ingress rules of a security group>], [<[GROUPARG]>]) +GROUP(Direction) +OPTION(input,I,, + [<input (ingress)>]) +ALIAS(ingress) +BEGIN + direction = DIR_INGRESS; +END + +OPTION(output,O,, + [<output (egress)>]) +ALIAS(egress) +BEGIN + direction = DIR_EGRESS; +END + GROUP(Commands) OPTION(add,A,, [<add rules>]) BEGIN - command = "AuthorizeSecurityGroupIngress"; + command = authorize_comtab[direction]; END OPTION(delete,D,, [<delete rules>]) BEGIN - command = "RevokeSecurityGroupIngress"; + command = revoke_comtab[direction]; END OPTION(list,L,, |