Lines Matching refs:tp
1313 struct table *tp; in find_router() local
1315 tp = table; in find_router()
1316 while (tp) { in find_router()
1317 if (tp->router.s_addr == addr.s_addr) in find_router()
1318 return (tp); in find_router()
1319 tp = tp->next; in find_router()
1326 struct table *tp; in max_preference() local
1329 tp = table; in max_preference()
1330 while (tp) { in max_preference()
1331 if (tp->preference > max) in max_preference()
1332 max = tp->preference; in max_preference()
1333 tp = tp->next; in max_preference()
1343 struct table **tpp, *tp; in age_table() local
1349 tp = *tpp; in age_table()
1350 tp->remaining_time -= time; in age_table()
1351 if (tp->remaining_time <= 0) { in age_table()
1352 *tpp = tp->next; in age_table()
1353 if (tp->in_kernel) in age_table()
1354 del_route(tp->router); in age_table()
1356 tp->preference == max) in age_table()
1358 free((char *)tp); in age_table()
1360 tpp = &tp->next; in age_table()
1367 tp = table; in age_table()
1368 while (tp) { in age_table()
1369 if (tp->preference == max && !tp->in_kernel) { in age_table()
1370 add_route(tp->router); in age_table()
1371 tp->in_kernel++; in age_table()
1373 tp = tp->next; in age_table()
1381 struct table **tpp, *tp; in discard_table() local
1385 tp = *tpp; in discard_table()
1386 *tpp = tp->next; in discard_table()
1387 if (tp->in_kernel) in discard_table()
1388 del_route(tp->router); in discard_table()
1389 free((char *)tp); in discard_table()
1397 struct table *tp; in record_router() local
1410 tp = find_router(router); in record_router()
1411 if (tp) { in record_router()
1412 if (tp->preference > preference && in record_router()
1413 tp->preference == old_max) in record_router()
1415 else if (preference > tp->preference) in record_router()
1417 tp->preference = preference; in record_router()
1418 tp->remaining_time = ttl; in record_router()
1422 tp = (struct table *)ALLIGN(malloc(sizeof(struct table))); in record_router()
1423 if (tp == NULL) { in record_router()
1427 tp->router = router; in record_router()
1428 tp->preference = preference; in record_router()
1429 tp->remaining_time = ttl; in record_router()
1430 tp->in_kernel = 0; in record_router()
1431 tp->next = table; in record_router()
1432 table = tp; in record_router()
1434 if (!tp->in_kernel && in record_router()
1435 (!best_preference || tp->preference == max_preference()) && in record_router()
1436 tp->preference != INELIGIBLE_PREF) { in record_router()
1437 add_route(tp->router); in record_router()
1438 tp->in_kernel++; in record_router()
1440 if (tp->preference == INELIGIBLE_PREF && tp->in_kernel) { in record_router()
1441 del_route(tp->router); in record_router()
1442 tp->in_kernel = 0; in record_router()
1448 tp = table; in record_router()
1449 while (tp) { in record_router()
1450 if (tp->preference == new_max && in record_router()
1451 !tp->in_kernel) { in record_router()
1452 add_route(tp->router); in record_router()
1453 tp->in_kernel++; in record_router()
1455 tp = tp->next; in record_router()
1462 tp = table; in record_router()
1463 while (tp) { in record_router()
1464 if (tp->preference < new_max && tp->in_kernel) { in record_router()
1465 del_route(tp->router); in record_router()
1466 tp->in_kernel = 0; in record_router()
1468 tp = tp->next; in record_router()