mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
/SET dcc_own_ip for specifying own IP to use in DCC requests
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1512 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
62dc0e36eb
commit
da9d55f403
@ -152,8 +152,15 @@ DCC_REC *dcc_find_request(int type, const char *nick, const char *arg)
|
||||
|
||||
void dcc_ip2str(IPADDR *ip, char *host)
|
||||
{
|
||||
IPADDR temp_ip;
|
||||
unsigned long addr;
|
||||
|
||||
if (*settings_get_str("dcc_own_ip") != '\0') {
|
||||
/* overridden IP address */
|
||||
net_host2ip(settings_get_str("dcc_own_ip"), &temp_ip);
|
||||
ip = &temp_ip;
|
||||
}
|
||||
|
||||
if (IPADDR_IS_V6(ip)) {
|
||||
/* IPv6 */
|
||||
net_ip2host(ip, host);
|
||||
@ -420,6 +427,7 @@ void irc_dcc_init(void)
|
||||
|
||||
settings_add_int("dcc", "dcc_port", 0);
|
||||
settings_add_int("dcc", "dcc_timeout", 300);
|
||||
settings_add_str("dcc", "dcc_own_ip", "");
|
||||
|
||||
signal_add("server connected", (SIGNAL_FUNC) sig_server_connected);
|
||||
signal_add("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
|
||||
|
@ -43,7 +43,8 @@ DCC_REC *dcc_find_request_latest(int type);
|
||||
DCC_REC *dcc_find_request(int type, const char *nick, const char *arg);
|
||||
|
||||
/* IP <-> string for DCC CTCP messages.
|
||||
`str' must be at least MAX_IP_LEN bytes */
|
||||
`str' must be at least MAX_IP_LEN bytes.
|
||||
If /SET dcc_own_ip is set, dcc_ip2str() always returns it. */
|
||||
void dcc_ip2str(IPADDR *ip, char *str);
|
||||
void dcc_str2ip(const char *str, IPADDR *ip);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user