ksslcfg.c revision 2ec7cc7fc084163eaed884efee9bbd322cc8951b
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#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.
*/
/*
* This version number is rather meaningless. In any case,
* version 2.0 adds support for IPv6 addresses.
*/
#define KSSLCFG_VERSION "Version 2.0"
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-";
char *first_space;
gettext("Error: Invalid port value -- %s\n"),
arg);
return (NULL);
}
return (NULL);
} else {
char *temp_str;
char *ptr;
int error_num;
gettext("Error: Invalid port value -- %s\n"),
first_space + 1);
return (NULL);
}
return (NULL);
/* Do a reverse lookup for the IPv6 address */
/* Do a reverse lookup for the IPv4 address */
} else {
/* Do a lookup for the host name */
&error_num);
}
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);
}