/[svn]/ircd-hybrid/trunk/include/channel.h
ViewVC logotype

Contents of /ircd-hybrid/trunk/include/channel.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9476 - (show annotations)
Sat Jul 4 15:26:19 2020 UTC (2 months, 2 weeks ago) by michael
File MIME type: text/x-csrc
File size: 5387 byte(s)
- channel.c:channel_send_namereply(): remove show_eon argument. In hybrid we no longer have a case where a names reply needs to be sent with no RPL_ENDOFNAMES

1 /*
2 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 *
4 * Copyright (c) 1997-2020 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
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 "extban.h"
32
33 #define AddMemberFlag(x, y) ((x)->flags |= (y))
34 #define DelMemberFlag(x, y) ((x)->flags &= ~(y))
35
36 enum
37 {
38 CAN_SEND_NO = 0,
39 CAN_SEND_NONOP = -1,
40 CAN_SEND_OPV = -2
41 };
42
43 enum
44 {
45 MSG_FLOOD_NOTICED = 1 << 0,
46 JOIN_FLOOD_NOTICED = 1 << 1
47 };
48
49 #define SetFloodNoticed(x) ((x)->flags |= MSG_FLOOD_NOTICED)
50 #define IsSetFloodNoticed(x) ((x)->flags & MSG_FLOOD_NOTICED)
51 #define ClearFloodNoticed(x) ((x)->flags &= ~MSG_FLOOD_NOTICED)
52
53 #define SetJoinFloodNoticed(x) ((x)->flags |= JOIN_FLOOD_NOTICED)
54 #define IsSetJoinFloodNoticed(x) ((x)->flags & JOIN_FLOOD_NOTICED)
55 #define ClearJoinFloodNoticed(x) ((x)->flags &= ~JOIN_FLOOD_NOTICED)
56
57 struct Client;
58
59 /*! \brief Mode structure for channels */
60 struct Mode
61 {
62 unsigned int mode; /**< simple modes */
63 unsigned int limit; /**< +l userlimit */
64 char key[KEYLEN + 1]; /**< +k key */
65 };
66
67 /*! \brief Channel structure */
68 struct Channel
69 {
70 dlink_node node;
71
72 struct Channel *hnextch;
73 struct Mode mode;
74
75 char topic[TOPICLEN + 1];
76 char topic_info[NICKLEN + USERLEN + HOSTLEN + 3];
77
78 uintmax_t creation_time; /**< Real time */
79 uintmax_t topic_time; /**< Real time */
80 uintmax_t last_knock_time; /**< Don't allow knock to flood; monotonic time */
81 uintmax_t last_invite_time; /**< Monotonic time */
82 uintmax_t last_join_time; /**< Monotonic time */
83 uintmax_t first_received_message_time; /*!< Channel flood control; monotonic time */
84 unsigned int flags;
85 unsigned int received_number_of_privmsgs;
86
87 dlink_list members_local; /*!< local members are here too */
88 dlink_list members;
89 dlink_list invites;
90 dlink_list banlist;
91 dlink_list exceptlist;
92 dlink_list invexlist;
93
94 float number_joined;
95
96 char name[CHANNELLEN + 1];
97 size_t name_len;
98 };
99
100 /*! \brief ChannelMember structure */
101 struct ChannelMember
102 {
103 dlink_node locchannode; /**< link to channel->members_local */
104 dlink_node channode; /**< link to channel->members */
105 dlink_node usernode; /**< link to client->channel */
106 struct Channel *channel; /**< Channel pointer */
107 struct Client *client; /**< Client pointer */
108 unsigned int flags; /**< user/channel flags, e.g. CHFL_CHANOP */
109 };
110
111 enum { BANSTRLEN = 200 }; /* XXX */
112
113 /*! \brief Ban structure. Used for b/e/I n!u\@h masks */
114 struct Ban
115 {
116 dlink_node node;
117 unsigned int extban;
118 char banstr[BANSTRLEN];
119 char name[NICKLEN + 1];
120 char user[USERLEN + 1];
121 char host[HOSTLEN + 1];
122 char who[NICKLEN + USERLEN + HOSTLEN + 3];
123 size_t banstr_len; /**< Cached string length of Ban::banstr */
124 uintmax_t when; /**< Time this ban has been set; real time */
125 struct irc_ssaddr addr;
126 int bits;
127 int type;
128 };
129
130 extern const dlink_list *channel_get_list(void);
131 extern bool channel_check_name(const char *, bool);
132 extern int can_send(struct Channel *, struct Client *, struct ChannelMember *, const char *, bool);
133 extern bool is_banned(struct Channel *, struct Client *);
134 extern bool find_bmask(struct Client *, struct Channel*, const dlink_list *, struct Extban *);
135 extern int has_member_flags(const struct ChannelMember *, const unsigned int);
136
137 extern void channel_do_join(struct Client *, char *, char *);
138 extern void channel_do_part(struct Client *, char *, const char *);
139 extern void remove_ban(struct Ban *, dlink_list *);
140 extern void add_user_to_channel(struct Channel *, struct Client *, unsigned int, bool);
141 extern void remove_user_from_channel(struct ChannelMember *);
142 extern void channel_demote_members(struct Channel *, const struct Client *, unsigned int, const char);
143 extern void channel_send_namereply(struct Client *, struct Channel *);
144 extern void channel_send_modes(struct Client *, const struct Channel *);
145 extern void channel_modes(const struct Channel *, const struct Client *, char *, char *);
146 extern void check_spambot_warning(struct Client *, const char *);
147 extern void channel_free(struct Channel *);
148 extern void channel_set_topic(struct Channel *, const char *, const char *, uintmax_t, bool);
149
150 extern const char *member_get_prefix(const struct ChannelMember *, bool);
151 extern size_t member_get_prefix_len(const struct ChannelMember *, bool);
152
153 extern struct Channel *channel_make(const char *);
154 extern struct ChannelMember *member_find_link(const struct Client *, const struct Channel *);
155 #endif /* INCLUDED_channel_h */

Properties

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

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