/*
- * m_egress.c ingress/egress packet mirror/redir actions module
+ * m_egress.c ingress/egress packet mirror/redir actions module
*
* This program is free software; you can distribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Authors: J Hadi Salim (hadi@cyberus.ca)
- *
+ * Authors: J Hadi Salim (hadi@cyberus.ca)
+ *
* TODO: Add Ingress support
*
*/
{
fprintf(stderr, "Usage: mirred <DIRECTION> <ACTION> [index INDEX] <dev DEVICENAME> \n");
fprintf(stderr, "where: \n");
- fprintf(stderr, "DIRECTION := <ingress | egress>\n");
- fprintf(stderr, "aCTION := <mirror | redirect>\n");
- fprintf(stderr, " : INDEX is the specific policy instance id\n");
- fprintf(stderr, " : DEVICENAME is the devicename \n");
+ fprintf(stderr, "\tDIRECTION := <ingress | egress>\n");
+ fprintf(stderr, "\tACTION := <mirror | redirect>\n");
+ fprintf(stderr, "\tINDEX is the specific policy instance id\n");
+ fprintf(stderr, "\tDEVICENAME is the devicename \n");
+
}
-#define usage() return(-1)
+static void
+usage(void)
+{
+ explain();
+ exit(-1);
+}
char *mirred_n2a(int action)
{
}
if (!ok && !iok) {
- explain();
return -1;
}
} else if (matches(*argv, "ingress") == 0) {
fprintf(stderr,"mirred ingress not supported at the moment\n");
-
+ } else if (matches(*argv, "help") == 0) {
+ usage();
} else {
- fprintf(stderr,"mirred not supported %s\n", *argv);
+ fprintf(stderr,"mirred option not supported %s\n", *argv);
}
return -1;
-
+
}
int