+void
+irc_mark(struct userNode *user, char *mark)
+{
+ char *host = user->hostname;
+ int type = 4;
+ const char *tstr = NULL;
+ unsigned int ii = 0;
+ int markfound = 0;
+
+ tstr = conf_get_data("server/type", RECDB_QSTRING);
+ if(tstr)
+ type = atoi(tstr);
+ else
+ type = 4;
+
+ if (user->marks)
+ for (ii=0; ii<user->marks->used; ii++)
+ if (!irccasecmp(user->marks->list[ii], mark))
+ markfound = 1;
+
+ if (!markfound)
+ {
+ if (!user->marks)
+ user->marks = alloc_string_list(1);
+ string_list_append(user->marks, strdup(mark));
+ }
+
+ if (type >= 9)
+ {
+ putsock("%s " CMD_MARK " %s MARK %s", self->numeric, user->nick, mark);
+ return;
+ }
+
+ /* TODO: Allow mark overwrite. If they are marked, and their fakehost is oldmark.hostname, update it to newmark.hostname so mark can be called multiple times. Probably requires ircd modification also */
+ if(user->mark)
+ return;
+
+ /* if the mark will put us over the host length, clip some off the left hand side
+ * to make room...
+ */
+ if(strlen(host) + 1 + strlen(mark) > HOSTLEN)
+ host += 1 + ( (strlen(host) + 1 + strlen(mark)) - HOSTLEN );
+ putsock("%s " CMD_MARK " %s DNSBL +m %s.%s", self->numeric, user->nick, mark, host);
+ putsock("%s " CMD_MARK " %s DNSBL_DATA %s", self->numeric, user->nick, mark);
+
+ /* Save it in the user */
+ user->mark = strdup(mark);
+
+ /* If they are not otherwise marked, mark their host with fakehost */
+ if(!IsFakeHost(user) && !IsSetHost(user) && !(IsHiddenHost(user) && user->handle_info) )
+ {
+ struct modeNode *mn = NULL;
+ char fakehost[HOSTLEN];
+ unsigned int count = 0;
+ unsigned int n = 0;
+
+ putsock("%s " CMD_FAKEHOST " %s %s.%s", self->numeric, user->numeric, mark, host);
+ putsock("%s " CMD_MODE " %s +x", self->numeric, user->nick);
+
+ snprintf(fakehost, sizeof(fakehost), "%s.%s", mark, host);
+ safestrncpy(user->fakehost, fakehost, sizeof(user->fakehost));
+
+ for (n=count=0; n<user->channels.used; n++) {
+ mn = user->channels.list[n];
+ if (strlen(mn->channel->name) >= 1) /* Sanity */
+ check_bans(user, mn->channel->name);
+ }
+ }
+}
+
+void irc_sno(unsigned int mask, char const* format, ...) {
+ va_list arg_list;
+ char buffer[MAXLEN];
+ va_start(arg_list, format);
+ vsnprintf(buffer, MAXLEN-2, format, arg_list);
+ buffer[MAXLEN-1] = 0;
+ putsock("%s " CMD_SNO " %d :%s", self->numeric, mask, buffer);
+}
+
+void
+irc_sasl(struct server* dest, const char *identifier, const char *subcmd, const char *data)
+{
+ putsock("%s " P10_SASL " %s %s %s %s", self->numeric, dest->numeric, identifier, subcmd, data);
+}
+