Lines Matching refs:tkey
62 pedit_parse_nopopt (int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) in pedit_parse_nopopt() argument
121 pack_key(struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) in pack_key() argument
128 if (tkey->off % 4) { in pack_key()
133 sel->keys[hwm].val = tkey->val; in pack_key()
134 sel->keys[hwm].mask = tkey->mask; in pack_key()
135 sel->keys[hwm].off = tkey->off; in pack_key()
136 sel->keys[hwm].at = tkey->at; in pack_key()
137 sel->keys[hwm].offmask = tkey->offmask; in pack_key()
138 sel->keys[hwm].shift = tkey->shift; in pack_key()
145 pack_key32(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) in pack_key32() argument
147 if (tkey->off > (tkey->off & ~3)) { in pack_key32()
153 tkey->val = htonl(tkey->val & retain); in pack_key32()
154 tkey->mask = htonl(tkey->mask | ~retain); in pack_key32()
156 tkey->off &= ~3; in pack_key32()
157 return pack_key(sel,tkey); in pack_key32()
161 pack_key16(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) in pack_key16() argument
166 if (tkey->val > 0xFFFF || tkey->mask > 0xFFFF) { in pack_key16()
171 ind = tkey->off & 3; in pack_key16()
179 tkey->val = htons(tkey->val); in pack_key16()
180 tkey->val <<= stride; in pack_key16()
181 tkey->mask <<= stride; in pack_key16()
183 tkey->mask = retain|m[ind]; in pack_key16()
185 tkey->off &= ~3; in pack_key16()
188 printf("pack_key16: Final val %08x mask %08x \n",tkey->val,tkey->mask); in pack_key16()
189 return pack_key(sel,tkey); in pack_key16()
194 pack_key8(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) in pack_key8() argument
199 if (tkey->val > 0xFF || tkey->mask > 0xFF) { in pack_key8()
200 fprintf(stderr, "pack_key8 bad value (val %x mask %x\n", tkey->val, tkey->mask); in pack_key8()
204 ind = tkey->off & 3; in pack_key8()
207 tkey->val <<= stride; in pack_key8()
208 tkey->mask <<= stride; in pack_key8()
210 tkey->mask = retain|m[ind]; in pack_key8()
212 tkey->off &= ~3; in pack_key8()
215 printf("pack_key8: Final word off %d val %08x mask %08x \n",tkey->off , tkey->val,tkey->mask); in pack_key8()
216 return pack_key(sel,tkey); in pack_key8()
251 …har ***argv_p, __u32 len, int type,__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) in parse_cmd() argument
263 printf("parse_cmd argc %d %s offset %d length %d\n",argc,*argv,tkey->off,len); in parse_cmd()
292 tkey->val = val; in parse_cmd()
295 tkey->mask = 0xFF; in parse_cmd()
296 res = pack_key8(retain,sel,tkey); in parse_cmd()
300 tkey->mask = mask; in parse_cmd()
301 res = pack_key16(retain,sel,tkey); in parse_cmd()
305 tkey->mask = mask; in parse_cmd()
306 res = pack_key32(retain,sel,tkey); in parse_cmd()
313 printf("parse_cmd done argc %d %s offset %d length %d\n",argc,*argv,tkey->off,len); in parse_cmd()
321 parse_offset(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) in parse_offset() argument
334 tkey->off = off; in parse_offset()
373 tkey->at = atv; in parse_offset()
379 tkey->offmask = offmask; in parse_offset()
385 tkey->shift = shift; in parse_offset()
390 res = parse_cmd(&argc, &argv, len, TU32,retain,sel,tkey); in parse_offset()
400 struct tc_pedit_key tkey; in parse_munge() local
408 memset(&tkey, 0, sizeof(tkey)); in parse_munge()
412 res = parse_offset(&argc, &argv,sel,&tkey); in parse_munge()
424 res = p->parse_peopt(&argc, &argv, sel,&tkey); in parse_munge()