update ircu message defines

This commit is contained in:
Mark 2004-01-15 20:31:56 +00:00
parent afeff6676d
commit dba65cae3d
2 changed files with 139 additions and 237 deletions

93
Ircu.c
View file

@ -34,12 +34,10 @@
static void Usr_Version (char *origin, char **argv, int argc);
static void Usr_MOTD (char *origin, char **argv, int argc);
static void Usr_Admin (char *origin, char **argv, int argc);
static void Usr_Credits (char *origin, char **argv, int argc);
static void Usr_Server (char *origin, char **argv, int argc);
static void Usr_Squit (char *origin, char **argv, int argc);
static void Usr_Quit (char *origin, char **argv, int argc);
static void Usr_Mode (char *origin, char **argv, int argc);
static void Usr_Smode (char *origin, char **argv, int argc);
static void Usr_Kill (char *origin, char **argv, int argc);
static void Usr_Pong (char *origin, char **argv, int argc);
static void Usr_Away (char *origin, char **argv, int argc);
@ -49,18 +47,14 @@ static void Usr_Kick (char *origin, char **argv, int argc);
static void Usr_Join (char *origin, char **argv, int argc);
static void Usr_Part (char *origin, char **argv, int argc);
static void Usr_Stats (char *origin, char **argv, int argc);
static void Usr_Vhost (char *origin, char **argv, int argc);
static void Srv_Ping (char *origin, char **argv, int argc);
static void Srv_Netinfo (char *origin, char **argv, int argc);
static void Srv_Pass (char *origin, char **argv, int argc);
static void Srv_Server (char *origin, char **argv, int argc);
static void Srv_Squit (char *origin, char **argv, int argc);
static void Srv_Nick (char *origin, char **argv, int argc);
static void Srv_Kill (char *origin, char **argv, int argc);
static void Srv_Protocol (char *origin, char **argv, int argc);
static void Srv_Svinfo (char *origin, char **argv, int argc);
static void Srv_Burst (char *origin, char **argv, int argc);
static void Srv_Sjoin (char *origin, char **argv, int argc);
static struct ircd_srv_ {
int uprot;
@ -78,7 +72,6 @@ IntCommands cmd_list[] = {
{MSG_VERSION, Usr_Version, 1, 0},
{MSG_MOTD, Usr_MOTD, 1, 0},
{MSG_ADMIN, Usr_Admin, 1, 0},
{MSG_CREDITS, Usr_Credits, 1, 0},
{MSG_SERVER, Usr_Server, 1, 0},
{MSG_SQUIT, Usr_Squit, 1, 0},
{MSG_QUIT, Usr_Quit, 1, 0},
@ -93,14 +86,11 @@ IntCommands cmd_list[] = {
{MSG_JOIN, Usr_Join, 1, 0},
{MSG_PART, Usr_Part, 1, 0},
{MSG_PING, Srv_Ping, 0, 0},
{MSG_SVINFO, Srv_Svinfo, 0, 0},
{MSG_PASS, Srv_Pass, 0, 0},
{MSG_SERVER, Srv_Server, 0, 0},
{MSG_SQUIT, Srv_Squit, 0, 0},
{MSG_NICK, Srv_Nick, 0, 0},
{MSG_KILL, Srv_Kill, 0, 0},
{MSG_EOB, Srv_Burst, 1, 0},
{MSG_SJOIN, Srv_Sjoin, 1, 0},
};
ChanModes chan_modes[] = {
@ -147,12 +137,6 @@ const int ircd_cmdcount = ((sizeof (cmd_list) / sizeof (cmd_list[0])));
const int ircd_umodecount = ((sizeof (user_umodes) / sizeof (user_umodes[0])));
const int ircd_cmodecount = ((sizeof (chan_modes) / sizeof (chan_modes[0])));
void
send_eob (const char *server)
{
sts (":%s %s", server, MSG_EOB);
}
void
send_server (const char *name, const int numeric, const char *infoline)
{
@ -163,7 +147,7 @@ void
send_server_connect (const char *name, const int numeric, const char *infoline, const char *pass)
{
sts ("%s %s :TS", MSG_PASS, pass);
sts ("CAPAB :TS EX CHW IE EOB KLN GLN KNOCK HOPS HUB AOPS MX");
sts ("CAPAB :TS EX CHW IE KLN GLN KNOCK HOPS HUB AOPS MX");
sts ("%s %s %d :%s", MSG_SERVER, name, numeric, infoline);
}
@ -188,7 +172,7 @@ send_part (const char *who, const char *chan)
void
send_join (const char *who, const char *chan)
{
sts (":%s %s 0 %s + :%s", me.name, MSG_SJOIN, chan, who);
sts (":%s %s 0 %s + :%s", me.name, MSG_JOIN, chan, who);
}
void
@ -260,12 +244,6 @@ void send_wallops (char *who, char *buf)
sts (":%s %s :%s", who, MSG_WALLOPS, buf);
}
void
send_svinfo (void)
{
sts ("SVINFO 5 3 0 :%d", (int) me.now);
}
void
send_burst (int b)
{
@ -287,7 +265,7 @@ send_akill (const char *host, const char *ident, const char *setby, const int le
hash_scan_begin (&ss, sh);
while ((sn = hash_scan_next (&ss)) != NULL) {
s = hnode_get (sn);
sts (":%s %s %s %lu %s %s :%s", setby, MSG_KLINE, s->name, (unsigned long)length, ident, host, reason);
//sts (":%s %s %s %lu %s %s :%s", setby, MSG_KLINE, s->name, (unsigned long)length, ident, host, reason);
}
}
@ -312,33 +290,10 @@ send_notice (char *to, const char *from, char *buf)
void
send_globops (char *from, char *buf)
{
sts (":%s %s :%s", from, MSG_GLOBOPS, buf);
// sts (":%s %s :%s", from, MSG_GLOBOPS, buf);
}
static void
Srv_Sjoin (char *origin, char **argv, int argc)
{
handle_sjoin (argv[1], argv[0], ((argc <= 2) ? argv[1] : argv[2]), 3, argv[4], argv, argc);
}
static void
Srv_Burst (char *origin, char **argv, int argc)
{
if (argc > 0) {
if (ircd_srv.burst == 1) {
send_burst (0);
ircd_srv.burst = 0;
me.synced = 1;
init_services_bot ();
}
} else {
ircd_srv.burst = 1;
}
send_eob (me.name);
init_services_bot ();
}
static void
Srv_Protocol (char *origin, char **argv, int argc)
{
@ -370,12 +325,6 @@ Usr_Admin (char *origin, char **argv, int argc)
ns_usr_admin (origin, argv, argc);
}
static void
Usr_Credits (char *origin, char **argv, int argc)
{
ns_usr_credits (origin, argv, argc);
}
static void
Usr_Server (char *origin, char **argv, int argc)
{
@ -397,17 +346,6 @@ Usr_Quit (char *origin, char **argv, int argc)
UserQuit (origin, NULL);
}
static void
Usr_Smode (char *origin, char **argv, int argc)
{
if (!strchr (argv[0], '#')) {
/* its user svsmode change */
UserMode (argv[0], argv[1]);
} else {
/* its a channel svsmode change */
ChanMode (origin, argv, argc);
}
}
static void
Usr_Mode (char *origin, char **argv, int argc)
{
@ -427,11 +365,6 @@ Usr_Kill (char *origin, char **argv, int argc)
free(tmpbuf);
}
static void
Usr_Vhost (char *origin, char **argv, int argc)
{
SetUserVhost(origin, argv[0]);
}
static void
Usr_Pong (char *origin, char **argv, int argc)
{
ns_usr_pong (origin, argv, argc);
@ -492,24 +425,6 @@ Srv_Ping (char *origin, char **argv, int argc)
send_pong (argv[0]);
}
static void
Srv_Svinfo (char *origin, char **argv, int argc)
{
send_svinfo ();
}
static void
Srv_Netinfo (char *origin, char **argv, int argc)
{
ircd_srv.uprot = atoi (argv[2]);
strlcpy (ircd_srv.cloak, argv[3], 10);
strlcpy (me.netname, argv[7], MAXPASS);
init_services_bot ();
globops (me.name, "Link with Network \2Complete!\2");
ModuleEvent (EVENT_NETINFO, NULL, 0);
me.synced = 1;
}
static void
Srv_Pass (char *origin, char **argv, int argc)
{

283
Ircu.h
View file

@ -68,154 +68,141 @@
#define TOPICLEN (512 + 1)
/* Messages/Tokens */
#define MSG_EOB "EOB" /* end of burst */
#define MSG_PRIVATE "PRIVMSG" /* PRIV */
#define MSG_WHO "WHO" /* WHO -> WHOC */
#define MSG_WHOIS "WHOIS" /* WHOI */
#define MSG_WHOWAS "WHOWAS" /* WHOW */
#define MSG_USER "USER" /* USER */
#define MSG_NICK "NICK" /* NICK */
#define MSG_SERVER "SERVER" /* SERV */
#define MSG_LIST "LIST" /* LIST */
#define MSG_TOPIC "TOPIC" /* TOPI */
#define MSG_INVITE "INVITE" /* INVI */
#define MSG_VERSION "VERSION" /* VERS */
#define MSG_QUIT "QUIT" /* QUIT */
#define MSG_SQUIT "SQUIT" /* SQUI */
#define MSG_KILL "KILL" /* KILL */
#define MSG_INFO "INFO" /* INFO */
#define MSG_LINKS "LINKS" /* LINK */
#define MSG_WATCH "WATCH" /* WATCH */
#define MSG_STATS "STATS" /* STAT */
#define MSG_HELP "HELP" /* HELP */
#define MSG_HELPOP "HELPOP" /* HELP */
#define MSG_ERROR "ERROR" /* ERRO */
#define MSG_AWAY "AWAY" /* AWAY */
#define MSG_CONNECT "CONNECT" /* CONN */
#define MSG_PING "PING" /* PING */
#define MSG_PONG "PONG" /* PONG */
#define MSG_OPER "OPER" /* OPER */
#define MSG_PASS "PASS" /* PASS */
#define MSG_WALLOPS "WALLOPS" /* WALL */
#define MSG_TIME "TIME" /* TIME */
#define MSG_NAMES "NAMES" /* NAME */
#define MSG_ADMIN "ADMIN" /* ADMI */
#define MSG_NOTICE "NOTICE" /* NOTI */
#define MSG_JOIN "JOIN" /* JOIN */
#define MSG_PART "PART" /* PART */
#define MSG_LUSERS "LUSERS" /* LUSE */
#define MSG_MOTD "MOTD" /* MOTD */
#define MSG_MODE "MODE" /* MODE */
#define MSG_KICK "KICK" /* KICK */
#define MSG_SERVICE "SERVICE" /* SERV -> SRVI */
#define MSG_USERHOST "USERHOST" /* USER -> USRH */
#define MSG_ISON "ISON" /* ISON */
#define MSG_SQUERY "SQUERY" /* SQUE */
#define MSG_SERVLIST "SERVLIST" /* SERV -> SLIS */
#define MSG_SERVSET "SERVSET" /* SERV -> SSET */
#define MSG_REHASH "REHASH" /* REHA */
#define MSG_RESTART "RESTART" /* REST */
#define MSG_CLOSE "CLOSE" /* CLOS */
#define MSG_DIE "DIE" /* DIE */
#define MSG_HASH "HASH" /* HASH */
#define MSG_DNS "DNS" /* DNS -> DNSS */
#define MSG_SILENCE "SILENCE" /* SILE */
#define MSG_AKILL "AKILL" /* AKILL */
#define MSG_KLINE "KLINE" /* KLINE */
#define MSG_UNKLINE "UNKLINE" /* UNKLINE */
#define MSG_RAKILL "RAKILL" /* RAKILL */
#define MSG_GNOTICE "GNOTICE" /* GNOTICE */
#define MSG_GOPER "GOPER" /* GOPER */
#define MSG_GLOBOPS "GLOBOPS" /* GLOBOPS */
#define MSG_LOCOPS "LOCOPS" /* LOCOPS */
#define MSG_PROTOCTL "PROTOCTL" /* PROTOCTL */
#define MSG_TRACE "TRACE" /* TRAC */
#define MSG_SQLINE "SQLINE" /* SQLINE */
#define MSG_UNSQLINE "UNSQLINE" /* UNSQLINE */
#define MSG_SVSNICK "SVSNICK" /* SVSNICK */
#define MSG_SVSNOOP "SVSNOOP" /* SVSNOOP */
#define MSG_IDENTIFY "IDENTIFY" /* IDENTIFY */
#define MSG_SVSKILL "SVSKILL" /* SVSKILL */
#define MSG_NICKSERV "NICKSERV" /* NICKSERV */
#define MSG_NS "NS"
#define MSG_CHANSERV "CHANSERV" /* CHANSERV */
#define MSG_CS "CS"
#define MSG_OPERSERV "OPERSERV" /* OPERSERV */
#define MSG_OS "OS"
#define MSG_MEMOSERV "MEMOSERV" /* MEMOSERV */
#define MSG_MS "MS"
#define MSG_SERVICES "SERVICES" /* SERVICES */
#define MSG_SVSMODE "SVSMODE" /* SVSMODE */
#define MSG_SAMODE "SAMODE" /* SAMODE */
#define MSG_CHATOPS "CHATOPS" /* CHATOPS */
#define MSG_HELPSERV "HELPSERV" /* HELPSERV */
#define MSG_ZLINE "ZLINE" /* ZLINE */
#define MSG_UNZLINE "UNZLINE" /* UNZLINE */
#define MSG_NETINFO "NETINFO" /* NETINFO */
#define MSG_RULES "RULES" /* RULES */
#define MSG_MAP "MAP" /* MAP */
#define MSG_NETG "NETG" /* NETG */
#define MSG_ADCHAT "ADCHAT" /* Adchat */
#define MSG_MAKEPASS "MAKEPASS" /* MAKEPASS */
#define MSG_ADDHUB "ADDHUB" /* ADDHUB */
#define MSG_DELHUB "DELHUB" /* DELHUB */
#define MSG_ADDCNLINE "ADDCNLINE" /* ADDCNLINE */
#define MSG_DELCNLINE "DELCNLINE" /* DELCNLINE */
#define MSG_ADDOPER "ADDOPER" /* ADDOPER */
#define MSG_DELOPER "DELOPER" /* DELOPER */
#define MSG_ADDQLINE "ADDQLINE" /* ADDQLINE */
#define MSG_DELQLINE "DELQLINE" /* DELQLINE */
#define MSG_GSOP "GSOP" /* GSOP */
#define MSG_ISOPER "ISOPER" /* ISOPER */
#define MSG_ADG "ADG" /* ADG */
#define MSG_NMON "NMON" /* NMON */
#define MSG_DALINFO "DALINFO" /* DALnet Credits */
#define MSG_CREDITS "CREDITS" /* UltimateIRCd Credits and "Thanks To" */
#define MSG_OPERMOTD "OPERMOTD" /* OPERMOTD */
#define MSG_REMREHASH "REMREHASH" /* Remote Rehash */
#define MSG_MONITOR "MONITOR" /* MONITOR */
#define MSG_GLINE "GLINE" /* The awesome g-line */
#define MSG_REMGLINE "REMGLINE" /* remove g-line */
#define MSG_STATSERV "STATSERV" /* StatServ */
#define MSG_RULESERV "RULESERV" /* RuleServ */
#define MSG_SNETINFO "SNETINFO" /* SNetInfo */
#define MSG_TSCTL "TSCTL" /* TSCTL */
#define MSG_SVSJOIN "SVSJOIN" /* SVSJOIN */
#define MSG_SAJOIN "SAJOIN" /* SAJOIN */
#define MSG_SDESC "SDESC" /* SDESC */
#define MSG_UNREALINFO "UNREALINFO" /* Unreal Info */
#define MSG_SETHOST "SETHOST" /* sethost */
#define MSG_SETIDENT "SETIDENT" /* set ident */
#define MSG_SETNAME "SETNAME" /* set Realname */
#define MSG_CHGHOST "CHGHOST" /* Changehost */
#define MSG_CHGIDENT "CHGIDENT" /* Change Ident */
#define MSG_RANDQUOTE "RANDQUOTE" /* Random Quote */
#define MSG_ADDQUOTE "ADDQUOTE" /* Add Quote */
#define MSG_ADDGQUOTE "ADDGQUOTE" /* Add Global Quote */
#define MSG_ADDULINE "ADDULINE" /* Adds an U Line to ircd.conf file */
#define MSG_DELULINE "DELULINE" /* Removes an U line from the ircd.conf */
#define MSG_KNOCK "KNOCK" /* Knock Knock - Who's there? */
#define MSG_SETTINGS "SETTINGS" /* Settings */
#define MSG_IRCOPS "IRCOPS" /* Shows Online IRCOps */
#define MSG_SVSPART "SVSPART" /* SVSPART */
#define MSG_SAPART "SAPART" /* SAPART */
#define MSG_VCTRL "VCTRL" /* VCTRL */
#define MSG_GCLIENT "GCLIENT" /* GLIENT */
#define MSG_CHANNEL "CHANNEL" /* CHANNEL */
#define MSG_UPTIME "UPTIME" /* UPTIME */
#define MSG_FAILOPS "FAILOPS" /* FAILOPS */
#define MSG_RPING "RPING" /* RPING */
#define MSG_RPONG "RPONG" /* RPONG */
#define MSG_UPING "UPING" /* UPING */
#define MSG_COPYRIGHT "COPYRIGHT" /* Copyright */
#define MSG_BOTSERV "BOTSERV" /* BOTSERV */
#define MSG_BS "BS"
#define MSG_ROOTSERV "ROOTSERV" /* ROOTSERV */
#define MSG_SVINFO "SVINFO"
#define MSG_CAPAB "CAPAB"
#define MSG_BURST "BURST"
#define MSG_SJOIN "SJOIN"
#define MSG_TBURST "TBURST"
#define MSG_PRIVATE "PRIVMSG" /* PRIV */
#define TOK_PRIVATE "P"
#define MSG_WHO "WHO" /* WHO -> WHOC */
#define TOK_WHO "H"
#define MSG_WHOIS "WHOIS" /* WHOI */
#define TOK_WHOIS "W"
#define MSG_WHOWAS "WHOWAS" /* WHOW */
#define TOK_WHOWAS "X"
#define MSG_USER "USER" /* USER */
#define TOK_USER "USER"
#define MSG_NICK "NICK" /* NICK */
#define TOK_NICK "N"
#define MSG_SERVER "SERVER" /* SERV */
#define TOK_SERVER "S"
#define MSG_LIST "LIST" /* LIST */
#define TOK_LIST "LIST"
#define MSG_TOPIC "TOPIC" /* TOPI */
#define TOK_TOPIC "T"
#define MSG_INVITE "INVITE" /* INVI */
#define TOK_INVITE "I"
#define MSG_VERSION "VERSION" /* VERS */
#define TOK_VERSION "V"
#define MSG_QUIT "QUIT" /* QUIT */
#define TOK_QUIT "Q"
#define MSG_SQUIT "SQUIT" /* SQUI */
#define TOK_SQUIT "SQ"
#define MSG_KILL "KILL" /* KILL */
#define TOK_KILL "D"
#define MSG_INFO "INFO" /* INFO */
#define TOK_INFO "F"
#define MSG_LINKS "LINKS" /* LINK */
#define TOK_LINKS "LI"
#define MSG_STATS "STATS" /* STAT */
#define TOK_STATS "R"
#define MSG_HELP "HELP" /* HELP */
#define TOK_HELP "HELP"
#define MSG_ERROR "ERROR" /* ERRO */
#define TOK_ERROR "Y"
#define MSG_AWAY "AWAY" /* AWAY */
#define TOK_AWAY "A"
#define MSG_CONNECT "CONNECT" /* CONN */
#define TOK_CONNECT "CO"
#define MSG_UPING "UPING" /* UPIN */
#define TOK_UPING "UP"
#define MSG_MAP "MAP" /* MAP */
#define TOK_MAP "MAP"
#define MSG_PING "PING" /* PING */
#define TOK_PING "G"
#define MSG_PONG "PONG" /* PONG */
#define TOK_PONG "Z"
#define MSG_OPER "OPER" /* OPER */
#define TOK_OPER "OPER"
#define MSG_PASS "PASS" /* PASS */
#define TOK_PASS "PA"
#define MSG_WALLOPS "WALLOPS" /* WALL */
#define TOK_WALLOPS "WA"
#define MSG_WALLUSERS "WALLUSERS" /* WALLU */
#define TOK_WALLUSERS "WU"
#define MSG_DESYNCH "DESYNCH" /* DESY */
#define TOK_DESYNCH "DS"
#define MSG_TIME "TIME" /* TIME */
#define TOK_TIME "TI"
#define MSG_SETTIME "SETTIME" /* SETT */
#define TOK_SETTIME "SE"
#define MSG_RPING "RPING" /* RPIN */
#define TOK_RPING "RI"
#define MSG_RPONG "RPONG" /* RPON */
#define TOK_RPONG "RO"
#define MSG_NAMES "NAMES" /* NAME */
#define TOK_NAMES "E"
#define MSG_ADMIN "ADMIN" /* ADMI */
#define TOK_ADMIN "AD"
#define MSG_TRACE "TRACE" /* TRAC */
#define TOK_TRACE "TR"
#define MSG_NOTICE "NOTICE" /* NOTI */
#define TOK_NOTICE "O"
#define MSG_WALLCHOPS "WALLCHOPS" /* WC */
#define TOK_WALLCHOPS "WC"
#define MSG_CPRIVMSG "CPRIVMSG" /* CPRI */
#define TOK_CPRIVMSG "CP"
#define MSG_CNOTICE "CNOTICE" /* CNOT */
#define TOK_CNOTICE "CN"
#define MSG_JOIN "JOIN" /* JOIN */
#define TOK_JOIN "J"
#define MSG_PART "PART" /* PART */
#define TOK_PART "L"
#define MSG_LUSERS "LUSERS" /* LUSE */
#define TOK_LUSERS "LU"
#define MSG_MOTD "MOTD" /* MOTD */
#define TOK_MOTD "MO"
#define MSG_MODE "MODE" /* MODE */
#define TOK_MODE "M"
#define MSG_KICK "KICK" /* KICK */
#define TOK_KICK "K"
#define MSG_USERHOST "USERHOST" /* USER -> USRH */
#define TOK_USERHOST "USERHOST"
#define MSG_USERIP "USERIP" /* USER -> USIP */
#define TOK_USERIP "USERIP"
#define MSG_ISON "ISON" /* ISON */
#define TOK_ISON "ISON"
#define MSG_SQUERY "SQUERY" /* SQUE */
#define TOK_SQUERY "SQUERY"
#define MSG_SERVLIST "SERVLIST" /* SERV -> SLIS */
#define TOK_SERVLIST "SERVSET"
#define MSG_SERVSET "SERVSET" /* SERV -> SSET */
#define TOK_SERVSET "SERVSET"
#define MSG_REHASH "REHASH" /* REHA */
#define TOK_REHASH "REHASH"
#define MSG_RESTART "RESTART" /* REST */
#define TOK_RESTART "RESTART"
#define MSG_CLOSE "CLOSE" /* CLOS */
#define TOK_CLOSE "CLOSE"
#define MSG_DIE "DIE" /* DIE */
#define TOK_DIE "DIE"
#define MSG_HASH "HASH" /* HASH */
#define TOK_HASH "HASH"
#define MSG_DNS "DNS" /* DNS -> DNSS */
#define TOK_DNS "DNS"
#define MSG_SILENCE "SILENCE" /* SILE */
#define TOK_SILENCE "U"
#define MSG_GLINE "GLINE" /* GLIN */
#define TOK_GLINE "GL"
#define MSG_BURST "BURST" /* BURS */
#define TOK_BURST "B"
#define MSG_CREATE "CREATE" /* CREA */
#define TOK_CREATE "C"
#define MSG_DESTRUCT "DESTRUCT" /* DEST */
#define TOK_DESTRUCT "DE"
#define MSG_END_OF_BURST "END_OF_BURST" /* END_ */
#define TOK_END_OF_BURST "EB"
#define MSG_END_OF_BURST_ACK "EOB_ACK" /* EOB_ */
#define TOK_END_OF_BURST_ACK "EA"
#define MSG_POST "POST" /* POS */
#define TOK_POST "POST"
/* message macros */
#define is_privmsg(msg) ( !strcmp(MSG_PRIVATE, (msg)) || !strcmp("P", (msg)) || !strcmp("CPRIVMSG", (msg)) || !strcmp("CP", (msg)))