| /minix3/external/bsd/dhcpcd/dist/ |
| H A D | dhcpcd.c | 230 dhcpcd_ifafwaiting(const struct interface *ifp) in dhcpcd_ifafwaiting() argument 234 opts = ifp->options->options; in dhcpcd_ifafwaiting() 235 if (opts & DHCPCD_WAITIP4 && !ipv4_hasaddr(ifp)) in dhcpcd_ifafwaiting() 237 if (opts & DHCPCD_WAITIP6 && !ipv6_hasaddr(ifp)) in dhcpcd_ifafwaiting() 241 !ipv4_hasaddr(ifp) && !ipv6_hasaddr(ifp)) in dhcpcd_ifafwaiting() 250 const struct interface *ifp; in dhcpcd_afwaiting() local 257 TAILQ_FOREACH(ifp, ctx->ifaces, next) { in dhcpcd_afwaiting() 259 ipv4_hasaddr(ifp)) in dhcpcd_afwaiting() 262 ipv6_hasaddr(ifp)) in dhcpcd_afwaiting() 281 struct interface *ifp; in dhcpcd_ipwaited() local [all …]
|
| H A D | if.c | 78 if_free(struct interface *ifp) in if_free() argument 81 if (ifp == NULL) in if_free() 83 ipv4ll_free(ifp); in if_free() 84 dhcp_free(ifp); in if_free() 85 ipv4_free(ifp); in if_free() 86 dhcp6_free(ifp); in if_free() 87 ipv6nd_free(ifp); in if_free() 88 ipv6_free(ifp); in if_free() 89 free_options(ifp->options); in if_free() 90 free(ifp); in if_free() [all …]
|
| H A D | dhcp.c | 123 static int dhcp_open(struct interface *ifp); 607 get_option_routes(struct interface *ifp, const struct dhcp_message *dhcp) in get_option_routes() argument 609 struct if_options *ifo = ifp->options; in get_option_routes() 619 p = get_option(ifp->ctx, dhcp, DHO_CSR, &len); in get_option_routes() 624 p = get_option(ifp->ctx, dhcp, DHO_MSCSR, &len); in get_option_routes() 629 routes = decode_rfc3442_rt(ifp->ctx, p, len); in get_option_routes() 633 state = D_CSTATE(ifp); in get_option_routes() 637 logger(ifp->ctx, LOG_DEBUG, in get_option_routes() 639 ifp->name, csr); in get_option_routes() 649 logger(ifp->ctx, LOG_ERR, "%s: %m", __func__); in get_option_routes() [all …]
|
| H A D | duid.c | 57 duid_make(unsigned char *d, const struct interface *ifp, uint16_t type) in duid_make() argument 68 u16 = htons(ifp->family); in duid_make() 80 memcpy(p, ifp->hwaddr, ifp->hwlen); in duid_make() 81 p += ifp->hwlen; in duid_make() 87 duid_get(unsigned char *d, const struct interface *ifp) in duid_get() argument 116 logger(ifp->ctx, LOG_ERR, in duid_get() 121 if (ifp->family == ARPHRD_NETROM) { in duid_get() 122 logger(ifp->ctx, LOG_WARNING, in duid_get() 123 "%s: is a NET/ROM psuedo interface", ifp->name); in duid_get() 124 TAILQ_FOREACH(ifp2, ifp->ctx->ifaces, next) { in duid_get() [all …]
|
| H A D | ipv4ll.c | 83 ipv4ll_subnet_route(const struct interface *ifp) in ipv4ll_subnet_route() argument 88 assert(ifp != NULL); in ipv4ll_subnet_route() 89 if ((state = IPV4LL_CSTATE(ifp)) == NULL || in ipv4ll_subnet_route() 94 logger(ifp->ctx, LOG_ERR, "%s: malloc: %m", __func__); in ipv4ll_subnet_route() 97 rt->iface = ifp; in ipv4ll_subnet_route() 106 ipv4ll_default_route(const struct interface *ifp) in ipv4ll_default_route() argument 111 assert(ifp != NULL); in ipv4ll_default_route() 112 if ((state = IPV4LL_CSTATE(ifp)) == NULL || in ipv4ll_default_route() 117 logger(ifp->ctx, LOG_ERR, "%s: malloc: %m", __func__); in ipv4ll_default_route() 120 rt->iface = ifp; in ipv4ll_default_route() [all …]
|
| H A D | dhcp6.c | 161 dhcp6_makevendor(struct dhcp6_option *o, const struct interface *ifp) in dhcp6_makevendor() argument 172 ifo = ifp->options; in dhcp6_makevendor() 189 logger(ifp->ctx, LOG_ERR, in dhcp6_makevendor() 190 "%s: DHCPv6 Vendor Class too big", ifp->name); in dhcp6_makevendor() 301 dhcp6_updateelapsed(struct interface *ifp, struct dhcp6_message *m, size_t len) in dhcp6_updateelapsed() argument 315 state = D6_STATE(ifp); in dhcp6_updateelapsed() 341 dhcp6_newxid(const struct interface *ifp, struct dhcp6_message *m) in dhcp6_newxid() argument 345 if (ifp->options->options & DHCPCD_XID_HWADDR && in dhcp6_newxid() 346 ifp->hwlen >= sizeof(xid)) in dhcp6_newxid() 348 memcpy(&xid, (ifp->hwaddr + ifp->hwlen) - sizeof(xid), in dhcp6_newxid() [all …]
|
| H A D | ipv6nd.c | 237 ipv6nd_makersprobe(struct interface *ifp) in ipv6nd_makersprobe() argument 243 state = RS_STATE(ifp); in ipv6nd_makersprobe() 245 state->rslen = sizeof(*rs) + (size_t)ROUNDUP8(ifp->hwlen + 2); in ipv6nd_makersprobe() 256 nd->nd_opt_len = (uint8_t)((ROUNDUP8(ifp->hwlen + 2)) >> 3); in ipv6nd_makersprobe() 257 memcpy(nd + 1, ifp->hwaddr, ifp->hwlen); in ipv6nd_makersprobe() 264 struct interface *ifp = arg; in ipv6nd_sendrsprobe() local 271 if (ipv6_linklocal(ifp) == NULL) { in ipv6nd_sendrsprobe() 272 logger(ifp->ctx, LOG_DEBUG, in ipv6nd_sendrsprobe() 274 ifp->name); in ipv6nd_sendrsprobe() 275 ipv6_addlinklocalcallback(ifp, ipv6nd_sendrsprobe, ifp); in ipv6nd_sendrsprobe() [all …]
|
| H A D | arp.c | 62 arp_request(const struct interface *ifp, in_addr_t sip, in_addr_t tip) in arp_request() argument 69 ar.ar_hrd = htons(ifp->family); in arp_request() 71 ar.ar_hln = ifp->hwlen; in arp_request() 90 APPEND(ifp->hwaddr, ifp->hwlen); in arp_request() 92 ZERO(ifp->hwlen); in arp_request() 94 return if_sendrawpacket(ifp, ETHERTYPE_ARP, arp_buffer, len); in arp_request() 123 struct interface *ifp = arg; in arp_packet() local 134 state = ARP_STATE(ifp); in arp_packet() 137 bytes = if_readrawpacket(ifp, ETHERTYPE_ARP, in arp_packet() 140 logger(ifp->ctx, LOG_ERR, in arp_packet() [all …]
|
| H A D | script.c | 229 make_env(const struct interface *ifp, const char *reason, char ***argv) in make_env() argument 236 const struct if_options *ifo = ifp->options; in make_env() 251 state = D_STATE(ifp); in make_env() 252 istate = IPV4LL_CSTATE(ifp); in make_env() 256 d6_state = D6_CSTATE(ifp); in make_env() 263 else if (ipv6nd_hasra(ifp)) in make_env() 297 if (ifp->ctx->options & DHCPCD_DUMPLEASE) in make_env() 307 e = strlen("interface") + strlen(ifp->name) + 2; in make_env() 309 snprintf(env[0], e, "interface=%s", ifp->name); in make_env() 313 if (ifp->ctx->options & DHCPCD_DUMPLEASE) in make_env() [all …]
|
| H A D | ipv4.c | 118 ipv4_iffindaddr(struct interface *ifp, in ipv4_iffindaddr() argument 124 state = IPV4_STATE(ifp); in ipv4_iffindaddr() 136 ipv4_iffindlladdr(struct interface *ifp) in ipv4_iffindlladdr() argument 141 state = IPV4_STATE(ifp); in ipv4_iffindlladdr() 154 struct interface *ifp; in ipv4_findaddr() local 157 TAILQ_FOREACH(ifp, ctx->ifaces, next) { in ipv4_findaddr() 158 ap = ipv4_iffindaddr(ifp, addr, NULL); in ipv4_findaddr() 166 ipv4_hasaddr(const struct interface *ifp) in ipv4_hasaddr() argument 171 dstate = D_CSTATE(ifp); in ipv4_hasaddr() 172 istate = IPV4LL_CSTATE(ifp); in ipv4_hasaddr() [all …]
|
| H A D | ipv4ll.h | 55 #define IPV4LL_STATE(ifp) \ argument 56 ((struct ipv4ll_state *)(ifp)->if_data[IF_DATA_IPV4LL]) 57 #define IPV4LL_CSTATE(ifp) \ argument 58 ((const struct ipv4ll_state *)(ifp)->if_data[IF_DATA_IPV4LL]) 59 #define IPV4LL_STATE_RUNNING(ifp) \ argument 60 (IPV4LL_CSTATE((ifp)) && !IPV4LL_CSTATE((ifp))->down && \ 61 IN_LINKLOCAL(ntohl(IPV4LL_CSTATE((ifp))->addr.s_addr))) 70 #define ipv4ll_free(ifp) ipv4ll_freedrop((ifp), 0); argument 71 #define ipv4ll_drop(ifp) ipv4ll_freedrop((ifp), 1); argument
|
| H A D | if-bsd.c | 136 if_linkaddr(struct sockaddr_dl *sdl, const struct interface *ifp) in if_linkaddr() argument 143 sdl->sdl_index = (unsigned short)ifp->index; in if_linkaddr() 201 if_getssid(struct interface *ifp) in if_getssid() argument 205 r = if_getssid1(ifp->ctx->pf_inet_fd, ifp->name, ifp->ssid); in if_getssid() 207 ifp->ssid_len = (unsigned int)r; in if_getssid() 271 if_openrawsocket(struct interface *ifp, uint16_t protocol) in if_openrawsocket() argument 298 state = IPV4_STATE(ifp); in if_openrawsocket() 304 logger(ifp->ctx, LOG_ERR, "BPF version mismatch - recompile"); in if_openrawsocket() 309 strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); in if_openrawsocket() 354 if_sendrawpacket(const struct interface *ifp, uint16_t protocol, in if_sendrawpacket() argument [all …]
|
| H A D | if.h | 109 int if_setflag(struct interface *ifp, short flag); 110 #define if_up(ifp) if_setflag((ifp), (IFF_UP | IFF_RUNNING)) argument 117 #define if_getmtu(ifp) if_domtu((ifp), 0) argument 118 #define if_setmtu(ifp, mtu) if_domtu((ifp), (mtu)) argument 150 #define if_addaddress(ifp, addr, net, brd) \ argument 151 if_address(ifp, addr, net, brd, 1) 152 #define if_deladdress(ifp, addr, net) \ argument 153 if_address(ifp, addr, net, NULL, -1)
|
| H A D | ipv6.c | 371 const struct interface *ifp, in ipv6_makestableprivate() argument 382 ifp->hwaddr, ifp->hwlen, in ipv6_makestableprivate() 383 ifp->ssid, ifp->ssid_len, in ipv6_makestableprivate() 385 ifp->ctx->secret, ifp->ctx->secret_len); in ipv6_makestableprivate() 393 ipv6_makeaddr(struct in6_addr *addr, const struct interface *ifp, in ipv6_makeaddr() argument 404 if (ifp->options->options & DHCPCD_SLAACPRIVATE) { in ipv6_makeaddr() 405 if (ifp->ctx->secret_len == 0) { in ipv6_makeaddr() 406 if (ipv6_readsecret(ifp->ctx) == -1) in ipv6_makeaddr() 411 prefix, prefix_len, ifp, &dad) == -1) in ipv6_makeaddr() 420 if ((ap = ipv6_linklocal(ifp)) == NULL) { in ipv6_makeaddr() [all …]
|
| H A D | ipv6.h | 184 #define IPV6_STATE(ifp) \ argument 185 ((struct ipv6_state *)(ifp)->if_data[IF_DATA_IPV6]) 186 #define IPV6_CSTATE(ifp) \ argument 187 ((const struct ipv6_state *)(ifp)->if_data[IF_DATA_IPV6]) 234 const struct interface *ifp, int *dad_counter); 259 #define ipv6_linklocal(ifp) ipv6_iffindaddr((ifp), NULL) argument 263 #define ipv6_free(ifp) ipv6_freedrop((ifp), 0) argument 264 #define ipv6_drop(ifp) ipv6_freedrop((ifp), 2) argument
|
| H A D | dhcp6.h | 210 #define D6_STATE(ifp) \ argument 211 ((struct dhcp6_state *)(ifp)->if_data[IF_DATA_DHCP6]) 212 #define D6_CSTATE(ifp) \ argument 213 ((const struct dhcp6_state *)(ifp)->if_data[IF_DATA_DHCP6]) 214 #define D6_STATE_RUNNING(ifp) \ argument 215 (D6_CSTATE((ifp)) && \ 216 D6_CSTATE((ifp))->reason && dhcp6_dadcompleted((ifp))) 238 const struct ipv6_addr *dhcp6_iffindaddr(const struct interface *ifp,
|
| H A D | dhcp.h | 229 #define D_STATE(ifp) \ argument 230 ((struct dhcp_state *)(ifp)->if_data[IF_DATA_DHCP]) 231 #define D_CSTATE(ifp) \ argument 232 ((const struct dhcp_state *)(ifp)->if_data[IF_DATA_DHCP]) 233 #define D_STATE_RUNNING(ifp) \ argument 234 (D_CSTATE((ifp)) && D_CSTATE((ifp))->new && D_CSTATE((ifp))->reason)
|
| /minix3/external/bsd/bind/dist/bin/named/ |
| H A D | interfacemgr.c | 355 ns_interface_t *ifp; in ns_interface_create() local 361 ifp = isc_mem_get(mgr->mctx, sizeof(*ifp)); in ns_interface_create() 362 if (ifp == NULL) in ns_interface_create() 365 ifp->mgr = NULL; in ns_interface_create() 366 ifp->generation = mgr->generation; in ns_interface_create() 367 ifp->addr = *addr; in ns_interface_create() 368 ifp->flags = 0; in ns_interface_create() 369 strncpy(ifp->name, name, sizeof(ifp->name)); in ns_interface_create() 370 ifp->name[sizeof(ifp->name)-1] = '\0'; in ns_interface_create() 371 ifp->clientmgr = NULL; in ns_interface_create() [all …]
|
| /minix3/crypto/external/bsd/heimdal/dist/lib/roken/ |
| H A D | getifaddrs_w32.c | 108 struct ifaddrs *ifp; in rk_getifaddrs() local 110 ifp = malloc(sizeof(*ifp)); in rk_getifaddrs() 111 if (ifp == NULL) in rk_getifaddrs() 114 ZeroMemory(ifp, sizeof(*ifp)); in rk_getifaddrs() 116 ifp->ifa_next = NULL; in rk_getifaddrs() 117 ifp->ifa_name = NULL; in rk_getifaddrs() 118 ifp->ifa_flags = il[i].iiFlags; in rk_getifaddrs() 119 ifp->ifa_addr = dupaddr(&il[i].iiAddress); in rk_getifaddrs() 120 ifp->ifa_netmask = dupaddr(&il[i].iiNetmask); in rk_getifaddrs() 121 ifp->ifa_broadaddr = dupaddr(&il[i].iiBroadcastAddress); in rk_getifaddrs() [all …]
|
| /minix3/sys/net/ |
| H A D | if.h | 450 #define IF_AFDATA_LOCK_INIT(ifp) \ argument 452 (ifp)->if_afdata_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NET); \ 455 #define IF_AFDATA_WLOCK(ifp) mutex_enter((ifp)->if_afdata_lock) argument 456 #define IF_AFDATA_RLOCK(ifp) mutex_enter((ifp)->if_afdata_lock) argument 457 #define IF_AFDATA_WUNLOCK(ifp) mutex_exit((ifp)->if_afdata_lock) argument 458 #define IF_AFDATA_RUNLOCK(ifp) mutex_exit((ifp)->if_afdata_lock) argument 459 #define IF_AFDATA_LOCK(ifp) IF_AFDATA_WLOCK(ifp) argument 460 #define IF_AFDATA_UNLOCK(ifp) IF_AFDATA_WUNLOCK(ifp) argument 461 #define IF_AFDATA_TRYLOCK(ifp) mutex_tryenter((ifp)->if_afdata_lock) argument 462 #define IF_AFDATA_DESTROY(ifp) mutex_destroy((ifp)->if_afdata_lock) argument [all …]
|
| /minix3/sys/ufs/lfs/ |
| H A D | lfs_alloc.c | 209 IFILE *ifp; in lfs_valloc() local 233 LFS_IENTRY(ifp, fs, *ino, bp); in lfs_valloc() 234 if (lfs_if_getdaddr(fs, ifp) != LFS_UNUSED_DADDR) in lfs_valloc() 237 LFS_PUT_HEADFREE(fs, cip, cbp, lfs_if_getnextfree(fs, ifp)); in lfs_valloc() 239 *ino, (uintmax_t)lfs_if_getnextfree(fs, ifp))); in lfs_valloc() 242 *gen = lfs_if_getversion(fs, ifp); in lfs_valloc() 275 IFILE *ifp; in lfs_valloc_fixed() local 287 LFS_IENTRY(ifp, fs, ino, bp); in lfs_valloc_fixed() 288 oldnext = lfs_if_getnextfree(fs, ifp); in lfs_valloc_fixed() 289 lfs_if_setversion(fs, ifp, vers); in lfs_valloc_fixed() [all …]
|
| /minix3/sys/netinet/ |
| H A D | icmp6.h | 680 #define icmp6_ifstat_inc(ifp, tag) \ argument 682 if (ifp) \ 683 ((struct in6_ifextra *)((ifp)->if_afdata[AF_INET6]))->icmp6_ifstat->tag++; \ 686 #define icmp6_ifoutstat_inc(ifp, type, code) \ argument 688 icmp6_ifstat_inc(ifp, ifs6_out_msg); \ 691 icmp6_ifstat_inc(ifp, ifs6_out_dstunreach); \ 693 icmp6_ifstat_inc(ifp, ifs6_out_adminprohib); \ 696 icmp6_ifstat_inc(ifp, ifs6_out_pkttoobig); \ 699 icmp6_ifstat_inc(ifp, ifs6_out_timeexceed); \ 702 icmp6_ifstat_inc(ifp, ifs6_out_paramprob); \ [all …]
|
| /minix3/external/bsd/dhcp/dist/relay/ |
| H A D | dhcrelay.c | 109 struct interface_info *ifp; member 1163 struct interface_info *ifp = NULL; in parse_downstream() local 1167 if (!supports_multiple_interfaces(ifp) && in parse_downstream() 1184 if (strlen(ifname) >= sizeof(ifp->name)) { in parse_downstream() 1191 if (strcmp(ifname, dp->ifp->name) == 0) in parse_downstream() 1198 if (strcmp(ifname, up->ifp->name) == 0) { in parse_downstream() 1201 ifp = up->ifp; in parse_downstream() 1207 if (ifp == NULL) { in parse_downstream() 1208 status = interface_allocate(&ifp, MDL); in parse_downstream() 1212 strcpy(ifp->name, ifname); in parse_downstream() [all …]
|
| /minix3/usr.bin/uniq/ |
| H A D | uniq.c | 69 FILE *ifp, *ofp; in main() local 75 ifp = ofp = NULL; in main() 112 ifp = stdin; in main() 116 ifp = file(argv[0], "r"); in main() 120 ifp = file(argv[0], "r"); in main() 127 if ((p = fgetln(ifp, &psize)) == NULL) in main() 139 while ((p = fgetln(ifp, &psize)) != NULL) { in main()
|
| /minix3/sys/netinet6/ |
| H A D | nd6.h | 121 #define ND_IFINFO(ifp) \ argument 122 (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->nd_ifinfo) 123 #define IN6_LINKMTU(ifp) \ argument 124 ((ND_IFINFO(ifp)->linkmtu && ND_IFINFO(ifp)->linkmtu < (ifp)->if_mtu) \ 125 ? ND_IFINFO(ifp)->linkmtu \ 126 : ((ND_IFINFO(ifp)->maxmtu && ND_IFINFO(ifp)->maxmtu < (ifp)->if_mtu) \ 127 ? ND_IFINFO(ifp)->maxmtu : (ifp)->if_mtu)) 270 struct ifnet *ifp; member
|