/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <syslog.h>
#include <slp-internal.h>
struct attr_node {
};
const char *);
static int compare_tags(const void *, const void *);
static void collate_attrs(char *, void **, int *, int);
static void parens_attr(char *, void **, int *);
static void merge_attrs(struct attr_node *, char *);
static char *build_attrs_list(void *collator);
static void collect_attrs(void *, VISIT, int, void *);
SLPAttrCallback, void *,
void **, int *);
SLPAttrCallback, void *,
void **, int *);
const char *pcAttrIds,
int wantSAAdvert =
int wantDAAdvert =
return (SLP_PARAMETER_BAD);
}
return (SLP_PARAMETER_BAD);
}
return (err);
/* Special packer and unpacker for DA and SA solicitations */
if (wantDAAdvert) {
} else if (wantSAAdvert) {
} else {
/* normal service request */
/* format params into msgBuf */
}
return (err);
}
void **collator, int *numResults) {
char *pcAttrList;
unsigned short protoErrCode;
int auth_cnt;
char *attr_tbv;
if (!reply) {
/* no more results */
}
}
return (SLP_FALSE);
}
/* parse reply into params */
/* err code */
return (SLP_TRUE);
/* internal errors should have been filtered out by the net code */
}
/* attr list */
return (SLP_TRUE);
/* number of attr auths */
goto cleanup;
}
/* get and verify auth blocks */
goto cleanup;
}
}
/* collate */
} else {
/* async: invoke cb */
(*numResults)++;
}
/* check maxResults */
return (SLP_FALSE);
}
return (cont);
}
/*
* unpackDAAdvert_attr follows the same logic stream as UnpackAttrReply,
* except that reply contains a DAAdvert.
*/
void **collator, int *numResults) {
if (!reply) {
/* no more results */
}
}
return (SLP_FALSE);
}
!= SLP_OK) {
return (SLP_TRUE);
}
}
/* collate */
} else {
/* async: invoke cb */
(*numResults)++;
}
/* cleanup */
/* check maxResults */
return (SLP_FALSE);
}
return (cont);
}
/*
* unpackSAAdvert_attr follows the same logic stream as UnpackAttrReply,
* except that reply contains an SAAdvert.
*/
void **collator, int *numResults) {
if (!reply) {
/* no more results */
}
}
return (SLP_FALSE);
}
return (SLP_TRUE);
}
/* collate */
} else {
/* async: invoke cb */
(*numResults)++;
}
/* cleanup */
/* check maxResults */
return (SLP_FALSE);
}
return (cont);
}
const char *ids) {
if (slp_get_security_on()) {
}
spi = "";
}
/*
* Allocate iovec for the messge. An AttrRqst is layed out thus:
* 0: header
* 1: prlist length
* 2: prlist (filled in later by networking code)
* 3: URL string
* 4: scopes length
* 5: scopes (filled in later by networking code)
* 6: tag list string and SPI string
*/
return (SLP_MEMORY_ALLOC_FAILED);
}
/* calculate msg length */
2 + /* scope list length */
return (SLP_MEMORY_ALLOC_FAILED);
}
/* set pointer to PR list and scope list length spaces */
/* set up the scopes and prlist pointers into iov */
len = 4;
/* Add URL string */
goto error;
/* Add tag list */
goto error;
/* SPI string */
return (SLP_OK);
}
/* else error */
return (err);
}
const char *scopes,
const char *ids,
char **msg,
const char *lang) {
msgLen =
2; /* No SPI string for internal calls */
return (SLP_MEMORY_ALLOC_FAILED);
}
len = 0;
}
}
}
/* empty SPI */
}
return (err);
}
return slp_strcasecmp(
}
char *p, *v;
for (p = v = vals; p; v = p) {
p = slp_utf_strchr(v, ',');
if (p)
*p++ = 0;
}
}
if (!close_paren)
return; /* skip bad attr list */
*close_paren = 0;
return;
*equals++ = 0;
if (!(n = malloc(sizeof (*n)))) {
return;
}
free(n);
return;
}
if (*res != n) {
} else {
/* not found; populate new attr node */
(*numResults)++;
return;
}
}
}
int *numResults, int maxResults) {
start &&
*start &&
*numResults != maxResults;
if (*start == '(') {
/* form of (tag=val,val) */
return; /* skip bad attr */
end++;
continue;
}
if (end)
*end++ = 0;
/* create a new node with the tag only */
if (!(n = malloc(sizeof (*n)))) {
return;
}
free(n);
return;
}
if (*res != n) {
/* already in the tree, so just free resources */
}
(*numResults)++;
}
}
if (!collator)
return (NULL);
return (answer);
}
/*ARGSUSED*/
struct attr_node *n;
if (!n->val) {
/* no values, so no parens */
"out of memory");
return;
}
} else {
"out of memory");
return;
}
/* build attr string */
p = attr;
*p++ = '(';
*p++ = '=';
*p++ = ')'; *p = 0;
}
}
}