Commit Graph

119 Commits

Author SHA1 Message Date
Evgeny Sinelnikov
82b92f1270 2.0.2-alt1
- valid_ipv4addr: Allow 0 in last byte. (closes: #33795)
2017-08-23 13:28:11 +03:00
Evgeny Sinelnikov
f59a68de59 valid_ipv4addr: Allow 0 in last byte
IP 198.168.1.0 in subnet 198.168.0.0 is a valid IPv4 address.
2017-08-23 13:27:31 +03:00
Mikhail Efremov
9cbb0d50d9 2.0.1-alt1
- valid_ipv4addr: Allow 255 in 2nd and 3th bytes.
2016-06-21 19:34:13 +03:00
Mikhail Efremov
f80c1dace3 valid_ipv4addr: Allow 255 in 2nd and 3th bytes
Really 198.19.255.9 is a valid IPv4 address, for example.
2016-06-21 19:17:37 +03:00
Mikhail Efremov
d6234d2fb8 2.0.0-alt1
- Drop unneeded line.
- Add functions for read current default route and DNS settings.
- Suppress 'broken pipe' error message.
- Add list_bridge() and list_bridge_with_cache().
- Add function for host interfaces.
- list_iface(): Skip ifaces in a bonding.
- list_eth(): Don't replace interface with bridge.
- Add init_slave_eth_iface_cache().
- tests: Add more ipv*addr tests.
- Add warning for deprecated functions.
- Remove read_iface_slaves().
- Add remove_iface_with_cache().
- Add list_vlans_for_iface() and list_vlans_for_iface_with_cache().
- iface_has_host(): Suppress find's error messages.
- Add list_vlan() and list_vlan_with_cache().
- Introduce function for work with cached data.
- next_iface(): Pass ifaces directory as argument.
- list_network(): Pass ifaces directory as second argument.
- Use list_etcnet_iface_filtered() to list interfaces.
- Use list_etcnet_iface_filtered for list_ppp().
- Add functions for filtered interfaces list.
- iface_has_host: Handle VLAN interfaces too.
- Rename read_iface_slaves -> read_iface_host_var.
2016-03-23 18:23:23 +03:00
Mikhail Efremov
60030e4bfc Drop unneeded line
The double line was a mistake apparently.
2016-03-22 20:13:18 +03:00
Mikhail Efremov
2f4b81a644 Add functions for read current default route and DNS settings 2016-03-22 20:09:08 +03:00
Mikhail Efremov
b813aeeaff Suppress 'broken pipe' error message 2016-03-21 20:41:22 +03:00
Mikhail Efremov
f5fc2a74bf Add list_bridge() and list_bridge_with_cache() 2016-03-21 19:51:59 +03:00
Mikhail Efremov
aafe8a4b11 Add function for host interfaces
Moved from alterator-net-bond.
2016-03-21 19:11:21 +03:00
Mikhail Efremov
2ccff10451 list_iface(): Skip ifaces in a bonding
BTW, I doubt that this function is in use really.
Should be considered to drop it later.
2016-03-21 18:37:48 +03:00
Mikhail Efremov
f636557c22 list_eth(): Don't replace interface with bridge
That was needed for old "bridge-with-single-interface" approach
for virtual machines support.
2016-03-21 18:08:17 +03:00
Mikhail Efremov
3901468091 Add init_slave_eth_iface_cache() 2016-03-21 17:22:39 +03:00
Mikhail Efremov
0a1b5acf6a tests: Add more ipv*addr tests 2016-03-21 16:42:43 +03:00
Mikhail Efremov
63772a6ecd Add warning for deprecated functions 2016-03-18 20:44:36 +03:00
Mikhail Efremov
37ed1ab73a Remove read_iface_slaves()
Just drop it and use read_iface_host_var() instead.
2016-03-18 19:44:59 +03:00
Mikhail Efremov
28a12b321d Add remove_iface_with_cache() 2016-03-18 19:44:59 +03:00
Mikhail Efremov
0f1d58d688 Add list_vlans_for_iface() and list_vlans_for_iface_with_cache() 2016-03-18 19:44:59 +03:00
Mikhail Efremov
b2a943819d iface_has_host(): Suppress find's error messages 2016-03-18 19:44:59 +03:00
Mikhail Efremov
33a627dff7 Add list_vlan() and list_vlan_with_cache() 2016-03-18 19:44:59 +03:00
Mikhail Efremov
17a65794b0 Introduce function for work with cached data
A cache for changes used in the alterator-net-* modules often enough,
so add some common function to alterator-net-functions.
2016-03-18 19:44:58 +03:00
Mikhail Efremov
848537975d next_iface(): Pass ifaces directory as argument 2016-03-17 18:51:42 +03:00
Mikhail Efremov
98e765e2c8 list_network(): Pass ifaces directory as second argument
And use list_etcnet_iface_filtered().
2016-03-17 18:51:42 +03:00
Mikhail Efremov
28f27e4a55 Use list_etcnet_iface_filtered() to list interfaces 2016-03-17 18:51:42 +03:00
Mikhail Efremov
12565b2122 Use list_etcnet_iface_filtered for list_ppp()
And add ifaces directory as second argument to list_ppp().
2016-03-17 18:51:41 +03:00
Mikhail Efremov
88cdd0c475 Add functions for filtered interfaces list
Add list_etcnet_iface_filtered() function.
This function prints iface name if filter_func returns
TRUE. Filter function will be called with an interface directory as first
parameter and all additional parameters with which list_etcnet_iface_filtered()
was called.
2016-03-17 18:51:41 +03:00
Mikhail Efremov
b8192ace2d iface_has_host: Handle VLAN interfaces too
VLAN interface always has host. And skip HOST variable
in VLAN's configs.
2016-03-09 20:05:32 +03:00
Mikhail Efremov
75a465583f Rename read_iface_slaves -> read_iface_host_var
For bond/bridge interfaces HOST variable means "_This_ interface is
a host for interfaces in the list".
But for VLAN interfaces HOST variable has opposite meaning:
"It is a host for this interfaces".
So for VLAN interface read_iface_slaves() function will return
a _host_ interface and this behavior can be a bit confusing.

Keep read_iface_slaves() for backward compatibility.
Besides, for bond/bridge it is quite suited.
2016-03-09 19:30:44 +03:00
Mikhail Efremov
5bdb5a6dcc 1.3.4-alt1
- Fix valid_ipv4addr().
2015-01-20 21:57:47 +03:00
Mikhail Efremov
dd587ca6c3 Fix valid_ipv4addr().
Fix first byte check.
2015-01-20 21:54:59 +03:00
Mikhail Efremov
24d6e13f02 1.3.3-alt1
- Add read_iface_slaves() and iface_has_host() functions.
- Add list_bond() function.
2014-12-26 18:07:41 +03:00
Mikhail Efremov
359315fd3c Add read_iface_slaves() and iface_has_host() functions.
Moved from alterator-net-bond.
2014-12-23 21:03:28 +03:00
Mikhail Efremov
45bc5a923d Add list_bond() function. 2014-12-23 20:38:44 +03:00
Mikhail Efremov
31e0778e0a 1.3.2-alt1
- Improve is_ipv6_enabled() (thx stanv@).
2014-10-07 21:37:41 +04:00
Mikhail Efremov
535e489ef1 Improve is_ipv6_enabled() (thx stanv@).
Check if module ipv6 is loaded, but disabled by sysctl
configuration.
Also add optional argument to check ipv6 per interface.
2014-10-07 20:41:03 +04:00
Mikhail Efremov
39af5f3d6e 1.3.1-alt1
- Added is_ipv6_enabled() function.
2014-08-12 21:35:51 +04:00
Mikhail Efremov
e8adb8d564 Added is_ipv6_enabled() function.
Returns true if IPv6 is enabled.
2014-08-08 20:45:20 +04:00
Mikhail Efremov
5299864a6c 1.3.0-alt1
- refdns: Replace valid_ipv4() with valid_ipv4addr().
- Added valid_ipv4addr() function.
- Added tests for ipv6addr_is_in_subnet() function.
- Added get_ip_version() function.
- revdns: Added IPv6 support.
- Added ipv6addr_is_in_subnet() function.
- ipv6_network(): Use valid_ipv6prefix().
- Added valid_ipv6prefix() and valid_ipv4prefix() functions.
2012-12-14 17:18:08 +04:00
Mikhail Efremov
1ca2d684da refdns: Replace valid_ipv4() with valid_ipv4addr(). 2012-12-14 15:42:37 +04:00
Mikhail Efremov
f047ca55ad Added valid_ipv4addr() function.
Heavy based on valid_ipv4() from libshell.
We can't use valid_ipv4() because it
don't treat 127.* and 224.* addresses as valid addresses.
2012-12-14 15:42:32 +04:00
Mikhail Efremov
b80777918d Added tests for ipv6addr_is_in_subnet() function. 2012-12-14 15:11:05 +04:00
Mikhail Efremov
e1383945b3 Added get_ip_version() function. 2012-12-13 21:42:00 +04:00
Mikhail Efremov
4ea61002cc revdns: Added IPv6 support. 2012-12-13 19:20:14 +04:00
Mikhail Efremov
7ecdc4ced0 Added ipv6addr_is_in_subnet() function. 2012-12-13 18:17:36 +04:00
Mikhail Efremov
12a20dd894 ipv6_network(): Use valid_ipv6prefix(). 2012-12-07 17:41:57 +04:00
Mikhail Efremov
3cb17360d3 Added valid_ipv6prefix() and valid_ipv4prefix() functions. 2012-12-07 16:51:07 +04:00
Mikhail Efremov
8056ad17ad 1.2.1-alt1
- Update tests for IPv6 functions.
- ipv6addr_expand(): Expand each segment of IPv4 address.
- Improve ipv6addr_terse().
- Rename ipv6add_terse -> ipv6addr_terse.
2012-12-06 20:17:08 +04:00
Mikhail Efremov
c694ec130f Update tests for IPv6 functions. 2012-12-06 20:04:12 +04:00
Mikhail Efremov
025970d034 ipv6addr_expand(): Expand each segment of IPv4 address.
Expand each segment to four hex digits,
e.g. *:1:db8:0:* -> *:0001:0db8:0000:*.
2012-12-06 18:47:06 +04:00
Mikhail Efremov
393cdf120f Improve ipv6addr_terse().
Drop leading zeros in IPv6 address segment.
2012-12-06 18:19:22 +04:00