client-common.c revision 9439bed2f07d6475febd8a247cd2f0990fb32a13
a8c5a86d183db25a57bf193c06b41e092ec2e151Timo Sirainen/* Copyright (C) 2002-2005 Timo Sirainen */
fa2a11210f20fb8998ed656f75e163191c8047e6Timo Sirainenstatic const struct var_expand_table *
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen static struct var_expand_table static_tab[] = {
c3a636e4c9ae776e0eed06b6d7ad1ccfb6003afdTimo Sirainen tab[1].value = t_strcut(client->virtual_user, '@');
c3a636e4c9ae776e0eed06b6d7ad1ccfb6003afdTimo Sirainen tab[2].value = strchr(client->virtual_user, '@');
13b063ba3ea51256fd97d7fa883f14cb08842b0dTimo Sirainen tab[5].value = net_ip2addr(&client->local_ip);
13b063ba3ea51256fd97d7fa883f14cb08842b0dTimo Sirainen tab[8].value = client->auth_mech_name == NULL ? NULL :
13b063ba3ea51256fd97d7fa883f14cb08842b0dTimo Sirainen str_sanitize(client->auth_mech_name, MAX_MECH_NAME);
13b063ba3ea51256fd97d7fa883f14cb08842b0dTimo Sirainen tab[9].value = client->tls ? "TLS" : client->secured ? "SSL" : NULL;
5d03d9f439e41c90215a3c938ffebe4c2a8ae257Timo Sirainenstatic int have_key(const struct var_expand_table *table, const char *str)
1388b590dbd85245b591346f860bc1319953318aTimo Sirainen unsigned int i;
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainenvoid client_syslog(struct client *client, const char *msg)
49fd8c950e3da2ed32506e617a4b1480a07f874fTimo Sirainen static struct var_expand_table static_tab[3] = {
1388b590dbd85245b591346f860bc1319953318aTimo Sirainen const struct var_expand_table *var_expand_table;
b9b841558c5f91db7f5fc71c0ac62aad1bbf6418Timo Sirainen const char *p, *const *e;
1388b590dbd85245b591346f860bc1319953318aTimo Sirainen var_expand_table = get_var_expand_table(client);
e438c85a6b0f77889e25913bbbba808d6078282dStephan Bosch for (e = log_format_elements; *e != NULL; e++) {
5a9912dcadfd467c5ea54bdc3331eef359f0b1c5Timo Sirainen for (p = *e; *p != '\0'; p++) {