/* * Copyright © 2005 William Pitcock, et al. * Rights to this code are as documented in doc/pod/license.pod. * * Data structures related to network servers. * * $Id: servers.h,v 1.4 2007/08/30 19:56:19 pippijn Exp $ */ #ifndef SERVERS_H #define SERVERS_H #include #include /* servers struct */ class server_t : public zero_initialised { struct callbacks { functor::callback1 eob; }; public: char *name; char *desc; char *sid; unsigned int hops; unsigned int users; unsigned int invis; unsigned int opers; unsigned int away; time_t connected_since; unsigned int flags; server_t *uplink; /* uplink server */ list_t children; /* children linked to me */ list_t userlist; /* users attached to me */ static callbacks callback; }; #define SF_HIDE 0x00000001 #define SF_EOB 0x00000002 /* Burst finished (we have all users/channels) -- jilles */ #define SF_EOB2 0x00000004 /* Is EOB but an uplink is not (for P10) */ #define SF_JUPE_PENDING 0x00000008 /* Sent SQUIT request, will introduce jupe when it dies (unconnect semantics) */ /* tld list struct */ struct tld_t : zero_initialised { char *name; }; #define SERVER_NAME(serv) ((serv)->sid[0] ? (serv)->sid : (serv)->name) #define ME (ircd->uses_uid ? me.numeric : me.name) /* servers.c */ E list_t tldlist; E void init_servers (void); E tld_t *tld_add (char const * const name); E void tld_delete (char const * const name); E tld_t *tld_find (char const * const name); E server_t *server_add (char const * const name, unsigned int hops, char const * const uplink, char const * const id, char const * const desc); E void server_delete (char const * const name); E server_t *server_find (char const * const name); #endif