ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/motd.h
Revision: 9857
Committed: Fri Jan 1 04:43:22 2021 UTC (4 years, 7 months ago) by michael
Content type: text/x-chdr
File size: 3430 byte(s)
Log Message:
- Bump copyright years

File Contents

# Content
1 /*
2 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 *
4 * Copyright (c) 2000 Kevin L. Mitchell <klmitch@mit.edu>
5 * Copyright (c) 2013-2021 ircd-hybrid development team
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
20 * USA
21 */
22
23 /*! \file motd.h
24 * \brief Message-of-the-day manipulation implementation.
25 * \version $Id$
26 */
27
28 #ifndef INCLUDED_motd_h
29 #define INCLUDED_motd_h
30
31 /** Type of MOTD. */
32 enum MotdType
33 {
34 MOTD_UNIVERSAL, /**< MOTD for all users */
35 MOTD_HOSTMASK, /**< MOTD selected by hostmask */
36 MOTD_IPMASKV4, /**< MOTD selected by IPv4 mask */
37 MOTD_IPMASKV6, /**< MOTD selected by IPv6 mask */
38 MOTD_CLASS /**< MOTD selected by connection class */
39 };
40
41 /** Length of one MOTD line(320 chars + '\\0'). */
42 enum { MOTD_LINESIZE = 321 };
43 /** Maximum number of lines for MOTD */
44 enum { MOTD_MAXLINES = 100 };
45
46 /** Entry for a single Message Of The Day (MOTD). */
47 struct Motd
48 {
49 dlink_node node; /**< Next MOTD in the linked list. */
50 enum MotdType type; /**< Type of MOTD. */
51 char *path; /**< Pathname of MOTD file. */
52 char *mask; /**< Hostmask if type==MOTD_HOSTMASK,
53 class name if type==MOTD_CLASS,
54 text IP mask if type==MOTD_IPMASK. */
55 struct irc_ssaddr address; /**< Address if type==MOTD_IPMASK. */
56 int addrbits; /**< Number of bits checked in Motd::address. */
57 unsigned int maxcount; /**< Number of lines for MOTD. */
58 struct MotdCache *cache; /**< MOTD cache entry. */
59 };
60
61 /** Cache entry for the contents of a MOTD file. */
62 struct MotdCache
63 {
64 dlink_node node; /**< Next MotdCache in list. */
65 char *path; /**< Pathname of file. */
66 unsigned int ref; /**< Number of references to this entry. */
67 unsigned int maxcount; /**< Number of lines allocated for message. */
68 unsigned int count; /**< Actual number of lines used in message. */
69 uintmax_t modtime; /**< Last modification time from file. */
70 char motd[][MOTD_LINESIZE]; /**< Message body. */
71 };
72
73 /* motd_send sends a MOTD off to a user */
74 extern void motd_send(struct Client *);
75
76 /* motd_signon sends a MOTD off to a newly-registered user */
77 extern void motd_signon(struct Client *);
78
79 /* motd_recache causes all the MOTD caches to be cleared */
80 extern void motd_recache(void);
81
82 /* motd_init initializes the MOTD routines, including reading the
83 * ircd.motd and remote.motd files into cache
84 */
85 extern void motd_init(void);
86
87 /* This routine adds a MOTD */
88 extern void motd_add(const char *, const char *);
89
90 /* This routine clears the list of MOTDs */
91 extern void motd_clear(void);
92
93 /* This is called to report motd {} blocks */
94 extern void motd_report(struct Client *, int, char *[]);
95 extern void motd_memory_count(struct Client *);
96 #endif /* INCLUDED_motd_h */

Properties

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