Lines Matching refs:ipaddr

131 i_ipadm_init_addr(ipadm_addrobj_t ipaddr, const char *ifname,  in i_ipadm_init_addr()  argument
134 bzero(ipaddr, sizeof (struct ipadm_addrobj_s)); in i_ipadm_init_addr()
135 (void) strlcpy(ipaddr->ipadm_ifname, ifname, in i_ipadm_init_addr()
136 sizeof (ipaddr->ipadm_ifname)); in i_ipadm_init_addr()
137 (void) strlcpy(ipaddr->ipadm_aobjname, aobjname, in i_ipadm_init_addr()
138 sizeof (ipaddr->ipadm_aobjname)); in i_ipadm_init_addr()
139 ipaddr->ipadm_atype = atype; in i_ipadm_init_addr()
182 i_ipadm_get_addrobj(ipadm_handle_t iph, ipadm_addrobj_t ipaddr) in i_ipadm_get_addrobj() argument
190 (void) strlcpy(larg.ia_aobjname, ipaddr->ipadm_aobjname, in i_ipadm_get_addrobj()
198 (void) strlcpy(ipaddr->ipadm_ifname, rval.ir_ifname, in i_ipadm_get_addrobj()
199 sizeof (ipaddr->ipadm_ifname)); in i_ipadm_get_addrobj()
200 ipaddr->ipadm_lifnum = rval.ir_lnum; in i_ipadm_get_addrobj()
201 ipaddr->ipadm_atype = rval.ir_atype; in i_ipadm_get_addrobj()
202 ipaddr->ipadm_af = rval.ir_family; in i_ipadm_get_addrobj()
203 ipaddr->ipadm_flags = rval.ir_flags; in i_ipadm_get_addrobj()
205 (void) memcpy(&ipaddr->ipadm_intfid, &rval.ir_ifid, in i_ipadm_get_addrobj()
206 sizeof (ipaddr->ipadm_intfid)); in i_ipadm_get_addrobj()
217 i_ipadm_get_static_addr_db(ipadm_handle_t iph, ipadm_addrobj_t ipaddr) in i_ipadm_get_static_addr_db() argument
225 char *aobjname = ipaddr->ipadm_aobjname; in i_ipadm_get_static_addr_db()
263 ipadm_set_addr(ipaddr, sname, af) != IPADM_SUCCESS) { in i_ipadm_get_static_addr_db()
361 struct ipadm_addrobj_s ipaddr; in i_ipadm_active_addr_info() local
433 ipaddr.ipadm_aobjname[0] = '\0'; in i_ipadm_active_addr_info()
434 (void) strlcpy(ipaddr.ipadm_ifname, cifname, in i_ipadm_active_addr_info()
435 sizeof (ipaddr.ipadm_ifname)); in i_ipadm_active_addr_info()
436 ipaddr.ipadm_lifnum = lnum; in i_ipadm_active_addr_info()
437 ipaddr.ipadm_af = ifap->ifa_addr->sa_family; in i_ipadm_active_addr_info()
438 status = i_ipadm_get_lif2addrobj(iph, &ipaddr); in i_ipadm_active_addr_info()
449 (void) strlcpy(curr->ia_aobjname, ipaddr.ipadm_aobjname, in i_ipadm_active_addr_info()
451 curr->ia_atype = ipaddr.ipadm_atype; in i_ipadm_active_addr_info()
911 ipadm_addrobj_t ipaddr = (ipadm_addrobj_t)arg; in i_ipadm_set_prefixlen() local
913 if (ipaddr->ipadm_atype == IPADM_ADDR_DHCP) in i_ipadm_set_prefixlen()
931 i_ipadm_addrobj2lifname(ipaddr, lifr.lifr_name, in i_ipadm_set_prefixlen()
964 ipadm_addrobj_t ipaddr = (ipadm_addrobj_t)arg; in i_ipadm_set_addr_flag() local
966 if (ipaddr->ipadm_atype == IPADM_ADDR_DHCP && in i_ipadm_set_addr_flag()
996 i_ipadm_addrobj2lifname(ipaddr, lifname, sizeof (lifname)); in i_ipadm_set_addr_flag()
1056 ipadm_addrobj_t ipaddr = (ipadm_addrobj_t)arg; in i_ipadm_get_broadcast() local
1061 i_ipadm_addrobj2lifname(ipaddr, lifname, sizeof (lifname)); in i_ipadm_get_broadcast()
1062 if (ipaddr->ipadm_flags & IPMGMT_ACTIVE) { in i_ipadm_get_broadcast()
1084 if (!(ipaddr->ipadm_flags & IPMGMT_ACTIVE)) { in i_ipadm_get_broadcast()
1089 if (ipaddr->ipadm_atype == IPADM_ADDR_DHCP || in i_ipadm_get_broadcast()
1090 ipaddr->ipadm_af == AF_INET6) { in i_ipadm_get_broadcast()
1098 status = i_ipadm_get_static_addr_db(iph, ipaddr); in i_ipadm_get_broadcast()
1101 sin = SIN(&ipaddr->ipadm_static_addr); in i_ipadm_get_broadcast()
1171 ipadm_addrobj_t ipaddr = (ipadm_addrobj_t)arg; in i_ipadm_get_prefixlen() local
1179 i_ipadm_addrobj2lifname(ipaddr, lifname, sizeof (lifname)); in i_ipadm_get_prefixlen()
1180 if (ipaddr->ipadm_flags & IPMGMT_ACTIVE) { in i_ipadm_get_prefixlen()
1201 if (ipaddr->ipadm_flags & IPMGMT_ACTIVE) { in i_ipadm_get_prefixlen()
1212 } else if ((ipaddr->ipadm_flags & IPMGMT_PERSIST) && in i_ipadm_get_prefixlen()
1213 ipaddr->ipadm_atype == IPADM_ADDR_DHCP) { in i_ipadm_get_prefixlen()
1225 status = i_ipadm_get_static_addr_db(iph, ipaddr); in i_ipadm_get_prefixlen()
1229 &ipaddr->ipadm_static_addr, &prefixlen); in i_ipadm_get_prefixlen()
1268 ipadm_addrobj_t ipaddr = (ipadm_addrobj_t)arg; in i_ipadm_get_addr_flag() local
1287 i_ipadm_addrobj2lifname(ipaddr, lifname, sizeof (lifname)); in i_ipadm_get_addr_flag()
1396 struct ipadm_addrobj_s ipaddr; in ipadm_get_addrprop() local
1414 i_ipadm_init_addr(&ipaddr, "", aobjname, IPADM_ADDR_NONE); in ipadm_get_addrprop()
1415 if ((status = i_ipadm_get_addrobj(iph, &ipaddr)) != IPADM_SUCCESS) in ipadm_get_addrprop()
1418 if (ipaddr.ipadm_atype == IPADM_ADDR_IPV6_ADDRCONF) in ipadm_get_addrprop()
1420 af = ipaddr.ipadm_af; in ipadm_get_addrprop()
1431 if (!(ipaddr.ipadm_flags & IPMGMT_ACTIVE)) { in ipadm_get_addrprop()
1434 status = pdp->ipd_get(iph, &ipaddr, pdp, buf, bufsize, in ipadm_get_addrprop()
1439 status = pdp->ipd_get(iph, &ipaddr, pdp, buf, bufsize, in ipadm_get_addrprop()
1444 status = pdp->ipd_get_range(iph, &ipaddr, pdp, buf, in ipadm_get_addrprop()
1452 &ipaddr); in ipadm_get_addrprop()
1470 struct ipadm_addrobj_s ipaddr; in ipadm_set_addrprop() local
1505 i_ipadm_init_addr(&ipaddr, "", aobjname, IPADM_ADDR_NONE); in ipadm_set_addrprop()
1506 if ((status = i_ipadm_get_addrobj(iph, &ipaddr)) != IPADM_SUCCESS) in ipadm_set_addrprop()
1509 if (!(ipaddr.ipadm_flags & IPMGMT_ACTIVE)) in ipadm_set_addrprop()
1514 !(ipaddr.ipadm_flags & IPMGMT_PERSIST)) in ipadm_set_addrprop()
1525 if (ipaddr.ipadm_atype == IPADM_ADDR_IPV6_ADDRCONF) in ipadm_set_addrprop()
1532 if (!(ipaddr.ipadm_flags & IPMGMT_ACTIVE)) in ipadm_set_addrprop()
1535 af = ipaddr.ipadm_af; in ipadm_set_addrprop()
1541 status = pdp->ipd_get(iph, &ipaddr, pdp, defbuf, &defbufsize, in ipadm_set_addrprop()
1548 status = pdp->ipd_set(iph, &ipaddr, pdp, pval, af, pflags); in ipadm_set_addrprop()
1557 status = i_ipadm_persist_propval(iph, pdp, pval, &ipaddr, in ipadm_set_addrprop()
1728 ipadm_set_addr(ipadm_addrobj_t ipaddr, const char *astr, sa_family_t af) in ipadm_set_addr() argument
1753 status = i_ipadm_resolve_addr(addrstr, af, &ipaddr->ipadm_static_addr); in ipadm_set_addr()
1755 (void) strlcpy(ipaddr->ipadm_static_aname, addrstr, in ipadm_set_addr()
1756 sizeof (ipaddr->ipadm_static_aname)); in ipadm_set_addr()
1757 ipaddr->ipadm_af = ipaddr->ipadm_static_addr.ss_family; in ipadm_set_addr()
1758 ipaddr->ipadm_static_prefixlen = prefixlen; in ipadm_set_addr()
1768 ipadm_get_addr(const ipadm_addrobj_t ipaddr, struct sockaddr_storage *addr) in ipadm_get_addr() argument
1770 if (ipaddr == NULL || ipaddr->ipadm_atype != IPADM_ADDR_STATIC || in ipadm_get_addr()
1774 *addr = ipaddr->ipadm_static_addr; in ipadm_get_addr()
1786 ipadm_set_dst_addr(ipadm_addrobj_t ipaddr, const char *daddrstr, sa_family_t af) in ipadm_set_dst_addr() argument
1795 &ipaddr->ipadm_static_dst_addr); in ipadm_set_dst_addr()
1797 (void) strlcpy(ipaddr->ipadm_static_dname, daddrstr, in ipadm_set_dst_addr()
1798 sizeof (ipaddr->ipadm_static_dname)); in ipadm_set_dst_addr()
1810 ipadm_set_interface_id(ipadm_addrobj_t ipaddr, const char *interface_id) in ipadm_set_interface_id() argument
1818 if (ipaddr == NULL || interface_id == NULL || in ipadm_set_interface_id()
1819 ipaddr->ipadm_atype != IPADM_ADDR_IPV6_ADDRCONF) in ipadm_set_interface_id()
1826 sin6 = &ipaddr->ipadm_intfid; in ipadm_set_interface_id()
1833 ipaddr->ipadm_intfidlen = prefixlen; in ipadm_set_interface_id()
1843 ipadm_set_stateless(ipadm_addrobj_t ipaddr, boolean_t stateless) in ipadm_set_stateless() argument
1845 if (ipaddr == NULL || in ipadm_set_stateless()
1846 ipaddr->ipadm_atype != IPADM_ADDR_IPV6_ADDRCONF) in ipadm_set_stateless()
1848 ipaddr->ipadm_stateless = stateless; in ipadm_set_stateless()
1857 ipadm_set_stateful(ipadm_addrobj_t ipaddr, boolean_t stateful) in ipadm_set_stateful() argument
1859 if (ipaddr == NULL || in ipadm_set_stateful()
1860 ipaddr->ipadm_atype != IPADM_ADDR_IPV6_ADDRCONF) in ipadm_set_stateful()
1862 ipaddr->ipadm_stateful = stateful; in ipadm_set_stateful()
1874 ipadm_set_primary(ipadm_addrobj_t ipaddr, boolean_t primary) in ipadm_set_primary() argument
1876 if (ipaddr == NULL || ipaddr->ipadm_atype != IPADM_ADDR_DHCP) in ipadm_set_primary()
1878 ipaddr->ipadm_primary = primary; in ipadm_set_primary()
1895 ipadm_set_wait_time(ipadm_addrobj_t ipaddr, int32_t wait) in ipadm_set_wait_time() argument
1897 if (ipaddr == NULL || ipaddr->ipadm_atype != IPADM_ADDR_DHCP) in ipadm_set_wait_time()
1899 ipaddr->ipadm_wait = wait; in ipadm_set_wait_time()
1912 i_ipadm_lookupadd_addrobj(ipadm_handle_t iph, ipadm_addrobj_t ipaddr) in i_ipadm_lookupadd_addrobj() argument
1920 (void) strlcpy(larg.ia_aobjname, ipaddr->ipadm_aobjname, in i_ipadm_lookupadd_addrobj()
1922 (void) strlcpy(larg.ia_ifname, ipaddr->ipadm_ifname, in i_ipadm_lookupadd_addrobj()
1924 larg.ia_family = ipaddr->ipadm_af; in i_ipadm_lookupadd_addrobj()
1925 larg.ia_atype = ipaddr->ipadm_atype; in i_ipadm_lookupadd_addrobj()
1930 if (err == 0 && ipaddr->ipadm_aobjname[0] == '\0') { in i_ipadm_lookupadd_addrobj()
1932 (void) strlcpy(ipaddr->ipadm_aobjname, rval.ir_aobjname, in i_ipadm_lookupadd_addrobj()
1933 sizeof (ipaddr->ipadm_aobjname)); in i_ipadm_lookupadd_addrobj()
1946 i_ipadm_setlifnum_addrobj(ipadm_handle_t iph, ipadm_addrobj_t ipaddr) in i_ipadm_setlifnum_addrobj() argument
1957 (void) strlcpy(larg.ia_aobjname, ipaddr->ipadm_aobjname, in i_ipadm_setlifnum_addrobj()
1959 larg.ia_lnum = ipaddr->ipadm_lifnum; in i_ipadm_setlifnum_addrobj()
1960 (void) strlcpy(larg.ia_ifname, ipaddr->ipadm_ifname, in i_ipadm_setlifnum_addrobj()
1962 larg.ia_family = ipaddr->ipadm_af; in i_ipadm_setlifnum_addrobj()
1984 struct ipadm_addrobj_s ipaddr; in i_ipadm_enable_static() local
2026 i_ipadm_init_addr(&ipaddr, ifname, aobjname, IPADM_ADDR_STATIC); in i_ipadm_enable_static()
2030 status = ipadm_set_addr(&ipaddr, cidraddr, af); in i_ipadm_enable_static()
2033 status = ipadm_set_addr(&ipaddr, sname, af); in i_ipadm_enable_static()
2039 status = ipadm_set_dst_addr(&ipaddr, dname, af); in i_ipadm_enable_static()
2043 return (i_ipadm_create_addr(iph, &ipaddr, flags)); in i_ipadm_enable_static()
2058 struct ipadm_addrobj_s ipaddr; in i_ipadm_enable_dhcp() local
2085 i_ipadm_init_addr(&ipaddr, ifname, aobjname, IPADM_ADDR_DHCP); in i_ipadm_enable_dhcp()
2086 ipaddr.ipadm_primary = primary; in i_ipadm_enable_dhcp()
2088 ipaddr.ipadm_wait = 0; in i_ipadm_enable_dhcp()
2090 ipaddr.ipadm_wait = wait; in i_ipadm_enable_dhcp()
2091 ipaddr.ipadm_af = AF_INET; in i_ipadm_enable_dhcp()
2092 return (i_ipadm_create_dhcp(iph, &ipaddr, IPADM_OPT_ACTIVE)); in i_ipadm_enable_dhcp()
2102 struct ipadm_addrobj_s ipaddr; in i_ipadm_enable_addrconf() local
2139 i_ipadm_init_addr(&ipaddr, ifname, aobjname, IPADM_ADDR_IPV6_ADDRCONF); in i_ipadm_enable_addrconf()
2141 ipaddr.ipadm_intfidlen = intfidlen; in i_ipadm_enable_addrconf()
2142 bcopy(addr6, &ipaddr.ipadm_intfid.sin6_addr.s6_addr, n); in i_ipadm_enable_addrconf()
2144 ipaddr.ipadm_stateless = (strcmp(stateless, "yes") == 0); in i_ipadm_enable_addrconf()
2145 ipaddr.ipadm_stateful = (strcmp(stateful, "yes") == 0); in i_ipadm_enable_addrconf()
2146 return (i_ipadm_create_ipv6addrs(iph, &ipaddr, IPADM_OPT_ACTIVE)); in i_ipadm_enable_addrconf()
2159 ipadm_addrobj_t *ipaddr) in ipadm_create_addrobj() argument
2167 if (ipaddr == NULL) in ipadm_create_addrobj()
2169 *ipaddr = NULL; in ipadm_create_addrobj()
2234 *ipaddr = newaddr; in ipadm_create_addrobj()
2245 ipadm_get_aobjname(const ipadm_addrobj_t ipaddr, char *aobjname, size_t len) in ipadm_get_aobjname() argument
2247 if (ipaddr == NULL || aobjname == NULL) in ipadm_get_aobjname()
2249 if (strlcpy(aobjname, ipaddr->ipadm_aobjname, len) >= len) in ipadm_get_aobjname()
2259 ipadm_destroy_addrobj(ipadm_addrobj_t ipaddr) in ipadm_destroy_addrobj() argument
2261 free(ipaddr); in ipadm_destroy_addrobj()
2269 i_ipadm_addrobj2lifname(ipadm_addrobj_t ipaddr, char *lifname, int lifnamesize) in i_ipadm_addrobj2lifname() argument
2271 if (ipaddr->ipadm_lifnum != 0) { in i_ipadm_addrobj2lifname()
2273 ipaddr->ipadm_ifname, ipaddr->ipadm_lifnum); in i_ipadm_addrobj2lifname()
2276 ipaddr->ipadm_ifname); in i_ipadm_addrobj2lifname()
2445 struct ipadm_addrobj_s ipaddr; in ipadm_create_addr() local
2447 ipaddr = *addr; in ipadm_create_addr()
2448 status = i_ipadm_get_lif2addrobj(iph, &ipaddr); in ipadm_create_addr()
2455 if (ipaddr.ipadm_atype != IPADM_ADDR_STATIC) in ipadm_create_addr()
2462 ipaddr.ipadm_aobjname, IPADM_AOBJSIZ); in ipadm_create_addr()
2626 i_ipadm_create_addr(ipadm_handle_t iph, ipadm_addrobj_t ipaddr, uint32_t flags) in i_ipadm_create_addr() argument
2632 const struct sockaddr_storage *addr = &ipaddr->ipadm_static_addr; in i_ipadm_create_addr()
2633 const struct sockaddr_storage *daddr = &ipaddr->ipadm_static_dst_addr; in i_ipadm_create_addr()
2641 af = ipaddr->ipadm_af; in i_ipadm_create_addr()
2645 if (ipaddr->ipadm_static_prefixlen == 0) { in i_ipadm_create_addr()
2648 &ipaddr->ipadm_static_addr, in i_ipadm_create_addr()
2649 &ipaddr->ipadm_static_prefixlen); in i_ipadm_create_addr()
2654 (void) plen2mask(ipaddr->ipadm_static_prefixlen, af, in i_ipadm_create_addr()
2663 status = i_ipadm_do_addif(iph, ipaddr); in i_ipadm_create_addr()
2674 status = i_ipadm_setlifnum_addrobj(iph, ipaddr); in i_ipadm_create_addr()
2681 i_ipadm_addrobj2lifname(ipaddr, lifr.lifr_name, in i_ipadm_create_addr()
2724 ipaddr->ipadm_aobjname, in i_ipadm_create_addr()
2732 status = i_ipadm_addr_persist(iph, ipaddr, default_prefixlen, in i_ipadm_create_addr()
2737 (void) i_ipadm_delete_addr(iph, ipaddr); in i_ipadm_create_addr()
2762 struct ipadm_addrobj_s ipaddr; in ipadm_delete_addr() local
2775 bzero(&ipaddr, sizeof (ipaddr)); in ipadm_delete_addr()
2776 if (aobjname == NULL || strlcpy(ipaddr.ipadm_aobjname, aobjname, in ipadm_delete_addr()
2782 status = i_ipadm_get_addrobj(iph, &ipaddr); in ipadm_delete_addr()
2786 if (release && ipaddr.ipadm_atype != IPADM_ADDR_DHCP) in ipadm_delete_addr()
2792 if (!(ipaddr.ipadm_flags & IPMGMT_ACTIVE) && in ipadm_delete_addr()
2801 if (ipaddr.ipadm_flags & IPMGMT_ACTIVE) { in ipadm_delete_addr()
2802 switch (ipaddr.ipadm_atype) { in ipadm_delete_addr()
2804 status = i_ipadm_delete_addr(iph, &ipaddr); in ipadm_delete_addr()
2807 status = i_ipadm_delete_dhcp(iph, &ipaddr, release); in ipadm_delete_addr()
2810 status = i_ipadm_delete_ipv6addrs(iph, &ipaddr); in ipadm_delete_addr()
2833 if (!(ipaddr.ipadm_flags & IPMGMT_PERSIST) && in ipadm_delete_addr()
2837 status = i_ipadm_delete_addrobj(iph, &ipaddr, flags); in ipadm_delete_addr()
3034 i_ipadm_addr_persist(ipadm_handle_t iph, const ipadm_addrobj_t ipaddr, in i_ipadm_addr_persist() argument
3037 char *aname = ipaddr->ipadm_aobjname; in i_ipadm_addr_persist()
3051 ipaddr->ipadm_ifname)) != 0 || in i_ipadm_addr_persist()
3054 ipaddr->ipadm_lifnum)) != 0) { in i_ipadm_addr_persist()
3058 switch (ipaddr->ipadm_atype) { in i_ipadm_addr_persist()
3060 status = i_ipadm_add_ipaddr2nvl(nvl, ipaddr); in i_ipadm_addr_persist()
3064 ipaddr->ipadm_static_prefixlen); in i_ipadm_addr_persist()
3072 status = i_ipadm_add_dhcp2nvl(nvl, ipaddr->ipadm_primary, in i_ipadm_addr_persist()
3073 ipaddr->ipadm_wait); in i_ipadm_addr_persist()
3076 status = i_ipadm_add_intfid2nvl(nvl, ipaddr); in i_ipadm_addr_persist()
3107 ipaddr->ipadm_atype == IPADM_ADDR_STATIC && in i_ipadm_addr_persist()
3114 status = i_ipadm_persist_propval(iph, pdp, pval, ipaddr, flags); in i_ipadm_addr_persist()
3157 i_ipadm_delete_addrobj(ipadm_handle_t iph, const ipadm_addrobj_t ipaddr, in i_ipadm_delete_addrobj() argument
3169 (void) strlcpy(arg.ia_aobjname, ipaddr->ipadm_aobjname, in i_ipadm_delete_addrobj()
3171 arg.ia_lnum = ipaddr->ipadm_lifnum; in i_ipadm_delete_addrobj()
3184 ipadm_addrobj_t ipaddr, uint32_t ipadm_flags, uint64_t *ifflags) in i_ipadm_updown_common() argument
3194 if (aobjname == NULL || strlcpy(ipaddr->ipadm_aobjname, aobjname, in i_ipadm_updown_common()
3200 status = i_ipadm_get_addrobj(iph, ipaddr); in i_ipadm_updown_common()
3204 if (!(ipaddr->ipadm_flags & IPMGMT_ACTIVE)) in i_ipadm_updown_common()
3207 !(ipaddr->ipadm_flags & IPMGMT_PERSIST)) in i_ipadm_updown_common()
3209 if (ipaddr->ipadm_atype == IPADM_ADDR_IPV6_ADDRCONF || in i_ipadm_updown_common()
3210 (ipaddr->ipadm_atype == IPADM_ADDR_DHCP && in i_ipadm_updown_common()
3214 i_ipadm_addrobj2lifname(ipaddr, lifname, sizeof (lifname)); in i_ipadm_updown_common()
3215 return (i_ipadm_get_flags(iph, lifname, ipaddr->ipadm_af, ifflags)); in i_ipadm_updown_common()
3227 struct ipadm_addrobj_s ipaddr; in ipadm_up_addr() local
3232 status = i_ipadm_updown_common(iph, aobjname, &ipaddr, ipadm_flags, in ipadm_up_addr()
3245 i_ipadm_addrobj2lifname(&ipaddr, lifname, sizeof (lifname)); in ipadm_up_addr()
3246 status = i_ipadm_set_flags(iph, lifname, ipaddr.ipadm_af, IFF_UP, 0); in ipadm_up_addr()
3254 "yes", &ipaddr, 0); in ipadm_up_addr()
3269 struct ipadm_addrobj_s ipaddr; in ipadm_down_addr() local
3274 status = i_ipadm_updown_common(iph, aobjname, &ipaddr, ipadm_flags, in ipadm_down_addr()
3278 i_ipadm_addrobj2lifname(&ipaddr, lifr.lifr_name, in ipadm_down_addr()
3282 ipaddr.ipadm_af, 0, IFF_UP); in ipadm_down_addr()
3298 "no", &ipaddr, 0); in ipadm_down_addr()
3320 struct ipadm_addrobj_s ipaddr; in ipadm_refresh_addr() local
3331 bzero(&ipaddr, sizeof (ipaddr)); in ipadm_refresh_addr()
3333 if (aobjname == NULL || strlcpy(ipaddr.ipadm_aobjname, aobjname, in ipadm_refresh_addr()
3339 status = i_ipadm_get_addrobj(iph, &ipaddr); in ipadm_refresh_addr()
3343 if (!(ipaddr.ipadm_flags & IPMGMT_ACTIVE)) in ipadm_refresh_addr()
3346 if (i_ipadm_is_vni(ipaddr.ipadm_ifname)) in ipadm_refresh_addr()
3348 if (inform && ipaddr.ipadm_atype != IPADM_ADDR_STATIC) in ipadm_refresh_addr()
3350 af = ipaddr.ipadm_af; in ipadm_refresh_addr()
3351 if (ipaddr.ipadm_atype == IPADM_ADDR_STATIC) { in ipadm_refresh_addr()
3352 i_ipadm_addrobj2lifname(&ipaddr, lifname, sizeof (lifname)); in ipadm_refresh_addr()
3360 ipaddr.ipadm_wait = IPADM_DHCP_WAIT_DEFAULT; in ipadm_refresh_addr()
3361 return (i_ipadm_op_dhcp(&ipaddr, DHCP_INFORM, NULL)); in ipadm_refresh_addr()
3366 } else if (ipaddr.ipadm_atype == IPADM_ADDR_DHCP) { in ipadm_refresh_addr()
3367 status = i_ipadm_op_dhcp(&ipaddr, DHCP_EXTEND, &dherr); in ipadm_refresh_addr()
3373 ipaddr.ipadm_wait = IPADM_DHCP_WAIT_DEFAULT; in ipadm_refresh_addr()
3374 status = i_ipadm_op_dhcp(&ipaddr, DHCP_START, NULL); in ipadm_refresh_addr()
3397 i_ipadm_validate_create_addr(ipadm_handle_t iph, ipadm_addrobj_t ipaddr, in i_ipadm_validate_create_addr() argument
3410 if (ipaddr == NULL || flags == 0 || flags == IPADM_OPT_PERSIST || in i_ipadm_validate_create_addr()
3415 if (ipaddr->ipadm_af == AF_UNSPEC) in i_ipadm_validate_create_addr()
3418 if (!legacy && ipaddr->ipadm_lifnum != 0) in i_ipadm_validate_create_addr()
3421 if (legacy && ipaddr->ipadm_atype != IPADM_ADDR_STATIC) in i_ipadm_validate_create_addr()
3424 ifname = ipaddr->ipadm_ifname; in i_ipadm_validate_create_addr()
3429 af = ipaddr->ipadm_af; in i_ipadm_validate_create_addr()
3470 switch (ipaddr->ipadm_atype) { in i_ipadm_validate_create_addr()
3472 if ((islo || isvni) && ipaddr->ipadm_static_dname[0] != '\0') in i_ipadm_validate_create_addr()
3476 (struct sockaddr *)&ipaddr->ipadm_static_addr)) in i_ipadm_validate_create_addr()
3535 struct ipadm_addrobj_s ipaddr; in ipadm_enable_addr() local
3544 if (aobjname == NULL || strlcpy(ipaddr.ipadm_aobjname, aobjname, in ipadm_enable_addr()
3550 status = i_ipadm_get_addrobj(iph, &ipaddr); in ipadm_enable_addr()
3553 if (ipaddr.ipadm_flags & IPMGMT_ACTIVE) in ipadm_enable_addr()