/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SLP_INTERNAL_H
#define _SLP_INTERNAL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <thread.h>
#include <synch.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <slp.h>
/* SLPv2 function numbers */
/* SLPv2 protocol error functions, hidden under the API */
typedef enum {
/* Defaults and properties */
/* Property names */
extern void slp_readConfig(void);
/* Synchronized queue structures and functions */
typedef void slp_queue_t;
extern void *slp_dequeue(slp_queue_t *);
extern void slp_flush_queue(slp_queue_t *, void (*)(void *));
extern void slp_destroy_queue(slp_queue_t *);
typedef struct {
int iovlen;
char *msg;
} slp_msg_t;
/* Implementation of SLPHandle */
typedef struct handle_impl {
slp_queue_t *q; /* message queue for this handle */
extern void slp_end_call(slp_handle_impl_t *);
extern void slp_cleanup_handle(slp_handle_impl_t *);
/* UA common functionality */
typedef void SLPGenericAppCB();
void *, void **, int *);
extern SLPError slp_packSrvRqst(const char *, const char *,
extern SLPError slp_packSrvRqst_single(const char *, const char *,
const char *, char **,
const char *);
SLPSrvURLCallback, void *,
void **, int *);
extern SLPError slp_packAttrRqst_single(const char *,
const char *,
const char *,
char **,
const char *);
SLPAttrCallback, void *,
void **, int *);
extern SLPError slp_unpackDAAdvert(char *, char **, char **, char **,
char **, SLPError *);
extern SLPError slp_unpackSAAdvert(char *, char **, char **, char **);
/* target selection routines */
typedef void slp_target_list_t;
typedef void slp_target_t;
slp_target_list_t **);
extern const char *slp_get_uc_scopes(slp_target_list_t *);
extern const char *slp_get_mc_scopes(slp_target_list_t *);
extern void *slp_get_target_sin(slp_target_t *);
extern void slp_mark_target_used(slp_target_t *);
extern void slp_mark_target_failed(slp_target_t *);
extern slp_target_t *slp_fabricate_target(void *);
extern void slp_free_target(slp_target_t *);
extern void slp_destroy_target_list(slp_target_list_t *);
/* short-lived DA cache */
extern char *slp_find_das_cached(const char *);
extern void slp_put_das_cached(const char *, const char *, unsigned int);
/* networking */
const char *, SLPBoolean, unsigned short);
const char *);
extern void slp_mc_send(slp_handle_impl_t *, const char *);
extern void slp_tcp_wait(slp_handle_impl_t *);
extern SLPError slp_tcp_read(int, char **);
extern char *slp_ntop(char *, int, const void *);
extern int slp_pton(const char *, void *);
/* IPC */
extern SLPError slp_send2slpd(const char *, char **);
/* SLP-style list management */
extern int slp_onlist(const char *, const char *);
extern void slp_add2list(const char *, char **, SLPBoolean);
extern void slp_list_subtract(const char *, char **);
/* searching and storing */
int, void *);
extern void *slp_tsearch(const void *, void **, int (*)());
extern void *slp_tfind(const void *, void *const *,
int (*)(const void *, const void *));
/* DA and scope discovery routines */
extern SLPError slp_find_das(const char *, char **);
/* UTF8 routines */
extern char *slp_utf_strchr(const char *, char);
extern int slp_strcasecmp(const char *, const char *);
/* Error reporting */
extern void slp_err(int, int, char *, char *, ...);
/* Mapping from protocol to API error codes */
extern SLPError slp_map_err(unsigned short);
/* Security: signing and verifying */
/* Config convenience wrappers */
extern size_t slp_get_mtu();
extern int slp_get_next_onlist(char **);
extern int slp_get_maxResults();
#define slp_get_usebroadcast() \
#define slp_get_security_on() \
#define slp_get_bypass_auth() \
/* Primitive encoding routines */
/* Header generation and handling */
/* OFFSETS to fields in the header */
#define SLP_VER 0
/* Flags */
/* One byte macros (not needing byte order conversion) */
/* Routines requiring byte order conversions */
extern unsigned short slp_header_get_sht(const char *, size_t);
extern void slp_header_set_sht(char *, unsigned short, size_t);
extern unsigned int slp_header_get_int24(const char *, size_t);
extern void slp_header_set_int24(char *, unsigned int, size_t);
extern slp_proto_err slp_get_errcode(char *);
#define slp_hdrlang_length(h) \
#ifdef __cplusplus
}
#endif
#endif /* _SLP_INTERNAL_H */