2 * @file l7vs_iomuxlist.c
3 * @brief This file manages sets of iomux.
4 * @brief It becomes the foundation of the event call of FD using sets of iomux
6 * L7VSD: Linux Virtual Server for Layer7 Load Balancing
7 * Copyright (C) 2005 NTT COMWARE Corporation.
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 **********************************************************************/
25 #ifndef L7VS_IOMUXLIST_H
26 #define L7VS_IOMUXLIST_H
28 #define L7VS_IOMUX_LIST_UNCHANGED 0
29 #define L7VS_IOMUX_LIST_REMOVED_MYSELF 1
30 #define L7VS_IOMUX_LIST_REMOVED_OTHER 2
34 #include "logger_wrapper.h"
36 extern int l7vs_iomux_init();
37 extern void l7vs_iomux_fini();
38 extern struct l7vs_iomux* l7vs_iomux_get_from_avail_list();
39 extern void l7vs_iomux_put_to_avail_list(struct l7vs_iomux*);
40 extern void l7vs_iomux_add( struct l7vs_iomux*, enum iomaction );
41 extern void l7vs_iomux_remove( struct l7vs_iomux* );
42 extern void l7vs_iomux_mod( struct l7vs_iomux*, enum iomaction );
43 extern void l7vs_iomux_removeall();
44 extern int l7vs_iomux_poll( struct timeval*, int blocking );
47 * serialize struct l7vs_iomux
49 * @param[out] ret serialized string
50 * @param[in] conn source l7vs_iomux
53 inline void l7vs_iomux_c_str(char* ret, const struct l7vs_iomux* iom)
60 snprintf(ret, DEBUG_STR_LEN, "(nil)");
64 snprintf(ret, DEBUG_STR_LEN,
65 "l7vs_iomux={fd = %d: "
75 #endif //L7VS_IOMUXLIST_H