operserv.c File Reference

#include "services.h"
#include "pseudo.h"

Include dependency graph for operserv.c:

Go to the source code of this file.

Defines

#define SAFE(x)
#define SAFE(x)
#define SAFE(x)

Functions

static int compare_adminlist_entries (SList *slist, void *item1, void *item2)
static int compare_operlist_entries (SList *slist, void *item1, void *item2)
static void free_adminlist_entry (SList *slist, void *item)
static void free_operlist_entry (SList *slist, void *item)
static int is_akill_entry_equal (SList *slist, void *item1, void *item2)
static void free_akill_entry (SList *slist, void *item)
static int is_sgline_entry_equal (SList *slist, void *item1, void *item2)
static void free_sgline_entry (SList *slist, void *item)
static int is_sqline_entry_equal (SList *slist, void *item1, void *item2)
static void free_sqline_entry (SList *slist, void *item)
static int is_szline_entry_equal (SList *slist, void *item1, void *item2)
static void free_szline_entry (SList *slist, void *item)
char * defconReverseModes (const char *modes)
void moduleAddOperServCmds (void)
void os_init (void)
void operserv (User *u, char *buf)
static void load_old_akill (void)
void load_os_dbase (void)
void save_os_dbase (void)
void save_os_rdb_dbase (void)
void os_remove_nick (NickCore *nc)
int is_services_root (User *u)
int is_services_admin (User *u)
int is_services_oper (User *u)
int nick_is_services_root (NickCore *nc)
int nick_is_services_admin (NickCore *nc)
int nick_is_services_oper (NickCore *nc)
Serverserver_global (Server *s, char *msg)
void oper_global (char *nick, char *fmt,...)
int add_akill (User *u, char *mask, const char *by, const time_t expires, const char *reason)
int check_akill (char *nick, const char *username, const char *host, const char *vhost, const char *ip)
void expire_akills (void)
int add_sgline (User *u, char *mask, const char *by, const time_t expires, const char *reason)
int check_sgline (char *nick, const char *realname)
void expire_sglines (void)
int add_sqline (User *u, char *mask, const char *by, const time_t expires, const char *reason)
int check_sqline (char *nick, int nick_change)
int check_chan_sqline (const char *chan)
void expire_sqlines (void)
int add_szline (User *u, char *mask, const char *by, const time_t expires, const char *reason)
int check_szline (char *nick, char *ip)
void expire_szlines (void)
int checkDefCon (int level)
void resetDefCon (int level)
void runDefCon (void)
int defconParseModeString (const char *str)

Variables

SList servadmins
SList servopers
SList akills
SList sglines
SList sqlines
SList szlines
time_t DefContimer
int DefConModesSet = 0
uint32 DefConModesOn
uint32 DefConModesOff
ChannelInfo DefConModesCI
SListOpts akopts = { 0, NULL, &is_akill_entry_equal, &free_akill_entry }
SListOpts saopts
SListOpts sgopts = { 0, NULL, &is_sgline_entry_equal, &free_sgline_entry }
SListOpts soopts
SListOpts sqopts
SListOpts szopts = { 0, NULL, &is_szline_entry_equal, &free_szline_entry }


Define Documentation

#define SAFE (  ) 

Value:

do {                                            \
    if ((x) < 0) {                                              \
        restore_db(f);                                          \
        log_perror("Write error on %s", OperDBName);            \
        if (time(NULL) - lastwarn > WarningTimeout) {           \
            anope_cmd_global(NULL, "Write error on %s: %s", OperDBName, \
                        strerror(errno));                       \
            lastwarn = time(NULL);                              \
        }                                                       \
        return;                                                 \
    }                                                           \
} while (0)

Definition at line 421 of file operserv.c.

#define SAFE (  ) 

Value:

do {                                    \
    if ((x) < 0) {                                      \
        if (!forceload)                                 \
            fatal("Read error on %s", OperDBName);      \
        failed = 1;                                     \
        break;                                          \
    }                                                   \
} while (0)

Definition at line 421 of file operserv.c.

#define SAFE (  ) 

Value:

do {                                    \
    if ((x) < 0) {                                      \
        if (!forceload)                                 \
            fatal("Read error on %s", AutokillDBName);  \
        break;                                          \
    }                                                   \
} while (0)

Definition at line 421 of file operserv.c.


Function Documentation

int add_akill ( User u,
char *  mask,
const char *  by,
const time_t  expires,
const char *  reason 
)

int add_sgline ( User u,
char *  mask,
const char *  by,
const time_t  expires,
const char *  reason 
)

int add_sqline ( User u,
char *  mask,
const char *  by,
const time_t  expires,
const char *  reason 
)

int add_szline ( User u,
char *  mask,
const char *  by,
const time_t  expires,
const char *  reason 
)

int check_akill ( char *  nick,
const char *  username,
const char *  host,
const char *  vhost,
const char *  ip 
)

int check_chan_sqline ( const char *  chan  ) 

Definition at line 1276 of file operserv.c.

References slist_::count, slist_::list, sxline_::mask, match_wild_nocase(), sxline_::reason, and sqline().

Referenced by do_sjoin().

int check_sgline ( char *  nick,
const char *  realname 
)

int check_sqline ( char *  nick,
int  nick_change 
)

int check_szline ( char *  nick,
char *  ip 
)

int checkDefCon ( int  level  ) 

Returns 1 if the passed level is part of the CURRENT defcon, else 0 is returned

Definition at line 1585 of file operserv.c.

References DefCon, and DefConLevel.

Referenced by add_session(), check_akill(), defcon_sendlvls(), do_nick(), do_register(), do_run_cmd(), do_sendall(), do_set_mlock(), do_staff(), memo_send(), req_send_memos(), rsend_notify(), and runDefCon().

static int compare_adminlist_entries ( SList slist,
void *  item1,
void *  item2 
) [static]

Definition at line 1526 of file operserv.c.

References nickcore_::display, and stricmp().

static int compare_operlist_entries ( SList slist,
void *  item1,
void *  item2 
) [static]

Definition at line 1547 of file operserv.c.

References nickcore_::display, and stricmp().

int defconParseModeString ( const char *  str  ) 

char * defconReverseModes ( const char *  modes  ) 

Reverse the mode string, used for remove DEFCON chan modes.

Definition at line 1653 of file operserv.c.

Referenced by runDefCon().

void expire_akills ( void   ) 

void expire_sglines ( void   ) 

void expire_sqlines ( void   ) 

void expire_szlines ( void   ) 

static void free_adminlist_entry ( SList slist,
void *  item 
) [static]

Definition at line 1537 of file operserv.c.

References nickcore_::flags, and NI_SERVICES_ADMIN.

static void free_akill_entry ( SList slist,
void *  item 
) [static]

static void free_operlist_entry ( SList slist,
void *  item 
) [static]

Definition at line 1558 of file operserv.c.

References nickcore_::flags, and NI_SERVICES_OPER.

static void free_sgline_entry ( SList slist,
void *  item 
) [static]

Definition at line 1102 of file operserv.c.

References anope_cmd_unsgline(), sxline_::by, sxline_::mask, and sxline_::reason.

static void free_sqline_entry ( SList slist,
void *  item 
) [static]

Definition at line 1323 of file operserv.c.

References anope_cmd_unsqline(), sxline_::by, sxline_::mask, and sxline_::reason.

static void free_szline_entry ( SList slist,
void *  item 
) [static]

Definition at line 1491 of file operserv.c.

References anope_cmd_unszline(), sxline_::by, sxline_::mask, and sxline_::reason.

static int is_akill_entry_equal ( SList slist,
void *  item1,
void *  item2 
) [static]

Definition at line 932 of file operserv.c.

References BUFSIZE, akill_::host, snprintf(), stricmp(), and akill_::user.

int is_services_admin ( User u  ) 

int is_services_oper ( User u  ) 

int is_services_root ( User u  ) 

static int is_sgline_entry_equal ( SList slist,
void *  item1,
void *  item2 
) [static]

Definition at line 1118 of file operserv.c.

References sxline_::mask, and stricmp().

static int is_sqline_entry_equal ( SList slist,
void *  item1,
void *  item2 
) [static]

Definition at line 1339 of file operserv.c.

References sxline_::mask, and stricmp().

static int is_szline_entry_equal ( SList slist,
void *  item1,
void *  item2 
) [static]

Definition at line 1508 of file operserv.c.

References sxline_::mask, and stricmp().

static void load_old_akill ( void   )  [static]

void load_os_dbase ( void   ) 

void moduleAddOperServCmds ( void   ) 

int nick_is_services_admin ( NickCore nc  ) 

Definition at line 637 of file operserv.c.

References nickcore_::flags, NI_SERVICES_ADMIN, and NI_SERVICES_ROOT.

Referenced by cs_remove_nick(), do_saset_email(), and do_saset_password().

int nick_is_services_oper ( NickCore nc  ) 

Definition at line 650 of file operserv.c.

References NI_SERVICES_ADMIN, NI_SERVICES_OPER, and NI_SERVICES_ROOT.

Referenced by do_staff().

int nick_is_services_root ( NickCore nc  ) 

Definition at line 624 of file operserv.c.

References nickcore_::flags, and NI_SERVICES_ROOT.

void oper_global ( char *  nick,
char *  fmt,
  ... 
)

void operserv ( User u,
char *  buf 
)

Definition at line 130 of file operserv.c.

References alog(), anope_cmd_ctcp(), mod_run_cmd(), user_::nick, OPERSERV, s_OperServ, and stricmp().

Referenced by m_privmsg().

void os_init ( void   ) 

void os_remove_nick ( NickCore nc  ) 

Definition at line 567 of file operserv.c.

References slist_remove().

Referenced by delcore().

void resetDefCon ( int  level  ) 

Automaticaly re-set the DefCon level if the time limit has expired.

Definition at line 1593 of file operserv.c.

References alog(), anope_cmd_global(), DefConLevel, DefconMessage, DefConOffMessage, DefConTimeOut, DefContimer, dotime(), EVENT_DEFCON_LEVEL, getstring, getstring2, GlobalOnDefcon, GlobalOnDefconMore, oper_global(), runDefCon(), s_OperServ, send_event(), and snprintf().

Referenced by main().

void runDefCon ( void   ) 

Run DefCon level specific Functions.

Definition at line 1625 of file operserv.c.

References alog(), checkDefCon(), DEFCON_FORCE_CHAN_MODES, DefConChanModes, DefConModesSet, defconReverseModes(), and do_mass_mode().

Referenced by do_defcon(), and resetDefCon().

void save_os_dbase ( void   ) 

void save_os_rdb_dbase ( void   ) 

Server* server_global ( Server s,
char *  msg 
)


Variable Documentation

Definition at line 25 of file operserv.c.

SListOpts akopts = { 0, NULL, &is_akill_entry_equal, &free_akill_entry }

Definition at line 66 of file operserv.c.

Definition at line 51 of file operserv.c.

Definition at line 50 of file operserv.c.

Definition at line 49 of file operserv.c.

int DefConModesSet = 0

Definition at line 46 of file operserv.c.

time_t DefContimer

Definition at line 45 of file operserv.c.

Initial value:

Definition at line 67 of file operserv.c.

Definition at line 21 of file operserv.c.

Definition at line 23 of file operserv.c.

Definition at line 25 of file operserv.c.

SListOpts sgopts = { 0, NULL, &is_sgline_entry_equal, &free_sgline_entry }

Definition at line 71 of file operserv.c.

Initial value:

Definition at line 72 of file operserv.c.

Definition at line 25 of file operserv.c.

Initial value:

Definition at line 74 of file operserv.c.

Definition at line 25 of file operserv.c.

SListOpts szopts = { 0, NULL, &is_szline_entry_equal, &free_szline_entry }

Definition at line 76 of file operserv.c.


Generated on Sun Oct 5 09:07:08 2008 for Anope by  doxygen 1.5.7.1