diff options
author | dnobori <da.git@softether.co.jp> | 2014-07-11 21:06:20 +0400 |
---|---|---|
committer | dnobori <da.git@softether.co.jp> | 2014-07-11 21:06:20 +0400 |
commit | 9f7d8578a7894233a02b427426eda7c29faae255 (patch) | |
tree | 5b6bdca3fecf77f180e93048923cda7fdad7c98a /src/Mayaqua/Pack.c | |
parent | ee8d609030c102f32cde2ba199a6a571120a4aca (diff) |
v4.10-9472-beta
Diffstat (limited to 'src/Mayaqua/Pack.c')
-rw-r--r-- | src/Mayaqua/Pack.c | 58 |
1 files changed, 54 insertions, 4 deletions
diff --git a/src/Mayaqua/Pack.c b/src/Mayaqua/Pack.c index 65a65237..4f4ac3f8 100644 --- a/src/Mayaqua/Pack.c +++ b/src/Mayaqua/Pack.c @@ -54,10 +54,25 @@ // AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
//
-// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
-// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
-// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
-// COUNTRIES MIGHT BE RESTRICTED.
+// USE ONLY IN JAPAN. DO NOT USE THIS SOFTWARE IN ANOTHER COUNTRY UNLESS
+// YOU HAVE A CONFIRMATION THAT THIS SOFTWARE DOES NOT VIOLATE ANY
+// CRIMINAL LAWS OR CIVIL RIGHTS IN THAT PARTICULAR COUNTRY. USING THIS
+// SOFTWARE IN OTHER COUNTRIES IS COMPLETELY AT YOUR OWN RISK. THE
+// SOFTETHER VPN PROJECT HAS DEVELOPED AND DISTRIBUTED THIS SOFTWARE TO
+// COMPLY ONLY WITH THE JAPANESE LAWS AND EXISTING CIVIL RIGHTS INCLUDING
+// PATENTS WHICH ARE SUBJECTS APPLY IN JAPAN. OTHER COUNTRIES' LAWS OR
+// CIVIL RIGHTS ARE NONE OF OUR CONCERNS NOR RESPONSIBILITIES. WE HAVE
+// NEVER INVESTIGATED ANY CRIMINAL REGULATIONS, CIVIL LAWS OR
+// INTELLECTUAL PROPERTY RIGHTS INCLUDING PATENTS IN ANY OF OTHER 200+
+// COUNTRIES AND TERRITORIES. BY NATURE, THERE ARE 200+ REGIONS IN THE
+// WORLD, WITH DIFFERENT LAWS. IT IS IMPOSSIBLE TO VERIFY EVERY
+// COUNTRIES' LAWS, REGULATIONS AND CIVIL RIGHTS TO MAKE THE SOFTWARE
+// COMPLY WITH ALL COUNTRIES' LAWS BY THE PROJECT. EVEN IF YOU WILL BE
+// SUED BY A PRIVATE ENTITY OR BE DAMAGED BY A PUBLIC SERVANT IN YOUR
+// COUNTRY, THE DEVELOPERS OF THIS SOFTWARE WILL NEVER BE LIABLE TO
+// RECOVER OR COMPENSATE SUCH DAMAGES, CRIMINAL OR CIVIL
+// RESPONSIBILITIES. NOTE THAT THIS LINE IS NOT LICENSE RESTRICTION BUT
+// JUST A STATEMENT FOR WARNING AND DISCLAIMER.
//
//
// SOURCE CODE CONTRIBUTION
@@ -782,6 +797,29 @@ ELEMENT *GetElement(PACK *p, char *name, UINT type) return e;
}
+// Check whether the specified element exists
+bool IsElement(PACK *p, char *name)
+{
+ ELEMENT t;
+ ELEMENT *e;
+ // Validate arguments
+ if (p == NULL || name == NULL)
+ {
+ return false;
+ }
+
+ // Search
+ StrCpy(t.name, sizeof(t.name), name);
+ e = Search(p->elements, &t);
+
+ if (e == NULL)
+ {
+ return false;
+ }
+
+ return true;
+}
+
// Remove the ELEMENT from the PACK
void DelElement(PACK *p, char *name)
{
@@ -1308,6 +1346,18 @@ bool PackGetIp(PACK *p, char *name, IP *ip) return PackGetIpEx(p, name, ip, 0);
}
+// Check whether the specified value is existing on the Pack
+bool PackIsValueExists(PACK *p, char *name)
+{
+ // Validate arguments
+ if (p == NULL || name == NULL)
+ {
+ return false;
+ }
+
+ return IsElement(p, name);
+}
+
// Get an integer from the PACK
UINT PackGetInt(PACK *p, char *name)
{
|