/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <errno.h>
#include <ipmp_admin.h>
#include <libinetutil.h>
#include <locale.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
static const char *progname;
static boolean_t is_offline(const char *);
static void warn(const char *, ...);
static void die(const char *, ...);
static void
usage(void)
{
progname);
}
static const char *
{
switch (error) {
case IPMP_EUNKIF:
return (gettext("not a physical interface or not in an "
"IPMP group"));
case IPMP_EMINRED:
return (gettext("no other functioning interfaces are in its "
"IPMP group"));
default:
return (ipmp_errmsg(error));
}
}
int
{
int retval;
const char *ifname;
int c;
progname++;
else
(void) textdomain(TEXT_DOMAIN);
switch (c) {
case 'd':
ofuncp = do_offline;
break;
case 'r':
break;
default:
usage();
}
}
usage();
/*
* Create the global V4 and V6 socket ioctl descriptors.
*/
die("cannot create sockets");
return (EXIT_SUCCESS);
}
/*
* Checks whether IFF_OFFLINE is set on `ifname'.
*/
{
}
}
}
static void
{
int retval;
if (is_offline(ifname))
/*
* Get all the up addresses for `ifname' and bring them down.
*/
warn("cannot bring down address on %s",
}
}
static void
{
int retval;
if (!is_offline(ifname))
/*
* Get all the down addresses for `ifname' and bring them up.
*/
}
/*
* Undo the offline.
*/
}
/*
* Verify whether IFF_OFFLINE is set as a sanity check.
*/
if (is_offline(ifname))
}
/*
* Change `lifname' to have `flags' set. Returns B_TRUE on success.
*/
static boolean_t
{
}
/* PRINTFLIKE1 */
static void
{
}
/* PRINTFLIKE1 */
static void
{
}