/*
* 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 <stdlib.h>
#include <strings.h>
#include <stddef.h>
#include <libilb_impl.h>
#include <libilb.h>
static ilb_status_t
{
return (ILB_STATUS_EINVAL);
return (ILB_STATUS_NAMETOOLONG);
return (ILB_STATUS_ENOMEM);
if (rc != ILB_STATUS_OK)
goto out;
out:
return (rc);
}
{
}
{
}
static ilb_status_t
{
return (ILB_STATUS_EINVAL);
return (ILB_STATUS_NAMETOOLONG);
/* now all the checks have passed, we can pass on the goods */
return (ILB_STATUS_ENOMEM);
else
if (rc != ILB_STATUS_OK)
goto out;
out:
return (rc);
}
{
}
{
}
static ilb_status_t
{
*rbufsz = ILBD_MSG_SIZE;
return (ILB_STATUS_ENOMEM);
if (rc != ILB_STATUS_OK)
goto out;
return (rc);
}
out:
return (rc);
}
static ilb_status_t
{
return (ILB_STATUS_ENOMEM);
*rbufsz = ILBD_MSG_SIZE;
return (ILB_STATUS_ENOMEM);
}
if (rc != ILB_STATUS_OK)
goto out;
return (rc);
}
out:
return (rc);
}
typedef enum {
} sgwalk_t;
/*
* "walks" one sg (retrieves data) and depending on "walktype" argument
* call servergroup function once per sg or server function once
* for every server. in both cases, the argument "f" is cast to
* be the proper function pointer type
*/
static ilb_status_t
{
int i;
if (rc != ILB_STATUS_OK)
return (rc);
goto out;
}
for (i = 0; i < sg_info->sg_srvcount; i++) {
if (rc != ILB_STATUS_OK)
break;
}
out:
return (rc);
}
/*
* wrapper function for i_walk_one_sg; if necessary, gets list of
* SG names and calles i_walk_one_sg with every name
*/
static ilb_status_t
{
int i;
return (rc);
}
if (rc != ILB_STATUS_OK)
return (rc);
for (i = 0; i < sgl->ilbl_count; i++) {
/*
* The server group may have been removed by another
* process, just continue.
*/
if (rc == ILB_STATUS_SGUNAVAIL) {
rc = ILB_STATUS_OK;
continue;
}
if (rc != ILB_STATUS_OK)
break;
}
return (rc);
}
void *arg)
{
}
void *arg)
{
}
static ilb_status_t
{
if (h == NULL)
return (ILB_STATUS_EINVAL);
/*
* In this implementation, this needs to be NULL, so
* there's no ugly surprises with old apps once we attach
* meaning to this parameter.
*/
return (ILB_STATUS_EINVAL);
/* now all the checks have passed, we can pass on the goods */
return (ILB_STATUS_ENOMEM);
/* make sure min_port <= max_port; comparison in host byte order! */
else
if (rc != ILB_STATUS_OK)
goto out;
out:
return (rc);
}
{
}
{
}
static ilb_status_t
{
return (ILB_STATUS_EINVAL);
return (ILB_STATUS_EINVAL);
return (ILB_STATUS_EINVAL);
return (ILB_STATUS_ENOMEM);
return (ILB_STATUS_ENOMEM);
}
if (cmd == ILBD_SRV_ID2ADDR)
else
if (rc != ILB_STATUS_OK)
goto out;
if (cmd == ILBD_SRV_ID2ADDR) {
} else {
}
return (rc);
}
out:
return (rc);
}
{
}
{
}