/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <dhcpagent_ipc.h>
#include <dhcp_inittab.h>
#include <dhcp_symbol.h>
static void
{
"usage: %s [-c] [-i interface] [-n limit] [-v {4|6}] code\n"
" %s [-c] [-i interface] [-n limit] [-v {4|6}] identifier\n",
}
int
{
int c, error, i;
switch (c) {
case 'c':
break;
case 'i':
break;
case 'n':
break;
case 'v':
break;
case '?':
default:
break;
}
}
/*
* we either have a code or an identifer. if we have a code,
* then values over 256 indicate a vendor option. if we have
* an identifier, then use inittab_getbyname() to turn the
* identifier into a code, then send the request over the wire.
*/
return (DHCP_EXIT_BADARGS);
}
} else {
/*
* sigh. this is a hack, but it's needed for backward
* compatibility with the CA dhcpinfo program.
*/
}
if (isv6)
return (DHCP_EXIT_BADARGS);
}
}
/*
* send the request to the agent and reap the reply
*/
return (DHCP_EXIT_SYSTEM);
if (error == 0)
if (error == DHCP_IPC_E_TIMEOUT)
return (DHCP_EXIT_TIMEOUT);
return (DHCP_EXIT_FAILURE);
}
/*
* no data means that the client has an ACK but has no information
* about the specified option; return success
*/
if (opt_len == 0)
return (DHCP_EXIT_SUCCESS);
/*
* check for protocol error
*/
if (isv6) {
return (DHCP_EXIT_FAILURE);
return (DHCP_EXIT_FAILURE);
} else {
return (DHCP_EXIT_FAILURE);
opt_len -= 2;
}
if (is_canonical) {
return (DHCP_EXIT_FAILURE);
}
gran = 1;
} else {
"reply\n", argv[0]);
return (DHCP_EXIT_FAILURE);
}
}
/*
* now display `gran' items per line, printing at most `max_lines'.
*/
for (i = 0; value[i] != '\0'; i++) {
if (value[i] == ' ') {
value[i] = '\n';
value[i] = '\0';
break;
}
}
}
}
return (DHCP_EXIT_SUCCESS);
}