# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# @author: Girish Moodalbail, Oracle, Inc.
#
import eventlet
import netaddr
# uses pfexec
'''Wrapper around Solaris ipadm(1m) command.'''
try:
except Exception:
return False
return True
if ifname:
result = {}
for atype_addr in atype_addrs:
if val is None:
# in the case of IPv6 addresses remove any escape '\' character
return result
# create ip interface
if temp:
return
# If an address is IPv6, then to create a static IPv6 address
# we need to create link-local address first
# check if link-local address already exists
# create a link-local address
if temp:
if temp:
# create ip interface
if temp:
else:
if 'addrconf' in stdout:
return
if temp:
return
for aobj_addr in aobj_addrs:
continue
break
# delete the interface as well
return
'''Wrapper around Solaris dladm(1m) command.'''
try:
except Exception:
return False
return True
return
if vid:
# If the default_tag of lower_link is same as vid, then there
# is no need to set vid
vid = '0'
else:
vid = '0'
if temp:
if temp:
return
return stdout.splitlines()
# Set timeout with -w to ensure arping exits in case the interface
# is deleted while it is running
try:
except Exception:
"an interface %(iface)s")
"""Send advance notification of an IP address assignment.
If the address is in the IPv4 family, send gratuitous ARP.
If the address is in the IPv6 family, no advance notification is
necessary, since the Neighbor Discovery Protocol (NDP), Duplicate
Address Discovery (DAD), and (for stateless addresses) router
advertisements (RAs) are sufficient for address resolution and
duplicate address detection.
"""
def arping():