utils: more flexible reading of /proc/sys/net

- changes nm_utils_get_proc_sys_net_value() to allow all values, not just 0,1
- adds nm_utils_get_proc_sys_net_value_with_bounds() for limiting valid values
This commit is contained in:
Jiří Klimeš
2011-07-12 09:08:04 +02:00
parent 23b73b1354
commit 785b6fb807
4 changed files with 43 additions and 13 deletions

View File

@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2004 - 2010 Red Hat, Inc.
* Copyright (C) 2004 - 2011 Red Hat, Inc.
* Copyright (C) 2005 - 2008 Novell, Inc.
*/
@@ -83,7 +83,13 @@ gboolean nm_utils_do_sysctl (const char *path, const char *value);
gboolean nm_utils_get_proc_sys_net_value (const char *path,
const char *iface,
guint32 *out_value);
gint32 *out_value);
gboolean nm_utils_get_proc_sys_net_value_with_bounds (const char *path,
const char *iface,
gint32 *out_value,
gint32 valid_min,
gint32 valid_max);
void nm_utils_complete_generic (NMConnection *connection,
const char *ctype,