summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/de/autogen/user/relay_options.txt5
-rw-r--r--doc/en/autogen/user/relay_options.txt5
-rw-r--r--doc/fr/autogen/user/relay_options.txt5
-rw-r--r--doc/it/autogen/user/relay_options.txt5
-rw-r--r--po/cs.po7
-rw-r--r--po/de.po7
-rw-r--r--po/es.po7
-rw-r--r--po/fr.po12
-rw-r--r--po/hu.po7
-rw-r--r--po/it.po7
-rw-r--r--po/pl.po7
-rw-r--r--po/ru.po7
-rw-r--r--po/weechat.pot7
-rw-r--r--src/plugins/relay/relay-config.c34
-rw-r--r--src/plugins/relay/relay-config.h1
-rw-r--r--src/plugins/relay/relay-server.c10
-rw-r--r--src/plugins/relay/relay-server.h2
17 files changed, 123 insertions, 12 deletions
diff --git a/doc/de/autogen/user/relay_options.txt b/doc/de/autogen/user/relay_options.txt
index e9066255c..c4942157a 100644
--- a/doc/de/autogen/user/relay_options.txt
+++ b/doc/de/autogen/user/relay_options.txt
@@ -48,6 +48,11 @@
** Typ: integer
** Werte: 0 .. 65535 (Standardwert: 256)
+* *relay.network.bind_address*
+** Beschreibung: address for bind (if empty, connection is possible on all interfaces, use "127.0.0.1" to allow connections from local machine only)
+** Typ: Zeichenkette
+** Werte: beliebige Zeichenkette (Standardwert: "")
+
* *relay.network.max_clients*
** Beschreibung: Maximale Anzahl an Clients die mit einem Port verbunden sein dürfen
** Typ: integer
diff --git a/doc/en/autogen/user/relay_options.txt b/doc/en/autogen/user/relay_options.txt
index c7c81225e..7ef1d8a3c 100644
--- a/doc/en/autogen/user/relay_options.txt
+++ b/doc/en/autogen/user/relay_options.txt
@@ -48,6 +48,11 @@
** type: integer
** values: 0 .. 65535 (default value: 256)
+* *relay.network.bind_address*
+** description: address for bind (if empty, connection is possible on all interfaces, use "127.0.0.1" to allow connections from local machine only)
+** type: string
+** values: any string (default value: "")
+
* *relay.network.max_clients*
** description: maximum number of clients connecting to a port
** type: integer
diff --git a/doc/fr/autogen/user/relay_options.txt b/doc/fr/autogen/user/relay_options.txt
index 38316d7fa..9f817539f 100644
--- a/doc/fr/autogen/user/relay_options.txt
+++ b/doc/fr/autogen/user/relay_options.txt
@@ -48,6 +48,11 @@
** type: entier
** valeurs: 0 .. 65535 (valeur par défaut: 256)
+* *relay.network.bind_address*
+** description: addresse pour le bind (si vide, la connexion est possible sur toutes les interfaces, utiliser "127.0.0.1" pour autoriser les connections depuis la machine locale seulement)
+** type: chaîne
+** valeurs: toute chaîne (valeur par défaut: "")
+
* *relay.network.max_clients*
** description: nombre maximum de clients qui se connectent sur un port
** type: entier
diff --git a/doc/it/autogen/user/relay_options.txt b/doc/it/autogen/user/relay_options.txt
index d6ebd45a1..99da1e8ae 100644
--- a/doc/it/autogen/user/relay_options.txt
+++ b/doc/it/autogen/user/relay_options.txt
@@ -48,6 +48,11 @@
** tipo: intero
** valori: 0 .. 65535 (valore predefinito: 256)
+* *relay.network.bind_address*
+** descrizione: address for bind (if empty, connection is possible on all interfaces, use "127.0.0.1" to allow connections from local machine only)
+** tipo: stringa
+** valori: qualsiasi stringa (valore predefinito: "")
+
* *relay.network.max_clients*
** descrizione: numero massimo di client connessi ad una porta
** tipo: intero
diff --git a/po/cs.po b/po/cs.po
index a5b548cb1..d10d17344 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-09-17 16:39+0200\n"
+"POT-Creation-Date: 2010-09-17 20:12+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6078,6 +6078,11 @@ msgstr "barva textu pro status \"autentizace selhala\""
msgid "text color for \"disconnected\" status"
msgstr "barva textu pro status \"odpojen\""
+msgid ""
+"address for bind (if empty, connection is possible on all interfaces, use "
+"\"127.0.0.1\" to allow connections from local machine only)"
+msgstr ""
+
msgid "maximum number of clients connecting to a port"
msgstr "maximální počet klientů připojených k portu"
diff --git a/po/de.po b/po/de.po
index 975eaefe5..47b4ff6c9 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.3-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-09-17 16:39+0200\n"
+"POT-Creation-Date: 2010-09-17 20:12+0200\n"
"PO-Revision-Date: 2010-09-08 22:15+0200\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6313,6 +6313,11 @@ msgstr "Textfarbe für Status: \"Authentifizierung gescheitert\""
msgid "text color for \"disconnected\" status"
msgstr "Textfarbe für Status: \"Verbindung getrennt\""
+msgid ""
+"address for bind (if empty, connection is possible on all interfaces, use "
+"\"127.0.0.1\" to allow connections from local machine only)"
+msgstr ""
+
msgid "maximum number of clients connecting to a port"
msgstr "Maximale Anzahl an Clients die mit einem Port verbunden sein dürfen"
diff --git a/po/es.po b/po/es.po
index 249cc2a59..779c0e89a 100644
--- a/po/es.po
+++ b/po/es.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-09-17 16:39+0200\n"
+"POT-Creation-Date: 2010-09-17 20:12+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6159,6 +6159,11 @@ msgstr "color para el estado \"falló la autenticación\""
msgid "text color for \"disconnected\" status"
msgstr "color para el estado \"desconectado\""
+msgid ""
+"address for bind (if empty, connection is possible on all interfaces, use "
+"\"127.0.0.1\" to allow connections from local machine only)"
+msgstr ""
+
msgid "maximum number of clients connecting to a port"
msgstr "número máximo de clientes conectados a un puerto"
diff --git a/po/fr.po b/po/fr.po
index 6600f5e11..349fafa97 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-09-17 16:39+0200\n"
-"PO-Revision-Date: 2010-09-17 16:39+0200\n"
+"POT-Creation-Date: 2010-09-17 20:12+0200\n"
+"PO-Revision-Date: 2010-09-17 20:13+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -6200,6 +6200,14 @@ msgstr "couleur du texte pour le statut \"échec auth\""
msgid "text color for \"disconnected\" status"
msgstr "couleur du texte pour le statut \"déconnecté\""
+msgid ""
+"address for bind (if empty, connection is possible on all interfaces, use "
+"\"127.0.0.1\" to allow connections from local machine only)"
+msgstr ""
+"addresse pour le bind (si vide, la connexion est possible sur toutes les "
+"interfaces, utiliser \"127.0.0.1\" pour autoriser les connections depuis la "
+"machine locale seulement)"
+
msgid "maximum number of clients connecting to a port"
msgstr "nombre maximum de clients qui se connectent sur un port"
diff --git a/po/hu.po b/po/hu.po
index a85b31357..23984242d 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-09-17 16:39+0200\n"
+"POT-Creation-Date: 2010-09-17 20:12+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5818,6 +5818,11 @@ msgstr "\"failed\" dcc státusz színe"
msgid "text color for \"disconnected\" status"
msgstr "\"connecting\" dcc státusz színe"
+msgid ""
+"address for bind (if empty, connection is possible on all interfaces, use "
+"\"127.0.0.1\" to allow connections from local machine only)"
+msgstr ""
+
msgid "maximum number of clients connecting to a port"
msgstr ""
diff --git a/po/it.po b/po/it.po
index 42f8b4590..fcfc1e16b 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-09-17 16:39+0200\n"
+"POT-Creation-Date: 2010-09-17 20:12+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6159,6 +6159,11 @@ msgstr "colore del testo per lo status \"autenticazione fallita\""
msgid "text color for \"disconnected\" status"
msgstr "colore del testo per lo status \"disconnesso\""
+msgid ""
+"address for bind (if empty, connection is possible on all interfaces, use "
+"\"127.0.0.1\" to allow connections from local machine only)"
+msgstr ""
+
msgid "maximum number of clients connecting to a port"
msgstr "numero massimo di client connessi ad una porta"
diff --git a/po/pl.po b/po/pl.po
index 7cd9e79fc..c565aa922 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-09-17 16:39+0200\n"
+"POT-Creation-Date: 2010-09-17 20:12+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6102,6 +6102,11 @@ msgstr "kolor statusu \"authentication failed\""
msgid "text color for \"disconnected\" status"
msgstr "kolor statusu \"disconnected\" "
+msgid ""
+"address for bind (if empty, connection is possible on all interfaces, use "
+"\"127.0.0.1\" to allow connections from local machine only)"
+msgstr ""
+
msgid "maximum number of clients connecting to a port"
msgstr "maksymalna ilość klientów łączących się na port"
diff --git a/po/ru.po b/po/ru.po
index 13ceb48f9..cdee49071 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-09-17 16:39+0200\n"
+"POT-Creation-Date: 2010-09-17 20:12+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5827,6 +5827,11 @@ msgstr "цвет \"неудачных\" в окне DCC"
msgid "text color for \"disconnected\" status"
msgstr "цвет \"соединения\" в окне DCC"
+msgid ""
+"address for bind (if empty, connection is possible on all interfaces, use "
+"\"127.0.0.1\" to allow connections from local machine only)"
+msgstr ""
+
msgid "maximum number of clients connecting to a port"
msgstr ""
diff --git a/po/weechat.pot b/po/weechat.pot
index c51eebb6c..37daffb48 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2010-09-17 16:39+0200\n"
+"POT-Creation-Date: 2010-09-17 20:12+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -5064,6 +5064,11 @@ msgstr ""
msgid "text color for \"disconnected\" status"
msgstr ""
+msgid ""
+"address for bind (if empty, connection is possible on all interfaces, use "
+"\"127.0.0.1\" to allow connections from local machine only)"
+msgstr ""
+
msgid "maximum number of clients connecting to a port"
msgstr ""
diff --git a/src/plugins/relay/relay-config.c b/src/plugins/relay/relay-config.c
index 1248a9391..3dce1bae5 100644
--- a/src/plugins/relay/relay-config.c
+++ b/src/plugins/relay/relay-config.c
@@ -49,6 +49,7 @@ struct t_config_option *relay_config_color_status[RELAY_NUM_STATUS];
/* relay config, network section */
+struct t_config_option *relay_config_network_bind_address;
struct t_config_option *relay_config_network_max_clients;
struct t_config_option *relay_config_network_password;
@@ -70,6 +71,29 @@ relay_config_refresh_cb (void *data, struct t_config_option *option)
}
/*
+ * relay_config_change_network_bind_address_cb: callback called when user changes
+ * network bind address option
+ */
+
+void
+relay_config_change_network_bind_address_cb (void *data,
+ struct t_config_option *option)
+{
+ struct t_relay_server *ptr_server;
+
+ /* make C compiler happy */
+ (void) data;
+ (void) option;
+
+ for (ptr_server = relay_servers; ptr_server;
+ ptr_server = ptr_server->next_server)
+ {
+ relay_server_close_socket (ptr_server);
+ relay_server_create_socket (ptr_server);
+ }
+}
+
+/*
* relay_config_change_port_cb: callback called when relay port option is
* modified
*/
@@ -336,7 +360,15 @@ relay_config_init ()
weechat_config_free (relay_config_file);
return 0;
}
-
+
+ relay_config_network_bind_address = weechat_config_new_option (
+ relay_config_file, ptr_section,
+ "bind_address", "string",
+ N_("address for bind (if empty, connection is possible on all "
+ "interfaces, use \"127.0.0.1\" to allow connections from "
+ "local machine only)"),
+ NULL, 0, 0, "", NULL, 0, NULL, NULL,
+ &relay_config_change_network_bind_address_cb, NULL, NULL, NULL);
relay_config_network_max_clients = weechat_config_new_option (
relay_config_file, ptr_section,
"max_clients", "integer",
diff --git a/src/plugins/relay/relay-config.h b/src/plugins/relay/relay-config.h
index 781ffb881..247d1598d 100644
--- a/src/plugins/relay/relay-config.h
+++ b/src/plugins/relay/relay-config.h
@@ -33,6 +33,7 @@ extern struct t_config_option *relay_config_color_text_bg;
extern struct t_config_option *relay_config_color_text_selected;
extern struct t_config_option *relay_config_color_status[];
+extern struct t_config_option *relay_config_network_bind_address;
extern struct t_config_option *relay_config_network_max_clients;
extern struct t_config_option *relay_config_network_password;
diff --git a/src/plugins/relay/relay-server.c b/src/plugins/relay/relay-server.c
index b8cff7dc7..a02ef474d 100644
--- a/src/plugins/relay/relay-server.c
+++ b/src/plugins/relay/relay-server.c
@@ -248,7 +248,15 @@ relay_server_create_socket (struct t_relay_server *server)
memset(&server_addr, 0, sizeof(struct sockaddr_in));
server_addr.sin_family = AF_INET;
- server_addr.sin_addr.s_addr = INADDR_ANY;
+ if (weechat_config_string (relay_config_network_bind_address)
+ && weechat_config_string (relay_config_network_bind_address)[0])
+ {
+ server_addr.sin_addr.s_addr = inet_addr (weechat_config_string (relay_config_network_bind_address));
+ }
+ else
+ {
+ server_addr.sin_addr.s_addr = INADDR_ANY;
+ }
server_addr.sin_port = htons (server->port);
if (bind (server->sock, (struct sockaddr *) &server_addr,
diff --git a/src/plugins/relay/relay-server.h b/src/plugins/relay/relay-server.h
index bb57a2e5f..a35f1ccf2 100644
--- a/src/plugins/relay/relay-server.h
+++ b/src/plugins/relay/relay-server.h
@@ -41,6 +41,8 @@ extern void relay_server_get_protocol_string (const char *protocol_and_string,
char **protocol_string);
extern struct t_relay_server *relay_server_search (const char *protocol_and_string);
extern struct t_relay_server *relay_server_search_port (int port);
+extern void relay_server_close_socket (struct t_relay_server *server);
+extern int relay_server_create_socket (struct t_relay_server *server);
extern struct t_relay_server *relay_server_new (enum t_relay_protocol protocol,
const char *protocol_string,
int port);