Lines Matching defs:np

242 void ripflush(struct ifc *, struct sockaddr_in6 *, int, struct netinfo6 *np);
759 ripflush(struct ifc *ifcp, struct sockaddr_in6 *sin6, int nrt, struct netinfo6 *np)
772 np = ripbuf->rip6_nets;
773 for (i = 0; i < nrt; i++, np++) {
774 if (np->rip6_metric == NEXTHOP_METRIC) {
775 if (IN6_IS_ADDR_UNSPECIFIED(&np->rip6_dest))
779 inet6_n2p(&np->rip6_dest));
783 inet6_n2p(&np->rip6_dest),
784 np->rip6_plen, np->rip6_metric);
786 if (np->rip6_tag) {
788 ntohs(np->rip6_tag) & 0xffff);
811 struct netinfo6 *np;
829 np = ripbuf->rip6_nets;
834 *np = rrt->rrt_info;
835 np++; nrt++;
837 ripflush(NULL, sin6, nrt, np);
840 np = ripbuf->rip6_nets;
844 ripflush(NULL, sin6, nrt, np);
865 np = ripbuf->rip6_nets;
866 *np = rrt_info;
868 ripflush(ifcp, sin6, nrt, np);
877 nrt = 0; np = ripbuf->rip6_nets; nh = NULL;
901 ripflush(ifcp, sin6, nrt, np);
904 np = ripbuf->rip6_nets;
907 np->rip6_dest = rrt->rrt_gw;
908 np->rip6_plen = 0;
909 np->rip6_tag = 0;
910 np->rip6_metric = NEXTHOP_METRIC;
912 np++; nrt++;
919 ripflush(ifcp, sin6, nrt, np);
922 np = ripbuf->rip6_nets;
924 memset(np, 0, sizeof(struct netinfo6));
925 np->rip6_metric = NEXTHOP_METRIC;
927 np++; nrt++;
931 *np = rrt->rrt_info;
932 np++; nrt++;
934 ripflush(ifcp, sin6, nrt, np);
937 np = ripbuf->rip6_nets;
941 ripflush(ifcp, sin6, nrt, np);
1106 struct netinfo6 *np, *nq;
1186 np = rp->rip6_nets;
1195 riprequest(ifcp, np, nn, &fsock);
1197 riprequest(NULL, np, nn, &fsock);
1261 for (; nn; nn--, np++) {
1262 if (np->rip6_metric == NEXTHOP_METRIC) {
1264 if (IN6_IS_ADDR_LINKLOCAL(&np->rip6_dest)) {
1265 nh = np->rip6_dest;
1267 } else if (IN6_IS_ADDR_UNSPECIFIED(&np->rip6_dest)) {
1273 inet6_n2p(&np->rip6_dest));
1277 if (IN6_IS_ADDR_MULTICAST(&np->rip6_dest)) {
1279 inet6_n2p(&np->rip6_dest),
1280 np->rip6_plen, np->rip6_metric);
1283 if (IN6_IS_ADDR_LOOPBACK(&np->rip6_dest)) {
1285 inet6_n2p(&np->rip6_dest),
1286 np->rip6_plen, np->rip6_metric);
1289 if (IN6_IS_ADDR_LINKLOCAL(&np->rip6_dest)) {
1291 inet6_n2p(&np->rip6_dest),
1292 np->rip6_plen, np->rip6_metric);
1296 if (IN6_IS_ADDR_SITELOCAL(&np->rip6_dest) && !lflag) {
1298 inet6_n2p(&np->rip6_dest),
1299 np->rip6_plen, np->rip6_metric);
1303 inet6_n2p(&np->rip6_dest),
1304 np->rip6_plen, np->rip6_metric);
1305 if (np->rip6_tag)
1306 trace(2, " tag=0x%04x", ntohs(np->rip6_tag) & 0xffff);
1308 ia = np->rip6_dest;
1309 applyplen(&ia, np->rip6_plen);
1310 if (!IN6_ARE_ADDR_EQUAL(&ia, &np->rip6_dest))
1322 if (np->rip6_plen < iffp->iff_plen)
1325 if (iffp->iff_plen == 0 && np->rip6_plen > 0)
1327 ia = np->rip6_dest;
1340 np->rip6_metric++;
1341 np->rip6_metric += ifcp->ifc_metric;
1342 if (np->rip6_metric > HOPCNT_INFINITY6)
1343 np->rip6_metric = HOPCNT_INFINITY6;
1345 applyplen(&np->rip6_dest, np->rip6_plen);
1346 if ((rrt = rtsearch(np)) != NULL) {
1350 if (nq->rip6_metric > np->rip6_metric) {
1354 nq->rip6_metric = np->rip6_metric;
1361 *nq = *np;
1367 } else if (nq->rip6_metric < np->rip6_metric &&
1371 nq->rip6_metric = np->rip6_metric;
1375 } else if (nq->rip6_metric == np->rip6_metric &&
1376 np->rip6_metric < HOPCNT_INFINITY6) {
1387 *nq = *np;
1397 } else if (np->rip6_metric < HOPCNT_INFINITY6) {
1410 *nq = *np;
1449 struct netinfo6 *np;
1455 np = ripbuf->rip6_nets;
1456 memset(np, 0, sizeof(struct netinfo6));
1457 np->rip6_metric = HOPCNT_INFINITY6;
1476 struct netinfo6 *np,
1483 if (!(nn == 1 && IN6_IS_ADDR_UNSPECIFIED(&np->rip6_dest) &&
1484 np->rip6_plen == 0 && np->rip6_metric == HOPCNT_INFINITY6)) {
1487 for (i = 0; i < nn; i++, np++) {
1488 rrt = rtsearch(np);
1490 np->rip6_metric = rrt->rrt_info.rip6_metric;
1492 np->rip6_metric = HOPCNT_INFINITY6;
2141 struct netinfo6 *np;
2194 np = &rrt->rrt_info;
2195 search_rrt = rtsearch(np);
2203 inet6_n2p(&np->rip6_dest), np->rip6_plen,
2214 inet6_n2p(&np->rip6_dest), np->rip6_plen,
2252 struct netinfo6 *np;
2373 np = &rrt->rrt_info;
2374 orrt = rtsearch(np);
2379 inet6_n2p(&np->rip6_dest), np->rip6_plen,
2390 inet6_n2p(&np->rip6_dest), np->rip6_plen,
2397 inet6_n2p(&np->rip6_dest),
2398 np->rip6_plen, category,
2642 struct netinfo6 *np;
2706 np = &rrt->rrt_info;
2715 np->rip6_tag = 0;
2716 np->rip6_metric = rtm->rtm_rmx.rmx_hopcount;
2717 if (np->rip6_metric < 1)
2718 np->rip6_metric = 1;
2720 np->rip6_dest = sin6_dst->sin6_addr;
2724 np->rip6_plen = 128; /* Host route */
2726 np->rip6_plen = sin6mask2len(sin6_mask);
2728 np->rip6_plen = 0;
2730 orrt = rtsearch(np);
2735 inet6_n2p(&np->rip6_dest), np->rip6_plen,
2754 inet6_n2p(&np->rip6_dest), np->rip6_plen, rtflags(rtm));
2789 inet6_n2p(&np->rip6_dest), np->rip6_plen,
2801 struct netinfo6 *np;
2807 np = &rrt->rrt_info;
2811 inet6_n2p(&np->rip6_dest), np->rip6_plen, buf1,
2812 np->rip6_metric - 1, buf2);
2815 inet6_n2p(&np->rip6_dest), np->rip6_plen, buf1,
2816 np->rip6_metric - 1, buf2);
2829 rtm->rtm_rmx.rmx_hopcount = np->rip6_metric - 1;
2835 sin6->sin6_addr = np->rip6_dest;
2847 sin6->sin6_addr = *(plen2mask(np->rip6_plen));
2857 inet6_n2p(&np->rip6_dest), np->rip6_plen, buf1);
2860 inet6_n2p(&np->rip6_dest), np->rip6_plen, buf1);
2872 delroute(struct netinfo6 *np, struct in6_addr *gw)
2880 tracet(1, "DEL: %s/%d gw %s\n", inet6_n2p(&np->rip6_dest),
2881 np->rip6_plen, buf2);
2884 hms(), inet6_n2p(&np->rip6_dest), np->rip6_plen, buf2);
2896 if (np->rip6_plen == sizeof(struct in6_addr) * 8)
2903 sin6->sin6_addr = np->rip6_dest;
2913 sin6->sin6_addr = *(plen2mask(np->rip6_plen));
2923 inet6_n2p(&np->rip6_dest), np->rip6_plen, buf2);
2926 inet6_n2p(&np->rip6_dest), np->rip6_plen, buf2);
2938 getroute(struct netinfo6 *np, struct in6_addr *gw)
2958 sin6->sin6_addr = np->rip6_dest;
3297 rtsearch(struct netinfo6 *np)
3302 if (rrt->rrt_info.rip6_plen == np->rip6_plen &&
3304 &np->rip6_dest))