Lines Matching refs:tb
87 int tb;
123 struct rtattr * tb[RTA_MAX+1];
157 parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len);
158 table = rtm_get_table(r, tb);
168 if (filter.tb) {
171 if (filter.tb == RT_TABLE_LOCAL) {
174 } else if (filter.tb == RT_TABLE_MAIN) {
186 if (filter.tb > 0 && filter.tb != table)
218 if (tb[RTA_DST])
219 memcpy(&dst.data, RTA_DATA(tb[RTA_DST]), (r->rtm_dst_len+7)/8);
223 if (tb[RTA_SRC])
224 memcpy(&src.data, RTA_DATA(tb[RTA_SRC]), (r->rtm_src_len+7)/8);
229 if (tb[RTA_GATEWAY])
230 memcpy(&via.data, RTA_DATA(tb[RTA_GATEWAY]), host_len/8);
235 if (tb[RTA_PREFSRC])
236 memcpy(&prefsrc.data, RTA_DATA(tb[RTA_PREFSRC]), host_len/8);
257 if (tb[RTA_FLOW])
258 realms = *(__u32*)RTA_DATA(tb[RTA_FLOW]);
264 if (tb[RTA_IIF])
265 iif = *(int*)RTA_DATA(tb[RTA_IIF]);
271 if (tb[RTA_OIF])
272 oif = *(int*)RTA_DATA(tb[RTA_OIF]);
280 tb[RTA_PRIORITY] &&
281 *(int*)RTA_DATA(tb[RTA_PRIORITY]) == -1)
306 if (tb[RTA_DST]) {
309 RTA_PAYLOAD(tb[RTA_DST]),
310 RTA_DATA(tb[RTA_DST]),
316 RTA_PAYLOAD(tb[RTA_DST]),
317 RTA_DATA(tb[RTA_DST]),
326 if (tb[RTA_SRC]) {
329 RTA_PAYLOAD(tb[RTA_SRC]),
330 RTA_DATA(tb[RTA_SRC]),
336 RTA_PAYLOAD(tb[RTA_SRC]),
337 RTA_DATA(tb[RTA_SRC]),
349 if (tb[RTA_GATEWAY] && filter.rvia.bitlen != host_len) {
352 RTA_PAYLOAD(tb[RTA_GATEWAY]),
353 RTA_DATA(tb[RTA_GATEWAY]),
356 if (tb[RTA_OIF] && filter.oifmask != -1)
357 fprintf(fp, "dev %s ", ll_index_to_name(*(int*)RTA_DATA(tb[RTA_OIF])));
360 if (table != RT_TABLE_MAIN && !filter.tb)
367 if (tb[RTA_PREFSRC] && filter.rprefsrc.bitlen != host_len) {
373 RTA_PAYLOAD(tb[RTA_PREFSRC]),
374 RTA_DATA(tb[RTA_PREFSRC]),
377 if (tb[RTA_PRIORITY])
378 fprintf(fp, " metric %d ", *(__u32*)RTA_DATA(tb[RTA_PRIORITY]));
390 if (tb[RTA_FLOW] && filter.realmmask != ~0U) {
391 __u32 to = *(__u32*)RTA_DATA(tb[RTA_FLOW]);
431 if (tb[RTA_CACHEINFO]) {
432 struct rta_cacheinfo *ci = RTA_DATA(tb[RTA_CACHEINFO]);
456 if (tb[RTA_CACHEINFO])
457 ci = RTA_DATA(tb[RTA_CACHEINFO]);
480 if (tb[RTA_METRICS]) {
485 parse_rtattr(mxrta, RTAX_MAX, RTA_DATA(tb[RTA_METRICS]),
486 RTA_PAYLOAD(tb[RTA_METRICS]));
533 if (tb[RTA_IIF] && filter.iifmask != -1) {
534 fprintf(fp, " iif %s", ll_index_to_name(*(int*)RTA_DATA(tb[RTA_IIF])));
536 if (tb[RTA_MULTIPATH]) {
537 struct rtnexthop *nh = RTA_DATA(tb[RTA_MULTIPATH]);
540 len = RTA_PAYLOAD(tb[RTA_MULTIPATH]);
555 parse_rtattr(tb, RTA_MAX, RTNH_DATA(nh), nh->rtnh_len - sizeof(*nh));
556 if (tb[RTA_GATEWAY]) {
559 tb[RTA_GATEWAY]),
560 RTA_DATA(tb[RTA_GATEWAY]),
563 if (tb[RTA_FLOW]) {
564 __u32 to = *(__u32*)RTA_DATA(tb[RTA_FLOW]);
1049 filter.tb = RT_TABLE_MAIN;
1062 filter.tb = 0;
1071 filter.tb = tid;
1175 if (do_ipv6 == AF_UNSPEC && filter.tb)
1389 struct rtattr * tb[RTA_MAX+1];
1406 parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len);
1408 if (tb[RTA_PREFSRC]) {
1409 tb[RTA_PREFSRC]->rta_type = RTA_SRC;
1410 r->rtm_src_len = 8*RTA_PAYLOAD(tb[RTA_PREFSRC]);
1411 } else if (!tb[RTA_SRC]) {
1415 if (!odev && tb[RTA_OIF])
1416 tb[RTA_OIF]->rta_type = 0;
1417 if (tb[RTA_GATEWAY])
1418 tb[RTA_GATEWAY]->rta_type = 0;
1419 if (!idev && tb[RTA_IIF])
1420 tb[RTA_IIF]->rta_type = 0;