/*
* 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
*/
/*
*
*/
#include <unistd.h>
#include <string.h>
#include <dhcpmsg.h>
#include <dhcp_hostconf.h>
#include <dhcpagent_util.h>
#include "agent.h"
#include "packet.h"
#include "interface.h"
#include "states.h"
/*
* send_declines(): sends a DECLINE message (broadcasted for IPv4) to the
* server to indicate a problem with the offered addresses.
* The failing addresses are removed from the leases.
*
* input: dhcp_smach_t *: the state machine sending DECLINE
* output: void
*/
void
{
/*
* Create an empty DECLINE message. We'll stuff the information into
* this message as we find it.
*/
return;
} else {
/*
* If this ack is from BOOTP, then there's no way to send a
* decline. Note that since we haven't bound yet, we can't
* just check the BOOTP flag.
*/
return;
return;
}
/*
* Loop over the leases, looking for ones with now-broken LIFs. Add
* each one found to the DECLINE message, and remove it from the list.
* Also remove any completely declined leases.
*/
}
}
}
if (!got_one)
return;
} else {
}
}
/*
* dhcp_release(): sends a RELEASE message to a DHCP server and removes
* the all interfaces for the given state machine from DHCP
* control. Called back by script handler.
*
* input: dhcp_smach_t *: the state machine to send the RELEASE on and remove
* void *: an optional text explanation to send with the message
* output: int: 1 on success, 0 on failure
*/
int
{
return (0);
}
}
}
/*
* Must kill off the leases before attempting to tell the
* server.
*/
/*
* For DHCPv6, this is a transaction, rather than just a
* one-shot message. When this transaction is done, we'll
* finish the invoking async operation.
*/
} else {
}
}
/*
* 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 through remove_smach.
*/
(void) usleep(500);
}
return (1);
}
/*
* dhcp_drop(): drops the interface from DHCP control; callback from script
* handler
*
* input: dhcp_smach_t *: the state machine dropping leases
* void *: unused
* output: int: always 1
*/
/* ARGSUSED1 */
int
{
"used bootp; not writing lease file for %s",
} else {
}
} else {
}
return (1);
}
/*
* messages for DHCPv6. When we stop, if there are no
* more leases left, then restart the state machine.
*
* input: dhcp_smach_t *: the state machine messages are being sent from
* unsigned int: the number of messages sent so far
* output: boolean_t: B_TRUE if retransmissions should stop
*/
static boolean_t
{
if (n_requests >= DHCPV6_REL_MAX_RC) {
return (B_TRUE);
} else {
return (B_FALSE);
}
} else {
if (n_requests >= DHCPV6_DEC_MAX_RC) {
}
return (B_TRUE);
} else {
return (B_FALSE);
}
}
}