Lines Matching refs:tkey
62 pedit_parse_nopopt (int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
122 pack_key(struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
129 if (tkey->off % 4) {
134 sel->keys[hwm].val = tkey->val;
135 sel->keys[hwm].mask = tkey->mask;
136 sel->keys[hwm].off = tkey->off;
137 sel->keys[hwm].at = tkey->at;
138 sel->keys[hwm].offmask = tkey->offmask;
139 sel->keys[hwm].shift = tkey->shift;
146 pack_key32(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
148 if (tkey->off > (tkey->off & ~3)) {
154 tkey->val = htonl(tkey->val & retain);
155 tkey->mask = htonl(tkey->mask | ~retain);
157 tkey->off &= ~3;
158 return pack_key(sel,tkey);
162 pack_key16(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
167 if (0 > tkey->off) {
168 ind = tkey->off + 1;
172 ind = tkey->off;
175 if (tkey->val > 0xFFFF || tkey->mask > 0xFFFF) {
180 ind = tkey->off & 3;
188 tkey->val = htons(tkey->val);
190 tkey->val <<= stride;
191 tkey->mask <<= stride;
194 tkey->mask = retain|m[ind];
196 tkey->off &= ~3;
199 printf("pack_key16: Final val %08x mask %08x \n",tkey->val,tkey->mask);
200 return pack_key(sel,tkey);
205 pack_key8(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
210 if (0 > tkey->off) {
211 ind = tkey->off + 1;
215 ind = tkey->off;
218 if (tkey->val > 0xFF || tkey->mask > 0xFF) {
219 fprintf(stderr, "pack_key8 bad value (val %x mask %x\n", tkey->val, tkey->mask);
223 ind = tkey->off & 3;
225 tkey->val <<= stride;
226 tkey->mask <<= stride;
228 tkey->mask = retain|m[ind];
229 tkey->off &= ~3;
232 printf("pack_key8: Final word off %d val %08x mask %08x \n",tkey->off , tkey->val,tkey->mask);
233 return pack_key(sel,tkey);
268 parse_cmd(int *argc_p, char ***argv_p, __u32 len, int type,__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
280 printf("parse_cmd argc %d %s offset %d length %d\n",argc,*argv,tkey->off,len);
309 tkey->val = val;
312 tkey->mask = 0xFF;
313 res = pack_key8(retain,sel,tkey);
317 tkey->mask = mask;
318 res = pack_key16(retain,sel,tkey);
322 tkey->mask = mask;
323 res = pack_key32(retain,sel,tkey);
330 printf("parse_cmd done argc %d %s offset %d length %d\n",argc,*argv,tkey->off,len);
338 parse_offset(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
351 tkey->off = off;
390 tkey->at = atv;
396 tkey->offmask = offmask;
402 tkey->shift = shift;
407 res = parse_cmd(&argc, &argv, len, TU32,retain,sel,tkey);
417 struct tc_pedit_key tkey;
425 memset(&tkey, 0, sizeof(tkey));
429 res = parse_offset(&argc, &argv,sel,&tkey);
441 res = p->parse_peopt(&argc, &argv, sel,&tkey);