1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2026-05-27 07:50:15 +03:00

Add server option 'JsonRpcWebApiAllowedSubnet' to restrict access to JSON-RPC API based on client IP address

This commit is contained in:
Alexey Kryuchkov
2023-06-02 00:00:30 +03:00
parent 0f689d9dfc
commit a366bdbf02
8 changed files with 48 additions and 4 deletions
+12
View File
@@ -6976,6 +6976,18 @@ void IPToStr6Inner(char *str, IP *ip)
}
}
// Format IP and subnet mask as "<ip>/<masksize>"
void IPAndMaskToStr(char *str, UINT size, IP *ip, IP *subnet)
{
int iplen;
UINT masksize;
IPToStr(str, size, ip);
iplen = StrLen(str);
masksize = SubnetMaskToInt(subnet);
Format(str + iplen, size - iplen, "/%d", masksize);
}
// Convert the string to an IP address
bool StrToIP6(IP *ip, char *str)
{
+1
View File
@@ -1270,6 +1270,7 @@ void IPToStr6(char *str, UINT size, IP *ip);
void IP6AddrToStr(char *str, UINT size, IPV6_ADDR *addr);
void IPToStr6Array(char *str, UINT size, UCHAR *bytes);
void IPToStr6Inner(char *str, IP *ip);
void IPAndMaskToStr(char *str, UINT size, IP *ip, IP *subnet);
void IntToSubnetMask6(IP *ip, UINT i);
void IPAnd6(IP *dst, IP *a, IP *b);
void GetAllRouterMulticastAddress6(IP *ip);