Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordnobori <da.git@softether.co.jp>2014-03-20 00:45:05 +0400
committerdnobori <da.git@softether.co.jp>2014-03-20 00:45:05 +0400
commitcf2a6a42bce34bd0c14223cd9e86d2395d3bd01c (patch)
tree0f1d237a4b9d7343b390398ce9eecdd54c251c1e /src/Mayaqua
parentdcd9b943817c4420bfbe4d973b358f4cc9d737c6 (diff)
v4.06-9430-beta
Diffstat (limited to 'src/Mayaqua')
-rw-r--r--src/Mayaqua/Cfg.c8
-rw-r--r--src/Mayaqua/Cfg.h8
-rw-r--r--src/Mayaqua/Encrypt.c21
-rw-r--r--src/Mayaqua/Encrypt.h8
-rw-r--r--src/Mayaqua/FileIO.c8
-rw-r--r--src/Mayaqua/FileIO.h8
-rw-r--r--src/Mayaqua/Internat.c8
-rw-r--r--src/Mayaqua/Internat.h8
-rw-r--r--src/Mayaqua/Kernel.c10
-rw-r--r--src/Mayaqua/Kernel.h8
-rw-r--r--src/Mayaqua/MayaType.h10
-rw-r--r--src/Mayaqua/Mayaqua.c8
-rw-r--r--src/Mayaqua/Mayaqua.h8
-rw-r--r--src/Mayaqua/Memory.c8
-rw-r--r--src/Mayaqua/Memory.h8
-rw-r--r--src/Mayaqua/Microsoft.c8
-rw-r--r--src/Mayaqua/Microsoft.h8
-rw-r--r--src/Mayaqua/Network.c22
-rw-r--r--src/Mayaqua/Network.h8
-rw-r--r--src/Mayaqua/OS.c8
-rw-r--r--src/Mayaqua/OS.h8
-rw-r--r--src/Mayaqua/Object.c8
-rw-r--r--src/Mayaqua/Object.h8
-rw-r--r--src/Mayaqua/Pack.c8
-rw-r--r--src/Mayaqua/Pack.h8
-rw-r--r--src/Mayaqua/Secure.c8
-rw-r--r--src/Mayaqua/Secure.h8
-rw-r--r--src/Mayaqua/Str.c8
-rw-r--r--src/Mayaqua/Str.h8
-rw-r--r--src/Mayaqua/Table.c8
-rw-r--r--src/Mayaqua/Table.h8
-rw-r--r--src/Mayaqua/TcpIp.c408
-rw-r--r--src/Mayaqua/TcpIp.h42
-rw-r--r--src/Mayaqua/Tick64.c8
-rw-r--r--src/Mayaqua/Tick64.h8
-rw-r--r--src/Mayaqua/Tracking.c8
-rw-r--r--src/Mayaqua/Tracking.h8
-rw-r--r--src/Mayaqua/TunTap.h8
-rw-r--r--src/Mayaqua/Unix.c14
-rw-r--r--src/Mayaqua/Unix.h12
-rw-r--r--src/Mayaqua/Win32.c8
-rw-r--r--src/Mayaqua/Win32.h8
42 files changed, 758 insertions, 53 deletions
diff --git a/src/Mayaqua/Cfg.c b/src/Mayaqua/Cfg.c
index 3a7766dd..f00d2b68 100644
--- a/src/Mayaqua/Cfg.c
+++ b/src/Mayaqua/Cfg.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Cfg.c
diff --git a/src/Mayaqua/Cfg.h b/src/Mayaqua/Cfg.h
index 005f2011..8bb03bd3 100644
--- a/src/Mayaqua/Cfg.h
+++ b/src/Mayaqua/Cfg.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Cfg.h
diff --git a/src/Mayaqua/Encrypt.c b/src/Mayaqua/Encrypt.c
index d2b985d8..2f1b0016 100644
--- a/src/Mayaqua/Encrypt.c
+++ b/src/Mayaqua/Encrypt.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Encrypt.c
@@ -1806,7 +1812,6 @@ X509 *NewX509(K *pub, K *priv, X *ca, NAME *name, UINT days, X_SERIAL *serial)
notBefore = SystemTime64();
notAfter = notBefore + (UINT64)days * (UINT64)3600 * (UINT64)24 * (UINT64)1000;
-
// Creating a X509
x509 = X509_new();
if (x509 == NULL)
@@ -1814,6 +1819,9 @@ X509 *NewX509(K *pub, K *priv, X *ca, NAME *name, UINT days, X_SERIAL *serial)
return NULL;
}
+ // Make it a v3 certificate
+ X509_set_version(x509, 2L);
+
// Set the Expiration
t1 = X509_get_notBefore(x509);
t2 = X509_get_notAfter(x509);
@@ -1873,7 +1881,8 @@ X509 *NewX509(K *pub, K *priv, X *ca, NAME *name, UINT days, X_SERIAL *serial)
X509_set_pubkey(x509, pub->pkey);
// Signature
- X509_sign(x509, priv->pkey, EVP_sha1());
+ // 2014.3.19 set the initial digest algorithm to SHA-256
+ X509_sign(x509, priv->pkey, EVP_sha256());
}
Unlock(openssl_lock);
@@ -1915,6 +1924,9 @@ X509 *NewRootX509(K *pub, K *priv, NAME *name, UINT days, X_SERIAL *serial)
return NULL;
}
+ // Make it a v3 certificate
+ X509_set_version(x509, 2L);
+
// Set the Expiration
t1 = X509_get_notBefore(x509);
t2 = X509_get_notAfter(x509);
@@ -1975,7 +1987,8 @@ X509 *NewRootX509(K *pub, K *priv, NAME *name, UINT days, X_SERIAL *serial)
X509_set_pubkey(x509, pub->pkey);
// Signature
- X509_sign(x509, priv->pkey, EVP_sha1());
+ // 2014.3.19 set the initial digest algorithm to SHA-256
+ X509_sign(x509, priv->pkey, EVP_sha256());
}
Unlock(openssl_lock);
diff --git a/src/Mayaqua/Encrypt.h b/src/Mayaqua/Encrypt.h
index 5a77c7db..a73c40e4 100644
--- a/src/Mayaqua/Encrypt.h
+++ b/src/Mayaqua/Encrypt.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Encrypt.h
diff --git a/src/Mayaqua/FileIO.c b/src/Mayaqua/FileIO.c
index d3609134..82b4b772 100644
--- a/src/Mayaqua/FileIO.c
+++ b/src/Mayaqua/FileIO.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// FileIO.c
diff --git a/src/Mayaqua/FileIO.h b/src/Mayaqua/FileIO.h
index 52ddf28a..71b2ff30 100644
--- a/src/Mayaqua/FileIO.h
+++ b/src/Mayaqua/FileIO.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// FileIO.h
diff --git a/src/Mayaqua/Internat.c b/src/Mayaqua/Internat.c
index c10a6a23..d3a9c60f 100644
--- a/src/Mayaqua/Internat.c
+++ b/src/Mayaqua/Internat.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Internat.c
diff --git a/src/Mayaqua/Internat.h b/src/Mayaqua/Internat.h
index 8001ab1f..00bc6cc0 100644
--- a/src/Mayaqua/Internat.h
+++ b/src/Mayaqua/Internat.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Internat.h
diff --git a/src/Mayaqua/Kernel.c b/src/Mayaqua/Kernel.c
index a058d29a..b18aa2d1 100644
--- a/src/Mayaqua/Kernel.c
+++ b/src/Mayaqua/Kernel.c
@@ -12,9 +12,10 @@
// http://www.softether.org/
//
// Author: Daiyuu Nobori
+// Contributors:
+// - nattoheaven (https://github.com/nattoheaven)
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +86,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Kernel.c
diff --git a/src/Mayaqua/Kernel.h b/src/Mayaqua/Kernel.h
index 29b9de05..cac78560 100644
--- a/src/Mayaqua/Kernel.h
+++ b/src/Mayaqua/Kernel.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
#ifndef KERNEL_H
diff --git a/src/Mayaqua/MayaType.h b/src/Mayaqua/MayaType.h
index cf2ea562..bf4af8bc 100644
--- a/src/Mayaqua/MayaType.h
+++ b/src/Mayaqua/MayaType.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// MayaType.h
@@ -548,6 +554,8 @@ typedef struct ICMPV6_HEADER_INFO ICMPV6_HEADER_INFO;
typedef struct DHCPV4_DATA DHCPV4_DATA;
typedef struct DHCP_OPTION DHCP_OPTION;
typedef struct DHCP_OPTION_LIST DHCP_OPTION_LIST;
+typedef struct DHCP_CLASSLESS_ROUTE DHCP_CLASSLESS_ROUTE;
+typedef struct DHCP_CLASSLESS_ROUTE_TABLE DHCP_CLASSLESS_ROUTE_TABLE;
typedef struct HTTPLOG HTTPLOG;
typedef struct DHCP_MODIFY_OPTION DHCP_MODIFY_OPTION;
typedef struct NBTDG_HEADER NBTDG_HEADER;
diff --git a/src/Mayaqua/Mayaqua.c b/src/Mayaqua/Mayaqua.c
index 64cb8c8f..c7d78b72 100644
--- a/src/Mayaqua/Mayaqua.c
+++ b/src/Mayaqua/Mayaqua.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Mayaqua.c
diff --git a/src/Mayaqua/Mayaqua.h b/src/Mayaqua/Mayaqua.h
index f8afede8..1965c76f 100644
--- a/src/Mayaqua/Mayaqua.h
+++ b/src/Mayaqua/Mayaqua.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Mayaqua.h
diff --git a/src/Mayaqua/Memory.c b/src/Mayaqua/Memory.c
index da2598c9..4c953d57 100644
--- a/src/Mayaqua/Memory.c
+++ b/src/Mayaqua/Memory.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Memory.c
diff --git a/src/Mayaqua/Memory.h b/src/Mayaqua/Memory.h
index 46d97700..ee0dbf59 100644
--- a/src/Mayaqua/Memory.h
+++ b/src/Mayaqua/Memory.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Memory.h
diff --git a/src/Mayaqua/Microsoft.c b/src/Mayaqua/Microsoft.c
index 7b249267..21c91a30 100644
--- a/src/Mayaqua/Microsoft.c
+++ b/src/Mayaqua/Microsoft.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Microsoft.c
diff --git a/src/Mayaqua/Microsoft.h b/src/Mayaqua/Microsoft.h
index b4798c18..774bd6dd 100644
--- a/src/Mayaqua/Microsoft.h
+++ b/src/Mayaqua/Microsoft.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Microsoft.h
diff --git a/src/Mayaqua/Network.c b/src/Mayaqua/Network.c
index 2cbb9edb..820cfb7f 100644
--- a/src/Mayaqua/Network.c
+++ b/src/Mayaqua/Network.c
@@ -12,9 +12,10 @@
// http://www.softether.org/
//
// Author: Daiyuu Nobori
+// Contributors:
+// - nattoheaven (https://github.com/nattoheaven)
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +86,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Network.c
@@ -14379,7 +14387,7 @@ void ConnectThreadForTcp(THREAD *thread, void *param)
IPToStr(hostname, sizeof(hostname), &p->Ip);
sock = ConnectEx3(hostname, p->Port, p->Timeout, p->CancelFlag, NULL, NULL, false, false, true);
- if (sock != NULL && p->Tcp_SslNoTls)
+ if (sock != NULL && p->Tcp_TryStartSsl)
{
bool ssl_ret = false;
// Attempt the SSL negotiation to take this opportunity
@@ -14756,14 +14764,14 @@ SOCK *ConnectEx3(char *hostname, UINT port, UINT timeout, bool *cancel_flag, cha
p2_spent_time = (UINT)(p2.FinishedTick - start_tick);
// Decide the grace time for results of TCP until settled.
- // The grace time is three times the duration of the R-UDP, and at least 250 milliseconds from the start,
- // and up to 1500 milliseconds after the R-UDP results settled
- p1_wait_time = p2_spent_time * 3;
- p1_wait_time = MAX(p1_wait_time, 250);
+ // The grace time is four times the duration of the R-UDP, and at least 400 milliseconds from the start,
+ // and up to 2500 milliseconds after the R-UDP results settled
+ p1_wait_time = p2_spent_time * 4;
+ p1_wait_time = MAX(p1_wait_time, 400);
//Debug("p2_spent_time = %u, p1_wait_time = %u\n", p2_spent_time, p1_wait_time);
tcp_giveup_tick = start_tick + (UINT64)p1_wait_time;
- tcp_giveup_tick = MIN(tcp_giveup_tick, (p2.FinishedTick + 1500ULL));
+ tcp_giveup_tick = MIN(tcp_giveup_tick, (p2.FinishedTick + 2500ULL));
if (now >= tcp_giveup_tick)
{
diff --git a/src/Mayaqua/Network.h b/src/Mayaqua/Network.h
index 2d4a633d..f062fb98 100644
--- a/src/Mayaqua/Network.h
+++ b/src/Mayaqua/Network.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Network.h
diff --git a/src/Mayaqua/OS.c b/src/Mayaqua/OS.c
index 17265ae4..3cbb1e08 100644
--- a/src/Mayaqua/OS.c
+++ b/src/Mayaqua/OS.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// OS.c
diff --git a/src/Mayaqua/OS.h b/src/Mayaqua/OS.h
index befd542f..13322214 100644
--- a/src/Mayaqua/OS.h
+++ b/src/Mayaqua/OS.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// OS.h
diff --git a/src/Mayaqua/Object.c b/src/Mayaqua/Object.c
index e90fecab..2fc3a34a 100644
--- a/src/Mayaqua/Object.c
+++ b/src/Mayaqua/Object.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Object.c
diff --git a/src/Mayaqua/Object.h b/src/Mayaqua/Object.h
index 6d870cd7..c5aec422 100644
--- a/src/Mayaqua/Object.h
+++ b/src/Mayaqua/Object.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Object.h
diff --git a/src/Mayaqua/Pack.c b/src/Mayaqua/Pack.c
index f5099791..65a65237 100644
--- a/src/Mayaqua/Pack.c
+++ b/src/Mayaqua/Pack.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Pack.c
diff --git a/src/Mayaqua/Pack.h b/src/Mayaqua/Pack.h
index 40ee08e0..8078eb1d 100644
--- a/src/Mayaqua/Pack.h
+++ b/src/Mayaqua/Pack.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Pack.h
diff --git a/src/Mayaqua/Secure.c b/src/Mayaqua/Secure.c
index 0dbb617e..b2507e3e 100644
--- a/src/Mayaqua/Secure.c
+++ b/src/Mayaqua/Secure.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Secure.c
diff --git a/src/Mayaqua/Secure.h b/src/Mayaqua/Secure.h
index 743c1eb1..874986d3 100644
--- a/src/Mayaqua/Secure.h
+++ b/src/Mayaqua/Secure.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Secure.h
diff --git a/src/Mayaqua/Str.c b/src/Mayaqua/Str.c
index d71b7692..9c94de6b 100644
--- a/src/Mayaqua/Str.c
+++ b/src/Mayaqua/Str.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Str.c
diff --git a/src/Mayaqua/Str.h b/src/Mayaqua/Str.h
index 6e6377d3..19df5bf7 100644
--- a/src/Mayaqua/Str.h
+++ b/src/Mayaqua/Str.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Str.h
diff --git a/src/Mayaqua/Table.c b/src/Mayaqua/Table.c
index 4952894e..0edd19f5 100644
--- a/src/Mayaqua/Table.c
+++ b/src/Mayaqua/Table.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Table.c
diff --git a/src/Mayaqua/Table.h b/src/Mayaqua/Table.h
index 2e77a0f1..11ace0f9 100644
--- a/src/Mayaqua/Table.h
+++ b/src/Mayaqua/Table.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Table.h
diff --git a/src/Mayaqua/TcpIp.c b/src/Mayaqua/TcpIp.c
index 0ec28cea..8bb6c595 100644
--- a/src/Mayaqua/TcpIp.c
+++ b/src/Mayaqua/TcpIp.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// TcpIp.c
@@ -3350,6 +3356,19 @@ LIST *BuildDhcpOption(DHCP_OPTION_LIST *opt)
FreeBuf(dns_buf);
+ if (opt->ClasslessRoute.NumExistingRoutes >= 1)
+ {
+ BUF *b = DhcpBuildClasslessRouteData(&opt->ClasslessRoute);
+
+ if (b != NULL)
+ {
+ Add(o, NewDhcpOption(DHCP_ID_CLASSLESS_ROUTE, b->Buf, b->Size));
+ Add(o, NewDhcpOption(DHCP_ID_MS_CLASSLESS_ROUTE, b->Buf, b->Size));
+
+ FreeBuf(b);
+ }
+ }
+
return o;
}
@@ -3486,6 +3505,20 @@ DHCP_OPTION_LIST *ParseDhcpOptionList(void *data, UINT size)
}
}
+ // Classless static routing table entries
+ // RFC 3442
+ a = GetDhcpOption(o, DHCP_ID_CLASSLESS_ROUTE);
+ if (a != NULL)
+ {
+ DhcpParseClasslessRouteData(&ret->ClasslessRoute, a->Data, a->Size);
+ }
+ // Microsoft Extension
+ a = GetDhcpOption(o, DHCP_ID_MS_CLASSLESS_ROUTE);
+ if (a != NULL)
+ {
+ DhcpParseClasslessRouteData(&ret->ClasslessRoute, a->Data, a->Size);
+ }
+
break;
}
@@ -3495,6 +3528,343 @@ DHCP_OPTION_LIST *ParseDhcpOptionList(void *data, UINT size)
return ret;
}
+// Normalize the classless routing table string
+bool NormalizeClasslessRouteTableStr(char *dst, UINT dst_size, char *src)
+{
+ DHCP_CLASSLESS_ROUTE_TABLE t;
+ // Validate arguments
+ if (dst == NULL || src == NULL)
+ {
+ return false;
+ }
+
+ Zero(&t, sizeof(t));
+ if (ParseClasslessRouteTableStr(&t, src))
+ {
+ BuildClasslessRouteTableStr(dst, dst_size, &t);
+
+ return true;
+ }
+
+ return false;
+}
+
+// Build the string from the classless routing table
+void BuildClasslessRouteTableStr(char *str, UINT str_size, DHCP_CLASSLESS_ROUTE_TABLE *t)
+{
+ UINT i;
+ UINT num = 0;
+ ClearStr(str, str_size);
+ // Validate arguments
+ if (str == NULL || t == NULL)
+ {
+ return;
+ }
+
+ for (i = 0;i < MAX_DHCP_CLASSLESS_ROUTE_ENTRIES;i++)
+ {
+ DHCP_CLASSLESS_ROUTE *r = &t->Entries[i];
+
+ if (r->Exists)
+ {
+ char tmp[128];
+
+ Zero(tmp, sizeof(tmp));
+ BuildClasslessRouteStr(tmp, sizeof(tmp), r);
+
+ if (IsEmptyStr(tmp) == false)
+ {
+ if (num >= 1)
+ {
+ StrCat(str, str_size, ", ");
+ }
+
+ StrCat(str, str_size, tmp);
+
+ num++;
+ }
+ }
+ }
+}
+
+// Build the string from the classless routing table entry
+void BuildClasslessRouteStr(char *str, UINT str_size, DHCP_CLASSLESS_ROUTE *r)
+{
+ ClearStr(str, str_size);
+ // Validate arguments
+ if (str == NULL || r == NULL || r->Exists == false)
+ {
+ return;
+ }
+
+ Format(str, str_size, "%r/%r/%r", &r->Network, &r->SubnetMask, &r->Gateway);
+}
+
+// Check the classless routing table string
+bool CheckClasslessRouteTableStr(char *str)
+{
+ DHCP_CLASSLESS_ROUTE_TABLE d;
+
+ // Validate arguments
+ if (str == NULL)
+ {
+ return false;
+ }
+
+ return ParseClasslessRouteTableStr(&d, str);
+}
+
+// Parse the classless routing table string
+bool ParseClasslessRouteTableStr(DHCP_CLASSLESS_ROUTE_TABLE *d, char *str)
+{
+ bool ret = true;
+ TOKEN_LIST *t;
+ // Validate arguments
+ if (d == NULL || str == NULL)
+ {
+ return false;
+ }
+
+ Zero(d, sizeof(DHCP_CLASSLESS_ROUTE_TABLE));
+
+ t = ParseTokenWithoutNullStr(str, NULL);
+
+ if (t != NULL)
+ {
+ UINT i;
+
+ for (i = 0;i < t->NumTokens;i++)
+ {
+ DHCP_CLASSLESS_ROUTE r;
+
+ Zero(&r, sizeof(r));
+ if (ParseClasslessRouteStr(&r, t->Token[i]))
+ {
+ if (d->NumExistingRoutes < MAX_DHCP_CLASSLESS_ROUTE_ENTRIES)
+ {
+ Copy(&d->Entries[d->NumExistingRoutes], &r, sizeof(DHCP_CLASSLESS_ROUTE));
+ d->NumExistingRoutes++;
+ }
+ else
+ {
+ // Overflow
+ ret = false;
+ break;
+ }
+ }
+ else
+ {
+ // Parse error
+ ret = false;
+ break;
+ }
+ }
+ }
+
+ FreeToken(t);
+
+ return ret;
+}
+
+// Parse the classless routing table entry string
+bool ParseClasslessRouteStr(DHCP_CLASSLESS_ROUTE *r, char *str)
+{
+ TOKEN_LIST *t;
+ bool ret = false;
+ char tmp[MAX_PATH];
+ // Validate arguments
+ if (r == NULL || str == NULL)
+ {
+ return false;
+ }
+
+ StrCpy(tmp, sizeof(tmp), str);
+ Trim(tmp);
+
+ t = ParseTokenWithoutNullStr(str, "/");
+ if (t == NULL)
+ {
+ return false;
+ }
+
+ if (t->NumTokens == 3)
+ {
+ char ip_and_mask[MAX_PATH];
+ char gateway[MAX_PATH];
+
+ Zero(r, sizeof(DHCP_CLASSLESS_ROUTE));
+
+ Format(ip_and_mask, sizeof(ip_and_mask), "%s/%s", t->Token[0], t->Token[1]);
+ StrCpy(gateway, sizeof(gateway), t->Token[2]);
+
+ if (ParseIpAndSubnetMask46(ip_and_mask, &r->Network, &r->SubnetMask))
+ {
+ r->SubnetMaskLen = SubnetMaskToInt4(&r->SubnetMask);
+
+ if (StrToIP(&r->Gateway, gateway))
+ {
+ if (IsIP4(&r->Gateway) && IsIP4(&r->Network) && IsIP4(&r->SubnetMask))
+ {
+ r->Exists = true;
+
+ IPAnd4(&r->Network, &r->Network, &r->SubnetMask);
+
+ ret = true;
+ }
+ }
+ }
+ }
+
+ FreeToken(t);
+
+ return ret;
+}
+
+// Build the classless static routing table data for a DHCP message
+BUF *DhcpBuildClasslessRouteData(DHCP_CLASSLESS_ROUTE_TABLE *t)
+{
+ BUF *b;
+ UINT i;
+ // Validate arguments
+ if (t == NULL || t->NumExistingRoutes == 0)
+ {
+ return NULL;
+ }
+
+ b = NewBuf();
+
+ for (i = 0;i < MAX_DHCP_CLASSLESS_ROUTE_ENTRIES;i++)
+ {
+ DHCP_CLASSLESS_ROUTE *r = &t->Entries[i];
+
+ if (r->Exists && r->SubnetMaskLen <= 32)
+ {
+ if (b->Size <= (255 - 9))
+ {
+ UCHAR c;
+ UINT data_len;
+ UINT ip32;
+ UCHAR tmp[4];
+
+ // Width of subnet mask
+ c = (UCHAR)r->SubnetMaskLen;
+ WriteBuf(b, &c, 1);
+
+ // Number of significant octets
+ data_len = (r->SubnetMaskLen + 7) / 8;
+ Zero(tmp, sizeof(tmp));
+ Copy(tmp, &r->Network, data_len);
+ WriteBuf(b, tmp, data_len);
+
+ // Gateway
+ ip32 = IPToUINT(&r->Gateway);
+ WriteBuf(b, &ip32, sizeof(UINT));
+ }
+ }
+ }
+
+ SeekBufToBegin(b);
+
+ return b;
+}
+
+// Parse a classless static routing table entries from the DHCP message
+void DhcpParseClasslessRouteData(DHCP_CLASSLESS_ROUTE_TABLE *t, void *data, UINT size)
+{
+ BUF *b;
+ // Validate arguments
+ if (t == NULL || data == NULL || size == 0)
+ {
+ return;
+ }
+
+ b = MemToBuf(data, size);
+
+ while (b->Current < b->Size)
+ {
+ UCHAR c;
+ UINT subnet_mask_len;
+ UINT data_len;
+ UCHAR tmp[4];
+ IP ip;
+ IP mask;
+ IP gateway;
+ DHCP_CLASSLESS_ROUTE r;
+ UINT ip32;
+ bool exists = false;
+ UINT i;
+
+ // Subnet mask length
+ c = ReadBufChar(b);
+ subnet_mask_len = c;
+ if (subnet_mask_len > 32)
+ {
+ // Invalid data
+ break;
+ }
+
+ data_len = (subnet_mask_len + 7) / 8;
+ if (data_len > 4)
+ {
+ // Invalid data
+ break;
+ }
+
+ Zero(tmp, sizeof(tmp));
+ if (ReadBuf(b, tmp, data_len) != data_len)
+ {
+ // Invalid data
+ break;
+ }
+
+ // IP address body
+ Zero(&ip, sizeof(IP));
+ Copy(ip.addr, tmp, data_len);
+
+ Zero(&mask, sizeof(mask));
+ IntToSubnetMask4(&mask, subnet_mask_len);
+
+ // Gateway address
+ Zero(&gateway, sizeof(gateway));
+ if (ReadBuf(b, &ip32, sizeof(UINT)) != sizeof(UINT))
+ {
+ // Invalid data
+ break;
+ }
+ UINTToIP(&gateway, ip32);
+
+ Zero(&r, sizeof(r));
+ r.Exists = true;
+ Copy(&r.Gateway, &gateway, sizeof(IP));
+ Copy(&r.Network, &ip, sizeof(IP));
+ Copy(&r.SubnetMask, &mask, sizeof(IP));
+ r.SubnetMaskLen = subnet_mask_len;
+
+ for (i = 0;i < MAX_DHCP_CLASSLESS_ROUTE_ENTRIES;i++)
+ {
+ if (Cmp(&t->Entries[i], &r, sizeof(DHCP_CLASSLESS_ROUTE)) == 0)
+ {
+ exists = true;
+ break;
+ }
+ }
+
+ if (exists == false)
+ {
+ if (t->NumExistingRoutes >= MAX_DHCP_CLASSLESS_ROUTE_ENTRIES)
+ {
+ // Overflow
+ break;
+ }
+
+ Copy(&t->Entries[t->NumExistingRoutes], &r, sizeof(DHCP_CLASSLESS_ROUTE));
+ t->NumExistingRoutes++;
+ }
+ }
+
+ FreeBuf(b);
+}
+
// Finding a DHCP option
DHCP_OPTION *GetDhcpOption(LIST *o, UINT id)
{
@@ -3518,6 +3888,42 @@ DHCP_OPTION *GetDhcpOption(LIST *o, UINT id)
return ret;
}
+// Get the best classless routing table entry from the routing table
+DHCP_CLASSLESS_ROUTE *GetBestClasslessRoute(DHCP_CLASSLESS_ROUTE_TABLE *t, IP *ip)
+{
+ DHCP_CLASSLESS_ROUTE *ret = NULL;
+ UINT i;
+ UINT max_mask = 0;
+ // Validate arguments
+ if (t == NULL || ip == NULL)
+ {
+ return NULL;
+ }
+ if (t->NumExistingRoutes == 0)
+ {
+ return NULL;
+ }
+
+ for (i = 0;i < MAX_DHCP_CLASSLESS_ROUTE_ENTRIES;i++)
+ {
+ DHCP_CLASSLESS_ROUTE *e = &t->Entries[i];
+
+ if (e->Exists)
+ {
+ if (IsInSameNetwork4(ip, &e->Network, &e->SubnetMask))
+ {
+ if (max_mask <= e->SubnetMaskLen)
+ {
+ max_mask = e->SubnetMaskLen;
+ ret = e;
+ }
+ }
+ }
+ }
+
+ return ret;
+}
+
// Release the DHCP option
void FreeDhcpOptions(LIST *o)
{
diff --git a/src/Mayaqua/TcpIp.h b/src/Mayaqua/TcpIp.h
index 7ca7ed67..eccbf883 100644
--- a/src/Mayaqua/TcpIp.h
+++ b/src/Mayaqua/TcpIp.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// TcpIp.h
@@ -602,6 +608,9 @@ struct ICMPV6_HEADER_INFO
#define DHCP_ID_CLIENT_ID 0x3d
#define DHCP_ID_VENDOR_ID 0x3c
#define DHCP_ID_REQ_PARAM_LIST 0x37
+#define DHCP_ID_CLASSLESS_ROUTE 0x79
+#define DHCP_ID_MS_CLASSLESS_ROUTE 0xF9
+
// DHCP client action
#define DHCP_DISCOVER 1
@@ -749,6 +758,26 @@ struct DHCP_OPTION
void *Data; // Data
};
+// DHCP classless static route entry
+struct DHCP_CLASSLESS_ROUTE
+{
+ bool Exists; // Existing flag
+ IP Network; // Network address
+ IP SubnetMask; // Subnet mask
+ IP Gateway; // Gateway
+ UINT SubnetMaskLen; // Subnet mask length
+};
+
+#define MAX_DHCP_CLASSLESS_ROUTE_ENTRIES 64
+#define MAX_DHCP_CLASSLESS_ROUTE_TABLE_STR_SIZE 3200
+
+// DHCP classless static route table
+struct DHCP_CLASSLESS_ROUTE_TABLE
+{
+ UINT NumExistingRoutes; // Number of existing routing table entries
+ DHCP_CLASSLESS_ROUTE Entries[MAX_DHCP_CLASSLESS_ROUTE_ENTRIES]; // Entries
+};
+
// DHCP option list
struct DHCP_OPTION_LIST
{
@@ -770,6 +799,7 @@ struct DHCP_OPTION_LIST
UINT DnsServer2; // DNS server address 2
UINT WinsServer; // WINS server address 1
UINT WinsServer2; // WINS server address 2
+ DHCP_CLASSLESS_ROUTE_TABLE ClasslessRoute; // Classless static routing table
};
// Modification option in the DHCP packet
@@ -870,6 +900,16 @@ HTTPLOG *ParseHttpAccessLog(PKT *pkt);
BUF *DhcpModify(DHCP_MODIFY_OPTION *m, void *data, UINT size);
BUF *DhcpModifyIPv4(DHCP_MODIFY_OPTION *m, void *data, UINT size);
+DHCP_CLASSLESS_ROUTE *GetBestClasslessRoute(DHCP_CLASSLESS_ROUTE_TABLE *t, IP *ip);
+void DhcpParseClasslessRouteData(DHCP_CLASSLESS_ROUTE_TABLE *t, void *data, UINT size);
+BUF *DhcpBuildClasslessRouteData(DHCP_CLASSLESS_ROUTE_TABLE *t);
+bool ParseClasslessRouteStr(DHCP_CLASSLESS_ROUTE *r, char *str);
+bool ParseClasslessRouteTableStr(DHCP_CLASSLESS_ROUTE_TABLE *d, char *str);
+bool CheckClasslessRouteTableStr(char *str);
+void BuildClasslessRouteStr(char *str, UINT str_size, DHCP_CLASSLESS_ROUTE *r);
+void BuildClasslessRouteTableStr(char *str, UINT str_size, DHCP_CLASSLESS_ROUTE_TABLE *t);
+bool NormalizeClasslessRouteTableStr(char *dst, UINT dst_size, char *src);
+
#ifdef OS_WIN32
diff --git a/src/Mayaqua/Tick64.c b/src/Mayaqua/Tick64.c
index 0654963d..a28f26ef 100644
--- a/src/Mayaqua/Tick64.c
+++ b/src/Mayaqua/Tick64.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Tick64.c
diff --git a/src/Mayaqua/Tick64.h b/src/Mayaqua/Tick64.h
index c754d684..07312c4c 100644
--- a/src/Mayaqua/Tick64.h
+++ b/src/Mayaqua/Tick64.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Tick64.h
diff --git a/src/Mayaqua/Tracking.c b/src/Mayaqua/Tracking.c
index d0ff53ae..20ba42cc 100644
--- a/src/Mayaqua/Tracking.c
+++ b/src/Mayaqua/Tracking.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Tracking.c
diff --git a/src/Mayaqua/Tracking.h b/src/Mayaqua/Tracking.h
index 498d8a1f..aa4a9557 100644
--- a/src/Mayaqua/Tracking.h
+++ b/src/Mayaqua/Tracking.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Tracking.h
diff --git a/src/Mayaqua/TunTap.h b/src/Mayaqua/TunTap.h
index 0555fcd1..b0ce4dd9 100644
--- a/src/Mayaqua/TunTap.h
+++ b/src/Mayaqua/TunTap.h
@@ -5,7 +5,6 @@
// Header file of the TUN / TAP device driver
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -76,6 +75,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
#ifndef TUNTAP_H
diff --git a/src/Mayaqua/Unix.c b/src/Mayaqua/Unix.c
index 58ceb0b9..0193a4fc 100644
--- a/src/Mayaqua/Unix.c
+++ b/src/Mayaqua/Unix.c
@@ -17,7 +17,6 @@
// - nattoheaven (https://github.com/nattoheaven)
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -88,6 +87,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Unix.c
@@ -2497,7 +2503,13 @@ void UnixStopService(char *name)
}
else
{
+ // SIGKILL
+ char tmp[256];
+
+ Format(tmp, sizeof(tmp), "killall -KILL %s", name);
+
UniPrint(_UU("UNIX_SVC_STOP_FAILED"), svc_title);
+ system(tmp);
}
}
diff --git a/src/Mayaqua/Unix.h b/src/Mayaqua/Unix.h
index 104a9f5c..272378cd 100644
--- a/src/Mayaqua/Unix.h
+++ b/src/Mayaqua/Unix.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Unix.h
@@ -105,8 +111,8 @@
#define UNIX_MAX_FD_MACOS (10000) // Maximum number of FDs (Mac OS X)
#define MAXIMUM_WAIT_OBJECTS 64 // Maximum number of select
-#define UNIX_SERVICE_STOP_TIMEOUT_1 (600 * 1000) // Timeout to stop the service
-#define UNIX_SERVICE_STOP_TIMEOUT_2 (900 * 1000) // Timeout to stop the service (parent process)
+#define UNIX_SERVICE_STOP_TIMEOUT_1 (60 * 1000) // Timeout to stop the service
+#define UNIX_SERVICE_STOP_TIMEOUT_2 (90 * 1000) // Timeout to stop the service (parent process)
// Service related
diff --git a/src/Mayaqua/Win32.c b/src/Mayaqua/Win32.c
index d1430d68..dbea236f 100644
--- a/src/Mayaqua/Win32.c
+++ b/src/Mayaqua/Win32.c
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Win32.c
diff --git a/src/Mayaqua/Win32.h b/src/Mayaqua/Win32.h
index e01915ed..bb298198 100644
--- a/src/Mayaqua/Win32.h
+++ b/src/Mayaqua/Win32.h
@@ -14,7 +14,6 @@
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
-//
// 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.
@@ -85,6 +84,13 @@
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
+//
+//
+// NO MEMORY OR RESOURCE LEAKS
+// ---------------------------
+//
+// The memory-leaks and resource-leaks verification under the stress
+// test has been passed before release this source code.
// Win32.h