[3/4] sub: Remove introspection of the "channel queue"
diff mbox

Message ID 1428648956-27615-3-git-send-email-holger@freyther.de
State Accepted
Headers show

Commit Message

Holger Freyther April 10, 2015, 6:55 a.m. UTC
From: Holger Hans Peter Freyther <holger@moiji-mobile.com>

Over the next commits the queuing of commits will be
completely modified to remove the queue and move the
scheduling/limits to the outer callers.
---
 openbsc/include/openbsc/gsm_subscriber.h  |  5 --
 openbsc/src/libmsc/gsm_subscriber.c       | 45 -----------------
 openbsc/src/libmsc/vty_interface_layer3.c | 81 ++-----------------------------
 3 files changed, 4 insertions(+), 127 deletions(-)

Patch
diff mbox

diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index 290cc44..c5585ce 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -109,11 +109,6 @@  struct gsm_subscriber *subscr_active_by_tmsi(struct gsm_subscriber_group *sgrp,
 struct gsm_subscriber *subscr_active_by_imsi(struct gsm_subscriber_group *sgrp,
 					     const char *imsi);
 
-int subscr_pending_requests(struct gsm_subscriber *subscr);
-int subscr_pending_clear(struct gsm_subscriber *subscr);
-int subscr_pending_dump(struct gsm_subscriber *subscr, struct vty *vty);
-int subscr_pending_kick(struct gsm_subscriber *subscr);
-
 char *subscr_name(struct gsm_subscriber *subscr);
 
 int subscr_purge_inactive(struct gsm_subscriber_group *sgrp);
diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c
index c444fe0..9037e89 100644
--- a/openbsc/src/libmsc/gsm_subscriber.c
+++ b/openbsc/src/libmsc/gsm_subscriber.c
@@ -443,48 +443,3 @@  void subscr_expire(struct gsm_subscriber_group *sgrp)
 {
 	db_subscriber_expire(sgrp->net, subscr_expire_callback);
 }
-
-int subscr_pending_requests(struct gsm_subscriber *sub)
-{
-	struct subscr_request *req;
-	int pending = 0;
-
-	llist_for_each_entry(req, &sub->requests, entry)
-		pending += 1;
-
-	return pending;
-}
-
-int subscr_pending_clear(struct gsm_subscriber *sub)
-{
-	int deleted = 0;
-	struct subscr_request *req, *tmp;
-
-	llist_for_each_entry_safe(req, tmp, &sub->requests, entry) {
-		subscr_put(req->subscr);
-		llist_del(&req->entry);
-		talloc_free(req);
-		deleted += 1;
-	}
-
-	return deleted;
-}
-
-int subscr_pending_dump(struct gsm_subscriber *sub, struct vty *vty)
-{
-	struct subscr_request *req;
-
-	vty_out(vty, "Pending Requests for Subscriber %llu.%s", sub->id, VTY_NEWLINE);
-	llist_for_each_entry(req, &sub->requests, entry) {
-		vty_out(vty, "Channel type: %d State: %d Sub: %llu.%s",
-			req->channel_type, req->state, req->subscr->id, VTY_NEWLINE);
-	}
-
-	return 0;
-}
-
-int subscr_pending_kick(struct gsm_subscriber *sub)
-{
-	subscr_put_channel(sub);
-	return 0;
-}
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 558db5e..04e65e7 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -55,7 +55,7 @@ 
 
 extern struct gsm_network *gsmnet_from_vty(struct vty *v);
 
-static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr, int pending)
+static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr)
 {
 	int rc;
 	struct gsm_auth_info ainfo;
@@ -107,11 +107,6 @@  static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr,
 			"%a, %d %b %Y %T %z", localtime(&subscr->expire_lu));
 	expire_time[sizeof(expire_time) - 1] = '\0';
 	vty_out(vty, "    Expiration Time: %s%s", expire_time, VTY_NEWLINE);
-
-	if (pending)
-		vty_out(vty, "    Pending: %d%s",
-			subscr_pending_requests(subscr), VTY_NEWLINE);
-
 	vty_out(vty, "    Use count: %u%s", subscr->use_count, VTY_NEWLINE);
 }
 
@@ -127,7 +122,7 @@  DEFUN(show_subscr_cache,
 
 	llist_for_each_entry(subscr, &active_subscribers, entry) {
 		vty_out(vty, "  Subscriber:%s", VTY_NEWLINE);
-		subscr_dump_full_vty(vty, subscr, 0);
+		subscr_dump_full_vty(vty, subscr);
 	}
 
 	return CMD_SUCCESS;
@@ -215,7 +210,7 @@  DEFUN(show_subscr,
 		return CMD_WARNING;
 	}
 
-	subscr_dump_full_vty(vty, subscr, 1);
+	subscr_dump_full_vty(vty, subscr);
 
 	subscr_put(subscr);
 
@@ -241,7 +236,7 @@  DEFUN(subscriber_create,
 	}
 
 	/* Show info about the created subscriber. */
-	subscr_dump_full_vty(vty, subscr, 0);
+	subscr_dump_full_vty(vty, subscr);
 
 	subscr_put(subscr);
 
@@ -596,71 +591,6 @@  DEFUN(ena_subscr_extension,
 	return CMD_SUCCESS;
 }
 
-DEFUN(ena_subscr_clear,
-      ena_subscr_clear_cmd,
-      "subscriber " SUBSCR_TYPES " ID clear-requests",
-	SUBSCR_HELP "Clear the paging requests for this subscriber\n")
-{
-	int del;
-	struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-	struct gsm_subscriber *subscr =
-			get_subscr_by_argv(gsmnet, argv[0], argv[1]);
-
-	if (!subscr) {
-		vty_out(vty, "%% No subscriber found for %s %s%s",
-			argv[0], argv[1], VTY_NEWLINE);
-		return CMD_WARNING;
-	}
-
-	del = subscr_pending_clear(subscr);
-	vty_out(vty, "Cleared %d pending requests.%s", del, VTY_NEWLINE);
-	subscr_put(subscr);
-
-	return CMD_SUCCESS;
-}
-
-DEFUN(ena_subscr_pend,
-      ena_subscr_pend_cmd,
-      "subscriber " SUBSCR_TYPES " ID show-pending",
-	SUBSCR_HELP "Clear the paging requests for this subscriber\n")
-{
-	struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-	struct gsm_subscriber *subscr =
-			get_subscr_by_argv(gsmnet, argv[0], argv[1]);
-
-	if (!subscr) {
-		vty_out(vty, "%% No subscriber found for %s %s%s",
-			argv[0], argv[1], VTY_NEWLINE);
-		return CMD_WARNING;
-	}
-
-	subscr_pending_dump(subscr, vty);
-	subscr_put(subscr);
-
-	return CMD_SUCCESS;
-}
-
-DEFUN(ena_subscr_kick,
-      ena_subscr_kick_cmd,
-      "subscriber " SUBSCR_TYPES " ID kick-pending",
-	SUBSCR_HELP "Clear the paging requests for this subscriber\n")
-{
-	struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-	struct gsm_subscriber *subscr =
-			get_subscr_by_argv(gsmnet, argv[0], argv[1]);
-
-	if (!subscr) {
-		vty_out(vty, "%% No subscriber found for %s %s%s",
-			argv[0], argv[1], VTY_NEWLINE);
-		return CMD_WARNING;
-	}
-
-	subscr_pending_kick(subscr);
-	subscr_put(subscr);
-
-	return CMD_SUCCESS;
-}
-
 DEFUN(ena_subscr_handover,
       ena_subscr_handover_cmd,
       "subscriber " SUBSCR_TYPES " ID handover BTS_NR",
@@ -1139,9 +1069,6 @@  int bsc_vty_init_extra(void)
 	install_element(ENABLE_NODE, &ena_subscr_extension_cmd);
 	install_element(ENABLE_NODE, &ena_subscr_authorized_cmd);
 	install_element(ENABLE_NODE, &ena_subscr_a3a8_cmd);
-	install_element(ENABLE_NODE, &ena_subscr_clear_cmd);
-	install_element(ENABLE_NODE, &ena_subscr_pend_cmd);
-	install_element(ENABLE_NODE, &ena_subscr_kick_cmd);
 	install_element(ENABLE_NODE, &ena_subscr_handover_cmd);
 	install_element(ENABLE_NODE, &subscriber_purge_cmd);
 	install_element(ENABLE_NODE, &smsqueue_trigger_cmd);