ksslcfg.c revision 164c0dd6f561db19bdaf1d0b7f2a8dec44355b69
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <ctype.h>
#include <libscf.h>
#include <netdb.h> /* hostent */
#include <stdio.h>
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <fcntl.h>
#include <strings.h>
#include "ksslcfg.h"
/*
* ksslcfg(1M)
*
* ksslcfg manages smf(5) instances for the Kernel SSL proxy module.
* It makes use of kssladm(1M) which does the grunt work.
*/
#define KSSLCFG_VERSION "v%I%"
const char *SERVICE_NAME = "network/ssl/proxy";
void
KSSL_DEBUG(const char *format, ...)
{
if (verbose) {
}
}
int
{
unsigned long port;
errno = 0;
return (0);
}
return (1);
}
#define ANY_ADDR "INADDR_ANY"
/*
* An instance name is formed using either the host name in the fully
* qualified domain name form (FQDN) which should map to a specific IP address
* or using INADDR_ANY which means all IP addresses.
*
* We do a lookup or reverse lookup to get the host name. It is assumed that
* the returned name is in the FQDN form. i.e. DNS is used.
*/
char *
{
int len;
char *cname;
char *instance_name;
const char *prefix = "kssl-";
if (first_space == NULL) {
gettext("Error: Invalid port value -- %s\n"),
arg);
return (NULL);
}
return (NULL);
} else {
char *temp_str;
char *ptr;
gettext("Error: Invalid port value -- %s\n"),
first_space + 1);
return (NULL);
}
return (NULL);
gettext("Error: Unknown host -- %s\n"),
temp_str);
return (NULL);
}
} else {
/* This is an IP address. Do a reverse lookup. */
== NULL) {
gettext("Error: Unknown host -- %s\n"),
temp_str);
return (NULL);
}
}
return (NULL);
}
/* "s/./-/g" */
if (do_warn)
*ptr = '-';
ptr++;
}
gettext("Warning: %s does not appear to have a"
" registered DNS name.\n"), temp_str);
}
}
gettext("Error: memory allocation failure.\n"));
return (NULL);
}
if (is_create) {
gettext("Error: memory allocation failure.\n"));
return (NULL);
}
}
return (instance_name);
}
static void
usage_all(void)
{
}
int
{
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
#endif
(void) textdomain(TEXT_DOMAIN);
if (argc < 2) {
usage_all();
return (ERROR_USAGE);
}
usage_all();
} else {
usage_all();
rv = ERROR_USAGE;
}
return (rv);
}