servers.c File Reference

#include "services.h"

Include dependency graph for servers.c:

Go to the source code of this file.

Functions

Serverfirst_server (int flags)
Servernext_server (int flags)
Servernew_server (Server *uplink, const char *name, const char *desc, uint16 flags, char *suid)
static void delete_server (Server *serv, const char *quitreason)
Serverfindserver (Server *s, const char *name)
Serverfindserver_uid (Server *s, const char *name)
int anope_check_sync (const char *name)
void do_server (const char *source, char *servername, char *hops, char *descript, char *numeric)
void do_squit (const char *source, int ac, char **av)
void capab_parse (int ac, char **av)
int is_ulined (char *server)
int is_sync (Server *server)
void finish_sync (Server *serv, int sync_links)
void ts6_uid_init (void)
void ts6_uid_increment (unsigned int slot)
char * ts6_uid_retrieve (void)

Variables

Serverservlist = NULL
Serverme_server = NULL
Serverserv_uplink = NULL
uint32 uplink_capab
char * uplink
char * TS6UPLINK
char * TS6SID
static Serverserver_cur
CapabInfo capab_info []
static int ts6_uid_initted = 0
static char ts6_new_uid [10]
static unsigned int ts6_uid_index = 9


Function Documentation

int anope_check_sync ( const char *  name  ) 

Find if the server is synced with the network

Parameters:
s Server struct
name Server Name
Returns:
Not Synced returns -1, Synced returns 1, Error returns 0

Definition at line 329 of file servers.c.

References findserver(), and is_sync().

void capab_parse ( int  ac,
char **  av 
)

Handle parsing the CAPAB/PROTOCTL messages

Parameters:
ac Number of arguments in av
av Agruments
Returns:
void

Definition at line 439 of file servers.c.

References ircdvars_::chanmodes, capabinfo_::flag, ircd, myStrGetToken(), myStrGetTokenRemainder(), ircdvars_::nickchars, ircdvars_::nickip, sstrdup(), stricmp(), capabinfo_::token, and uplink_capab.

Referenced by anope_event_capab().

static void delete_server ( Server serv,
const char *  quitreason 
) [static]

Remove and free a Server structure. This function is the most complete remove treatment a server can get, as it first quits all clients which still pretend to be on this server, then it walks through all connected servers and disconnects them too. If all mess is cleared, the server itself will be too.

Parameters:
Server struct
reason the server quit
Returns:
void

Definition at line 180 of file servers.c.

References alog(), debug, del_session(), delete_user(), server_::desc, firstuser(), nickcore_::flags, user_::host, ircdcap, nickalias_::last_quit, nickalias_::last_seen, LimitSessions, server_::links, user_::na, server_::name, nickalias_::nc, server_::next, nextuser(), NI_SUSPENDED, ircdcapab_::noquit, NS_IDENTIFIED, NS_RECOGNIZED, NS_VERBOTEN, server_::prev, ircdcapab_::qs, user_::server, sstrdup(), nickalias_::status, server_::uplink, and uplink_capab.

Referenced by do_squit().

void do_server ( const char *  source,
char *  servername,
char *  hops,
char *  descript,
char *  numeric 
)

Handle adding the server to the Server struct

Parameters:
source Name of the uplink if any
servername Name of the server being linked
hops Number of hops to reach this server
descript Description of the server
numeric Server Numberic/SUID
Returns:
void

Definition at line 354 of file servers.c.

References alog(), debug, EVENT_SERVER_CONNECT, findserver(), new_server(), and send_event().

Referenced by anope_event_server(), and anope_event_sid().

void do_squit ( const char *  source,
int  ac,
char **  av 
)

Handle removing the server from the Server struct

Parameters:
source Name of the server leaving
ac Number of arguments in av
av Agruments as part of the SQUIT
Returns:
void

Definition at line 386 of file servers.c.

References alog(), anope_cmd_global(), anope_cmd_squit(), BUFSIZE, debug, delete_server(), EVENT_SERVER_SQUIT, findserver(), findserver_uid(), server_::flags, ircd, ircdcap, server_::name, s_OperServ, send_event(), SERVER_JUPED, snprintf(), ircdvars_::ts6, ircdcapab_::unconnect, server_::uplink, uplink_capab, and UseTS6.

Referenced by anope_event_rsquit(), and anope_event_squit().

Server* findserver ( Server s,
const char *  name 
)

Server* findserver_uid ( Server s,
const char *  name 
)

Find a server by UID, returns NULL if not found

Parameters:
s Server struct
name Server Name
Returns:
Server struct

Definition at line 292 of file servers.c.

References alog(), debug, findserver_uid(), server_::links, server_::next, stricmp(), and server_::suid.

Referenced by anope_event_eos(), anope_event_euid(), anope_event_nick(), anope_event_sid(), do_squit(), and findserver_uid().

void finish_sync ( Server serv,
int  sync_links 
)

Server* first_server ( int  flags  ) 

Return the first server in the server struct

Parameters:
flags Server Flags, see services.h
Returns:
Server Struct

Definition at line 65 of file servers.c.

References server_::flags, and next_server().

int is_sync ( Server server  ) 

See if the current server is synced, or has an unknown sync state (in which case we pretend it is always synced)

Parameters:
server Server of which we want to know the state
Returns:
int 0 if not synced, 1 if synced

Definition at line 504 of file servers.c.

References SSYNC_DONE, SSYNC_UNKNOWN, and server_::sync.

Referenced by anope_check_sync(), chan_adduser2(), chan_create(), do_nick(), do_sjoin(), and finish_sync().

int is_ulined ( char *  server  ) 

Search the uline servers array to find out if the server that just set the mode is in our uline list

Parameters:
server Server Setting the mode
Returns:
int 0 if not found, 1 if found

Definition at line 483 of file servers.c.

References NumUlines, stricmp(), and Ulines.

Referenced by chan_set_correct_modes(), check_kick(), do_kill(), do_nick(), and do_quit().

Server* new_server ( Server uplink,
const char *  name,
const char *  desc,
uint16  flags,
char *  suid 
)

Server* next_server ( int  flags  ) 

Return the next server in the server struct

Parameters:
flags Server Flags, see services.h
Returns:
Server Struct

Definition at line 82 of file servers.c.

References server_::flags, server_::links, server_::next, and server_::uplink.

Referenced by first_server().

void ts6_uid_increment ( unsigned int  slot  ) 

Definition at line 589 of file servers.c.

References ts6_new_uid, ts6_uid_increment(), and TS6SID.

Referenced by ts6_uid_increment(), and ts6_uid_retrieve().

void ts6_uid_init ( void   ) 

Definition at line 572 of file servers.c.

References alog(), BUFSIZE, snprintf(), ts6_new_uid, ts6_uid_initted, TS6SID, and UseTS6.

Referenced by ts6_uid_retrieve().

char* ts6_uid_retrieve ( void   ) 


Variable Documentation

Initial value:

 {
    {"NOQUIT", CAPAB_NOQUIT},
    {"TSMODE", CAPAB_TSMODE},
    {"UNCONNECT", CAPAB_UNCONNECT},
    {"NICKIP", CAPAB_NICKIP},
    {"SSJOIN", CAPAB_NSJOIN},
    {"ZIP", CAPAB_ZIP},
    {"BURST", CAPAB_BURST},
    {"TS5", CAPAB_TS5},
    {"TS3", CAPAB_TS3},
    {"DKEY", CAPAB_DKEY},
    {"PT4", CAPAB_PT4},
    {"SCS", CAPAB_SCS},
    {"QS", CAPAB_QS},
    {"UID", CAPAB_UID},
    {"KNOCK", CAPAB_KNOCK},
    {"CLIENT", CAPAB_CLIENT},
    {"IPV6", CAPAB_IPV6},
    {"SSJ5", CAPAB_SSJ5},
    {"SN2", CAPAB_SN2},
    {"TOK1", CAPAB_TOKEN},
    {"TOKEN", CAPAB_TOKEN},
    {"VHOST", CAPAB_VHOST},
    {"SSJ3", CAPAB_SSJ3},
    {"SJB64", CAPAB_SJB64},
    {"CHANMODES", CAPAB_CHANMODE},
    {"NICKCHARS", CAPAB_NICKCHARS},
    {NULL, 0}
}

Definition at line 28 of file servers.c.

Server* me_server = NULL

Definition at line 18 of file servers.c.

Definition at line 19 of file servers.c.

Server* server_cur [static]

Definition at line 26 of file servers.c.

Server* servlist = NULL

Definition at line 17 of file servers.c.

char ts6_new_uid[10] [static]

Definition at line 569 of file servers.c.

Referenced by ts6_uid_increment(), ts6_uid_init(), and ts6_uid_retrieve().

unsigned int ts6_uid_index = 9 [static]

Definition at line 570 of file servers.c.

Referenced by ts6_uid_retrieve().

int ts6_uid_initted = 0 [static]

Definition at line 568 of file servers.c.

Referenced by ts6_uid_init(), and ts6_uid_retrieve().

char* TS6SID

Definition at line 23 of file servers.c.

char* TS6UPLINK

Definition at line 22 of file servers.c.

char* uplink

Definition at line 21 of file servers.c.

Definition at line 20 of file servers.c.


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