summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-11-02 15:46:45 +0100
committerMarcel Holtmann <marcel@holtmann.org>2010-11-02 15:46:45 +0100
commitab459eafd190cecf68153dc19635cea5513d0ede (patch)
tree18bc1ee0c44299cd5e1eacba2ba421d3ed1353d5 /tools
parent207365e76a96f9cd222fa12a4256a27b7106bd03 (diff)
downloadconnman-ab459eafd190cecf68153dc19635cea5513d0ede.tar.gz
connman-ab459eafd190cecf68153dc19635cea5513d0ede.tar.bz2
connman-ab459eafd190cecf68153dc19635cea5513d0ede.zip
Print hotspot location details
Diffstat (limited to 'tools')
-rw-r--r--tools/wispr.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/wispr.c b/tools/wispr.c
index c2f77c46..760ba771 100644
--- a/tools/wispr.c
+++ b/tools/wispr.c
@@ -101,6 +101,9 @@ struct wispr_msg {
int response_code;
char *login_url;
char *logoff_url;
+ char *access_procedure;
+ char *access_location;
+ char *location_name;
};
static inline void wispr_msg_init(struct wispr_msg *msg)
@@ -116,6 +119,15 @@ static inline void wispr_msg_init(struct wispr_msg *msg)
g_free(msg->logoff_url);
msg->logoff_url = NULL;
+
+ g_free(msg->access_procedure);
+ msg->access_procedure = NULL;
+
+ g_free(msg->access_location);
+ msg->access_location = NULL;
+
+ g_free(msg->location_name);
+ msg->location_name = NULL;
}
struct wispr_session {
@@ -200,8 +212,14 @@ static void text_handler(GMarkupParseContext *context,
switch (wispr_element_map[i].element) {
case WISPR_ELEMENT_NONE:
case WISPR_ELEMENT_ACCESS_PROCEDURE:
+ g_free(msg->access_procedure);
+ msg->access_procedure = g_strdup(text);
case WISPR_ELEMENT_ACCESS_LOCATION:
+ g_free(msg->access_location);
+ msg->access_location = g_strdup(text);
case WISPR_ELEMENT_LOCATION_NAME:
+ g_free(msg->location_name);
+ msg->location_name = g_strdup(text);
break;
case WISPR_ELEMENT_LOGIN_URL:
g_free(msg->login_url);
@@ -313,6 +331,12 @@ static gboolean wispr_result(GWebResult *result, gpointer user_data)
printf("Response code: %s (%d)\n",
response_code_to_string(wispr->msg.response_code),
wispr->msg.response_code);
+ if (wispr->msg.access_procedure != NULL)
+ printf("Access procedure: %s\n", wispr->msg.access_procedure);
+ if (wispr->msg.access_location != NULL)
+ printf("Access location: %s\n", wispr->msg.access_location);
+ if (wispr->msg.location_name != NULL)
+ printf("Location name: %s\n", wispr->msg.location_name);
if (wispr->msg.login_url != NULL)
printf("Login URL: %s\n", wispr->msg.login_url);
if (wispr->msg.logoff_url != NULL)