Expose the filter protocol

makes protocol accessible ..

cheers,
jamal

[PATCH 2/3] [TC/FILTERS] Expose the filter protocol

Expose the filter protocol so it can be used by underlying
classifiers when they need it.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
This commit is contained in:
jamal 2008-04-20 10:47:48 -04:00 committed by Stephen Hemminger
parent 44dcfe8201
commit eefcbc7206
2 changed files with 6 additions and 4 deletions

View File

@ -175,6 +175,7 @@ static __u32 filter_parent;
static int filter_ifindex; static int filter_ifindex;
static __u32 filter_prio; static __u32 filter_prio;
static __u32 filter_protocol; static __u32 filter_protocol;
__u16 f_proto = 0;
int print_filter(const struct sockaddr_nl *who, int print_filter(const struct sockaddr_nl *who,
struct nlmsghdr *n, struct nlmsghdr *n,
@ -221,13 +222,13 @@ int print_filter(const struct sockaddr_nl *who,
} }
} }
if (t->tcm_info) { if (t->tcm_info) {
__u32 protocol = TC_H_MIN(t->tcm_info); f_proto = TC_H_MIN(t->tcm_info);
__u32 prio = TC_H_MAJ(t->tcm_info)>>16; __u32 prio = TC_H_MAJ(t->tcm_info)>>16;
if (!filter_protocol || filter_protocol != protocol) { if (!filter_protocol || filter_protocol != f_proto) {
if (protocol) { if (f_proto) {
SPRINT_BUF(b1); SPRINT_BUF(b1);
fprintf(fp, "protocol %s ", fprintf(fp, "protocol %s ",
ll_proto_n2a(protocol, b1, sizeof(b1))); ll_proto_n2a(f_proto, b1, sizeof(b1)));
} }
} }
if (!filter_prio || filter_prio != prio) { if (!filter_prio || filter_prio != prio) {

View File

@ -19,6 +19,7 @@ struct qdisc_util
int (*print_copt)(struct qdisc_util *qu, FILE *f, struct rtattr *opt); int (*print_copt)(struct qdisc_util *qu, FILE *f, struct rtattr *opt);
}; };
extern __u16 f_proto;
struct filter_util struct filter_util
{ {
struct filter_util *next; struct filter_util *next;