source: MondoRescue/branches/2.2.9/mindi-busybox/networking/isrv.h@ 3320

Last change on this file since 3320 was 3320, checked in by Bruno Cornec, 9 years ago
  • Re-add (thanks git BTW) the 2.2.9 branch which had been destroyed in the move to 3.0
  • Property svn:eol-style set to native
File size: 1012 bytes
Line 
1/* vi: set sw=4 ts=4: */
2/*
3 * Generic non-forking server infrastructure.
4 * Intended to make writing telnetd-type servers easier.
5 *
6 * Copyright (C) 2007 Denys Vlasenko
7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */
10
11PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
12
13/* opaque structure */
14struct isrv_state_t;
15typedef struct isrv_state_t isrv_state_t;
16
17/* callbacks */
18void isrv_want_rd(isrv_state_t *state, int fd);
19void isrv_want_wr(isrv_state_t *state, int fd);
20void isrv_dont_want_rd(isrv_state_t *state, int fd);
21void isrv_dont_want_wr(isrv_state_t *state, int fd);
22int isrv_register_fd(isrv_state_t *state, int peer, int fd);
23void isrv_close_fd(isrv_state_t *state, int fd);
24int isrv_register_peer(isrv_state_t *state, void *param);
25
26/* driver */
27void isrv_run(
28 int listen_fd,
29 int (*new_peer)(isrv_state_t *state, int fd),
30 int (*do_rd)(int fd, void **),
31 int (*do_wr)(int fd, void **),
32 int (*do_timeout)(void **),
33 int timeout,
34 int linger_timeout
35);
36
37POP_SAVED_FUNCTION_VISIBILITY
Note: See TracBrowser for help on using the repository browser.