~ubuntu-branches/ubuntu/oneiric/jabberd2/oneiric-security

« back to all changes in this revision

Viewing changes to router/router.h

  • Committer: Bazaar Package Importer
  • Author(s): Nicolai Spohrer
  • Date: 2008-08-12 16:13:43 UTC
  • mfrom: (1.1.3 upstream) (0.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20080812161343-6trz3r97dtevxd17
Tags: 2.2.1-1ubuntu1
* Merge with Debian unstable (LP: #257130), remaining changes:
  - debian/control:
    + Modify Maintainer field as per spec
    + Depend on libdb4.6-dev instead of libdb4.4-dev
    + Added Conflicts and Replaces: ..., jabber for jabberd2
  - debian/rules: Added libtoolize call (jabberd2 ships with
     an older ltmain.sh version that conflicts with the
     current libtool version)
  - debian/init: create /var/run/jabber directory with correct
     permissions
* Dropped changes:
  - Debian already depends on libpq-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 * the latest protocol revisions.
31
31
 *
32
32
 * The project web page:\n
33
 
 * http://jabberd.jabberstudio.org/
 
33
 * http://jabberd2.xiaoka.com/
34
34
 */
35
35
 
36
36
#ifdef HAVE_CONFIG_H
38
38
#endif
39
39
 
40
40
#include "sx/sx.h"
41
 
#include "sx/ssl.h"
42
 
#include "sx/sasl.h"
43
41
#include "mio/mio.h"
44
42
#include "util/util.h"
45
43
 
54
52
typedef struct component_st *component_t;
55
53
typedef struct alias_st     *alias_t;
56
54
 
 
55
typedef struct acl_s *acl_t;
 
56
struct acl_s {
 
57
    int error;
 
58
    char *what;
 
59
    char *from;
 
60
    char *to;
 
61
    acl_t next;
 
62
};
 
63
 
57
64
struct router_st {
58
65
    /** our id */
59
66
    char                *id;
65
72
    xht                 users;
66
73
    time_t              users_load;
67
74
 
 
75
    /** user table */
 
76
    acl_t               filter;
 
77
    time_t              filter_load;
 
78
 
68
79
    /** logging */
69
80
    log_t               log;
70
81
 
106
117
    mio_t               mio;
107
118
 
108
119
    /** listening socket */
109
 
    int                 fd;
 
120
    mio_fd_t            fd;
110
121
 
111
122
    /** time checks */
112
123
    int                 check_interval;
113
124
    int                 check_keepalive;
114
125
 
115
126
    time_t              next_check;
116
 
                       
117
 
    /** stringprep cache */
118
 
    prep_cache_t        pc;
119
 
    
 
127
 
120
128
    /** attached components, key is 'ip:port', var is component_t */
121
129
    xht                 components;
122
130
 
144
152
    router_t            r;
145
153
 
146
154
    /** file descriptor */
147
 
    int                 fd;
 
155
    mio_fd_t            fd;
148
156
 
149
157
    /** remote ip and port */
150
158
    char                ip[INET6_ADDRSTRLEN];
180
188
    alias_t             next;
181
189
};
182
190
 
183
 
int     router_mio_callback(mio_t m, mio_action_t a, int fd, void *data, void *arg);
 
191
int     router_mio_callback(mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg);
184
192
void    router_sx_handshake(sx_t s, sx_buf_t buf, void *arg);
185
193
 
186
194
xht     aci_load(router_t r);
187
195
void    aci_unload(xht aci);
188
 
int     aci_check(xht acls, char *type, char *name);
 
196
int     aci_check(xht acls, const char *type, const char *name);
189
197
 
190
198
int     user_table_load(router_t r);
191
199
void    user_table_unload(router_t r);
192
200
 
 
201
int     filter_load(router_t r);
 
202
void    filter_unload(router_t r);
 
203
int     filter_packet(router_t r, nad_t nad);
 
204
 
193
205
/* union for xhash_iter_get to comply with strict-alias rules for gcc3 */
194
206
union xhashv
195
207
{