mirror of
https://github.com/sheumann/hush.git
synced 2024-11-05 06:07:00 +00:00
98636eb08c
This was Bernhard Fischer' idea. text data bss dec hex filename 773549 7781 9740 791070 c121e busybox.t7/0_lib/libbusybox.so.1.11.0.svn_unstripped 769683 7397 9740 786820 c0184 busybox.t9t/0_lib/libbusybox.so.1.11.0.svn_unstripped
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
/* vi: set sw=4 ts=4: */
|
|
/*
|
|
* Generic non-forking server infrastructure.
|
|
* Intended to make writing telnetd-type servers easier.
|
|
*
|
|
* Copyright (C) 2007 Denys Vlasenko
|
|
*
|
|
* Licensed under GPL version 2, see file LICENSE in this tarball for details.
|
|
*/
|
|
|
|
#if __GNUC_PREREQ(4,1)
|
|
# pragma GCC visibility push(hidden)
|
|
#endif
|
|
|
|
/* opaque structure */
|
|
struct isrv_state_t;
|
|
typedef struct isrv_state_t isrv_state_t;
|
|
|
|
/* callbacks */
|
|
void isrv_want_rd(isrv_state_t *state, int fd);
|
|
void isrv_want_wr(isrv_state_t *state, int fd);
|
|
void isrv_dont_want_rd(isrv_state_t *state, int fd);
|
|
void isrv_dont_want_wr(isrv_state_t *state, int fd);
|
|
int isrv_register_fd(isrv_state_t *state, int peer, int fd);
|
|
void isrv_close_fd(isrv_state_t *state, int fd);
|
|
int isrv_register_peer(isrv_state_t *state, void *param);
|
|
|
|
/* driver */
|
|
void isrv_run(
|
|
int listen_fd,
|
|
int (*new_peer)(isrv_state_t *state, int fd),
|
|
int (*do_rd)(int fd, void **),
|
|
int (*do_wr)(int fd, void **),
|
|
int (*do_timeout)(void **),
|
|
int timeout,
|
|
int linger_timeout
|
|
);
|
|
|
|
#if __GNUC_PREREQ(4,1)
|
|
# pragma GCC visibility pop
|
|
#endif
|