/*
* 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
*/
/*
*/
#ifndef _INETSVC_H
#define _INETSVC_H
#include <libscf.h>
#include <libuutil.h>
/*
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Provide index values for inetd property locations in the property table, for
* convenience. If the array is modified, these values MUST be updated.
*/
#define PT_SVC_NAME_INDEX 0
/*
* Names of method properties.
*/
/*
* Method property group names.
*/
/*
* Valid socket type values.
*/
/*
* Valid socket based service protocols.
*/
/*
* Return codes for the methods of inetd managed services.
*/
#define IMRET_SUCCESS 0
/*
* Set this value above the range used by unix commands so theres minimal chance
* of a non-GL cognizant command accidentally returning this code.
*/
/*
* Macros for differentiating between sockaddr_in & sockaddr_in6 when
* dealing with the contents of a sockaddr_storage structure.
* These differentiate based on the contents of ss_family (either AF_INET
* or AF_INET6).
*/
sizeof (struct sockaddr_in) : sizeof (struct sockaddr_in6))
((struct sockaddr_in *)&(s))->sin_port : \
((struct sockaddr_in6 *)&(s))->sin6_port)
((void *) &(((struct sockaddr_in *)&(s))->sin_addr)) : \
((void *) &(((struct sockaddr_in6 *)&(s))->sin6_addr)))
/* Collection of information pertaining to rpc based services. */
typedef struct {
int prognum;
int lowver;
int highver;
char *netid;
} rpc_info_t;
/*
* Structure containing the common elements of both the socket_info_t and the
* tlx_info_t structures.
*/
typedef struct {
/* proto string causing this entry */
char *proto;
/* network fd we're listening on; -1 if not listening */
int listen_fd;
/* associate RPC info structure, if any (NULL if none). */
/* should this fd have the v6 socket option set? */
} proto_info_t;
typedef struct {
typedef struct {
/* protocol information common to tlx and socket based services */
/* address we're bound to */
/* device name supplied to t_open() */
char *dev_name;
/* queue of pending connection indications */
} tlx_info_t;
/* Collection of information pertaining to socket based services. */
typedef struct {
/* protocol information common to tlx and socket based services */
/* address we're bound to */
int type;
int protocol;
/* Basic configuration properties for an instance. */
typedef struct {
/* getservbyname() recognized service name */
char *svc_name;
/* list of protocols and associated info */
/* wait type service ? */
/*
* Properties from here onwards all have default values in the inetd
* service instance.
*/
/* inherit inetd's environment, or take an empty one */
/* failure rate configuration */
int wait_fail_interval;
/* maximum concurrent copies limit */
/* connection rate configuration */
int conn_rate_offline;
/* bind failure retries configuration */
int bind_fail_interval;
/* specific address to bind instance to */
char *bind_addr;
/* connection backlog queue size */
} basic_cfg_t;
typedef enum uds_request {
typedef union {
char *iv_string;
char **iv_string_list;
typedef enum {
} iv_error_t;
/*
* Operations on these types (like valid_default_prop()) need to be modified
* when this list is changed.
*/
typedef enum {
INET_TYPE_INVALID = 0,
} inet_type_t;
typedef struct {
const char *ip_name;
const char *ip_pg;
} inetd_prop_t;
const char *get_prop_value_string(const inetd_prop_t *, const char *);
const char **get_prop_value_string_list(const inetd_prop_t *, const char *);
void put_prop_value_string_list(inetd_prop_t *, const char *, char **);
uu_list_pool_t *, uu_list_pool_t *);
void destroy_basic_cfg(basic_cfg_t *);
void destroy_proto_list(basic_cfg_t *);
boolean_t valid_default_prop(const char *, const void *);
const char *);
scf_error_t *);
void free_instance_props(inetd_prop_t *);
int connect_to_inetd(void);
int refresh_inetd(void);
int get_sock_type_id(const char *);
int get_rpc_prognum(const char *);
int calculate_hash(const char *, char **);
scf_error_t retrieve_inetd_hash(char **);
scf_error_t store_inetd_hash(const char *);
const char *inet_ntop_native(int, const void *, char *, size_t);
void setproctitle(const char *, int, char **);
void dg_template(
void *, size_t);
int safe_write(int, const void *, size_t);
char **get_protos(const char *);
char **get_netids(char *);
void destroy_strings(char **);
#ifdef __cplusplus
}
#endif
#endif /* _INETSVC_H */