Home | History | Annotate | Download | only in tc

Lines Matching refs:tkey

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