Lines Matching refs:afp
560 const struct afswtch *afp = af_getbyname(*argv); in args_parse() local
562 if (afp == NULL) { in args_parse()
566 if (afp->af_name != NULL) in args_parse()
569 args->afp = afp; in args_parse()
704 args->afp = af_getbyname(args_peek(args)); in main()
705 if (args->afp != NULL) in main()
722 ifconfig(&ctx, 0, args->afp); in main()
727 args->allfamilies = args->afp == NULL; in main()
765 match_afp(const struct afswtch *afp, int sa_family, const struct sockaddr_dl *sdl) in match_afp() argument
767 if (afp == NULL) in match_afp()
770 if (!strcmp(afp->af_name, "ether")) { in match_afp()
775 return (afp->af_af == sa_family); in match_afp()
838 if (!match_afp(args->afp, ifa->ifa_addr->sa_family, sdl)) in list_interfaces_ioctl()
850 ifconfig(ctx, 0, args->afp); in list_interfaces_ioctl()
940 struct afswtch *afp; in af_getbyname() local
942 for (afp = afs; afp != NULL; afp = afp->af_next) in af_getbyname()
943 if (strcmp(afp->af_name, name) == 0) in af_getbyname()
944 return afp; in af_getbyname()
951 struct afswtch *afp; in af_getbyfamily() local
953 for (afp = afs; afp != NULL; afp = afp->af_next) in af_getbyfamily()
954 if (afp->af_af == af) in af_getbyfamily()
955 return afp; in af_getbyfamily()
962 struct afswtch *afp; in af_other_status() local
966 for (afp = afs; afp != NULL; afp = afp->af_next) { in af_other_status()
967 if (afp->af_other_status == NULL) in af_other_status()
969 if (afp->af_af != AF_UNSPEC && isset(afmask, afp->af_af)) in af_other_status()
971 afp->af_other_status(ctx); in af_other_status()
972 setbit(afmask, afp->af_af); in af_other_status()
979 struct afswtch *afp; in af_all_tunnel_status() local
983 for (afp = afs; afp != NULL; afp = afp->af_next) { in af_all_tunnel_status()
984 if (afp->af_status_tunnel == NULL) in af_all_tunnel_status()
986 if (afp->af_af != AF_UNSPEC && isset(afmask, afp->af_af)) in af_all_tunnel_status()
988 afp->af_status_tunnel(ctx); in af_all_tunnel_status()
989 setbit(afmask, afp->af_af); in af_all_tunnel_status()
1061 delifaddr(if_ctx *ctx, const struct afswtch *afp) in delifaddr() argument
1065 if (afp->af_exec == NULL) { in delifaddr()
1067 ctx->ifname, afp->af_name); in delifaddr()
1072 error = afp->af_exec(ctx, afp->af_difaddr, afp->af_ridreq); in delifaddr()
1082 addifaddr(if_ctx *ctx, const struct afswtch *afp) in addifaddr() argument
1084 if (afp->af_exec == NULL) { in addifaddr()
1086 ctx->ifname, afp->af_name); in addifaddr()
1092 int error = afp->af_exec(ctx, afp->af_aifaddr, afp->af_addreq); in addifaddr()
1101 const struct afswtch *afp, *nafp; in ifconfig_ioctl() local
1116 afp = NULL; in ifconfig_ioctl()
1118 afp = uafp; in ifconfig_ioctl()
1130 if (afp == NULL && feature_present("inet")) in ifconfig_ioctl()
1131 afp = af_getbyname("inet"); in ifconfig_ioctl()
1134 if (afp == NULL) in ifconfig_ioctl()
1135 afp = af_getbyname("link"); in ifconfig_ioctl()
1136 if (afp == NULL) { in ifconfig_ioctl()
1143 afp->af_af == AF_LINK || afp->af_af == AF_UNSPEC ? in ifconfig_ioctl()
1144 AF_LOCAL : afp->af_af; in ifconfig_ioctl()
1152 ctx->afp = afp; in ifconfig_ioctl()
1176 if (nafp != afp) { in ifconfig_ioctl()
1178 afp = nafp; in ifconfig_ioctl()
1220 if (afp->af_postproc != NULL) in ifconfig_ioctl()
1221 afp->af_postproc(ctx, newaddr, getifflags(ctx->ifname, s, true)); in ifconfig_ioctl()
1232 delifaddr(ctx, afp); in ifconfig_ioctl()
1234 addifaddr(ctx, afp); in ifconfig_ioctl()
1243 const struct afswtch *afp = ctx->afp; in setifaddr() local
1245 if (afp->af_getaddr == NULL) in setifaddr()
1253 if (doalias == 0 && afp->af_af != AF_LINK) in setifaddr()
1255 afp->af_getaddr(addr, (doalias >= 0 ? ADDR : RIDADDR)); in setifaddr()
1261 const struct afswtch *afp = ctx->afp; in settunnel() local
1265 if (afp->af_settunnel == NULL) { in settunnel()
1267 afp->af_name); in settunnel()
1283 afp->af_settunnel(ctx, srcres, dstres); in settunnel()
1327 const struct afswtch *afp = ctx->afp; in setifnetmask() local
1329 if (afp->af_getaddr != NULL) { in setifnetmask()
1331 afp->af_getaddr(addr, MASK); in setifnetmask()
1338 const struct afswtch *afp = ctx->afp; in setifbroadaddr() local
1340 if (afp->af_getaddr != NULL) in setifbroadaddr()
1341 afp->af_getaddr(addr, BRDADDR); in setifbroadaddr()
1347 const struct afswtch *afp = ctx->afp; in notealias() local
1350 if (afp->af_copyaddr != NULL) in notealias()
1351 afp->af_copyaddr(ctx, RIDADDR, ADDR); in notealias()
1364 const struct afswtch *afp = ctx->afp; in setifdstaddr() local
1366 if (afp->af_getaddr != NULL) in setifdstaddr()
1367 afp->af_getaddr(addr, DSTADDR); in setifdstaddr()
1823 bool allfamilies = args->afp == NULL; in status()
1826 if (args->afp == NULL) in status()
1830 args->afp->af_af == AF_LINK ? AF_LOCAL : args->afp->af_af; in status()
1860 } else if (args->afp->af_af == ift->ifa_addr->sa_family) in status()
1861 args->afp->af_status(ctx, ift); in status()
1864 if (allfamilies || afp->af_af == AF_LINK) { in status()
1882 else if (args->afp->af_other_status != NULL) in status()
1883 args->afp->af_other_status(ctx); in status()