static void userhost_formatter(struct Client* cptr, struct Client *sptr, struct MsgBuf* mb) { assert(IsUser(cptr)); msgq_append(0, mb, "%s%s=%c%s@%s", cli_name(cptr), HasPriv(cptr, PRIV_DISPLAY) ? "*" : "", cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username, (sptr == cptr) ? get_realhost(cptr) : get_virtualhost(cptr)); }
static void userhost_formatter(struct Client* cptr, struct Client *sptr, struct MsgBuf* mb) { assert(IsUser(cptr)); msgq_append(0, mb, "%s%s=%c%s@%s", cli_name(cptr), SeeOper(sptr,cptr) ? "*" : "", cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username, /* Do not *EVER* change this to give opers the real host. * Too many scripts rely on this data and can inadvertently * publish the user's real host, thus breaking the security * of +x. If an oper wants the real host, he should go to * /whois to get it. */ !IsAnOper(sptr) ? cli_user(cptr)->host : cli_user(cptr)->realhost); }
static void userip_formatter(struct Client* cptr, struct Client *sptr, struct MsgBuf* mb) { assert(IsUser(cptr)); msgq_append(0, mb, "%s%s=%c%s@%s", cli_name(cptr), SeeOper(sptr,cptr) ? "*" : "", cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username, /* Do not *EVER* change this to give opers the real IP. * Too many scripts rely on this data and can inadvertently * publish the user's real IP, thus breaking the security * of +x. If an oper wants the real IP, he should go to * /whois to get it. */ HasHiddenHost(cptr) && (sptr != cptr) ? feature_str(FEAT_HIDDEN_IP) : ircd_ntoa(&cli_ip(cptr))); }
static _VCOS_INLINE void vcos_msg_send_helper(VCOS_MSGQUEUE_T *src, VCOS_MSGQUEUE_T *dest, uint32_t code, VCOS_MSG_T *msg) { vcos_assert(msg); vcos_assert(dest); msg->code = code; msg->dst = dest; msg->src = src; msg->next = NULL; msg->src_thread = vcos_thread_current(); msgq_append(dest, msg); vcos_semaphore_post(&dest->sem); }
/** Report privileges of \a client to \a to. * @param[in] to Client requesting privilege list. * @param[in] client Client whos privileges should be listed. * @return Zero. */ int client_report_privs(struct Client *to, struct Client *client) { struct MsgBuf *mb; int found1 = 0; int i; mb = msgq_make(to, rpl_str(RPL_PRIVS), cli_name(&me), cli_name(to), cli_name(client)); for (i = 0; privtab[i].name; i++) if (HasPriv(client, privtab[i].priv)) msgq_append(0, mb, "%s%s", found1++ ? " " : "", privtab[i].name); send_buffer(to, mb, 0); /* send response */ msgq_clean(mb); return 0; }