/[svn]/branches/newio/include/channel.h
ViewVC logotype

Contents of /branches/newio/include/channel.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2415 - (show annotations)
Sun Jul 21 14:33:22 2013 UTC (6 years, 11 months ago) by michael
File MIME type: text/x-csrc
File size: 4773 byte(s)
- ioengine changes as of 21JUL13

1 /*
2 * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3 *
4 * Copyright (C) 2002 by the past and present ircd coders, and others.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 * USA
20 */
21
22 /*! \file channel.h
23 * \brief Responsible for managing channels, members, bans and topics
24 * \version $Id$
25 */
26
27 #ifndef INCLUDED_channel_h
28 #define INCLUDED_channel_h
29
30 #include "ircd_defs.h" /* KEYLEN, CHANNELLEN */
31 #include "ioengine.h"
32
33 /* channel visible */
34 #define ShowChannel(v,c) (PubChannel(c) || IsMember((v),(c)))
35
36 #define IsMember(who, chan) ((find_channel_link(who, chan)) ? 1 : 0)
37 #define AddMemberFlag(x, y) ((x)->flags |= (y))
38 #define DelMemberFlag(x, y) ((x)->flags &= ~(y))
39
40 #define FLOOD_NOTICED 1
41 #define JOIN_FLOOD_NOTICED 2
42
43 #define SetFloodNoticed(x) ((x)->flags |= FLOOD_NOTICED)
44 #define IsSetFloodNoticed(x) ((x)->flags & FLOOD_NOTICED)
45 #define ClearFloodNoticed(x) ((x)->flags &= ~FLOOD_NOTICED)
46
47 #define SetJoinFloodNoticed(x) ((x)->flags |= JOIN_FLOOD_NOTICED)
48 #define IsSetJoinFloodNoticed(x) ((x)->flags & JOIN_FLOOD_NOTICED)
49 #define ClearJoinFloodNoticed(x) ((x)->flags &= ~JOIN_FLOOD_NOTICED)
50
51 struct Client;
52
53 /*! \brief Mode structure for channels */
54 struct Mode
55 {
56 unsigned int mode; /*!< simple modes */
57 unsigned int limit; /*!< +l userlimit */
58 char key[KEYLEN + 1]; /*!< +k key */
59 };
60
61 /*! \brief Channel structure */
62 struct Channel
63 {
64 dlink_node node;
65
66 struct Channel *hnextch;
67 struct Mode mode;
68
69 char topic[TOPICLEN + 1];
70 char topic_info[USERHOST_REPLYLEN];
71
72 time_t channelts;
73 time_t topic_time;
74 time_t last_knock; /*!< don't allow knock to flood */
75 time_t last_join_time;
76 time_t first_received_message_time; /*!< channel flood control */
77 unsigned int flags;
78 int received_number_of_privmsgs;
79
80 dlink_list members;
81 dlink_list invites;
82 dlink_list banlist;
83 dlink_list exceptlist;
84 dlink_list invexlist;
85
86 float number_joined;
87
88 char chname[CHANNELLEN + 1];
89 };
90
91 /*! \brief Membership structure */
92 struct Membership
93 {
94 dlink_node channode; /*!< link to chptr->members */
95 dlink_node usernode; /*!< link to source_p->channel */
96 struct Channel *chptr; /*!< Channel pointer */
97 struct Client *client_p; /*!< Client pointer */
98 unsigned int flags; /*!< user/channel flags, e.g. CHFL_CHANOP */
99 };
100
101 /*! \brief Ban structure. Used for b/e/I n!u\@h masks */
102 struct Ban
103 {
104 dlink_node node;
105 char *name;
106 char *user;
107 char *host;
108 char *who;
109 size_t len;
110 time_t when;
111 struct irc_ssaddr addr;
112 int bits;
113 int type;
114 };
115
116 extern dlink_list global_channel_list;
117
118 extern int check_channel_name(const char *, const int);
119 extern int channel_can_send(struct Channel *, struct Client *, struct Membership *, const char *);
120 extern int is_banned(const struct Channel *, const struct Client *);
121 extern int can_join(struct Client *, struct Channel *, const char *);
122 extern int has_member_flags(const struct Membership *, const unsigned int);
123
124 extern void remove_ban(struct Ban *, dlink_list *);
125 extern void channel_init(void);
126 extern void add_user_to_channel(struct Channel *, struct Client *,
127 unsigned int, int);
128 extern void remove_user_from_channel(struct Membership *);
129 extern void channel_member_names(struct Client *, struct Channel *, int);
130 extern void add_invite(struct Channel *, struct Client *);
131 extern void del_invite(struct Channel *, struct Client *);
132 extern void send_channel_modes(struct Client *, struct Channel *);
133 extern void channel_modes(struct Channel *, struct Client *, char *, char *);
134 extern void check_spambot_warning(struct Client *, const char *);
135 extern void check_splitmode(struct Event *);
136 extern void free_channel_list(dlink_list *);
137 extern void destroy_channel(struct Channel *);
138 extern void set_channel_topic(struct Channel *, const char *, const char *, time_t, int);
139
140 extern const char *get_member_status(const struct Membership *, const int);
141
142 extern struct Channel *make_channel(const char *);
143 extern struct Membership *find_channel_link(struct Client *, struct Channel *);
144 #endif /* INCLUDED_channel_h */

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28