Commit a2d07ef9 authored by Evelyn's avatar Evelyn Committed by GitHub

Update mg_check_ip_acl.md

parent 3cf4e32d
...@@ -6,7 +6,7 @@ signature: | ...@@ -6,7 +6,7 @@ signature: |
int mg_check_ip_acl(const char *acl, uint32_t remote_ip); int mg_check_ip_acl(const char *acl, uint32_t remote_ip);
--- ---
Verify given IP address against the ACL. Verifies given IP address against the ACL.
`remote_ip` - an IPv4 address to check, in host byte order `remote_ip` - an IPv4 address to check, in host byte order
`acl` - a comma separated list of IP subnets: `x.x.x.x/x` or `x.x.x.x`. `acl` - a comma separated list of IP subnets: `x.x.x.x/x` or `x.x.x.x`.
...@@ -15,13 +15,13 @@ prepended by either a - or a + sign. A plus sign means allow, where a ...@@ -15,13 +15,13 @@ prepended by either a - or a + sign. A plus sign means allow, where a
minus sign means deny. If a subnet mask is omitted, such as `-1.2.3.4`, minus sign means deny. If a subnet mask is omitted, such as `-1.2.3.4`,
this means to deny only that single IP address. this means to deny only that single IP address.
Subnet masks may vary from 0 to 32, inclusive. The default setting Subnet masks may vary from 0 to 32, inclusive. The default setting
is to allow all accesses. On each request the full list is traversed, is to allow all access. On each request the full list is traversed,
and the last match wins. Example: and the last match wins. Example:
`-0.0.0.0/0,+192.168/16` - deny all acccesses, only allow 192.168/16 subnet `-0.0.0.0/0,+192.168/16` - deny all acccesses, only allow 192.168/16 subnet
To learn more about subnet masks, see the To learn more about subnet masks, see this
link:https://en.wikipedia.org/wiki/Subnetwork[Wikipedia page on Subnetwork] link:https://en.wikipedia.org/wiki/Subnetwork[Wikipedia page on Subnetwork].
Return -1 if ACL is malformed, 0 if address is disallowed, 1 if allowed. Returns -1 if ACL is malformed, 0 if address is disallowed, 1 if allowed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment