/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* as they are called from different threads.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "dhcp_impl.h"
#else
#include <strings.h>
#endif /* _KERNEL && !_BOOT */
/*
* Scan field for options.
*/
static void
{
start++;
continue;
}
break; /* done */
if (*start > last_option) {
continue; /* unrecognized option */
}
/* all options besides CD_END and CD_PAD should have a len */
continue;
/* Ignores duplicate options. */
/* verify that len won't go beyond end */
continue;
}
}
}
}
/*
* Scan Vendor field for options.
*/
static void
{
return;
/* verify that len won't go beyond the end of the packet */
return;
}
/*
* Load opts table in PKT_LIST entry with PKT's options.
* Returns 0 if no fatal errors occur, otherwise...
*/
int
{
/*
* bcmp() is used here instead of memcmp() since kernel/standalone
* doesn't have a memcmp().
*/
return (0);
}
/* check the options field */
/*
* process vendor specific options. We look at the vendor options
* here, simply because a BOOTP server could fake DHCP vendor
* options. This increases our interoperability with BOOTP.
*/
return (0);
return (DHCP_GARBLED_MSG_TYPE);
return (DHCP_WRONG_MSG_TYPE);
return (DHCP_BAD_OPT_OVLD);
}
case 1:
break;
case 2:
break;
case 3:
break;
default:
return (DHCP_BAD_OPT_OVLD);
}
}
return (0);
}
/*
* Locate a DHCPv6 option or suboption within a buffer. DHCPv6 uses nested
* options within options, and this function is designed to work with both
* primary options and the suboptions contained within.
*
* The 'oldopt' is a previous option pointer, and is typically used to iterate
* over options of the same code number. The 'codenum' is in host byte order
* for simplicity. 'retlenp' may be NULL, and if present gets the _entire_
* option length (including header).
*
* Warning: the returned pointer has no particular alignment because DHCPv6
* defines options without alignment. The caller must deal with unaligned
* pointers carefully.
*/
{
while (buflen >= sizeof (dhcpv6_option_t)) {
break;
continue;
}
/* LINTED: alignment */
return ((dhcpv6_option_t *)bp);
}
return (NULL);
}
/*
* Locate a DHCPv6 option within the top level of a PKT_LIST entry. DHCPv6
* uses nested options within options, and this function returns only the
* primary options. Use dhcpv6_find_option to traverse suboptions.
*
* See dhcpv6_find_option for usage details and warnings.
*/
{
return (NULL);
}