Lines Matching refs:sel
62 struct m_pedit_sel *sel, in pedit_parse_nopopt() argument
124 struct tc_pedit_sel *sel = &_sel->sel; in pack_key() local
126 int hwm = sel->nkeys; in pack_key()
136 sel->keys[hwm].val = tkey->val; in pack_key()
137 sel->keys[hwm].mask = tkey->mask; in pack_key()
138 sel->keys[hwm].off = tkey->off; in pack_key()
139 sel->keys[hwm].at = tkey->at; in pack_key()
140 sel->keys[hwm].offmask = tkey->offmask; in pack_key()
141 sel->keys[hwm].shift = tkey->shift; in pack_key()
155 sel->nkeys++; in pack_key()
159 int pack_key32(__u32 retain, struct m_pedit_sel *sel, in pack_key32() argument
170 return pack_key(sel, tkey); in pack_key32()
173 int pack_key16(__u32 retain, struct m_pedit_sel *sel, in pack_key16() argument
200 return pack_key(sel, tkey); in pack_key16()
204 int pack_key8(__u32 retain, struct m_pedit_sel *sel, struct m_pedit_key *tkey) in pack_key8() argument
226 return pack_key(sel, tkey); in pack_key8()
229 static int pack_mac(struct m_pedit_sel *sel, struct m_pedit_key *tkey, in pack_mac() argument
237 ret |= pack_key32(~0, sel, tkey); in pack_mac()
242 ret |= pack_key16(~0, sel, tkey); in pack_mac()
246 ret |= pack_key16(~0, sel, tkey); in pack_mac()
251 ret |= pack_key32(~0, sel, tkey); in pack_mac()
261 static int pack_ipv6(struct m_pedit_sel *sel, struct m_pedit_key *tkey, in pack_ipv6() argument
277 ret = pack_key32(~0, sel, tkey); in pack_ipv6()
334 struct m_pedit_sel *sel, struct m_pedit_key *tkey) in parse_cmd() argument
364 if (!sel->extended && tkey->cmd) { in parse_cmd()
398 res = pack_mac(sel, tkey, (__u8 *)val); in parse_cmd()
403 res = pack_ipv6(sel, tkey, val); in parse_cmd()
414 res = pack_key8(retain, sel, tkey); in parse_cmd()
418 res = pack_key16(retain, sel, tkey); in parse_cmd()
422 res = pack_key32(retain, sel, tkey); in parse_cmd()
437 int parse_offset(int *argc_p, char ***argv_p, struct m_pedit_sel *sel, in parse_offset() argument
506 res = parse_cmd(&argc, &argv, len, TU32, retain, sel, tkey); in parse_offset()
513 static int parse_munge(int *argc_p, char ***argv_p, struct m_pedit_sel *sel) in parse_munge() argument
525 res = parse_offset(&argc, &argv, sel, &tkey); in parse_munge()
538 res = p->parse_peopt(&argc, &argv, sel, &tkey); in parse_munge()
584 static int pedit_keys_ex_addattr(struct m_pedit_sel *sel, struct nlmsghdr *n) in pedit_keys_ex_addattr() argument
586 struct m_pedit_key_ex *k = sel->keys_ex; in pedit_keys_ex_addattr()
590 if (!sel->extended) in pedit_keys_ex_addattr()
595 for (i = 0; i < sel->sel.nkeys; i++) { in pedit_keys_ex_addattr()
619 struct m_pedit_sel sel = {}; in parse_pedit() local
640 sel.extended = true; in parse_pedit()
656 if (parse_munge(&argc, &argv, &sel)) { in parse_pedit()
674 parse_action_control_dflt(&argc, &argv, &sel.sel.action, false, TC_ACT_OK); in parse_pedit()
679 if (get_u32(&sel.sel.index, *argv, 10)) { in parse_pedit()
691 if (!sel.extended) { in parse_pedit()
692 addattr_l(n, MAX_MSG, TCA_PEDIT_PARMS, &sel, in parse_pedit()
693 sizeof(sel.sel) + in parse_pedit()
694 sel.sel.nkeys * sizeof(struct tc_pedit_key)); in parse_pedit()
696 addattr_l(n, MAX_MSG, TCA_PEDIT_PARMS_EX, &sel, in parse_pedit()
697 sizeof(sel.sel) + in parse_pedit()
698 sel.sel.nkeys * sizeof(struct tc_pedit_key)); in parse_pedit()
700 pedit_keys_ex_addattr(&sel, n); in parse_pedit()
737 struct tc_pedit_sel *sel; in print_pedit() local
752 sel = RTA_DATA(tb[TCA_PEDIT_PARMS]); in print_pedit()
756 sel = RTA_DATA(tb[TCA_PEDIT_PARMS_EX]); in print_pedit()
763 keys_ex = calloc(sel->nkeys, sizeof(*keys_ex)); in print_pedit()
770 sel->nkeys); in print_pedit()
780 print_action_control(f, "action ", sel->action, " "); in print_pedit()
781 fprintf(f,"keys %d\n ", sel->nkeys); in print_pedit()
782 fprintf(f, "\t index %u ref %d bind %d", sel->index, sel->refcnt, in print_pedit()
783 sel->bindcnt); in print_pedit()
792 if (sel->nkeys) { in print_pedit()
794 struct tc_pedit_key *key = sel->keys; in print_pedit()
797 for (i = 0; i < sel->nkeys; i++, key++) { in print_pedit()
821 fprintf(f, "\npedit %x keys %d is not LEGIT", sel->index, in print_pedit()
822 sel->nkeys); in print_pedit()