diff options
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r-- | src/mm-modem-helpers.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 4c93045b..e595c45b 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -22,6 +22,7 @@ #include <string.h> #include <ctype.h> #include <stdlib.h> +#include <arpa/inet.h> #include <ModemManager.h> #include <libmm-common.h> @@ -135,6 +136,17 @@ mm_create_device_identifier (guint vid, /*****************************************************************************/ +guint +mm_netmask_to_cidr (const gchar *netmask) +{ + guint32 num = 0; + + inet_pton (AF_INET, netmask, &num); + return mm_count_bits_set (num); +} + +/*****************************************************************************/ + /* +CREG: <stat> (GSM 07.07 CREG=1 unsolicited) */ #define CREG1 "\\+(CREG|CGREG):\\s*0*([0-9])" |