• Home
  • Raw
  • Download

Lines Matching refs:sel

119 static int pack_key(struct tc_u32_sel *sel, __u32 key, __u32 mask,  in pack_key()  argument
123 int hwm = sel->nkeys; in pack_key()
128 if (sel->keys[i].off == off && sel->keys[i].offmask == offmask) { in pack_key()
129 __u32 intersect = mask & sel->keys[i].mask; in pack_key()
131 if ((key ^ sel->keys[i].val) & intersect) in pack_key()
133 sel->keys[i].val |= key; in pack_key()
134 sel->keys[i].mask |= mask; in pack_key()
143 sel->keys[hwm].val = key; in pack_key()
144 sel->keys[hwm].mask = mask; in pack_key()
145 sel->keys[hwm].off = off; in pack_key()
146 sel->keys[hwm].offmask = offmask; in pack_key()
147 sel->nkeys++; in pack_key()
151 static int pack_key32(struct tc_u32_sel *sel, __u32 key, __u32 mask, in pack_key32() argument
156 return pack_key(sel, key, mask, off, offmask); in pack_key32()
159 static int pack_key16(struct tc_u32_sel *sel, __u32 key, __u32 mask, in pack_key16() argument
173 return pack_key(sel, key, mask, off, offmask); in pack_key16()
176 static int pack_key8(struct tc_u32_sel *sel, __u32 key, __u32 mask, int off, in pack_key8() argument
196 return pack_key(sel, key, mask, off, offmask); in pack_key8()
229 static int parse_u32(int *argc_p, char ***argv_p, struct tc_u32_sel *sel, in parse_u32() argument
255 res = pack_key32(sel, key, mask, off, offmask); in parse_u32()
261 static int parse_u16(int *argc_p, char ***argv_p, struct tc_u32_sel *sel, in parse_u16() argument
286 res = pack_key16(sel, key, mask, off, offmask); in parse_u16()
292 static int parse_u8(int *argc_p, char ***argv_p, struct tc_u32_sel *sel, in parse_u8() argument
321 res = pack_key8(sel, key, mask, off, offmask); in parse_u8()
327 static int parse_ip_addr(int *argc_p, char ***argv_p, struct tc_u32_sel *sel, in parse_ip_addr() argument
353 if (pack_key(sel, addr.data[0], mask, off, offmask) < 0) in parse_ip_addr()
363 struct tc_u32_sel *sel, int off) in parse_ip6_addr() argument
389 res = pack_key(sel, addr.data[i / 32], in parse_ip6_addr()
396 res = pack_key(sel, addr.data[i / 32], in parse_ip6_addr()
409 static int parse_ip6_class(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_ip6_class() argument
438 res = pack_key(sel, key, mask, off, offmask); in parse_ip6_class()
448 struct tc_u32_sel *sel, int off) in parse_ether_addr() argument
476 res = pack_key8(sel, addr[i], 0xFF, off + i, offmask); in parse_ether_addr()
486 static int parse_ip(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_ip() argument
497 res = parse_ip_addr(&argc, &argv, sel, 12); in parse_ip()
500 res = parse_ip_addr(&argc, &argv, sel, 16); in parse_ip()
505 res = parse_u8(&argc, &argv, sel, 1, 0); in parse_ip()
508 res = parse_u8(&argc, &argv, sel, 0, 0); in parse_ip()
511 res = parse_u8(&argc, &argv, sel, 9, 0); in parse_ip()
514 res = pack_key16(sel, 0, 0x3FFF, 6, 0); in parse_ip()
517 res = pack_key16(sel, 0x2000, 0x3FFF, 6, 0); in parse_ip()
520 res = pack_key16(sel, 0x4000, 0x4000, 6, 0); in parse_ip()
523 res = pack_key16(sel, 0x2000, 0x2000, 6, 0); in parse_ip()
526 res = parse_u16(&argc, &argv, sel, 22, 0); in parse_ip()
529 res = parse_u16(&argc, &argv, sel, 20, 0); in parse_ip()
532 res = parse_u8(&argc, &argv, sel, 20, 0); in parse_ip()
535 res = parse_u8(&argc, &argv, sel, 21, 0); in parse_ip()
544 static int parse_ip6(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_ip6() argument
555 res = parse_ip6_addr(&argc, &argv, sel, 8); in parse_ip6()
558 res = parse_ip6_addr(&argc, &argv, sel, 24); in parse_ip6()
561 res = parse_ip6_class(&argc, &argv, sel); in parse_ip6()
564 res = parse_u8(&argc, &argv, sel, 6, 0); in parse_ip6()
567 res = parse_u32(&argc, &argv, sel, 0, 0); in parse_ip6()
570 res = parse_u16(&argc, &argv, sel, 42, 0); in parse_ip6()
573 res = parse_u16(&argc, &argv, sel, 40, 0); in parse_ip6()
576 res = parse_u8(&argc, &argv, sel, 40, 0); in parse_ip6()
579 res = parse_u8(&argc, &argv, sel, 41, 1); in parse_ip6()
588 static int parse_ether(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_ether() argument
599 res = parse_ether_addr(&argc, &argv, sel, -8); in parse_ether()
602 res = parse_ether_addr(&argc, &argv, sel, -14); in parse_ether()
614 static int parse_udp(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_udp() argument
625 res = parse_u16(&argc, &argv, sel, 0, -1); in parse_udp()
628 res = parse_u16(&argc, &argv, sel, 2, -1); in parse_udp()
638 static int parse_icmp(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_icmp() argument
649 res = parse_u8(&argc, &argv, sel, 0, -1); in parse_icmp()
652 res = parse_u8(&argc, &argv, sel, 1, -1); in parse_icmp()
697 struct tc_u32_sel *sel, struct nlmsghdr *n) in parse_selector() argument
708 res = parse_u32(&argc, &argv, sel, 0, 0); in parse_selector()
711 res = parse_u16(&argc, &argv, sel, 0, 0); in parse_selector()
714 res = parse_u8(&argc, &argv, sel, 0, 0); in parse_selector()
717 res = parse_ip(&argc, &argv, sel); in parse_selector()
720 res = parse_ip6(&argc, &argv, sel); in parse_selector()
723 res = parse_udp(&argc, &argv, sel); in parse_selector()
726 res = parse_tcp(&argc, &argv, sel); in parse_selector()
729 res = parse_icmp(&argc, &argv, sel); in parse_selector()
735 res = parse_ether(&argc, &argv, sel); in parse_selector()
744 static int parse_offset(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_offset() argument
756 sel->off = off; in parse_offset()
757 sel->flags |= TC_U32_OFFSET; in parse_offset()
764 sel->offoff = off; in parse_offset()
769 sel->flags |= TC_U32_VAROFFSET; in parse_offset()
772 if (get_be16(&sel->offmask, *argv, 16)) in parse_offset()
774 sel->flags |= TC_U32_VAROFFSET; in parse_offset()
781 sel->offshift = shift; in parse_offset()
782 sel->flags |= TC_U32_VAROFFSET; in parse_offset()
784 sel->flags |= TC_U32_EAT; in parse_offset()
796 static int parse_hashkey(int *argc_p, char ***argv_p, struct tc_u32_sel *sel) in parse_hashkey() argument
804 if (get_be32(&sel->hmask, *argv, 16)) in parse_hashkey()
814 sel->hoff = num; in parse_hashkey()
988 struct tc_u32_sel sel; in u32_parse_opt() member
990 } sel = {}; in u32_parse_opt() local
1013 if (parse_selector(&argc, &argv, &sel.sel, n)) { in u32_parse_opt()
1021 if (parse_offset(&argc, &argv, &sel.sel)) { in u32_parse_opt()
1028 if (parse_hashkey(&argc, &argv, &sel.sel)) { in u32_parse_opt()
1043 sel.sel.flags |= TC_U32_TERMINAL; in u32_parse_opt()
1094 struct tc_u32_sel sel; in u32_parse_opt() member
1099 if (parse_selector(&argc, &argv, &sel2.sel, n)) { in u32_parse_opt()
1103 if (sel2.sel.nkeys != 1) { in u32_parse_opt()
1117 hash = sel2.sel.keys[0].val & sel2.sel.keys[0].mask; in u32_parse_opt()
1174 sel.sel.flags |= TC_U32_TERMINAL; in u32_parse_opt()
1188 addattr_l(n, MAX_MSG, TCA_U32_SEL, &sel, in u32_parse_opt()
1189 sizeof(sel.sel) + in u32_parse_opt()
1190 sel.sel.nkeys * sizeof(struct tc_u32_key)); in u32_parse_opt()
1209 struct tc_u32_sel *sel = NULL; in u32_print_opt() local
1226 if (RTA_PAYLOAD(tb[TCA_U32_SEL]) < sizeof(*sel)) in u32_print_opt()
1229 sel = RTA_DATA(tb[TCA_U32_SEL]); in u32_print_opt()
1246 !sel || !(sel->flags & TC_U32_TERMINAL) ? "*" : "", in u32_print_opt()
1249 } else if (sel && sel->flags & TC_U32_TERMINAL) { in u32_print_opt()
1281 if (sel && show_stats && NULL != pf) in u32_print_opt()
1297 if (sel) { in u32_print_opt()
1298 if (sel->nkeys) { in u32_print_opt()
1301 for (i = 0; i < sel->nkeys; i++) { in u32_print_opt()
1302 show_keys(f, sel->keys + i); in u32_print_opt()
1309 if (sel->flags & (TC_U32_VAROFFSET | TC_U32_OFFSET)) { in u32_print_opt()
1311 if (sel->flags & TC_U32_VAROFFSET) in u32_print_opt()
1313 ntohs(sel->offmask), in u32_print_opt()
1314 sel->offshift, sel->offoff); in u32_print_opt()
1315 if (sel->off) in u32_print_opt()
1316 fprintf(f, "plus %d ", sel->off); in u32_print_opt()
1318 if (sel->flags & TC_U32_EAT) in u32_print_opt()
1321 if (sel->hmask) { in u32_print_opt()
1323 (unsigned int)htonl(sel->hmask), sel->hoff); in u32_print_opt()