entropy.c revision 2d67c2474475acf52c8251dc48bfb7565ee5f2ff
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * Copyright (C) 2000, 2001 Internet Software Consortium.
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * Permission to use, copy, modify, and distribute this software for any
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * purpose with or without fee is hereby granted, provided that the above
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * copyright notice and this permission notice appear in all copies.
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
d3498432822fb487e58f8f72bb5f880dd8307d7dMichael Sawyer * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
c51203011182577cbb53a6d16d496aa9697fff5cAndreas Gustafsson/* $Id: entropy.c,v 1.1 2001/06/21 14:19:20 tale Exp $ */
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson * This is the system depenedent part of the ISC entropy API.
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson * There is only one variable in the entropy data structures that is not
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson * system independent, but pulling the structure that uses it into this file
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson * ultimately means pulling several other independent structures here also to
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson * resolve their interdependencies. Thus only the problem variable's type
0e9dcd548051a8ec34744bfa18b4e09fea742a39Andreas Gustafsson * is defined here.
unsigned int added;
added = 0;
while (desired > 0) {
goto out;
out:
return (added);
unsigned int added;
unsigned int got;
if (desired == 0)
added = 0;
return (added);
unsigned int added;
unsigned int remaining;
unsigned int needed;
unsigned int nsource;
if (needed == 0) {
added = 0;
unsigned int got;
if (remaining == 0)
got = 0;
goto again_file;
unsigned int got;
got = 0;
total = 0;
while (remain != 0) {
if (goodonly) {
unsigned int fillcount;
if (!partial)
goto zeroize;
goto partial_output;
for (i = 0; i < count; i++)
return (ISC_R_SUCCESS);
*returned = 0;
return (ISC_R_NOENTROPY);
return (ISC_R_NOMEMORY);
goto errout;
return (ISC_R_SUCCESS);
return (ret);
static inline isc_boolean_t
return (ISC_FALSE);
case ENTROPY_SOURCETYPE_FILE:
return (ISC_FALSE);
return (ISC_TRUE);
case ENTROPY_SOURCETYPE_FILE:
if(!err){
goto errout;
goto closecontext;
return (ISC_R_SUCCESS);
return (ret);
if (killit)
void *arg,
goto errout;
goto errout;
return (ISC_R_SUCCESS);
return (ret);
goto errout;
goto errout;
return (ISC_R_SUCCESS);
return (ret);
if (delta < 0)
if (delta2 < 0)
if (delta3 < 0)
unsigned int ns;
unsigned int added;
added = 0;
return (added);
static isc_result_t
return (ISC_R_NOMORE);
return (ISC_R_QUEUEFULL);
return (ISC_R_SUCCESS);
unsigned int entropy;
return (result);
return (result);
if (killit)