资源简介
该libevent的 API提供一种机制,在特定事件上的文件描述符或达到超时后发生时执行的回调函数。此外,libevent还支持由于信号或定期超时而产生的回调。
libevent旨在替代事件驱动的网络服务器中发现的事件循环。应用程序只需调用 event_dispatch(),然后动态添加或删除事件,而无需更改事件循环。
代码片段和文件信息
/* Portable arc4random.c based on arc4random.c from OpenBSD.
* Portable version by Chris Davis adapted for Libevent by Nick Mathewson
* Copyright (c) 2010 Chris Davis Niels Provos and Nick Mathewson
* Copyright (c) 2010-2012 Niels Provos and Nick Mathewson
*
* Note that in Libevent this file isn‘t compiled directly. Instead
* it‘s included from evutil_rand.c
*/
/*
* Copyright (c) 1996 David Mazieres
* Copyright (c) 2008 Damien Miller
*
* Permission to use copy modify and distribute this software for any
* purpose with or without fee is hereby granted provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED “AS IS“ AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL DIRECT INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN
* ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIOUS ACTION ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Arc4 random number generator for OpenBSD.
*
* This code is derived from section 17.1 of Applied Cryptography
* second edition which describes a stream cipher allegedly
* compatible with RSA Labs “RC4“ cipher (the actual description of
* which is a trade secret). The same algorithm is used as a stream
* cipher called “arcfour“ in Tatu Ylonen‘s ssh package.
*
* Here the stream cipher has been modified always to include the time
* when initializing the state. That makes it impossible to
* regenerate the same random sequence twice so this can‘t be used
* for encryption but will generate good random numbers.
*
* RC4 is a registered trademark of RSA Laboratories.
*/
#ifndef ARC4RANDOM_EXPORT
#define ARC4RANDOM_EXPORT
#endif
#ifndef ARC4RANDOM_UINT32
#define ARC4RANDOM_UINT32 uint32_t
#endif
#ifndef ARC4RANDOM_NO_INCLUDES
#include “evconfig-private.h“
#ifdef _WIN32
#include
#include
#else
#include
#include
#include
#include
#ifdef EVENT__HAVE_SYS_SYSCTL_H
#include
#endif
#endif
#include
#include
#include
#endif
/* Add platform entropy 32 bytes (256 bits) at a time. */
#define ADD_ENTROPY 32
/* Re-seed from the platform RNG after generating this many bytes. */
#define BYTES_BEFORE_RESEED 1600000
struct arc4_stream {
unsigned char i;
unsigned char j;
unsigned char s[256];
};
#ifdef _WIN32
#define getpid _getpid
#define pid_t int
#endif
static int rs_initialized;
static struct arc4_stream rs;
static pid_t arc4_stir_pid;
static int arc4_count;
static int arc4_seeded_ok;
static inline unsigned char arc4_getbyte(void);
static inline void
arc4_init(void)
{
int n;
for (n = 0; n < 256; n++)
rs.s[n]
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 42436 2017-01-30 01:51 libevent-2.1.8-stable\aclocal.m4
文件 13136 2016-10-05 03:55 libevent-2.1.8-stable\arc4random.c
文件 431 2016-11-01 23:34 libevent-2.1.8-stable\autogen.sh
文件 82236 2016-12-06 17:00 libevent-2.1.8-stable\buffer.c
文件 18486 2016-10-05 03:55 libevent-2.1.8-stable\bufferevent-internal.h
文件 26105 2016-11-01 23:34 libevent-2.1.8-stable\bufferevent.c
文件 18179 2016-10-05 03:55 libevent-2.1.8-stable\bufferevent_async.c
文件 18007 2017-01-30 01:51 libevent-2.1.8-stable\bufferevent_filter.c
文件 39500 2017-01-22 23:26 libevent-2.1.8-stable\bufferevent_openssl.c
文件 9834 2016-10-05 03:55 libevent-2.1.8-stable\bufferevent_pair.c
文件 30215 2016-10-05 03:55 libevent-2.1.8-stable\bufferevent_ratelim.c
文件 18814 2017-01-22 23:26 libevent-2.1.8-stable\bufferevent_sock.c
文件 8639 2016-10-05 03:55 libevent-2.1.8-stable\buffer_iocp.c
文件 4627 2016-10-05 03:55 libevent-2.1.8-stable\changelist-internal.h
文件 101174 2017-01-30 01:36 libevent-2.1.8-stable\ChangeLog
文件 17369 2016-10-05 03:55 libevent-2.1.8-stable\ChangeLog-1.4
文件 83347 2016-10-05 03:55 libevent-2.1.8-stable\ChangeLog-2.0
文件 16674 2016-10-05 03:55 libevent-2.1.8-stable\compat\sys\queue.h
文件 7333 2017-01-15 17:34 libevent-2.1.8-stable\compile
文件 42938 2017-01-15 17:34 libevent-2.1.8-stable\config.guess
文件 14360 2017-01-30 01:51 libevent-2.1.8-stable\config.h.in
文件 35987 2017-01-15 17:34 libevent-2.1.8-stable\config.sub
文件 537802 2017-01-30 01:51 libevent-2.1.8-stable\configure
文件 24549 2017-01-30 01:51 libevent-2.1.8-stable\configure.ac
文件 2766 2016-10-05 03:55 libevent-2.1.8-stable\defer-internal.h
文件 23566 2017-01-15 17:34 libevent-2.1.8-stable\depcomp
文件 7889 2016-10-05 03:55 libevent-2.1.8-stable\devpoll.c
文件 10206 2016-10-05 03:55 libevent-2.1.8-stable\Doxyfile
文件 14714 2016-10-05 03:55 libevent-2.1.8-stable\epoll.c
文件 41365 2016-10-05 03:55 libevent-2.1.8-stable\epolltable-internal.h
............此处省略177个文件信息
相关资源
- libevent在vs下编译工程
- libevent-2.1.8-
- libevent源码
- libevent和http服务端
- libevent深入浅出,libevent参考手册,
- libevent-2.0.21-stable
- libevent-devel-1.4.13-4.el6.x86_64.rpm libeven
- libevent多线程
- libevent聊天室
- LibEvent中文帮助文档
- libevent参考手册(中文版)_libevent-2
- Libevent Book 官方教程Programming with Lib
- libevent参考手册(中文版-高清-目录)
- libevent-2.0.22-stable.tar.gz memcached-1.4.32
- libevent-master.zip
- libevent for qt网络模块直接替换qt的se
- 基于tcp的rtp传输
评论
共有 条评论