ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/channel.h
Revision: 4404
Committed: Wed Aug 6 17:02:18 2014 UTC (11 years ago) by michael
Content type: text/x-chdr
File size: 4999 byte(s)
Log Message:
- Minor documentation updates

File Contents

# Content
1 /*
2 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 *
4 * Copyright (c) 1997-2014 ircd-hybrid development team
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
32 /* channel visible */
33 #define ShowChannel(v,c) (PubChannel(c) || IsMember((v),(c)))
34
35 #define IsMember(who, chan) ((find_channel_link(who, chan)) ? 1 : 0)
36 #define AddMemberFlag(x, y) ((x)->flags |= (y))
37 #define DelMemberFlag(x, y) ((x)->flags &= ~(y))
38
39 #define FLOOD_NOTICED 1
40 #define JOIN_FLOOD_NOTICED 2
41
42 #define SetFloodNoticed(x) ((x)->flags |= FLOOD_NOTICED)
43 #define IsSetFloodNoticed(x) ((x)->flags & FLOOD_NOTICED)
44 #define ClearFloodNoticed(x) ((x)->flags &= ~FLOOD_NOTICED)
45
46 #define SetJoinFloodNoticed(x) ((x)->flags |= JOIN_FLOOD_NOTICED)
47 #define IsSetJoinFloodNoticed(x) ((x)->flags & JOIN_FLOOD_NOTICED)
48 #define ClearJoinFloodNoticed(x) ((x)->flags &= ~JOIN_FLOOD_NOTICED)
49
50 struct Client;
51
52 /*! \brief Mode structure for channels */
53 struct Mode
54 {
55 unsigned int mode; /**< simple modes */
56 unsigned int limit; /**< +l userlimit */
57 char key[KEYLEN + 1]; /**< +k key */
58 };
59
60 /*! \brief Channel structure */
61 struct Channel
62 {
63 dlink_node node;
64
65 struct Channel *hnextch;
66 struct Mode mode;
67
68 char topic[TOPICLEN + 1];
69 char topic_info[USERHOST_REPLYLEN];
70
71 time_t channelts;
72 time_t topic_time;
73 time_t last_knock; /**< Don't allow knock to flood */
74 time_t last_join_time;
75 time_t first_received_message_time; /*!< channel flood control */
76 unsigned int flags;
77 int received_number_of_privmsgs;
78
79 dlink_list locmembers; /*!< local members are here too */
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 locchannode; /**< link to chptr->locmembers */
95 dlink_node channode; /**< link to chptr->members */
96 dlink_node usernode; /**< link to source_p->channel */
97 struct Channel *chptr; /**< Channel pointer */
98 struct Client *client_p; /**< Client pointer */
99 unsigned int flags; /**< user/channel flags, e.g. CHFL_CHANOP */
100 };
101
102 /*! \brief Ban structure. Used for b/e/I n!u\@h masks */
103 struct Ban
104 {
105 dlink_node node;
106 char *name;
107 char *user;
108 char *host;
109 char *who;
110 size_t len;
111 time_t when;
112 struct irc_ssaddr addr;
113 int bits;
114 int type;
115 };
116
117 extern dlink_list channel_list;
118 extern struct event splitmode_event;
119
120 extern int check_channel_name(const char *, const int);
121 extern int can_send(struct Channel *, struct Client *, struct Membership *, const char *);
122 extern int is_banned(const struct Channel *, const struct Client *);
123 extern int can_join(struct Client *, struct Channel *, const char *);
124 extern int has_member_flags(const struct Membership *, const unsigned int);
125
126 extern void channel_do_join(struct Client *, char *, char *);
127 extern void channel_do_join_0(struct Client *);
128 extern void channel_do_part(struct Client *, char *, char *);
129 extern void remove_ban(struct Ban *, dlink_list *);
130 extern void channel_init(void);
131 extern void add_user_to_channel(struct Channel *, struct Client *, unsigned int, int);
132 extern void remove_user_from_channel(struct Membership *);
133 extern void channel_member_names(struct Client *, struct Channel *, int);
134 extern void add_invite(struct Channel *, struct Client *);
135 extern void del_invite(struct Channel *, struct Client *);
136 extern void send_channel_modes(struct Client *, struct Channel *);
137 extern void channel_modes(struct Channel *, struct Client *, char *, char *);
138 extern void check_spambot_warning(struct Client *, const char *);
139 extern void check_splitmode(void *);
140 extern void free_channel_list(dlink_list *);
141 extern void destroy_channel(struct Channel *);
142 extern void channel_set_topic(struct Channel *, const char *, const char *, time_t, int);
143
144 extern const char *get_member_status(const struct Membership *, const int);
145
146 extern struct Channel *make_channel(const char *);
147 extern struct Membership *find_channel_link(struct Client *, struct Channel *);
148 #endif

Properties

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