Lines Matching refs:rt

366           struct mfc *rt;  in mfc_find()  local
368 LIST_FOREACH(rt, &mfchashtbl[MFCHASH(*o, *g)], mfc_hash) { in mfc_find()
369 if (in_hosteq(rt->mfc_origin, *o) && in mfc_find()
370 in_hosteq(rt->mfc_mcastgrp, *g) && in mfc_find()
371 (rt->mfc_stall == NULL)) in mfc_find()
375 return rt; in mfc_find()
545 struct mfc *rt; in get_sg_cnt() local
548 rt = mfc_find(&req->src, &req->grp); in get_sg_cnt()
549 if (rt == NULL) { in get_sg_cnt()
554 req->pktcnt = rt->mfc_pkt_cnt; in get_sg_cnt()
555 req->bytecnt = rt->mfc_byte_cnt; in get_sg_cnt()
556 req->wrong_if = rt->mfc_wrong_if; in get_sg_cnt()
659 struct mfc *rt, *nrt; in ip_mrouter_done() local
661 for (rt = LIST_FIRST(&mfchashtbl[i]); rt; rt = nrt) { in ip_mrouter_done()
662 nrt = LIST_NEXT(rt, mfc_hash); in ip_mrouter_done()
664 expire_mfc(rt); in ip_mrouter_done()
692 struct mfc *rt; in ip_mrouter_detach() local
704 LIST_FOREACH(rt, &mfchashtbl[i], mfc_hash) { in ip_mrouter_detach()
705 for (rte = rt->mfc_stall; rte; rte = rte->next) { in ip_mrouter_detach()
977 update_mfc_params(struct mfc *rt, struct mfcctl2 *mfccp) in update_mfc_params() argument
981 rt->mfc_parent = mfccp->mfcc_parent; in update_mfc_params()
983 rt->mfc_ttls[i] = mfccp->mfcc_ttls[i]; in update_mfc_params()
984 rt->mfc_flags[i] = mfccp->mfcc_flags[i] & mrt_api_config & in update_mfc_params()
989 rt->mfc_rp = mfccp->mfcc_rp; in update_mfc_params()
991 rt->mfc_rp = zeroin_addr; in update_mfc_params()
998 init_mfc_params(struct mfc *rt, struct mfcctl2 *mfccp) in init_mfc_params() argument
1000 rt->mfc_origin = mfccp->mfcc_origin; in init_mfc_params()
1001 rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp; in init_mfc_params()
1003 update_mfc_params(rt, mfccp); in init_mfc_params()
1006 rt->mfc_pkt_cnt = 0; in init_mfc_params()
1007 rt->mfc_byte_cnt = 0; in init_mfc_params()
1008 rt->mfc_wrong_if = 0; in init_mfc_params()
1009 timerclear(&rt->mfc_last_assert); in init_mfc_params()
1013 expire_mfc(struct mfc *rt) in expire_mfc() argument
1017 free_bw_list(rt->mfc_bw_meter); in expire_mfc()
1019 for (rte = rt->mfc_stall; rte != NULL; rte = nrte) { in expire_mfc()
1025 LIST_REMOVE(rt, mfc_hash); in expire_mfc()
1026 free(rt, M_MRTABLE); in expire_mfc()
1037 struct mfc *rt; in add_mfc() local
1059 rt = mfc_find(&mfccp->mfcc_origin, &mfccp->mfcc_mcastgrp); in add_mfc()
1062 if (rt) { in add_mfc()
1069 update_mfc_params(rt, mfccp); in add_mfc()
1080 LIST_FOREACH(rt, &mfchashtbl[hash], mfc_hash) { in add_mfc()
1081 if (in_hosteq(rt->mfc_origin, mfccp->mfcc_origin) && in add_mfc()
1082 in_hosteq(rt->mfc_mcastgrp, mfccp->mfcc_mcastgrp) && in add_mfc()
1083 rt->mfc_stall != NULL) { in add_mfc()
1089 mfccp->mfcc_parent, rt->mfc_stall); in add_mfc()
1095 mfccp->mfcc_parent, rt->mfc_stall); in add_mfc()
1097 rte = rt->mfc_stall; in add_mfc()
1098 init_mfc_params(rt, mfccp); in add_mfc()
1099 rt->mfc_stall = NULL; in add_mfc()
1101 rt->mfc_expire = 0; /* Don't clean this guy up */ in add_mfc()
1108 ip_mdq(rte->m, rte->ifp, rt); in add_mfc()
1132 LIST_FOREACH(rt, &mfchashtbl[hash], mfc_hash) { in add_mfc()
1133 if (in_hosteq(rt->mfc_origin, mfccp->mfcc_origin) && in add_mfc()
1134 in_hosteq(rt->mfc_mcastgrp, mfccp->mfcc_mcastgrp)) { in add_mfc()
1135 init_mfc_params(rt, mfccp); in add_mfc()
1136 if (rt->mfc_expire) in add_mfc()
1138 rt->mfc_expire = 0; in add_mfc()
1142 if (rt == NULL) { /* no upcall, so make a new entry */ in add_mfc()
1143 rt = malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT); in add_mfc()
1144 if (rt == NULL) { in add_mfc()
1149 init_mfc_params(rt, mfccp); in add_mfc()
1150 rt->mfc_expire = 0; in add_mfc()
1151 rt->mfc_stall = NULL; in add_mfc()
1152 rt->mfc_bw_meter = NULL; in add_mfc()
1155 LIST_INSERT_HEAD(&mfchashtbl[hash], rt, mfc_hash); in add_mfc()
1196 struct mfc *rt; in del_mfc() local
1223 rt = mfc_find(&mfccp->mfcc_origin, &mfccp->mfcc_mcastgrp); in del_mfc()
1224 if (rt == NULL) { in del_mfc()
1232 free_bw_list(rt->mfc_bw_meter); in del_mfc()
1233 rt->mfc_bw_meter = NULL; in del_mfc()
1235 LIST_REMOVE(rt, mfc_hash); in del_mfc()
1236 free(rt, M_MRTABLE); in del_mfc()
1302 struct mfc *rt; in ip_mforward_real() local
1349 rt = mfc_find(&ip->ip_src, &ip->ip_dst); in ip_mforward_real()
1352 if (rt != NULL) { in ip_mforward_real()
1354 return ip_mdq(m, ifp, rt); in ip_mforward_real()
1398 LIST_FOREACH(rt, &mfchashtbl[hash], mfc_hash) { in ip_mforward_real()
1399 if (in_hosteq(ip->ip_src, rt->mfc_origin) && in ip_mforward_real()
1400 in_hosteq(ip->ip_dst, rt->mfc_mcastgrp) && in ip_mforward_real()
1401 rt->mfc_stall != NULL) in ip_mforward_real()
1405 if (rt == NULL) { in ip_mforward_real()
1421 rt = malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT); in ip_mforward_real()
1422 if (rt == NULL) in ip_mforward_real()
1452 free(rt, M_MRTABLE); in ip_mforward_real()
1461 rt->mfc_origin = ip->ip_src; in ip_mforward_real()
1462 rt->mfc_mcastgrp = ip->ip_dst; in ip_mforward_real()
1463 rt->mfc_pkt_cnt = 0; in ip_mforward_real()
1464 rt->mfc_byte_cnt = 0; in ip_mforward_real()
1465 rt->mfc_wrong_if = 0; in ip_mforward_real()
1466 rt->mfc_expire = UPCALL_EXPIRE; in ip_mforward_real()
1469 rt->mfc_ttls[i] = 0; in ip_mforward_real()
1470 rt->mfc_flags[i] = 0; in ip_mforward_real()
1472 rt->mfc_parent = -1; in ip_mforward_real()
1475 rt->mfc_rp = zeroin_addr; in ip_mforward_real()
1477 rt->mfc_bw_meter = NULL; in ip_mforward_real()
1480 LIST_INSERT_HEAD(&mfchashtbl[hash], rt, mfc_hash); in ip_mforward_real()
1482 rt->mfc_stall = rte; in ip_mforward_real()
1493 for (p = &rt->mfc_stall; *p != NULL; p = &(*p)->next) in ip_mforward_real()
1531 struct mfc *rt, *nrt; in expire_upcalls() local
1536 for (rt = LIST_FIRST(&mfchashtbl[i]); rt; rt = nrt) { in expire_upcalls()
1537 nrt = LIST_NEXT(rt, mfc_hash); in expire_upcalls()
1539 if (rt->mfc_expire == 0 || --rt->mfc_expire > 0) in expire_upcalls()
1546 while (rt->mfc_bw_meter != NULL) { in expire_upcalls()
1547 struct bw_meter *x = rt->mfc_bw_meter; in expire_upcalls()
1549 rt->mfc_bw_meter = x->bm_mfc_next; in expire_upcalls()
1557 ntohl(rt->mfc_origin.s_addr), in expire_upcalls()
1558 ntohl(rt->mfc_mcastgrp.s_addr)); in expire_upcalls()
1560 expire_mfc(rt); in expire_upcalls()
1585 ip_mdq(struct mbuf *m, struct ifnet *ifp, struct mfc *rt) in ip_mdq() argument
1596 vifi = rt->mfc_parent; in ip_mdq()
1604 ++rt->mfc_wrong_if; in ip_mdq()
1633 if (rt->mfc_flags[vifi] & in ip_mdq()
1641 TV_DELTA(rt->mfc_last_assert, now, delta); in ip_mdq()
1653 rt->mfc_last_assert = now; in ip_mdq()
1682 rt->mfc_pkt_cnt++; in ip_mdq()
1683 rt->mfc_byte_cnt += plen; in ip_mdq()
1692 if ((rt->mfc_ttls[vifi] > 0) && in ip_mdq()
1693 (ip->ip_ttl > rt->mfc_ttls[vifi])) { in ip_mdq()
1698 pim_register_send(ip, vifp, m, rt); in ip_mdq()
1708 if (rt->mfc_bw_meter != NULL) { in ip_mdq()
1713 for (x = rt->mfc_bw_meter; x != NULL; x = x->bm_mfc_next) in ip_mdq()
2726 struct mfc *rt) in pim_register_send() argument
2748 !in_nullhost(rt->mfc_rp)) { in pim_register_send()
2749 pim_register_send_rp(ip, vifp, mm, rt); in pim_register_send()
2751 pim_register_send_upcall(ip, vifp, mm, rt); in pim_register_send()
2813 struct mbuf *mb_copy, struct mfc *rt) in pim_register_send_upcall() argument
2868 struct mbuf *mb_copy, struct mfc *rt) in pim_register_send_rp() argument
2874 vifi_t vifi = rt->mfc_parent; in pim_register_send_rp()
2907 ip_outer->ip_dst = rt->mfc_rp; in pim_register_send_rp()
2919 if (rt->mfc_flags[vifi] & MRT_MFC_FLAGS_BORDER_VIF & mrt_api_config) in pim_register_send_rp()