OSDN Git Service

Update INSTALL.ja.utf-8 for new release.
[ultramonkey-l7/ultramonkey-l7-v2.git] / include / l7vs_sched.h
1 /**********************************************************************
2  * l7vs_sched.h                                                May 2007
3  *
4  * L7VSD: Linux Virtual Server for Layer7 Load Balancing
5  * Copyright (C) 2005  NTT COMWARE Corporation.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  *
22  **********************************************************************/
23 #ifndef L7VS_SCHED_H
24 #define L7VS_SCHED_H
25
26 #include "l7vs_module.h"
27 #include "logger_wrapper.h"
28
29 struct  l7vs_service;
30 struct  l7vs_conn;
31 struct  l7vs_dest;
32
33 // scheduler datatype
34 struct  l7vs_scheduler{
35         void*                   handle;
36         char                    modname[L7VS_MODNAME_LEN+1];
37         int                     refcnt;
38         struct l7vs_dest*       (*schedule)( struct l7vs_service*, struct l7vs_conn*);
39         void                    (*bind)( struct l7vs_service*);
40         void                    (*unbind)(struct l7vs_service*);
41         void                    (*fini)();
42         enum LOG_LEVEL_TAG      (*get_log_level)(const enum LOG_CATEGORY_TAG);
43         void                    (*put_log_debug)(const enum LOG_CATEGORY_TAG, const unsigned int, char*, int, const char*);
44         void                    (*put_log_info)(const enum LOG_CATEGORY_TAG, const unsigned int, char*, int, const char*);
45         void                    (*put_log_warn)(const enum LOG_CATEGORY_TAG, const unsigned int, char*, int, const char*);
46         void                    (*put_log_error)(const enum LOG_CATEGORY_TAG, const unsigned int, char*, int, const char*);
47         void                    (*put_log_fatal)(const enum LOG_CATEGORY_TAG, const unsigned int, char*, int, const char*);
48 };
49
50 //
51 // finctions.
52 //
53 extern  struct l7vs_scheduler*  l7vs_sched_get(char*);
54 extern  void                    l7vs_sched_put( struct l7vs_scheduler* );
55 extern  void                    l7vs_sched_bind( struct l7vs_scheduler*, struct l7vs_service* );
56 extern  void                    l7vs_sched_unbind( struct l7vs_scheduler*, struct l7vs_service* );
57 extern  int                     l7vs_sched_sorry_check(struct l7vs_service*, int);
58 extern  struct l7vs_dest*       l7vs_sched_sorry_dest(struct l7vs_service*, struct l7vs_conn*, int);
59
60 #endif  //L7VS_SCHED_H