• Home
  • Raw
  • Download

Lines Matching refs:sel

117 static int pack_key(struct tc_u32_sel *sel, __u32 key, __u32 mask,  in pack_key()  argument
121 int hwm = sel->nkeys; in pack_key()
126 if (sel->keys[i].off == off && sel->keys[i].offmask == offmask) { in pack_key()
127 __u32 intersect = mask&sel->keys[i].mask; in pack_key()
129 if ((key^sel->keys[i].val) & intersect) in pack_key()
131 sel->keys[i].val |= key; in pack_key()
132 sel->keys[i].mask |= mask; in pack_key()
141 sel->keys[hwm].val = key; in pack_key()
142 sel->keys[hwm].mask = mask; in pack_key()
143 sel->keys[hwm].off = off; in pack_key()
144 sel->keys[hwm].offmask = offmask; in pack_key()
145 sel->nkeys++; in pack_key()
149 static int pack_key32(struct tc_u32_sel *sel, __u32 key, __u32 mask, in pack_key32() argument
154 return pack_key(sel, key, mask, off, offmask); in pack_key32()
157 static int pack_key16(struct tc_u32_sel *sel, __u32 key, __u32 mask, in pack_key16() argument
171 return pack_key(sel, key, mask, off, offmask); in pack_key16()
174 static int pack_key8(struct tc_u32_sel *sel, __u32 key, __u32 mask, int off, int offmask) in pack_key8() argument
193 return pack_key(sel, key, mask, off, offmask); in pack_key8()
226 static int parse_u32(int *argc_p, char ***argv_p, struct tc_u32_sel *sel, in parse_u32() argument
252 res = pack_key32(sel, key, mask, off, offmask); in parse_u32()
258 static int parse_u16(int *argc_p, char ***argv_p, struct tc_u32_sel *sel, in parse_u16() argument
283 res = pack_key16(sel, key, mask, off, offmask); in parse_u16()
289 static int parse_u8(int *argc_p, char ***argv_p, struct tc_u32_sel *sel, in parse_u8() argument
318 res = pack_key8(sel, key, mask, off, offmask); in parse_u8()
324 static int parse_ip_addr(int *argc_p, char ***argv_p, struct tc_u32_sel *sel, in parse_ip_addr() argument
350 if (pack_key(sel, addr.data[0], mask, off, offmask) < 0) in parse_ip_addr()
360 struct tc_u32_sel *sel, int off) in parse_ip6_addr() argument
387 res = pack_key(sel, addr.data[i/32], in parse_ip6_addr()
393 res = pack_key(sel, addr.data[i/32], in parse_ip6_addr()
406 static int parse_ip6_class(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_ip6_class() argument
435 res = pack_key(sel, key, mask, off, offmask); in parse_ip6_class()
445 struct tc_u32_sel *sel, int off) in parse_ether_addr() argument
473 res = pack_key8(sel, addr[i], 0xFF, off + i, offmask); in parse_ether_addr()
483 static int parse_ip(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_ip() argument
494 res = parse_ip_addr(&argc, &argv, sel, 12); in parse_ip()
497 res = parse_ip_addr(&argc, &argv, sel, 16); in parse_ip()
501 res = parse_u8(&argc, &argv, sel, 1, 0); in parse_ip()
504 res = parse_u8(&argc, &argv, sel, 0, 0); in parse_ip()
507 res = parse_u8(&argc, &argv, sel, 9, 0); in parse_ip()
510 res = parse_u8(&argc, &argv, sel, 1, 0); in parse_ip()
513 res = pack_key16(sel, 0, 0x3FFF, 6, 0); in parse_ip()
516 res = pack_key16(sel, 0, 0x1FFF, 6, 0); in parse_ip()
519 res = pack_key16(sel, 0x4000, 0x4000, 6, 0); in parse_ip()
522 res = pack_key16(sel, 0x2000, 0x2000, 6, 0); in parse_ip()
525 res = parse_u16(&argc, &argv, sel, 22, 0); in parse_ip()
528 res = parse_u16(&argc, &argv, sel, 20, 0); in parse_ip()
531 res = parse_u8(&argc, &argv, sel, 20, 0); in parse_ip()
534 res = parse_u8(&argc, &argv, sel, 20, 1); in parse_ip()
543 static int parse_ip6(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_ip6() argument
554 res = parse_ip6_addr(&argc, &argv, sel, 8); in parse_ip6()
557 res = parse_ip6_addr(&argc, &argv, sel, 24); in parse_ip6()
560 res = parse_ip6_class(&argc, &argv, sel); in parse_ip6()
563 res = parse_u8(&argc, &argv, sel, 6, 0); in parse_ip6()
566 res = parse_u32(&argc, &argv, sel, 0, 0); in parse_ip6()
569 res = parse_u16(&argc, &argv, sel, 42, 0); in parse_ip6()
572 res = parse_u16(&argc, &argv, sel, 40, 0); in parse_ip6()
575 res = parse_u8(&argc, &argv, sel, 40, 0); in parse_ip6()
578 res = parse_u8(&argc, &argv, sel, 41, 1); in parse_ip6()
587 static int parse_ether(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_ether() argument
598 res = parse_ether_addr(&argc, &argv, sel, -8); in parse_ether()
601 res = parse_ether_addr(&argc, &argv, sel, -14); in parse_ether()
613 static int parse_udp(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_udp() argument
624 res = parse_u16(&argc, &argv, sel, 0, -1); in parse_udp()
627 res = parse_u16(&argc, &argv, sel, 2, -1); in parse_udp()
637 static int parse_icmp(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_icmp() argument
648 res = parse_u8(&argc, &argv, sel, 0, -1); in parse_icmp()
651 res = parse_u8(&argc, &argv, sel, 1, -1); in parse_icmp()
696 struct tc_u32_sel *sel, struct nlmsghdr *n) in parse_selector() argument
707 res = parse_u32(&argc, &argv, sel, 0, 0); in parse_selector()
710 res = parse_u16(&argc, &argv, sel, 0, 0); in parse_selector()
713 res = parse_u8(&argc, &argv, sel, 0, 0); in parse_selector()
716 res = parse_ip(&argc, &argv, sel); in parse_selector()
719 res = parse_ip6(&argc, &argv, sel); in parse_selector()
722 res = parse_udp(&argc, &argv, sel); in parse_selector()
725 res = parse_tcp(&argc, &argv, sel); in parse_selector()
728 res = parse_icmp(&argc, &argv, sel); in parse_selector()
734 res = parse_ether(&argc, &argv, sel); in parse_selector()
743 static int parse_offset(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_offset() argument
754 sel->off = off; in parse_offset()
755 sel->flags |= TC_U32_OFFSET; in parse_offset()
761 sel->offoff = off; in parse_offset()
766 sel->flags |= TC_U32_VAROFFSET; in parse_offset()
772 sel->offmask = htons(mask); in parse_offset()
773 sel->flags |= TC_U32_VAROFFSET; in parse_offset()
779 sel->offshift = shift; in parse_offset()
780 sel->flags |= TC_U32_VAROFFSET; in parse_offset()
782 sel->flags |= TC_U32_EAT; in parse_offset()
794 static int parse_hashkey(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_hashkey() argument
805 sel->hmask = htonl(mask); in parse_hashkey()
813 sel->hoff = num; in parse_hashkey()
979 struct tc_u32_sel sel; in u32_parse_opt() member
981 } sel; in u32_parse_opt() local
989 memset(&sel, 0, sizeof(sel)); in u32_parse_opt()
1005 if (parse_selector(&argc, &argv, &sel.sel, n)) { in u32_parse_opt()
1013 if (parse_offset(&argc, &argv, &sel.sel)) { in u32_parse_opt()
1020 if (parse_hashkey(&argc, &argv, &sel.sel)) { in u32_parse_opt()
1034 sel.sel.flags |= TC_U32_TERMINAL; in u32_parse_opt()
1083 struct tc_u32_sel sel; in u32_parse_opt() member
1088 if (parse_selector(&argc, &argv, &sel2.sel, n)) { in u32_parse_opt()
1092 if (sel2.sel.nkeys != 1) { in u32_parse_opt()
1106 hash = sel2.sel.keys[0].val&sel2.sel.keys[0].mask; in u32_parse_opt()
1154 sel.sel.flags |= TC_U32_TERMINAL; in u32_parse_opt()
1167 addattr_l(n, MAX_MSG, TCA_U32_SEL, &sel, in u32_parse_opt()
1168 sizeof(sel.sel)+sel.sel.nkeys*sizeof(struct tc_u32_key)); in u32_parse_opt()
1177 struct tc_u32_sel *sel = NULL; in u32_print_opt() local
1194 if (RTA_PAYLOAD(tb[TCA_U32_SEL]) < sizeof(*sel)) in u32_print_opt()
1197 sel = RTA_DATA(tb[TCA_U32_SEL]); in u32_print_opt()
1212 !sel || !(sel->flags&TC_U32_TERMINAL) ? "*" : "", in u32_print_opt()
1214 } else if (sel && sel->flags&TC_U32_TERMINAL) { in u32_print_opt()
1231 if (sel && show_stats && NULL != pf) in u32_print_opt()
1246 if (sel) { in u32_print_opt()
1247 if (sel->nkeys) { in u32_print_opt()
1249 for (i=0; i<sel->nkeys; i++) { in u32_print_opt()
1250 show_keys(f, sel->keys + i); in u32_print_opt()
1257 if (sel->flags&(TC_U32_VAROFFSET|TC_U32_OFFSET)) { in u32_print_opt()
1259 if (sel->flags&TC_U32_VAROFFSET) in u32_print_opt()
1261 ntohs(sel->offmask), in u32_print_opt()
1262 sel->offshift, sel->offoff); in u32_print_opt()
1263 if (sel->off) in u32_print_opt()
1264 fprintf(f, "plus %d ", sel->off); in u32_print_opt()
1266 if (sel->flags&TC_U32_EAT) in u32_print_opt()
1269 if (sel->hmask) { in u32_print_opt()
1271 (unsigned int)htonl(sel->hmask), sel->hoff); in u32_print_opt()