/*
* 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>
/*
* Create a health check, returning a health check handle upon success.
* Health check created will be recorded in persistent datastore.
*/
{
return (ILB_STATUS_EINVAL);
return (ILB_STATUS_ENOMEM);
if (rc != ILB_STATUS_OK)
goto out;
out:
return (rc);
}
/*
* Given a health check handle, destroy the corresponding health check.
* Persistent datastore will be updated as well.
*/
{
return (ILB_STATUS_EINVAL);
return (ILB_STATUS_ENOMEM);
if (rc != ILB_STATUS_OK)
goto out;
out:
return (rc);
}
/*
* Given a health check name, get hc info associated with this handle
*/
{
return (ILB_STATUS_EINVAL);
return (ILB_STATUS_ENOMEM);
return (ILB_STATUS_ENOMEM);
}
if (rc != ILB_STATUS_OK)
goto out;
goto out;
}
out:
return (rc);
}
/*
* Walk through all health checks, will need if we implement list-hc
*/
{
int i;
return (ILB_STATUS_ENOMEM);
if (rc != ILB_STATUS_OK)
goto out;
goto out;
}
for (i = 0; i < hc_names->ilbl_count; i++) {
/*
* Since getting the list of hc names and getting the info
* of each of them are not atomic, some hc objects may have
* been deleted. If this is the case, just skip them.
*/
if (rc == ILB_STATUS_ENOENT) {
rc = ILB_STATUS_OK;
continue;
} else if (rc != ILB_STATUS_OK) {
break;
}
}
out:
return (rc);
}
static ilb_status_t
{
return (ILB_STATUS_ENOMEM);
*rbufsz = ILBD_MSG_SIZE;
return (ILB_STATUS_ENOMEM);
}
sizeof (ilbd_name_t));
if (rc != ILB_STATUS_OK)
goto out;
return (rc);
}
out:
return (rc);
}
void *arg)
{
int i, j;
if (rc != ILB_STATUS_OK)
return (rc);
for (i = 0; i < srvs->rs_num_srvs; i++) {
if (rc != ILB_STATUS_OK)
break;
}
} else {
if (rc != ILB_STATUS_OK)
return (rc);
for (i = 0; i < names->ilbl_count; i++) {
&srv_rbuf, &srv_rbufsz);
/* Not all rules have HC, so reset the error to OK. */
if (rc == ILB_STATUS_RULE_NO_HC) {
rc = ILB_STATUS_OK;
continue;
} else if (rc != ILB_STATUS_OK) {
break;
}
for (j = 0; j < srvs->rs_num_srvs; j++) {
if (rc != ILB_STATUS_OK)
break;
}
}
}
return (rc);
}