release.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <string.h>
#include <dhcpmsg.h>
#include <dhcp_hostconf.h>
#include <unistd.h>
#include "packet.h"
#include "interface.h"
#include "states.h"
/*
* send_decline(): sends a DECLINE message (broadcasted)
*
* input: struct ifslist *: the interface to send the DECLINE on
* char *: an optional text explanation to send with the message
* struct in_addr *: the IP address being declined
* output: void
*/
void
{
}
/*
* dhcp_release(): sends a RELEASE message to a DHCP server and removes
* the interface from DHCP control
*
* input: struct ifslist *: the interface to send the RELEASE on and remove
* const char *: an optional text explanation to send with the message
* output: int: 1 on success, 0 on failure
*/
int
{
int retval = 0;
int error = DHCP_IPC_E_INT;
goto out;
goto out;
/*
* XXX this totally sucks, but since udp is best-effort,
* without this delay, there's a good chance that the packet
* that we just enqueued for sending will get pitched
* when we canonize the interface below.
*/
(void) usleep(500);
(void) canonize_ifs(ifsp);
retval = 1;
out:
return (retval);
}
/*
* dhcp_drop(): drops the interface from DHCP control
*
* input: struct ifslist *: the interface to drop
* const char *: unused
* output: int: always 1
*/
/* ARGSUSED */
int
{
"not use cached configuration)",
}
(void) canonize_ifs(ifsp);
}
return (1);
}