• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/ntp/lib/isc/unix/

Lines Matching refs:source

73 get_from_filesource(isc_entropysource_t *source, isc_uint32_t desired) {
74 isc_entropy_t *ent = source->ent;
76 int fd = source->sources.file.handle;
80 if (source->bad)
105 source->sources.file.handle = -1;
106 source->bad = ISC_TRUE;
113 get_from_usocketsource(isc_entropysource_t *source, isc_uint32_t desired) {
114 isc_entropy_t *ent = source->ent;
116 int fd = source->sources.usocket.handle;
119 size_t sz_to_recv = source->sources.usocket.sz_to_recv;
121 if (source->bad)
131 switch ( source->sources.usocket.status ) {
141 source->sources.usocket.status =
156 source->sources.usocket.status =
161 source->sources.usocket.status =
195 source->sources.usocket.status =
198 source->sources.usocket.sz_to_recv = sz_to_recv;
221 source->sources.usocket.sz_to_recv -= n;
223 source->sources.usocket.status =
237 source->bad = ISC_TRUE;
238 source->sources.usocket.status = isc_usocketsource_disconnected;
239 source->sources.usocket.handle = -1;
246 * Poll each source, trying to get data from it to stuff into the entropy
255 isc_entropysource_t *source;
308 * Poll each file source to see if we can read anything useful from
322 source = ent->nextsource;
332 switch ( source->type ) {
334 got = get_from_filesource(source, remaining);
338 got = get_from_usocketsource(source, remaining);
346 source = ISC_LIST_NEXT(source, link);
347 if (source == NULL)
348 source = ISC_LIST_HEAD(ent->sources);
350 ent->nextsource = source;
362 * check to see if we have a callback source. If so, call them.
364 source = ISC_LIST_HEAD(ent->sources);
365 while ((remaining != 0) && (source != NULL)) {
370 if (source->type == ENTROPY_SOURCETYPE_CALLBACK)
371 got = get_from_callback(source, remaining, blocking);
379 source = ISC_LIST_NEXT(source, link);
391 isc_entropysource_t *source;
401 source = ISC_LIST_HEAD(ent->sources);
402 while (source != NULL) {
403 if (source->type == ENTROPY_SOURCETYPE_FILE) {
404 fd = source->sources.file.handle;
410 if (source->type == ENTROPY_SOURCETYPE_USOCKET) {
411 fd = source->sources.usocket.handle;
413 switch (source->sources.usocket.status) {
430 source = ISC_LIST_NEXT(source, link);
444 destroyfilesource(isc_entropyfilesource_t *source) {
445 (void)close(source->handle);
449 destroyusocketsource(isc_entropyusocketsource_t *source) {
450 close(source->handle);
494 isc_entropysource_t *source;
509 * the program to look at an actual FIFO as its source of
559 source = isc_mem_get(ent->mctx, sizeof(isc_entropysource_t));
560 if (source == NULL) {
568 source->magic = SOURCE_MAGIC;
569 source->ent = ent;
570 source->total = 0;
571 source->bad = ISC_FALSE;
572 memset(source->name, 0, sizeof(source->name));
573 ISC_LINK_INIT(source, link);
575 source->sources.usocket.handle = fd;
577 source->sources.usocket.status =
580 source->sources.usocket.status =
582 source->sources.usocket.sz_to_recv = 0;
583 source->type = ENTROPY_SOURCETYPE_USOCKET;
585 source->sources.file.handle = fd;
586 source->type = ENTROPY_SOURCETYPE_FILE;
592 ISC_LIST_APPEND(ent->sources, source, link);