Lines Matching defs:ifcp
273 struct ifc *ifcp;
355 for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) {
356 if (ifcp->ifc_index < 0) {
359 ifcp->ifc_name);
368 for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next)
369 ifrt(ifcp, 0);
401 for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) {
402 if (iff_find(ifcp, 'N'))
404 if (ifcp->ifc_index > 0 && (ifcp->ifc_flags & IFF_UP))
405 sendrequest(ifcp);
508 struct ifc *ifcp;
538 for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) {
539 if (ifcp->ifc_index > 0 && (ifcp->ifc_flags & IFF_UP))
540 ripsend(ifcp, &ifcp->ifc_ripsin, 0);
635 ripflush(struct ifc *ifcp, struct sockaddr_in6 *sin6)
640 if (ifcp)
642 ifcp->ifc_name, nrt,
670 if (error == EAFNOSUPPORT && ifcp) {
674 ifcp->ifc_name, inet6_n2p(&ifcp->ifc_ripsin.sin6_addr));
675 ifcp->ifc_flags &= ~IFF_UP; /* As if down for AF_INET6 */
684 ripsend(struct ifc *ifcp, struct sockaddr_in6 *sin6, int flag)
693 if (ifcp == NULL) {
720 (qflag || (ifcp->ifc_flags & IFF_LOOPBACK)))
724 if (iff_find(ifcp, 'N') != NULL)
728 if (iff_find(ifcp, 'T') != NULL) {
734 rrt_info.rip6_metric += ifcp->ifc_metric;
739 ripflush(ifcp, sin6);
743 maxrte = (ifcp->ifc_mtu - sizeof(struct ip6_hdr) -
754 if (out_filter(rrt, ifcp) == 0)
758 if (tobeadv(rrt, ifcp) == 0)
767 if (rrt->rrt_index == ifcp->ifc_index &&
772 ripflush(ifcp, sin6);
782 } else if (nh && (rrt->rrt_index != ifcp->ifc_index ||
787 ripflush(ifcp, sin6);
798 ripflush(ifcp, sin6);
803 ripflush(ifcp, sin6);
810 out_filter(struct riprt *rrt, struct ifc *ifcp)
820 for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) {
837 for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) {
854 if (iff_find(ifcp, 'O')) {
856 for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) {
881 tobeadv(struct riprt *rrt, struct ifc *ifcp)
892 if (sflag && rrt->rrt_index != ifcp->ifc_index)
897 if (hflag == 0 && rrt->rrt_index == ifcp->ifc_index)
967 struct ifc *ifcp, *ic;
1032 ifcp = index2ifc[idx];
1033 riprequest(ifcp, np, nn, &fsock);
1046 ifcp = (idx < (unsigned)nindex2ifc) ? index2ifc[idx] : NULL;
1047 if (!ifcp) {
1051 if (IN6_ARE_ADDR_EQUAL(&ifcp->ifc_mylladdr, &fsock.sin6_addr))
1059 if (iff_find(ifcp, 'N') != NULL)
1063 ifcp->ifc_name, inet6_n2p(&nh), ntohs(fsock.sin6_port), (int)nn);
1125 for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) {
1148 np->rip6_metric += ifcp->ifc_metric;
1158 if (rrt->rrt_index == ifcp->ifc_index &&
1164 rrt->rrt_index = ifcp->ifc_index;
1169 addroute(rrt, &nh, ifcp);
1175 rrt->rrt_index == ifcp->ifc_index &&
1184 if (rrt->rrt_index == ifcp->ifc_index &&
1190 rrt->rrt_index = ifcp->ifc_index;
1195 addroute(rrt, &nh, ifcp);
1213 rrt->rrt_index = ifcp->ifc_index;
1225 addroute(rrt, &nh, ifcp);
1235 if (ifcp->ifc_index == ic->ifc_index)
1252 sendrequest(struct ifc *ifcp)
1257 if (ifcp->ifc_flags & IFF_LOOPBACK)
1264 ifcp->ifc_name, inet6_n2p(&ifcp->ifc_ripsin.sin6_addr));
1265 error = sendpacket(&ifcp->ifc_ripsin, RIPSIZE(1));
1270 ifcp->ifc_name, inet6_n2p(&ifcp->ifc_ripsin.sin6_addr));
1271 ifcp->ifc_flags &= ~IFF_UP; /* As if down for AF_INET6 */
1280 riprequest(struct ifc *ifcp, struct netinfo6 *np, int nn,
1302 ripsend(ifcp, sin6, RRTF_SENDANYWAY);
1312 struct ifc *ifcp;
1327 ifcp = ifc_find(ifa->ifa_name);
1331 if (!ifcp) {
1333 if ((ifcp = MALLOC(struct ifc)) == NULL) {
1336 memset(ifcp, 0, sizeof(*ifcp));
1337 ifcp->ifc_index = -1;
1338 ifcp->ifc_next = ifc;
1339 ifc = ifcp;
1341 ifcp->ifc_name = xstrdup(ifa->ifa_name);
1342 ifcp->ifc_addr = 0;
1343 ifcp->ifc_filter = 0;
1344 ifcp->ifc_flags = ifa->ifa_flags;
1345 trace(1, "newif %s <%s>\n", ifcp->ifc_name,
1346 ifflags(ifcp->ifc_flags));
1347 if (!strcmp(ifcp->ifc_name, LOOPBACK_IF))
1348 loopifcp = ifcp;
1351 if (ifcp->ifc_flags != ifa->ifa_flags) {
1352 trace(1, "%s: <%s> -> ", ifcp->ifc_name,
1353 ifflags(ifcp->ifc_flags));
1355 ifcp->ifc_cflags |= IFC_CHANGED;
1357 ifcp->ifc_flags = ifa->ifa_flags;
1359 ifconfig1(ifa->ifa_name, ifa->ifa_addr, ifcp, s);
1360 if ((ifcp->ifc_flags & (IFF_LOOPBACK | IFF_UP)) == IFF_UP
1361 && 0 < ifcp->ifc_index && !ifcp->ifc_joined) {
1362 mreq.ipv6mr_multiaddr = ifcp->ifc_ripsin.sin6_addr;
1363 mreq.ipv6mr_interface = ifcp->ifc_index;
1368 trace(1, "join %s %s\n", ifcp->ifc_name, RIP6_DEST);
1369 ifcp->ifc_joined++;
1377 ifconfig1(const char *name, const struct sockaddr *sa, struct ifc *ifcp, int s)
1394 if ((ifa = ifa_match(ifcp, &sin6->sin6_addr, plen)) != NULL) {
1407 ifa->ifa_conf = ifcp;
1408 ifa->ifa_next = ifcp->ifc_addr;
1409 ifcp->ifc_addr = ifa;
1412 if (ifcp->ifc_flags & IFF_POINTOPOINT) {
1425 if (ifcp->ifc_index < 0 && IN6_IS_ADDR_LINKLOCAL(&ifa->ifa_addr)) {
1426 ifcp->ifc_mylladdr = ifa->ifa_addr;
1427 ifcp->ifc_index = IN6_LINKLOCAL_IFINDEX(ifa->ifa_addr);
1428 memcpy(&ifcp->ifc_ripsin, &ripsin, ripsin.ss_len);
1429 SET_IN6_LINKLOCAL_IFINDEX(ifcp->ifc_ripsin.sin6_addr,
1430 ifcp->ifc_index);
1431 setindex2ifc(ifcp->ifc_index, ifcp);
1432 ifcp->ifc_mtu = getifmtu(ifcp->ifc_index);
1433 if (ifcp->ifc_mtu > RIP6_MAXMTU)
1434 ifcp->ifc_mtu = RIP6_MAXMTU;
1438 ifcp->ifc_metric = ifr.ifr_metric;
1440 ifcp->ifc_index, ifcp->ifc_mtu, ifcp->ifc_metric);
1442 ifcp->ifc_cflags |= IFC_CHANGED;
1458 struct ifc *ifcp, *ic;
1632 ifcp = index2ifc[ifam->ifam_index];
1634 ifcp = NULL;
1635 if (!ifcp) {
1640 if (!rt_deladdr(ifcp, rta[RTAX_IFA], rta[RTAX_NETMASK]))
1654 for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next)
1655 if (ifcp->ifc_cflags & IFC_CHANGED) {
1656 if (ifrt(ifcp, 1)) {
1658 if (ifcp->ifc_index == ic->ifc_index)
1668 ifcp->ifc_cflags &= ~IFC_CHANGED;
1778 rt_deladdr(struct ifc *ifcp, const struct sockaddr_in6 *sifa,
1797 inet6_n2p(addr), prefix, ifcp->ifc_name);
1798 ifa = ifa_match(ifcp, addr, prefix);
1801 inet6_n2p(addr), prefix, ifcp->ifc_name);
1804 if (ifa->ifa_conf != ifcp) {
1807 ifcp->ifc_name, ifa->ifa_conf->ifc_name);
1811 if (ifcp->ifc_addr == ifa)
1812 ifcp->ifc_addr = ifa->ifa_next;
1815 for (p = ifcp->ifc_addr; p; p = p->ifa_next) {
1831 inet6_n2p(&ni6.rip6_dest), ni6.rip6_plen, ifcp->ifc_index);
1835 if (rrt->rrt_index == ifcp->ifc_index &&
1853 if (ifcp->ifc_flags & IFF_POINTOPOINT) {
1860 ifcp->ifc_index);
1862 ifcp->ifc_index &&
1888 ifrt(struct ifc *ifcp, int again)
1897 if (ifcp->ifc_flags & IFF_LOOPBACK)
1901 if (ifcp->ifc_flags & IFF_POINTOPOINT) {
1902 ifrt_p2p(ifcp, again);
1906 for (ifa = ifcp->ifc_addr; ifa; ifa = ifa->ifa_next) {
1911 inet6_n2p(&ifa->ifa_addr), ifcp->ifc_name);
1918 ifcp->ifc_name);
1925 ifcp->ifc_name);
1929 if (ifcp->ifc_flags & IFF_UP) {
1934 rrt->rrt_index = ifcp->ifc_index;
1938 rrt->rrt_info.rip6_metric = 1 + ifcp->ifc_metric;
1958 ifcp->ifc_name);
1972 ifcp->ifc_name);
1975 addroute(rrt, &rrt->rrt_gw, ifcp);
1977 sendrequest(ifcp);
1978 ripsend(ifcp, &ifcp->ifc_ripsin, 0);
1982 if (loop_rrt->rrt_index == ifcp->ifc_index) {
2006 ifrt_p2p(struct ifc *ifcp, int again)
2024 for (ifa = ifcp->ifc_addr; ifa; ifa = ifa->ifa_next) {
2092 rrt->rrt_index = ifcp->ifc_index;
2119 "(%s on %s)\n", category, ifcp->ifc_name);
2130 rrt->rrt_info.rip6_metric = 1 + ifcp->ifc_metric;
2138 category, ifcp->ifc_name, noadv);
2153 category, ifcp->ifc_name, noadv);
2161 ifcp->ifc_name, noadv);
2554 addroute(struct riprt *rrt, const struct in6_addr *gw, struct ifc *ifcp)
2564 inet_ntop(AF_INET6, (void *)&ifcp->ifc_mylladdr, (char *)buf2, sizeof(buf2));
2707 struct ifc *ifcp;
2721 for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) {
2723 if ((ifcp->ifc_flags & IFF_UP) == 0)
2725 if (iff_find(ifcp, 'N') != NULL)
2728 if (ifcp->ifc_flags & IFF_UP)
2731 ifdump0(dump, ifcp);
2740 ifdump0(FILE *dump, const struct ifc *ifcp)
2749 ifcp->ifc_name, ifcp->ifc_index, ifflags(ifcp->ifc_flags),
2750 inet6_n2p(&ifcp->ifc_mylladdr),
2751 ifcp->ifc_mtu, ifcp->ifc_metric);
2752 for (ifa = ifcp->ifc_addr; ifa; ifa = ifa->ifa_next) {
2753 if (ifcp->ifc_flags & IFF_POINTOPOINT) {
2765 if (ifcp->ifc_filter) {
2767 for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) {
2851 struct ifc *ifcp;
2861 ifcp = NULL;
2896 ifcp = ifc_find(ifname);
2897 if (ifcp == NULL) {
2907 iff_obj->iff_next = ifcp->ifc_filter;
2908 ifcp->ifc_filter = iff_obj;
2954 ifcp->ifc_name);
2969 ifa_match(const struct ifc *ifcp, const struct in6_addr *ia, int plen)
2973 for (ifa = ifcp->ifc_addr; ifa; ifa = ifa->ifa_next) {
3184 struct ifc *ifcp;
3186 for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next) {
3187 if (strcmp(name, ifcp->ifc_name) == 0)
3188 return ifcp;
3194 iff_find(struct ifc *ifcp, int type)
3198 for (iffp = ifcp->ifc_filter; iffp; iffp = iffp->iff_next) {
3206 setindex2ifc(int idx, struct ifc *ifcp)
3232 index2ifc[idx] = ifcp;