All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
To: ofono@ofono.org
Subject: [PATCHv8 6/6] tools: lookup-apn update
Date: Fri, 30 Sep 2011 16:31:14 +0300	[thread overview]
Message-ID: <1317389474-16566-7-git-send-email-oleg.zhurakivskyy@intel.com> (raw)
In-Reply-To: <1317389474-16566-1-git-send-email-oleg.zhurakivskyy@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]

---
 tools/lookup-apn.c |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/tools/lookup-apn.c b/tools/lookup-apn.c
index 2969baf..c4cb928 100644
--- a/tools/lookup-apn.c
+++ b/tools/lookup-apn.c
@@ -24,12 +24,7 @@
 #endif
 
 #include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
 #include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
 
 #include <glib.h>
 
@@ -39,31 +34,38 @@
 
 #include "plugins/mbpi.h"
 
-static void lookup_apn(const char *match_mcc, const char *match_mnc)
+static void lookup_apn(const char *mcc, const char *mnc)
 {
 	GSList *l;
 	GSList *apns;
 	GError *error = NULL;
 
-	printf("Searching for info for network: %s%s\n", match_mcc, match_mnc);
+	printf("Searching for info for network: %s%s\n", mcc, mnc);
 
-	apns = mbpi_lookup(match_mcc, match_mnc, TRUE, &error);
+	apns = mbpi_lookup(mcc, mnc, FALSE, &error);
 
 	if (apns == NULL) {
-		g_print("Lookup failed: %s\n", error->message);
+		if (error != NULL) {
+			g_printerr("Lookup failed: %s\n", error->message);
+			g_error_free(error);
+		}
+
 		return;
 	}
 
+	printf("Found %d APs\n", g_slist_length(apns));
+
 	for (l = apns; l; l = l->next) {
-		struct ofono_gprs_provision_data *apn = l->data;
+		struct ofono_gprs_provision_data *ap = l->data;
 
 		printf("\n");
-		printf("Name: %s\n", apn->name);
-		printf("APN: %s\n", apn->apn);
-		printf("Username: %s\n", apn->username);
-		printf("Password: %s\n", apn->password);
+		printf("Name: '%s'\n", ap->name);
+		printf("APN: '%s'\n", ap->apn);
+		printf("Type: %s\n", mbpi_ap_type(ap->type));
+		printf("Username: '%s'\n", ap->username);
+		printf("Password: '%s'\n", ap->password);
 
-		mbpi_provision_data_free(apn);
+		mbpi_ap_free(ap);
 	}
 
 	g_slist_free(apns);
-- 
1.7.4.1


      parent reply	other threads:[~2011-09-30 13:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30 13:31 [PATCHv8 0/6] Provisioning plugin Oleg Zhurakivskyy
2011-09-30 13:31 ` [PATCHv8 1/6] plugins: Provisioning plugin autoconf support Oleg Zhurakivskyy
2011-09-30 13:31 ` [PATCHv8 2/6] plugins: Provisioning plugin makefile changes Oleg Zhurakivskyy
2011-09-30 13:31 ` [PATCHv8 3/6] plugins: mobile-broadband-provider-info parser changes Oleg Zhurakivskyy
2011-09-30 14:57   ` Denis Kenzior
2011-10-04  9:33     ` Oleg Zhurakivskyy
2011-09-30 13:31 ` [PATCHv8 4/6] " Oleg Zhurakivskyy
2011-09-30 15:20   ` Denis Kenzior
2011-10-04  9:33     ` Oleg Zhurakivskyy
2011-10-04 14:05       ` Denis Kenzior
2011-10-05  8:07         ` Oleg Zhurakivskyy
2011-09-30 13:31 ` [PATCHv8 5/6] plugins: Add provisioning plugin Oleg Zhurakivskyy
2011-09-30 13:31 ` Oleg Zhurakivskyy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317389474-16566-7-git-send-email-oleg.zhurakivskyy@intel.com \
    --to=oleg.zhurakivskyy@intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.