From 6d185bdaa19f698270a0df4b0a0c05618864b955 Mon Sep 17 00:00:00 2001 From: Helen Campbell Date: Tue, 16 Aug 2016 11:55:05 +0100 Subject: Deprecation of ip functions --- types/compat/ip_address.pp | 1 + types/compat/ipv4.pp | 2 ++ types/compat/ipv6.pp | 1 + 3 files changed, 4 insertions(+) create mode 100644 types/compat/ip_address.pp create mode 100644 types/compat/ipv4.pp create mode 100644 types/compat/ipv6.pp (limited to 'types') diff --git a/types/compat/ip_address.pp b/types/compat/ip_address.pp new file mode 100644 index 0000000..bf4c4b4 --- /dev/null +++ b/types/compat/ip_address.pp @@ -0,0 +1 @@ +type Stdlib::Compat::Ip_address = Variant[Stdlib::Compat::Ipv4, Stdlib::Compat::Ipv6] diff --git a/types/compat/ipv4.pp b/types/compat/ipv4.pp new file mode 100644 index 0000000..1d72ebd --- /dev/null +++ b/types/compat/ipv4.pp @@ -0,0 +1,2 @@ +# Emulate the validate_ipv4_address and is_ipv4_address functions +type Stdlib::Compat::Ipv4 = Pattern[/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/] diff --git a/types/compat/ipv6.pp b/types/compat/ipv6.pp new file mode 100644 index 0000000..18b148d --- /dev/null +++ b/types/compat/ipv6.pp @@ -0,0 +1 @@ +type Stdlib::Compat::Ipv6 = Pattern[/^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|((?:[\da-f]{1,4}:){6})(\d+)\.(\d+)\.(\d+)\.(\d+))$/] -- cgit v1.2.3