diff options
| author | Daniil Baturin <daniil@baturin.org> | 2013-06-02 05:53:13 -0700 |
|---|---|---|
| committer | Daniil Baturin <daniil@baturin.org> | 2013-06-02 05:53:13 -0700 |
| commit | 83cf00e0117c4b41001a56f93cf4beae720cc6a0 (patch) | |
| tree | f9be4ab75a0a7df11f1a35103987a83f218bb13a /src/ipaddrcheck_functions.h | |
| parent | a64770739a28b05f6c5a033a3f2085959662b447 (diff) | |
| download | ipaddrcheck-83cf00e0117c4b41001a56f93cf4beae720cc6a0.tar.gz ipaddrcheck-83cf00e0117c4b41001a56f93cf4beae720cc6a0.zip | |
Add interface address validation support.
Fix IPv4 CIDR regex to support one-digit mask properly.
Diffstat (limited to 'src/ipaddrcheck_functions.h')
| -rw-r--r-- | src/ipaddrcheck_functions.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ipaddrcheck_functions.h b/src/ipaddrcheck_functions.h index 34bb18e..67cc410 100644 --- a/src/ipaddrcheck_functions.h +++ b/src/ipaddrcheck_functions.h @@ -37,11 +37,17 @@ #define IPV4_MULTICAST "224.0.0.0/4" #define IPV4_LOOPBACK "127.0.0.0/8" #define IPV4_LINKLOCAL "169.254.0.0/16" +#define IPV4_UNSPECIFIED "0.0.0.0/0" +#define IPV4_THIS "0.0.0.0/8" #define IPV4_RFC1918_A "10.0.0.0/8" #define IPV4_RFC1918_B "172.16.0.0/12" #define IPV4_RFC1918_C "192.168.0.0/16" #define IPV6_MULTICAST "ff00::/8" #define IPV6_LINKLOCAL "fe80::/64" +#define IPV6_LOOPBACK "::1/128" + +#define NO_LOOPBACK 0 +#define LOOPBACK_ALLOWED 1 int is_ipv4_cidr(char* address_str); int is_ipv4_single(char* address_str); @@ -63,3 +69,4 @@ int is_ipv6_host(CIDR *address); int is_ipv6_net(CIDR *address); int is_ipv6_multicast(CIDR *address); int is_ipv6_link_local(CIDR *address); +int is_valid_intf_address(CIDR *address, char* address_str, int allow_loopback); |
