X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tc%2Fm_mirred.c;h=226df4d29281154ca0a14cc6208c38681bddfcdc;hb=7132284647c15ca30d942926bc506d6019d3b61c;hp=cbfea841ef8545e7628434f27e866f55945bf842;hpb=105da95218c9d30375efc43f9edd8ef32998fedb;p=iproute2.git diff --git a/tc/m_mirred.c b/tc/m_mirred.c index cbfea84..226df4d 100644 --- a/tc/m_mirred.c +++ b/tc/m_mirred.c @@ -1,13 +1,13 @@ /* - * 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 * */ @@ -33,13 +33,19 @@ explain(void) { fprintf(stderr, "Usage: mirred [index INDEX] \n"); fprintf(stderr, "where: \n"); - fprintf(stderr, "DIRECTION := \n"); - fprintf(stderr, "aCTION := \n"); - fprintf(stderr, " : INDEX is the specific policy instance id\n"); - fprintf(stderr, " : DEVICENAME is the devicename \n"); + fprintf(stderr, "\tDIRECTION := \n"); + fprintf(stderr, "\tACTION := \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) { @@ -133,7 +139,6 @@ parse_egress(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, str } if (!ok && !iok) { - explain(); return -1; } @@ -235,13 +240,14 @@ parse_mirred(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, str } 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