1 Occasionally, a server will become incorrectly configured or will
2 start behaving incorrectly. Even more rarely, a server will be
3 compromised, and a modified version of the server put in place to
4 cause problems. These cases are the reason for the _jupe_, a
5 temporary server ban. This is similar to the G-line, which is a
6 temporary user ban, and indeed, the jupe API is very similar to the
10 #define JUPE_MAX_EXPIRE 604800 /* max expire: 7 days */
12 This macro lists the maximum expire time a jupe is permitted to have.
13 This value is limited to 7 days to prevent abuse of the system.
17 #define JUPE_ACTIVE 0x0001
19 This flag is used to indicate that a given jupe is globally active.
23 #define JUPE_LOCAL 0x0002
25 This flag is used to indicate that a given jupe is a local one. Local
26 jupes do not affect users on other servers.
30 #define JUPE_LDEACT 0x0004 /* locally deactivated */
32 This flag is set on global jupes that have been locally deactivated.
33 This flag is maintained internally by the jupe subsystem.
39 The struct Jupe describes everything about a given jupe. None of its
40 fields may be directly accessed by the application; use the functions
41 and macros described below instead.
45 int JupeIsActive(struct Jupe* j);
47 This macro returns a non-zero value if the jupe is active, or 0
48 otherwise. If a jupe is locally deactivated, this macro will always
53 int JupeIsRemActive(struct Jupe* j);
55 This macro returns a non-zero value if the jupe is active, ignoring
56 whether or not it is locally deactivated.
60 int JupeIsLocal(struct Jupe* j);
62 This macro returns a non-zero value if the jupe is local only.
66 char* JupeServer(struct Jupe* j);
68 This macro returns the server name associated with the jupe.
72 char* JupeReason(struct Jupe* j);
74 This macro returns the reason that was given when the jupe was set.
78 time_t JupeLastMod(struct Jupe* j);
80 Jupes have a modification time that must be monotonically increasing.
81 This macro simply returns that modification time.
85 int jupe_add(struct Client *cptr, struct Client *sptr, char *server,
86 char *reason, time_t expire, time_t lastmod, unsigned int flags);
88 This function simply adds a jupe, set by _sptr_ and with a _server_,
89 _reason_, _expire_, and _lastmod_ as specified. The _flags_ parameter
90 is a bit mask consisting of the binary OR of JUPE_LOCAL and
91 JUPE_ACTIVE, as appropriate. The jupe_add() function will propagate
92 the jupe to all servers (assuming JUPE_LOCAL was not passed), and will
93 break its link to the server specified by _server_ (assuming that the
94 JUPE_ACTIVE flag _was_ passed).
98 int jupe_activate(struct Client *cptr, struct Client *sptr, struct Jupe *jupe,
99 time_t lastmod, unsigned int flags);
101 This function activates the jupe specified by _jupe_, setting its
102 _lastmod_ time as specified. If _flags_ is JUPE_LOCAL and if the jupe
103 is locally deactivated, this function will turn off the local
104 deactivation flag, but will not modify _lastmod_. If the jupe is
105 globally deactivated, passing this function the JUPE_LOCAL flag will
110 int jupe_deactivate(struct Client *cptr, struct Client *sptr,
111 struct Jupe *jupe, time_t lastmod, unsigned int flags);
113 This function is similar to jupe_activate() except that it deactivates
114 the jupe. If the given jupe is local, then the jupe is deleted from
115 memory. In all other cases, the jupe is simply deactivated, either
116 locally (if JUPE_LOCAL was passed via _flags_) or globally. Global
117 deactivation will update the _lastmod_ time.
121 struct Jupe* jupe_find(char *server);
123 This function searches for a jupe matching the given _server_.
127 void jupe_free(struct Jupe *jupe);
129 This function releases all storage associated with a given jupe.
133 void jupe_burst(struct Client *cptr);
135 This function generates a burst of all existing global jupes and sends
136 them to the server specified by _cptr_.
140 int jupe_resend(struct Client *cptr, struct Jupe *jupe);
142 This function resends the _jupe_ to a server specified by _cptr_.
143 This may be used if, for instance, it is discovered that a server is
144 not synchronized with respect to a particular jupe.
148 int jupe_list(struct Client *sptr, char *server);
150 This function sends the information about a jupe matching _server_ to
151 the client specified by _sptr_. If _server_ is a NULL pointer, a list
152 of all jupes is sent.
156 Kev <klmitch@mit.edu>
160 [2001-6-15 Kev] Initial documentation of the jupe API.