1 /* This file is part of YAZ proxy
2 Copyright (C) 1998-2011 Index Data
4 YAZ proxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 YAZ proxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef YAZ_PROXY_MODULE_H
20 #define YAZ_PROXY_MODULE_H_INCLUDED
22 struct Yaz_ProxyModule_entry {
24 const char *module_name;
25 const char *module_description;
29 #define YAZPROXY_RET_NOT_ME 0 /* Did not catch it. pass to other handler */
30 #define YAZPROXY_RET_OK 1 /* OK, grabbed */
31 #define YAZPROXY_RET_PERM 2 /* Permissiong denied, reject etc. */
33 struct Yaz_ProxyModule_int0 {
34 void *(*init)(void); // Init handler - returns module-specific handle
36 void (*destroy)( // Destroy handler
37 void *handle // module-specific handle as returned by init
40 int (*authenticate)( // Authenticate handler. Returns YAZPROXY_RET_..
41 void *handle, // module-specific handle as returned by init
42 const char *name, // target name (or NULL if default target)
43 void *element_ptr, // xmlnodePtr thing to XML config this
44 const char *user, // User ID (or NULL if no suppliied User ID)
45 const char *group, // Group ID (or NULL if no supplied Group ID)
46 const char *pw, // Password (or NULL if no supplied password)
47 const char *peer_IP// IP address of client
51 class Yaz_ProxyModule;
53 class Yaz_ProxyModules {
54 friend class Proxy_Msg;
58 int authenticate(const char *module_name,
59 const char *target_name, void *element_ptr,
64 int add_module(const char *fname);
65 void unload_modules();
67 Yaz_ProxyModule *m_list;
75 * c-file-style: "Stroustrup"
76 * indent-tabs-mode: nil
78 * vim: shiftwidth=4 tabstop=8 expandtab