X-Git-Url: http://git.pk910.de/?p=srvx.git;a=blobdiff_plain;f=src%2Fproto-p10.c;fp=src%2Fproto-p10.c;h=d08fb1804fd82c48aaf5a3f9ffcd624d1a48d05a;hp=c48d21b45125fc6431c1d3413e7b1c2f3c3c60f3;hb=fffe459760943b6ed8e0bb736c87ef424ce38fdc;hpb=c253a006e0eafc173752e7c77dd706e02073cd20 diff --git a/src/proto-p10.c b/src/proto-p10.c index c48d21b..d08fb18 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -105,6 +105,8 @@ #define CMD_WHO "WHO" #define CMD_WHOIS "WHOIS" #define CMD_WHOWAS "WHOWAS" +#define CMD_XQUERY "XQUERY" +#define CMD_XRESPONSE "XRESPONSE" /* Tokenized commands. */ #define TOK_ACCOUNT "AC" @@ -191,6 +193,8 @@ #define TOK_WHO "H" #define TOK_WHOIS "W" #define TOK_WHOWAS "X" +#define TOK_XQUERY "XQ" +#define TOK_XRESPONSE "XR" /* Protocol messages; aliased to full commands or tokens depending on compile-time configuration. ircu prefers tokens WITH THE @@ -288,6 +292,8 @@ #define P10_WHO TYPE(WHO) #define P10_WHOIS TYPE(WHOIS) #define P10_WHOWAS TYPE(WHOWAS) +#define P10_XQUERY TYPE(XQUERY) +#define P10_XRESPONSE TYPE(XRESPONSE) /* Servers claiming to have a boot or link time before PREHISTORY * trigger errors to the log. We hope no server has been running @@ -961,6 +967,12 @@ irc_numeric(struct userNode *user, unsigned int num, const char *format, ...) putsock(":%s %03d %s %s", self->name, num, user->nick, buffer); } +void +irc_xresponse(struct server *target, const char *routing, const char *response) +{ + putsock("%s " P10_XRESPONSE " %s %s :%s", self->numeric, target->numeric, routing, response); +} + static void send_burst(void); static void @@ -1822,6 +1834,16 @@ static CMD_FUNC(cmd_relay) return 1; } +static CMD_FUNC(cmd_xquery) +{ + struct server *source; + if ((argc < 4) + || !(source = GetServerH(origin))) + return 0; + call_xquery_funcs(source, argv[2], argv[3]); + return 1; +} + void free_user(struct userNode *user) { @@ -1965,6 +1987,8 @@ init_parse(void) dict_insert(irc_func_dict, TOK_ADMIN, cmd_admin); dict_insert(irc_func_dict, CMD_TIME, cmd_time); dict_insert(irc_func_dict, TOK_TIME, cmd_time); + /* We don't handle XR or the (not really defined) XQUERY. */ + dict_insert(irc_func_dict, TOK_XQUERY, cmd_xquery); /* In P10, DESTRUCT doesn't do anything except be broadcast to servers. * Apparently to obliterate channels from any servers that think they