osmith has uploaded this change for review.
gtp: remove unused conversion functions
Remove ipv42eua and eua2ipv4, which are in the "internal functions"
section of gtp.h, but are not used anywhere in the code anymore. This is
in preparation of moving the internal functions that are used in
multiple .c files into a separate header file, and to make the other
internal functions static. (Compiler complains about unused static
functions.)
Change-Id: I90e2750f6a6e3e6122e9c562103fda77d7326932
---
M gtp/gtp.c
M include/osmocom/gtp/gtp.h
2 files changed, 16 insertions(+), 23 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/90/36790/1
diff --git a/gtp/gtp.c b/gtp/gtp.c
index 2d18fab..9442b33 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -3069,27 +3069,6 @@
* port number.
*************************************************************/
-int ipv42eua(struct ul66_t *eua, struct in_addr *src)
-{
- eua->v[0] = PDP_EUA_ORG_IETF;
- eua->v[1] = PDP_EUA_TYPE_v4;
- if (src) {
- eua->l = 6;
- memcpy(&eua->v[2], src, 4);
- } else {
- eua->l = 2;
- }
- return 0;
-}
-
-int eua2ipv4(struct in_addr *dst, struct ul66_t *eua)
-{
- if ((eua->l != 6) || (eua->v[0] != PDP_EUA_ORG_IETF) || (eua->v[1] != PDP_EUA_TYPE_v4))
- return -1; /* Not IPv4 address */
- memcpy(dst, &eua->v[2], 4);
- return 0;
-}
-
int gsna2in_addr(struct in_addr *dst, struct ul16_t *gsna)
{
memset(dst, 0, sizeof(struct in_addr));
diff --git a/include/osmocom/gtp/gtp.h b/include/osmocom/gtp/gtp.h
index 7465cf1..7e6bb55 100644
--- a/include/osmocom/gtp/gtp.h
+++ b/include/osmocom/gtp/gtp.h
@@ -315,8 +315,6 @@
struct sockaddr_in *peer,
void *pack, unsigned len);
-extern int ipv42eua(struct ul66_t *eua, struct in_addr *src);
-extern int eua2ipv4(struct in_addr *dst, struct ul66_t *eua);
extern int gsna2in_addr(struct in_addr *dst, struct ul16_t *gsna);
extern int in_addr2gsna(struct ul16_t *gsna, struct in_addr *src);
extern const char *imsi_gtp2str(const uint64_t *imsi);
To view, visit change 36790. To unsubscribe, or for help writing mail filters, visit settings.