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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9476 - (hide annotations)
Sat Jul 4 15:26:19 2020 UTC (3 months, 3 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 adx 30 /*
2 michael 2865 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 adx 30 *
4 michael 9101 * Copyright (c) 1997-2020 ircd-hybrid development team
5 adx 30 *
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 michael 4565 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 adx 30 * USA
20     */
21    
22     /*! \file channel.h
23     * \brief Responsible for managing channels, members, bans and topics
24 knight 31 * \version $Id$
25 adx 30 */
26    
27     #ifndef INCLUDED_channel_h
28     #define INCLUDED_channel_h
29    
30     #include "ircd_defs.h" /* KEYLEN, CHANNELLEN */
31 michael 9234 #include "extban.h"
32 adx 30
33 michael 1798 #define AddMemberFlag(x, y) ((x)->flags |= (y))
34     #define DelMemberFlag(x, y) ((x)->flags &= ~(y))
35    
36 michael 6323 enum
37     {
38 michael 8808 CAN_SEND_NO = 0,
39     CAN_SEND_NONOP = -1,
40     CAN_SEND_OPV = -2
41     };
42    
43     enum
44     {
45 michael 8431 MSG_FLOOD_NOTICED = 1 << 0,
46     JOIN_FLOOD_NOTICED = 1 << 1
47 michael 6323 };
48 michael 1798
49 michael 6328 #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 michael 1798
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 adx 30 struct Client;
58    
59     /*! \brief Mode structure for channels */
60     struct Mode
61     {
62 michael 4404 unsigned int mode; /**< simple modes */
63     unsigned int limit; /**< +l userlimit */
64     char key[KEYLEN + 1]; /**< +k key */
65 adx 30 };
66    
67     /*! \brief Channel structure */
68     struct Channel
69     {
70     dlink_node node;
71    
72     struct Channel *hnextch;
73 michael 1013 struct Mode mode;
74 adx 30
75 michael 1203 char topic[TOPICLEN + 1];
76 michael 6932 char topic_info[NICKLEN + USERLEN + HOSTLEN + 3];
77 michael 1013
78 michael 9073 uintmax_t creation_time; /**< Real time */
79 michael 8917 uintmax_t topic_time; /**< Real time */
80 michael 9081 uintmax_t last_knock_time; /**< Don't allow knock to flood; monotonic time */
81     uintmax_t last_invite_time; /**< Monotonic time */
82 michael 8917 uintmax_t last_join_time; /**< Monotonic time */
83 michael 9081 uintmax_t first_received_message_time; /*!< Channel flood control; monotonic time */
84 michael 1013 unsigned int flags;
85 michael 7862 unsigned int received_number_of_privmsgs;
86 adx 30
87 michael 8599 dlink_list members_local; /*!< local members are here too */
88 adx 30 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 michael 4618 char name[CHANNELLEN + 1];
97 michael 6982 size_t name_len;
98 adx 30 };
99    
100 michael 9081 /*! \brief ChannelMember structure */
101     struct ChannelMember
102 adx 30 {
103 michael 9081 dlink_node locchannode; /**< link to channel->members_local */
104     dlink_node channode; /**< link to channel->members */
105 michael 9250 dlink_node usernode; /**< link to client->channel */
106 michael 9081 struct Channel *channel; /**< Channel pointer */
107     struct Client *client; /**< Client pointer */
108     unsigned int flags; /**< user/channel flags, e.g. CHFL_CHANOP */
109 adx 30 };
110    
111 michael 9234 enum { BANSTRLEN = 200 }; /* XXX */
112    
113 michael 4404 /*! \brief Ban structure. Used for b/e/I n!u\@h masks */
114 adx 30 struct Ban
115     {
116     dlink_node node;
117 michael 9234 unsigned int extban;
118     char banstr[BANSTRLEN];
119 michael 5757 char name[NICKLEN + 1];
120     char user[USERLEN + 1];
121     char host[HOSTLEN + 1];
122     char who[NICKLEN + USERLEN + HOSTLEN + 3];
123 michael 9234 size_t banstr_len; /**< Cached string length of Ban::banstr */
124 michael 8917 uintmax_t when; /**< Time this ban has been set; real time */
125 michael 371 struct irc_ssaddr addr;
126     int bits;
127 michael 1644 int type;
128 adx 30 };
129    
130 michael 8439 extern const dlink_list *channel_get_list(void);
131 michael 8660 extern bool channel_check_name(const char *, bool);
132 michael 9081 extern int can_send(struct Channel *, struct Client *, struct ChannelMember *, const char *, bool);
133 michael 9234 extern bool is_banned(struct Channel *, struct Client *);
134     extern bool find_bmask(struct Client *, struct Channel*, const dlink_list *, struct Extban *);
135 michael 9081 extern int has_member_flags(const struct ChannelMember *, const unsigned int);
136 adx 30
137 michael 3937 extern void channel_do_join(struct Client *, char *, char *);
138 michael 4785 extern void channel_do_part(struct Client *, char *, const char *);
139 adx 30 extern void remove_ban(struct Ban *, dlink_list *);
140 michael 8664 extern void add_user_to_channel(struct Channel *, struct Client *, unsigned int, bool);
141 michael 9081 extern void remove_user_from_channel(struct ChannelMember *);
142 michael 9450 extern void channel_demote_members(struct Channel *, const struct Client *, unsigned int, const char);
143 michael 9476 extern void channel_send_namereply(struct Client *, struct Channel *);
144 michael 8439 extern void channel_send_modes(struct Client *, const struct Channel *);
145     extern void channel_modes(const struct Channel *, const struct Client *, char *, char *);
146 adx 30 extern void check_spambot_warning(struct Client *, const char *);
147 michael 6373 extern void channel_free(struct Channel *);
148 michael 8660 extern void channel_set_topic(struct Channel *, const char *, const char *, uintmax_t, bool);
149 adx 30
150 michael 9454 extern const char *member_get_prefix(const struct ChannelMember *, bool);
151     extern size_t member_get_prefix_len(const struct ChannelMember *, bool);
152 adx 30
153 michael 6373 extern struct Channel *channel_make(const char *);
154 michael 9455 extern struct ChannelMember *member_find_link(const struct Client *, const struct Channel *);
155 michael 8439 #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