Lines Matching defs:rt

370 	struct mfc *rt;
379 LIST_FOREACH(rt, &V_mfchashtbl[MFCHASH(*o, *g)], mfc_hash) {
380 if (in_hosteq(rt->mfc_origin, *o) &&
381 in_hosteq(rt->mfc_mcastgrp, *g) &&
382 buf_ring_empty(rt->mfc_stall_ring))
386 return (rt);
392 struct mfc *rt;
393 rt = malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT | M_ZERO);
394 if (rt == NULL)
395 return rt;
397 rt->mfc_stall_ring = buf_ring_alloc(MAX_UPQ, M_MRTABLE,
399 if (rt->mfc_stall_ring == NULL) {
400 free(rt, M_MRTABLE);
404 return rt;
573 struct mfc *rt;
576 rt = mfc_find(&req->src, &req->grp);
577 if (rt == NULL) {
582 req->pktcnt = rt->mfc_pkt_cnt;
583 req->bytecnt = rt->mfc_byte_cnt;
584 req->wrong_if = rt->mfc_wrong_if;
641 struct mfc *rt, *nrt;
643 LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) {
644 if (rt->mfc_parent == vifi) {
645 expire_mfc(rt);
817 struct mfc *rt, *nrt;
819 LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) {
820 expire_mfc(rt);
1077 update_mfc_params(struct mfc *rt, struct mfcctl2 *mfccp)
1081 rt->mfc_parent = mfccp->mfcc_parent;
1083 rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
1084 rt->mfc_flags[i] = mfccp->mfcc_flags[i] & V_mrt_api_config &
1089 rt->mfc_rp = mfccp->mfcc_rp;
1091 rt->mfc_rp.s_addr = INADDR_ANY;
1098 init_mfc_params(struct mfc *rt, struct mfcctl2 *mfccp)
1100 rt->mfc_origin = mfccp->mfcc_origin;
1101 rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
1103 update_mfc_params(rt, mfccp);
1106 rt->mfc_pkt_cnt = 0;
1107 rt->mfc_byte_cnt = 0;
1108 rt->mfc_wrong_if = 0;
1109 timevalclear(&rt->mfc_last_assert);
1113 expire_mfc(struct mfc *rt)
1119 free_bw_list(rt->mfc_bw_meter_leq);
1120 free_bw_list(rt->mfc_bw_meter_geq);
1122 while (!buf_ring_empty(rt->mfc_stall_ring)) {
1123 rte = buf_ring_dequeue_mc(rt->mfc_stall_ring);
1129 buf_ring_free(rt->mfc_stall_ring, M_MRTABLE);
1131 LIST_REMOVE(rt, mfc_hash);
1132 free(rt, M_MRTABLE);
1141 struct mfc *rt;
1148 rt = mfc_find(&mfccp->mfcc_origin, &mfccp->mfcc_mcastgrp);
1151 if (rt) {
1156 update_mfc_params(rt, mfccp);
1167 LIST_FOREACH(rt, &V_mfchashtbl[hash], mfc_hash) {
1168 if (in_hosteq(rt->mfc_origin, mfccp->mfcc_origin) &&
1169 in_hosteq(rt->mfc_mcastgrp, mfccp->mfcc_mcastgrp) &&
1170 !buf_ring_empty(rt->mfc_stall_ring)) {
1176 rt->mfc_stall_ring);
1180 init_mfc_params(rt, mfccp);
1181 rt->mfc_expire = 0; /* Don't clean this guy up */
1185 while (!buf_ring_empty(rt->mfc_stall_ring)) {
1186 rte = buf_ring_dequeue_mc(rt->mfc_stall_ring);
1188 ip_mdq(rte->m, rte->ifp, rt, -1);
1201 LIST_FOREACH(rt, &V_mfchashtbl[hash], mfc_hash) {
1202 if (in_hosteq(rt->mfc_origin, mfccp->mfcc_origin) &&
1203 in_hosteq(rt->mfc_mcastgrp, mfccp->mfcc_mcastgrp)) {
1204 init_mfc_params(rt, mfccp);
1205 if (rt->mfc_expire)
1207 rt->mfc_expire = 0;
1212 if (rt == NULL) { /* no upcall, so make a new entry */
1213 rt = mfc_alloc();
1214 if (rt == NULL) {
1219 init_mfc_params(rt, mfccp);
1221 rt->mfc_expire = 0;
1222 rt->mfc_bw_meter_leq = NULL;
1223 rt->mfc_bw_meter_geq = NULL;
1226 LIST_INSERT_HEAD(&V_mfchashtbl[hash], rt, mfc_hash);
1243 struct mfc *rt;
1253 LIST_FOREACH(rt, &V_mfchashtbl[MFCHASH(origin, mcastgrp)], mfc_hash) {
1254 if (in_hosteq(rt->mfc_origin, origin) &&
1255 in_hosteq(rt->mfc_mcastgrp, mcastgrp))
1258 if (rt == NULL) {
1263 expire_mfc(rt);
1306 struct mfc *rt;
1359 rt = mfc_find(&ip->ip_src, &ip->ip_dst);
1362 if (rt != NULL) {
1363 error = ip_mdq(m, ifp, rt, -1);
1413 LIST_FOREACH(rt, &V_mfchashtbl[hash], mfc_hash)
1415 if (in_hosteq(ip->ip_src, rt->mfc_origin) &&
1416 in_hosteq(ip->ip_dst, rt->mfc_mcastgrp) &&
1417 !buf_ring_empty(rt->mfc_stall_ring))
1421 if (rt == NULL) {
1438 rt = mfc_alloc();
1439 if (rt == NULL)
1463 fail1: free(rt, M_MRTABLE);
1471 rt->mfc_origin.s_addr = ip->ip_src.s_addr;
1472 rt->mfc_mcastgrp.s_addr = ip->ip_dst.s_addr;
1473 rt->mfc_expire = UPCALL_EXPIRE;
1476 rt->mfc_ttls[i] = 0;
1477 rt->mfc_flags[i] = 0;
1479 rt->mfc_parent = -1;
1482 rt->mfc_rp.s_addr = INADDR_ANY;
1483 rt->mfc_bw_meter_leq = NULL;
1484 rt->mfc_bw_meter_geq = NULL;
1487 rt->mfc_pkt_cnt = 0;
1488 rt->mfc_byte_cnt = 0;
1489 rt->mfc_wrong_if = 0;
1490 timevalclear(&rt->mfc_last_assert);
1492 buf_ring_enqueue(rt->mfc_stall_ring, rte);
1495 LIST_INSERT_HEAD(&V_mfchashtbl[hash], rt, mfc_hash);
1498 if (buf_ring_full(rt->mfc_stall_ring)) {
1506 buf_ring_enqueue(rt->mfc_stall_ring, rte);
1530 struct mfc *rt, *nrt;
1535 LIST_FOREACH_SAFE(rt, &V_mfchashtbl[i], mfc_hash, nrt) {
1536 if (buf_ring_empty(rt->mfc_stall_ring))
1539 if (rt->mfc_expire == 0 || --rt->mfc_expire > 0)
1544 (u_long)ntohl(rt->mfc_origin.s_addr),
1545 (u_long)ntohl(rt->mfc_mcastgrp.s_addr));
1547 expire_mfc(rt);
1561 ip_mdq(struct mbuf *m, struct ifnet *ifp, struct mfc *rt, vifi_t xmt_vif)
1578 pim_register_send(ip, V_viftable + xmt_vif, m, rt);
1587 vifi = rt->mfc_parent;
1592 ++rt->mfc_wrong_if;
1612 if (rt->mfc_flags[vifi] & MRT_MFC_FLAGS_DISABLE_WRONGVIF)
1615 if (ratecheck(&rt->mfc_last_assert, &pim_assert_interval)) {
1655 rt->mfc_pkt_cnt++;
1656 rt->mfc_byte_cnt += plen;
1665 if ((rt->mfc_ttls[vifi] > 0) && (ip->ip_ttl > rt->mfc_ttls[vifi])) {
1669 pim_register_send(ip, V_viftable + vifi, m, rt);
1677 if ((rt->mfc_bw_meter_geq != NULL) || (rt->mfc_bw_meter_leq != NULL)) {
1683 for (x = rt->mfc_bw_meter_geq; x != NULL; x = x->bm_mfc_next)
1687 for (x = rt->mfc_bw_meter_leq; x != NULL; x = x->bm_mfc_next) {
2262 struct mfc *rt)
2271 in_nullhost(rt->mfc_rp))
2288 if ((V_mrt_api_config & MRT_MFC_RP) && !in_nullhost(rt->mfc_rp)) {
2289 pim_register_send_rp(ip, vifp, mm, rt);
2291 pim_register_send_upcall(ip, vifp, mm, rt);
2354 struct mbuf *mb_copy, struct mfc *rt)
2406 struct mfc *rt)
2412 vifi_t vifi = rt->mfc_parent;
2443 ip_outer->ip_dst = rt->mfc_rp;
2456 if (rt->mfc_flags[vifi] & MRT_MFC_FLAGS_BORDER_VIF & V_mrt_api_config)
2712 struct mfc *rt;
2725 LIST_FOREACH(rt, &V_mfchashtbl[i], mfc_hash) {
2726 error = SYSCTL_OUT(req, rt, sizeof(struct mfc));