#include "../server/server.h"
#include "../lib/base64.h"
#include "../lib/irc_ipv6.h"
-#include "../lib/patricia.h"
+#include "../patricia/patricia.h"
#include "../authext/authext.h"
#define UMODE_ALL 0x3FFF
#define AFLAG_STAFF 0x0001
-#define AFLAG_DEVELOPER 0x0002
+#define AFLAG_SUPPORT 0x0002
+#define AFLAG_OPER 0x0004
+#define AFLAG_ADMIN 0x0008
+#define AFLAG_DEVELOPER 0x0010
+
+#define AFLAG_ALL 0x001F
#define IsInvisible(x) ((x)->umodes & UMODE_INV)
#define IsWallops(x) ((x)->umodes & UMODE_WALLOPS)
#define ClearHideIdle(x) ((x)->umodes &= ~UMODE_HIDEIDLE)
#define ClearParanoid(x) ((x)->umodes &= ~UMODE_PARANOID)
-#define IsStaff(x) ((x)->umodes & AFLAG_STAFF)
-#define IsDeveloper(x) ((x)->umodes & AFLAG_DEVELOPER)
+#define IsStaff(x) ((x)->flags & AFLAG_STAFF)
+#define IsDeveloper(x) ((x)->flags & AFLAG_DEVELOPER)
+#define IsSupport(x) ((x)->flags & AFLAG_SUPPORT)
+#define IsAdmin(x) ((x)->flags & AFLAG_ADMIN)
+#define IsOperFlag(x) ((x)->flags & AFLAG_OPER)
-#define SetStaff(x) ((x)->umodes |= AFLAG_STAFF)
-#define SetDeveloper(x) ((x)->umodes |= AFLAG_DEVELOPER)
+#define SetStaff(x) ((x)->flags |= AFLAG_STAFF)
+#define SetDeveloper(x) ((x)->flags |= AFLAG_DEVELOPER)
+#define SetSupport(x) ((x)->flags |= AFLAG_SUPPORT)
+#define SetAdmin(x) ((x)->flags |= AFLAG_ADMIN)
+#define SetOperFlag(x) ((x)->flags |= AFLAG_OPER)
-#define ClearStaff(x) ((x)->umodes &= ~AFLAG_STAFF)
-#define ClearDeveloper(x) ((x)->umodes &= ~AFLAG_DEVELOPER)
+#define ClearStaff(x) ((x)->flags &= ~AFLAG_STAFF)
+#define ClearDeveloper(x) ((x)->flags &= ~AFLAG_DEVELOPER)
+#define ClearSupport(x) ((x)->flags &= ~AFLAG_SUPPORT)
+#define ClearAdmin(x) ((x)->flags &= ~AFLAG_ADMIN)
+#define ClearOperFlag(x) ((x)->flags &= ~AFLAG_OPER)
typedef struct host {
sstring *name;
realname *realname;
sstring *shident; /* +h users: fake ident/host goes here */
sstring *sethost;
+ sstring *opername;
flag_t umodes;
- char authname[ACCOUNTLEN+1];
+ char *authname;
authname *auth; /* This requires User ID numbers to work */
time_t timestamp;
time_t accountts;
- flag_t accountflags;
patricia_node_t *ipnode;
unsigned int marker;
struct nick *next;
extern realname *realnametable[REALNAMEHASHSIZE];
extern const flag umodeflags[];
extern const flag accountflags[];
-extern patricia_tree_t *iptree;
#define MAXNUMERIC 0x3FFFFFFF
void releasenickext(int index);
char *visiblehostmask(nick *np, char *buf);
char *visibleuserhost(nick *np, char *buf);
-int registernodeext(const char *name);
-int findnodeext(const char *name);
-void releasenodeext(int index);
/* nickhandlers.c functions */
int handlenickmsg(void *source, int cargc, char **cargv);
int handlewhoismsg(void *source, int cargc, char **cargv);
int handleaccountmsg(void *source, int cargc, char **cargv);
int handlestatsmsg(void *source, int cargc, char **cargv);
+int handleprivmsg(void *source, int cargc, char **cargv);
/* These functions have been replaced by macros
nick **gethandlebynumeric(long numeric);