/*
* 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 <stdio.h>
#include <stdlib.h>
#include <syslog.h>
#include <string.h>
#include <thread.h>
#include <synch.h>
#include <slp-internal.h>
/* This is used to pass needed params to consumer_thr and slp_call */
struct thr_call_args {
void *cookie;
};
static void slp_call(void *);
slp_queue_t *q;
int terr;
/* select targets */
return (err);
return (err);
}
/* populate the args structure */
return (SLP_MEMORY_ALLOC_FAILED);
}
/* create the queue that this call will use */
goto error;
hp->q = q;
/* kick off the producer thread */
if ((terr = thr_create(
goto error;
}
/* kick off the consumer thread */
if ((terr = thr_create(
"could not start thread: %s",
/* cleanup producer thread, if necessary */
goto error;
}
return (SLP_OK);
}
/* else sync */
return (err);
}
char *reply;
void *collator;
int numResults = 0;
/* while cb wants more and there is more to get ... */
for (;;) {
/* reply == NULL if no more available or SLPClosed */
&collator, &numResults);
if (reply) {
} else {
break;
}
if (!cont) {
/* cb doesn't want any more; invoke last call */
&collator, &numResults);
break;
}
}
/* cleanup */
/* clean stop producer [thread] */
/* empty and free queue */
slp_destroy_queue(hp->q);
return (SLP_OK);
}
/*
* This is the producer thread
*/
slp_target_t *t;
/* Unicast */
int i;
/* calculate msg length */
}
mtu = slp_get_mtu();
for (
t;
break;
if (use_tcp)
SLP_FALSE, 0);
else
}
}
/* Multicast */
/* Wait for TCP to complete, if necessary */
/* free the message */
/* null terminate message queue */
}
/*
* If the message to be sent needs to be multicast, check that it
* can fit into a datagram. If not, return BUFFER_OVERFLOW, otherwise
* return SLP_OK.
*/
int i;
const char *mc_scopes;
return (SLP_OK); /* no mc targets to worry about */
}
if (msgSize > slp_get_mtu())
return (SLP_BUFFER_OVERFLOW);
return (SLP_OK);
}