Change in osmo-ggsn[master]: pdp: Drop unused code for haship

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Fri May 31 15:03:32 UTC 2019


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/14294


Change subject: pdp: Drop unused code for haship
......................................................................

pdp: Drop unused code for haship

Nowadays we have one tun device per APN, so we don't need this hash
table because we use the ippool of the APN to find the related PDP ctx
pointer.

Change-Id: Ife3f222daa87f0630ff34ffc3e63f4dad2ad914b
---
M gtp/pdp.c
M gtp/pdp.h
2 files changed, 0 insertions(+), 78 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/94/14294/1

diff --git a/gtp/pdp.c b/gtp/pdp.c
index 92fe5ec..a5146e9 100644
--- a/gtp/pdp.c
+++ b/gtp/pdp.c
@@ -38,7 +38,6 @@
 
 static struct pdp_t pdpa[PDP_MAX];	/* PDP storage */
 static struct pdp_t *hashtid[PDP_MAX];	/* Hash table for IMSI + NSAPI */
-/* struct pdp_t* haship[PDP_MAX];  Hash table for IP and network interface */
 
 /* ***********************************************************
  * Functions related to PDP storage
@@ -291,77 +290,7 @@
 			  ((uint64_t) nsapi << 60));
 }
 
-/*
-int pdp_iphash(void* ipif, struct ul66_t *eua) {
-  /#printf("IPhash %ld\n", lookup(eua->v, eua->l, ipif) % PDP_MAX);#/
-  return (lookup(eua->v, eua->l, ipif) % PDP_MAX);
-}
 
-int pdp_ipset(struct pdp_t *pdp, void* ipif, struct ul66_t *eua) {
-  int hash;
-  struct pdp_t *pdp2;
-  struct pdp_t *pdp_prev = NULL;
-
-  if (PDP_DEBUG) printf("Begin pdp_ipset %d %d %2x%2x%2x%2x\n",
-			(unsigned) ipif, eua->l,
-			eua->v[2], eua->v[3],
-			eua->v[4], eua->v[5]);
-
-  pdp->ipnext = NULL;
-  pdp->ipif = ipif;
-  pdp->eua.l = eua->l;
-  memcpy(pdp->eua.v, eua->v, eua->l);
-
-  hash = pdp_iphash(pdp->ipif, &pdp->eua);
-
-  for (pdp2 = haship[hash]; pdp2; pdp2 = pdp2->ipnext)
-    pdp_prev = pdp2;
-  if (!pdp_prev)
-    haship[hash] = pdp;
-  else
-    pdp_prev->ipnext = pdp;
-  if (PDP_DEBUG) printf("End pdp_ipset\n");
-  return 0;
-}
-
-int pdp_ipdel(struct pdp_t *pdp) {
-  int hash = pdp_iphash(pdp->ipif, &pdp->eua);
-  struct pdp_t *pdp2;
-  struct pdp_t *pdp_prev = NULL;
-  if (PDP_DEBUG) printf("Begin pdp_ipdel\n");
-  for (pdp2 = haship[hash]; pdp2; pdp2 = pdp2->ipnext) {
-    if (pdp2 == pdp) {
-      if (!pdp_prev)
-	haship[hash] = pdp2->ipnext;
-      else
-	pdp_prev->ipnext = pdp2->ipnext;
-      if (PDP_DEBUG) printf("End pdp_ipdel: PDP found\n");
-      return 0;
-    }
-    pdp_prev = pdp2;
-  }
-  if (PDP_DEBUG) printf("End pdp_ipdel: PDP not found\n");
-  return EOF; /# End of linked list and not found #/
-}
-
-int pdp_ipget(struct pdp_t **pdp, void* ipif, struct ul66_t *eua) {
-  int hash = pdp_iphash(ipif, eua);
-  struct pdp_t *pdp2;
-  /#printf("Begin pdp_ipget %d %d %2x%2x%2x%2x\n", (unsigned)ipif, eua->l,
-    eua->v[2],eua->v[3],eua->v[4],eua->v[5]);#/
-  for (pdp2 = haship[hash]; pdp2; pdp2 = pdp2->ipnext) {
-    if ((pdp2->ipif == ipif) && (pdp2->eua.l == eua->l) &&
-	(memcmp(&pdp2->eua.v, &eua->v, eua->l) == 0)) {
-      *pdp = pdp2;
-      /#printf("End pdp_ipget. Found\n");#/
-      return 0;
-    }
-  }
-  if (PDP_DEBUG) printf("End pdp_ipget Notfound %d %d %2x%2x%2x%2x\n",
-	 (unsigned)ipif, eua->l, eua->v[2],eua->v[3],eua->v[4],eua->v[5]);
-  return EOF; /# End of linked list and not found #/
-}
-*/
 /* Various conversion functions */
 
 uint64_t pdp_gettid(uint64_t imsi, uint8_t nsapi)
diff --git a/gtp/pdp.h b/gtp/pdp.h
index e48f1a1..a287113 100644
--- a/gtp/pdp.h
+++ b/gtp/pdp.h
@@ -262,13 +262,6 @@
 
 unsigned int pdp_count_secondary(struct pdp_t *pdp);
 
-/*
-int pdp_iphash(void* ipif, struct ul66_t *eua);
-int pdp_ipset(struct pdp_t *pdp, void* ipif, struct ul66_t *eua);
-int pdp_ipdel(struct pdp_t *pdp);
-int pdp_ipget(struct pdp_t **pdp, void* ipif, struct ul66_t *eua);
-*/
-
 uint64_t pdp_gettid(uint64_t imsi, uint8_t nsapi);
 
 #endif /* !_PDP_H */

-- 
To view, visit https://gerrit.osmocom.org/14294
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife3f222daa87f0630ff34ffc3e63f4dad2ad914b
Gerrit-Change-Number: 14294
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190531/b0088249/attachment.htm>


More information about the gerrit-log mailing list