1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
/*
* Copyright (c) 2010-2016 Balabit
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* As an additional exemption you are allowed to compile & link against the
* OpenSSL libraries as published by the OpenSSL project. See the file
* COPYING for details.
*
*/
#include "afmongodb-legacy-grammar.h"
#include "afmongodb-legacy-private.h"
gboolean
afmongodb_dd_validate_socket_combination(LogDriver *d)
{
MongoDBDestDriver *self = (MongoDBDestDriver *)d;
if ((self->port != 0 || self->port != MONGO_CONN_LOCAL) && self->address != NULL)
return FALSE;
if (self->servers)
return FALSE;
return TRUE;
}
gboolean
afmongodb_dd_validate_network_combination(LogDriver *d)
{
MongoDBDestDriver *self = (MongoDBDestDriver *)d;
if (self->port == MONGO_CONN_LOCAL && self->address != NULL)
return FALSE;
return TRUE;
}
void
afmongodb_dd_set_user(LogDriver *d, const gchar *user)
{
MongoDBDestDriver *self = (MongoDBDestDriver *)d;
msg_warning_once("WARNING: Using username() option is deprecated in mongodb driver,"
" please use uri() instead");
g_free(self->user);
self->user = g_strdup(user);
self->is_legacy = TRUE;
}
void
afmongodb_dd_set_password(LogDriver *d, const gchar *password)
{
MongoDBDestDriver *self = (MongoDBDestDriver *)d;
msg_warning_once("WARNING: Using password() option is deprecated in mongodb driver,"
" please use uri() instead");
g_free(self->password);
self->password = g_strdup(password);
self->is_legacy = TRUE;
}
void
afmongodb_dd_set_host(LogDriver *d, const gchar *host)
{
MongoDBDestDriver *self = (MongoDBDestDriver *)d;
msg_warning_once(
"WARNING: Using host() option is deprecated in mongodb driver, please use uri() instead");
g_free(self->address);
self->address = g_strdup(host);
self->is_legacy = TRUE;
}
void
afmongodb_dd_set_port(LogDriver *d, gint port)
{
MongoDBDestDriver *self = (MongoDBDestDriver *)d;
msg_warning_once(
"WARNING: Using port() option is deprecated in mongodb driver, please use uri() instead");
self->port = port;
self->is_legacy = TRUE;
}
void
afmongodb_dd_set_servers(LogDriver *d, GList *servers)
{
MongoDBDestDriver *self = (MongoDBDestDriver *)d;
msg_warning_once(
"WARNING: Using servers() option is deprecated in mongodb driver, please use uri() instead");
string_list_free(self->servers);
self->servers = servers;
self->is_legacy = TRUE;
}
void
afmongodb_dd_set_path(LogDriver *d, const gchar *path)
{
MongoDBDestDriver *self = (MongoDBDestDriver *)d;
msg_warning_once(
"WARNING: Using path() option is deprecated in mongodb driver, please use uri() instead");
g_free(self->address);
self->address = g_strdup(path);
self->port = MONGO_CONN_LOCAL;
self->is_legacy = TRUE;
}
void
afmongodb_dd_set_database(LogDriver *d, const gchar *database)
{
MongoDBDestDriver *self = (MongoDBDestDriver *)d;
msg_warning_once("WARNING: Using database() option is deprecated in mongodb driver,"
" please use uri() instead");
g_free(self->db);
self->db = g_strdup(database);
self->is_legacy = TRUE;
}
void
afmongodb_dd_set_safe_mode(LogDriver *d, gboolean state)
{
MongoDBDestDriver *self = (MongoDBDestDriver *)d;
msg_warning_once("WARNING: Using safe_mode() option is deprecated in mongodb driver,"
" please use uri() instead");
self->safe_mode = state;
self->is_legacy = TRUE;
}
|