#include "services.h"
Go to the source code of this file.
Functions | |
| Server * | first_server (int flags) |
| Server * | next_server (int flags) |
| Server * | new_server (Server *uplink, const char *name, const char *desc, uint16 flags, char *suid) |
| static void | delete_server (Server *serv, const char *quitreason) |
| Server * | findserver (Server *s, const char *name) |
| Server * | findserver_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 | |
| Server * | servlist = NULL |
| Server * | me_server = NULL |
| Server * | serv_uplink = NULL |
| uint32 | uplink_capab |
| char * | uplink |
| char * | TS6UPLINK |
| char * | TS6SID |
| static Server * | server_cur |
| CapabInfo | capab_info [] |
| static int | ts6_uid_initted = 0 |
| static char | ts6_new_uid [10] |
| static unsigned int | ts6_uid_index = 9 |
| int anope_check_sync | ( | const char * | name | ) |
Find if the server is synced with the network
| s | Server struct | |
| name | Server Name |
Definition at line 335 of file servers.c.
References findserver(), and is_sync().
| void capab_parse | ( | int | ac, | |
| char ** | av | |||
| ) |
Handle parsing the CAPAB/PROTOCTL messages
| ac | Number of arguments in av | |
| av | Agruments |
Definition at line 451 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.
| Server | struct | |
| reason | the server quit |
Definition at line 185 of file servers.c.
References alog(), debug, del_session(), delete_user(), server_::desc, firstuser(), nickcore_::flags, user_::host, ircdcap, is_ulined(), 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_::suid, 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
| 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 |
Definition at line 360 of file servers.c.
References alog(), debug, EVENT_SERVER_CONNECT, fatal(), findserver(), findserver_uid(), ircd, new_server(), send_event(), ircdvars_::ts6, and UseTS6.
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
| source | Name of the server leaving | |
| ac | Number of arguments in av | |
| av | Agruments as part of the SQUIT |
Definition at line 398 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().
Find a server by name, returns NULL if not found
| s | Server struct | |
| name | Server Name |
Definition at line 261 of file servers.c.
References alog(), debug, findserver(), server_::links, server_::name, server_::next, and stricmp().
Referenced by anope_check_sync(), anope_event_burst(), anope_event_eob(), anope_event_eos(), anope_event_mode(), anope_event_rsquit(), anope_event_sdesc(), bahamut_cmd_jupe(), charybdis_cmd_jupe(), do_jupe(), do_nick(), do_server(), do_sjoin(), do_squit(), dreamforge_cmd_jupe(), findserver(), hybrid_cmd_jupe(), inspircd_cmd_jupe(), plexus_cmd_jupe(), ptlink_cmd_jupe(), rageircd_cmd_jupe(), ratbox_cmd_jupe(), shadowircd_cmd_jupe(), solidircd_cmd_jupe(), ultimate2_cmd_jupe(), ultimate3_cmd_jupe(), unreal_cmd_jupe(), and viagra_cmd_jupe().
Find a server by UID, returns NULL if not found
| s | Server struct | |
| name | Server Name |
Definition at line 298 of file servers.c.
References alog(), debug, findserver_uid(), server_::links, server_::next, stricmp(), and server_::suid.
Referenced by anope_event_eob(), anope_event_eos(), anope_event_euid(), anope_event_metadata(), anope_event_nick(), anope_event_rsquit(), anope_event_sid(), anope_event_uid(), do_server(), do_sjoin(), do_squit(), findserver_uid(), inspircd_cmd_jupe(), and ts6_sid_retrieve().
| void finish_sync | ( | Server * | serv, | |
| int | sync_links | |||
| ) |
Definition at line 531 of file servers.c.
References alog(), debug, is_sync(), server_::links, server_::name, server_::next, restore_unsynced_topics(), server_::sync, and server_::uplink.
Referenced by anope_event_burst(), anope_event_eob(), and anope_event_eos().
| Server* first_server | ( | int | flags | ) |
Return the first server in the server struct
| flags | Server Flags, see services.h |
Definition at line 64 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)
| server | Server of which we want to know the state |
Definition at line 516 of file servers.c.
References SSYNC_DONE, SSYNC_UNKNOWN, and server_::sync.
Referenced by anope_check_sync(), chan_adduser2(), chan_create(), chan_set_correct_modes(), do_nick(), do_sjoin(), do_topic(), 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
| server | Server Setting the mode |
Definition at line 495 of file servers.c.
References NumUlines, stricmp(), and Ulines.
Referenced by bot_kick(), chan_set_correct_modes(), chan_set_modes(), check_ban(), check_kick(), delete_server(), do_kill(), do_nick(), and do_quit().
| Server* new_server | ( | Server * | uplink, | |
| const char * | name, | |||
| const char * | desc, | |||
| uint16 | flags, | |||
| char * | suid | |||
| ) |
This function makes a new Server structure and links it in the right places in the linked list if a Server struct to it's uplink if provided. It can also be NULL to indicate it's the uplink and should be first in the server list.
| uplink | Server struct | |
| name | Server Name | |
| desc | Server Description | |
| flags | Server Flags, see services.h | |
| suid | Server Universal ID |
Definition at line 119 of file servers.c.
References alog(), debug, server_::desc, server_::flags, GlobalOnCycle, GlobalOnCycleUP, server_::hops, ircd, server_::links, server_::name, server_::next, notice_server(), server_::prev, s_GlobalNoticer, scalloc(), SERVER_JUPED, sstrdup(), server_::suid, server_::sync, ircdvars_::sync, and server_::uplink.
Referenced by bahamut_cmd_connect(), bahamut_cmd_jupe(), charybdis_cmd_connect(), charybdis_cmd_jupe(), do_server(), dreamforge_cmd_connect(), dreamforge_cmd_jupe(), hybrid_cmd_connect(), hybrid_cmd_jupe(), inspircd_cmd_connect(), inspircd_cmd_jupe(), plexus_cmd_connect(), plexus_cmd_jupe(), ptlink_cmd_connect(), ptlink_cmd_jupe(), rageircd_cmd_connect(), rageircd_cmd_jupe(), ratbox_cmd_connect(), ratbox_cmd_jupe(), shadowircd_cmd_connect(), shadowircd_cmd_jupe(), solidircd_cmd_connect(), solidircd_cmd_jupe(), ultimate2_cmd_connect(), ultimate2_cmd_jupe(), ultimate3_cmd_connect(), ultimate3_cmd_jupe(), unreal_cmd_connect(), unreal_cmd_jupe(), viagra_cmd_connect(), and viagra_cmd_jupe().
| Server* next_server | ( | int | flags | ) |
Return the next server in the server struct
| flags | Server Flags, see services.h |
Definition at line 81 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 598 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 584 of file servers.c.
References alog(), snprintf(), ts6_new_uid, ts6_uid_initted, TS6SID, and UseTS6.
Referenced by ts6_uid_retrieve().
| char* ts6_uid_retrieve | ( | void | ) |
Definition at line 617 of file servers.c.
References ts6_new_uid, ts6_uid_increment(), ts6_uid_index, ts6_uid_init(), and ts6_uid_initted.
Referenced by charybdis_cmd_bot_nick(), charybdis_cmd_nick(), inspircd_cmd_bot_nick(), inspircd_cmd_guest_nick(), inspircd_cmd_nick(), ratbox_cmd_bot_nick(), ratbox_cmd_nick(), shadowircd_cmd_bot_nick(), and shadowircd_cmd_nick().
{
{"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}
}
| Server* serv_uplink = NULL |
Server* server_cur [static] |
char ts6_new_uid[10] [static] |
Definition at line 581 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 582 of file servers.c.
Referenced by ts6_uid_retrieve().
int ts6_uid_initted = 0 [static] |
Definition at line 580 of file servers.c.
Referenced by ts6_uid_init(), and ts6_uid_retrieve().
1.7.1