Lines Matching refs:rt

342 #define MFCFIND(o, g, rt) { \
344 rt = NULL; \
350 rt = _rt; \
355 if (rt == NULL) { \
524 struct mfc *rt;
526 MFCFIND(req->src.s_addr, req->grp.s_addr, rt);
527 if (rt != NULL) {
528 req->pktcnt = rt->mfc_pkt_cnt;
529 req->bytecnt = rt->mfc_byte_cnt;
530 req->wrong_if = rt->mfc_wrong_if;
598 struct mfc *rt;
626 for (rt = mfctable[i]; rt != NULL; ) {
627 struct mfc *nr = rt->mfc_next;
629 for (rte = rt->mfc_stall; rte != NULL; ) {
636 FREE(rt, M_MRTABLE);
637 rt = nr;
831 struct mfc *rt;
837 MFCFIND(mfccp->mfcc_origin.s_addr, mfccp->mfcc_mcastgrp.s_addr, rt);
840 if (rt) {
847 rt->mfc_parent = mfccp->mfcc_parent;
849 rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
857 for (rt = mfctable[hash], nstl = 0; rt; rt = rt->mfc_next) {
859 if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
860 (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr) &&
861 (rt->mfc_stall != NULL)) {
868 mfccp->mfcc_parent, (void *)rt->mfc_stall);
874 mfccp->mfcc_parent, (void *)rt->mfc_stall);
876 rt->mfc_origin = mfccp->mfcc_origin;
877 rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
878 rt->mfc_parent = mfccp->mfcc_parent;
880 rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
882 rt->mfc_pkt_cnt = 0;
883 rt->mfc_byte_cnt = 0;
884 rt->mfc_wrong_if = 0;
885 rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
887 rt->mfc_expire = 0; /* Don't clean this guy up */
891 for (rte = rt->mfc_stall; rte != NULL; ) {
894 ip_mdq(rte->m, rte->ifp, rt, -1);
902 rt->mfc_stall = NULL;
916 for (rt = mfctable[hash]; rt != NULL; rt = rt->mfc_next) {
918 if ((rt->mfc_origin.s_addr == mfccp->mfcc_origin.s_addr) &&
919 (rt->mfc_mcastgrp.s_addr == mfccp->mfcc_mcastgrp.s_addr)) {
921 rt->mfc_origin = mfccp->mfcc_origin;
922 rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
923 rt->mfc_parent = mfccp->mfcc_parent;
925 rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
927 rt->mfc_pkt_cnt = 0;
928 rt->mfc_byte_cnt = 0;
929 rt->mfc_wrong_if = 0;
930 rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
931 if (rt->mfc_expire)
933 rt->mfc_expire = 0;
936 if (rt == NULL) {
938 rt = (struct mfc *) _MALLOC(sizeof(*rt), M_MRTABLE, M_NOWAIT);
939 if (rt == NULL) {
944 rt->mfc_origin = mfccp->mfcc_origin;
945 rt->mfc_mcastgrp = mfccp->mfcc_mcastgrp;
946 rt->mfc_parent = mfccp->mfcc_parent;
948 rt->mfc_ttls[i] = mfccp->mfcc_ttls[i];
950 rt->mfc_pkt_cnt = 0;
951 rt->mfc_byte_cnt = 0;
952 rt->mfc_wrong_if = 0;
953 rt->mfc_last_assert.tv_sec = rt->mfc_last_assert.tv_usec = 0;
954 rt->mfc_expire = 0;
955 rt->mfc_stall = NULL;
958 rt->mfc_next = mfctable[hash];
959 mfctable[hash] = rt;
999 struct mfc *rt;
1012 while ((rt = *nptr) != NULL) {
1013 if (origin.s_addr == rt->mfc_origin.s_addr &&
1014 mcastgrp.s_addr == rt->mfc_mcastgrp.s_addr &&
1015 rt->mfc_stall == NULL)
1018 nptr = &rt->mfc_next;
1020 if (rt == NULL) {
1024 *nptr = rt->mfc_next;
1025 FREE(rt, M_MRTABLE);
1069 struct mfc *rt;
1137 MFCFIND(ip->ip_src.s_addr, ip->ip_dst.s_addr, rt);
1140 if (rt != NULL) {
1141 return (ip_mdq(m, ifp, rt, -1));
1184 for (rt = mfctable[hash]; rt; rt = rt->mfc_next) {
1185 if ((ip->ip_src.s_addr == rt->mfc_origin.s_addr) &&
1186 (ip->ip_dst.s_addr == rt->mfc_mcastgrp.s_addr) &&
1187 (rt->mfc_stall != NULL))
1191 if (rt == NULL) {
1196 rt = (struct mfc *) _MALLOC(sizeof(*rt), M_MRTABLE, M_NOWAIT);
1197 if (rt == NULL) {
1207 FREE(rt, M_MRTABLE);
1228 FREE(rt, M_MRTABLE);
1233 rt->mfc_origin.s_addr = ip->ip_src.s_addr;
1234 rt->mfc_mcastgrp.s_addr = ip->ip_dst.s_addr;
1235 rt->mfc_expire = UPCALL_EXPIRE;
1238 rt->mfc_ttls[i] = 0;
1239 rt->mfc_parent = -1;
1242 rt->mfc_next = mfctable[hash];
1243 mfctable[hash] = rt;
1244 rt->mfc_stall = rte;
1251 for (p = &rt->mfc_stall; *p != NULL; p = &(*p)->next)
1336 ip_mdq(struct mbuf *m, struct ifnet *ifp, struct mfc *rt,
1369 vifi = rt->mfc_parent;
1376 ++rt->mfc_wrong_if;
1382 if (pim_assert && rt->mfc_ttls[vifi] &&
1394 TV_DELTA(rt->mfc_last_assert, now, delta);
1404 rt->mfc_last_assert = now;
1427 rt->mfc_pkt_cnt++;
1428 rt->mfc_byte_cnt += plen;
1437 if ((rt->mfc_ttls[vifi] > 0) &&
1438 (ip->ip_ttl > rt->mfc_ttls[vifi])) {