lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

February 2024

  • 1 participants
  • 1748 discussions
[L] Change in osmo-ggsn[master]: Move in46_addr to libosmocore
by osmith 23 Feb '24

23 Feb '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/36070?usp=email ) Change subject: Move in46_addr to libosmocore ...................................................................... Move in46_addr to libosmocore I'm in the process of extending the public API of OsmoGGSN's libgtp, so a GSN can be created with either IPv4 or IPv6. The in46_addr code from osmo-ggsn.git provides a good abstraction for that. I've considered making it public in libgtp, but given that it is generic code that could be used outside of libgtp in other Osmocom projects, put it in libosmocore instead. Depends: libosmocore I31078f130ec42aeaa5ead1dde82fdd1eb44d992b Change-Id: I8f4d9d78689909a149683583cfe36bcdc3f7cbc7 --- M TODO-RELEASE M ggsn/ggsn.c M ggsn/ggsn.h M lib/Makefile.am D lib/in46_addr.c D lib/in46_addr.h M lib/ippool.h M lib/netdev.h M lib/tun.h M lib/util.c M tests/lib/Makefile.am D tests/lib/in46a_test.c D tests/lib/in46a_test.ok D tests/lib/in46a_v6_test.ok M tests/lib/ippool_test.c M tests/testsuite.at 16 files changed, 27 insertions(+), 938 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/70/36070/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 22cfd1d..38ddde9 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -9,3 +9,4 @@ #library what description / commit summary line libgtp REMOVE remove GTP cause defines of reserved values libgtpnl > 1.2.5 gtp_tunnel_set_family() +libosmocore > 1.9.0 moved in46_addr code to libosmocore diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index d64e82f..de3f614 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -43,6 +43,7 @@ #include <netinet/ip6.h> #include <osmocom/core/timer.h> +#include <osmocom/core/in46_addr.h> #include <osmocom/ctrl/control_if.h> #include <osmocom/gsm/apn.h> @@ -52,7 +53,6 @@ #include "../lib/tun.h" #include "../lib/ippool.h" #include "../lib/syserr.h" -#include "../lib/in46_addr.h" #include "../lib/gtp-kernel.h" #include "../lib/util.h" #include "../lib/icmpv6.h" diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index 7a3204f..5b8cc9b 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -7,13 +7,13 @@ #include <osmocom/core/select.h> #include <osmocom/core/timer.h> #include <osmocom/core/tdef.h> +#include <osmocom/core/in46_addr.h> #include <osmocom/ctrl/control_if.h> #include <osmocom/gtp/gtp.h> #include "../lib/tun.h" #include "../lib/ippool.h" #include "../lib/syserr.h" -#include "../lib/in46_addr.h" #include "sgsn.h" diff --git a/lib/Makefile.am b/lib/Makefile.am index 1fdc93f..c24b63f 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -5,7 +5,6 @@ gnugetopt.h \ gtp-kernel.h \ icmpv6.h \ - in46_addr.h \ ippool.h \ lookup.h \ netdev.h \ @@ -29,7 +28,6 @@ getopt.c \ getopt1.c \ icmpv6.c \ - in46_addr.c \ ippool.c \ lookup.c \ netdev.c \ diff --git a/lib/in46_addr.c b/lib/in46_addr.c deleted file mode 100644 index f5cdf41..0000000 --- a/lib/in46_addr.c +++ /dev/null @@ -1,377 +0,0 @@ -/* - * IPv4/v6 address functions. - * Copyright (C) 2017 by Harald Welte <laforge(a)gnumonks.org> - * - * The contents of this file may be used under the terms of the GNU - * General Public License Version 2, provided that the above copyright - * notice and this permission notice is included in all copies or - * substantial portions of the software. - * - */ - -#include "../lib/in46_addr.h" -#include <osmocom/gtp/pdp.h> - -#include <osmocom/core/utils.h> - -#include <sys/types.h> -#include <netinet/in.h> -#include <sys/socket.h> -#include <arpa/inet.h> -#include <netdb.h> -#include <stdlib.h> -#include <string.h> - -/*! Return the address family of given \reff in46_addr argument */ -int in46a_to_af(const struct in46_addr *in) -{ - switch (in->len) { - case 4: - return AF_INET; - case 8: - case 16: - return AF_INET6; - default: - OSMO_ASSERT(0); - return -1; - } -} - -/*! Convert \ref in46_addr to sockaddr_storage */ -int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in) -{ - struct sockaddr_in *sin = (struct sockaddr_in *)out; - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)out; - - switch (in->len) { - case 4: - sin->sin_family = AF_INET; - sin->sin_addr = in->v4; - break; - case 16: - sin6->sin6_family = AF_INET6; - sin6->sin6_addr = in->v6; - break; - default: - OSMO_ASSERT(0); - return -1; - } - - return 0; -} - -/*! Convenience wrapper around inet_ntop() for in46_addr. - * \param[in] in the in46_addr to print - * \param[out] dst destination buffer where string representation of the address is stored - * \param[out] dst_size size dst. Usually it should be at least INET6_ADDRSTRLEN. - * \return address of dst on success, NULL on error */ -const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size) -{ - int af; - - if (!in || in->len == 0) { - strncpy(dst, "UNDEFINED", dst_size); - return dst; - } - - af = in46a_to_af(in); - if (af < 0) - return NULL; - - return inet_ntop(af, (const void *) &in->v4, dst, dst_size); -} - -/* like inet_ntoa() */ -const char *in46a_ntoa(const struct in46_addr *in46) -{ - static char addrstr_buf[256]; - if (in46a_ntop(in46, addrstr_buf, sizeof(addrstr_buf)) < 0) - return "INVALID"; - else - return addrstr_buf; -} - -const char *in46p_ntoa(const struct in46_prefix *in46p) -{ - static char addrstr_buf[256]; - snprintf(addrstr_buf, sizeof(addrstr_buf), "%s/%u", in46a_ntoa(&in46p->addr), in46p->prefixlen); - return addrstr_buf; -} - -/*! Determine if two in46_addr are equal or not - * \returns 1 in case they are equal; 0 otherwise */ -int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) -{ - if (a->len == b->len && !memcmp(&a->v6, &b->v6, a->len)) - return 1; - else - return 0; -} - -/*! Determine if two in46_addr prefix are equal or not - * The prefix length is determined by the shortest of the prefixes of a and b - * \returns 1 in case the common prefix are equal; 0 otherwise */ -int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b) -{ - unsigned int len; - if (a->len > b->len) - len = b->len; - else - len = a->len; - - if (!memcmp(&a->v6, &b->v6, len)) - return 1; - else - return 0; -} - -/*! Match if IPv6 addr1 + addr2 are within same \a mask */ -static int ipv6_within_mask(const struct in6_addr *addr1, const struct in6_addr *addr2, - const struct in6_addr *mask) -{ - struct in6_addr masked = *addr2; -#if defined(__linux__) - masked.s6_addr32[0] &= mask->s6_addr32[0]; - masked.s6_addr32[1] &= mask->s6_addr32[1]; - masked.s6_addr32[2] &= mask->s6_addr32[2]; - masked.s6_addr32[3] &= mask->s6_addr32[3]; -#else - masked.__u6_addr.__u6_addr32[0] &= mask->__u6_addr.__u6_addr32[0]; - masked.__u6_addr.__u6_addr32[1] &= mask->__u6_addr.__u6_addr32[1]; - masked.__u6_addr.__u6_addr32[2] &= mask->__u6_addr.__u6_addr32[2]; - masked.__u6_addr.__u6_addr32[3] &= mask->__u6_addr.__u6_addr32[3]; -#endif - if (!memcmp(addr1, &masked, sizeof(struct in6_addr))) - return 1; - else - return 0; -} - -/*! Create an IPv6 netmask from the given prefix length */ -static void create_ipv6_netmask(struct in6_addr *netmask, int prefixlen) -{ - uint32_t *p_netmask; - memset(netmask, 0, sizeof(struct in6_addr)); - if (prefixlen < 0) - prefixlen = 0; - else if (128 < prefixlen) - prefixlen = 128; - -#if defined(__linux__) - p_netmask = &netmask->s6_addr32[0]; -#else - p_netmask = &netmask->__u6_addr.__u6_addr32[0]; -#endif - while (32 < prefixlen) { - *p_netmask = 0xffffffff; - p_netmask++; - prefixlen -= 32; - } - if (prefixlen != 0) { - *p_netmask = htonl(0xFFFFFFFF << (32 - prefixlen)); - } -} - -/*! Determine if given \a addr is within given \a net + \a prefixlen - * Builds the netmask from \a net + \a prefixlen and matches it to \a addr - * \returns 1 in case of a match, 0 otherwise */ -int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen) -{ - struct in_addr netmask; - struct in6_addr netmask6; - - if (addr->len != net->len) - return 0; - - switch (addr->len) { - case 4: - netmask.s_addr = htonl(0xFFFFFFFF << (32 - prefixlen)); - if ((addr->v4.s_addr & netmask.s_addr) == net->v4.s_addr) - return 1; - else - return 0; - case 16: - create_ipv6_netmask(&netmask6, prefixlen); - return ipv6_within_mask(&addr->v6, &net->v6, &netmask6); - default: - OSMO_ASSERT(0); - return 0; - } -} - -static unsigned int ipv4_netmasklen(const struct in_addr *netmask) -{ - uint32_t bits = netmask->s_addr; - uint8_t *b = (uint8_t*) &bits; - unsigned int i, prefix = 0; - - for (i = 0; i < 4; i++) { - while (b[i] & 0x80) { - prefix++; - b[i] = b[i] << 1; - } - } - return prefix; -} - -static unsigned int ipv6_netmasklen(const struct in6_addr *netmask) -{ - #if defined(__linux__) - #define ADDRFIELD(i) s6_addr32[i] - #else - #define ADDRFIELD(i) __u6_addr.__u6_addr32[i] - #endif - - unsigned int i, j, prefix = 0; - - for (j = 0; j < 4; j++) { - uint32_t bits = netmask->ADDRFIELD(j); - uint8_t *b = (uint8_t*) &bits; - for (i = 0; i < 4; i++) { - while (b[i] & 0x80) { - prefix++; - b[i] = b[i] << 1; - } - } - } - - #undef ADDRFIELD - - return prefix; -} - -/*! Convert netmask to prefix length representation - * \param[in] netmask in46_addr containing a netmask (consecutive list of 1-bit followed by consecutive list of 0-bit) - * \returns prefix length representation of the netmask (count of 1-bit from the start of the netmask) - */ -unsigned int in46a_netmasklen(const struct in46_addr *netmask) -{ - switch (netmask->len) { - case 4: - return ipv4_netmasklen(&netmask->v4); - case 16: - return ipv6_netmasklen(&netmask->v6); - default: - OSMO_ASSERT(0); - return 0; - } -} - -/*! Convert given array of in46_addr to PDP End User Address - * \param[in] src Array containing 1 or 2 in46_addr - * \param[out] eua End User Address structure to fill - * \returns 0 on success; negative on error - * - * In case size is 2, this function expects to find exactly one IPv4 and one - * IPv6 addresses in src. */ -int in46a_to_eua(const struct in46_addr *src, unsigned int size, struct ul66_t *eua) -{ - const struct in46_addr *src_v4, *src_v6; - if (size == 1) { - switch (src->len) { - case 4: - eua->l = 6; - eua->v[0] = PDP_EUA_ORG_IETF; - eua->v[1] = PDP_EUA_TYPE_v4; - memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */ - break; - case 8: - case 16: - eua->l = 18; - eua->v[0] = PDP_EUA_ORG_IETF; - eua->v[1] = PDP_EUA_TYPE_v6; - memcpy(&eua->v[2], &src->v6, 16); /* Copy a 16 byte address */ - break; - default: - OSMO_ASSERT(0); - return -1; - } - return 0; - } - - if (src[0].len == src[1].len) - return -1; /* we should have a v4 and a v6 address */ - - src_v4 = (src[0].len == 4) ? &src[0] : &src[1]; - src_v6 = (src[0].len == 4) ? &src[1] : &src[0]; - - eua->l = 22; - eua->v[0] = PDP_EUA_ORG_IETF; - eua->v[1] = PDP_EUA_TYPE_v4v6; - memcpy(&eua->v[2], &src_v4->v4, 4); - memcpy(&eua->v[6], &src_v6->v6, 16); - - return 0; -} - -/*! Convert given PDP End User Address to an array of in46_addr - * \param[in] eua End User Address structure to parse - * \param[out] dst Array containing 2 in46_addr - * \returns number of parsed addresses (1 or 2) on success; negative on error - * - * This function expects to receive an End User Address struct together with an - * array of 2 zeroed in46_addr structs. The in46_addr structs are filled in - * order, hence if the function returns 1 the parsed address will be stored in - * the first struct and the second one will be left intact. If 2 is returned, it - * is guaranteed that one of them is an IPv4 and the other one is an IPv6, but - * the order in which they are presented is not specified and must be - * discovered for instance by checking the len field of each address. - */ -int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst) -{ - if (eua->l < 2) - goto default_to_dyn_v4; - - if (eua->v[0] != 0xf1) - return -1; - - switch (eua->v[1]) { - case PDP_EUA_TYPE_v4: - dst->len = 4; - if (eua->l >= 6) - memcpy(&dst->v4, &eua->v[2], 4); /* Copy a 4 byte address */ - else - dst->v4.s_addr = 0; - return 1; - case PDP_EUA_TYPE_v6: - dst->len = 16; - if (eua->l >= 18) - memcpy(&dst->v6, &eua->v[2], 16); /* Copy a 16 byte address */ - else - memset(&dst->v6, 0, 16); - return 1; - case PDP_EUA_TYPE_v4v6: - /* 3GPP TS 29.060, section 7.7.27 */ - switch (eua->l) { - case 2: /* v4 & v6 dynamic */ - dst[0].v4.s_addr = 0; - memset(&dst[1].v6, 0, 16); - break; - case 6: /* v4 static, v6 dynamic */ - memcpy(&dst[0].v4, &eua->v[2], 4); - memset(&dst[1].v6, 0, 16); - break; - case 18: /* v4 dynamic, v6 static */ - dst[0].v4.s_addr = 0; - memcpy(&dst[1].v6, &eua->v[2], 16); - break; - case 22: /* v4 & v6 static */ - memcpy(&dst[0].v4, &eua->v[2], 4); - memcpy(&dst[1].v6, &eua->v[6], 16); - break; - default: - return -1; - } - dst[0].len = 4; - dst[1].len = 16; - return 2; - default: - return -1; - } - -default_to_dyn_v4: - /* assume dynamic IPv4 by default */ - dst->len = 4; - dst->v4.s_addr = 0; - return 1; -} diff --git a/lib/in46_addr.h b/lib/in46_addr.h deleted file mode 100644 index c3c9e9c..0000000 --- a/lib/in46_addr.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once -#include <stdint.h> -#include <netinet/in.h> - -#include <osmocom/gtp/pdp.h> - -/* a simple wrapper around an in6_addr to also contain the length of the address, - * thereby implicitly indicating the address family of the address */ -struct in46_addr { - uint8_t len; - union { - struct in_addr v4; - struct in6_addr v6; - }; -}; - -struct in46_prefix { - struct in46_addr addr; - uint8_t prefixlen; -}; - -extern int in46a_to_af(const struct in46_addr *in); -extern int in46a_to_sas(struct sockaddr_storage *out, const struct in46_addr *in); -extern const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size); -extern const char *in46a_ntoa(const struct in46_addr *in46); -extern const char *in46p_ntoa(const struct in46_prefix *in46p); -extern int in46a_equal(const struct in46_addr *a, const struct in46_addr *b); -extern int in46a_prefix_equal(const struct in46_addr *a, const struct in46_addr *b); -extern int in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, size_t prefixlen); -unsigned int in46a_netmasklen(const struct in46_addr *netmask); - -int in46a_to_eua(const struct in46_addr *src, unsigned int size, struct ul66_t *eua); -int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst); - -static inline bool in46a_is_v6(const struct in46_addr *addr) { - return addr->len == 8 || addr->len == 16; -} - -static inline bool in46a_is_v4(const struct in46_addr *addr) { - return addr->len == sizeof(struct in_addr); -} diff --git a/lib/ippool.h b/lib/ippool.h index 406938e..8baf330 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -12,7 +12,7 @@ #ifndef _IPPOOL_H #define _IPPOOL_H -#include "../lib/in46_addr.h" +#include <osmocom/core/in46_addr.h> #include <osmocom/gtp/gtp.h> /* Assuming that the address space is fragmented we need a hash table diff --git a/lib/netdev.h b/lib/netdev.h index 1bce814..196340e 100644 --- a/lib/netdev.h +++ b/lib/netdev.h @@ -13,7 +13,7 @@ #include <net/if.h> -#include "../lib/in46_addr.h" +#include <osmocom/core/in46_addr.h> #define TUN_NLBUFSIZE 1024 diff --git a/lib/tun.h b/lib/tun.h index 36a4f7e..394d816 100644 --- a/lib/tun.h +++ b/lib/tun.h @@ -16,7 +16,7 @@ #include <stdbool.h> #include <net/if.h> -#include "../lib/in46_addr.h" +#include <osmocom/core/in46_addr.h> #define PACKET_MAX 8196 /* Maximum packet size we receive */ #define TUN_SCRIPTSIZE 256 diff --git a/lib/util.c b/lib/util.c index f29884a..30401d5 100644 --- a/lib/util.c +++ b/lib/util.c @@ -9,10 +9,10 @@ * */ +#include <osmocom/core/in46_addr.h> #include <osmocom/gtp/pdp.h> #include "ippool.h" -#include "in46_addr.h" /*! Get the peer of pdp based on IP version used. * \param[in] pdp PDP context to select the peer from. diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index 7c01915..9f672f8 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -9,10 +9,9 @@ ippool_test.err \ ippool_v6_test.ok \ ippool_v6_test.err \ - in46a_test.ok \ - in46a_v6_test.ok + $(NULL) -check_PROGRAMS = ippool_test in46a_test +check_PROGRAMS = ippool_test ippool_test_SOURCES = \ ippool_test.c \ @@ -22,12 +21,3 @@ $(top_builddir)/lib/libmisc.a \ $(LIBOSMOCORE_LIBS) \ $(NULL) - -in46a_test_SOURCES = \ - in46a_test.c \ - $(NULL) - -in46a_test_LDADD = \ - $(top_builddir)/lib/libmisc.a \ - $(LIBOSMOCORE_LIBS) \ - $(NULL) diff --git a/tests/lib/in46a_test.c b/tests/lib/in46a_test.c deleted file mode 100644 index d576124..0000000 --- a/tests/lib/in46a_test.c +++ /dev/null @@ -1,460 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <time.h> - -#include <netinet/in.h> -#include <sys/socket.h> - -#include <osmocom/core/utils.h> -#include <osmocom/core/application.h> -#include <osmocom/core/logging.h> -#include <osmocom/core/msgb.h> -#include <osmocom/core/bits.h> - -#include "../../lib/in46_addr.h" -#include "../../lib/syserr.h" - -static const struct in46_addr g_ia4 = { - .len = 4, - .v4.s_addr = 0x0d0c0b0a, -}; - -static void test_in46a_to_af(void) -{ - printf("Testing in46a_to_af() with IPv4 addresses\n"); - - OSMO_ASSERT(in46a_to_af(&g_ia4) == AF_INET); -} - -static void test_in46a_to_sas(void) -{ - struct sockaddr_storage ss; - struct sockaddr_in *sin = (struct sockaddr_in *) &ss; - - printf("Testing in46a_to_sas() with IPv4 addresses\n"); - - memset(&ss, 0, sizeof(ss)); - OSMO_ASSERT(in46a_to_sas(&ss, &g_ia4) == 0); - OSMO_ASSERT(sin->sin_family == AF_INET); - OSMO_ASSERT(sin->sin_addr.s_addr == g_ia4.v4.s_addr); -} - -static void test_in46a_ntop(void) -{ - struct in46_addr ia; - char buf[256]; - const char *res; - - printf("Testing in46a_ntop() with IPv4 addresses\n"); - - res = in46a_ntop(NULL, buf, sizeof(buf)); - OSMO_ASSERT(res && !strcmp(res, "UNDEFINED")); - printf("res = %s\n", res); - - ia.len = 0; - res = in46a_ntop(&ia, buf, sizeof(buf)); - printf("res = %s\n", res); - OSMO_ASSERT(res && !strcmp(res, "UNDEFINED")); - - ia.len = 4; - ia.v4.s_addr = htonl(0x01020304); - res = in46a_ntop(&ia, buf, sizeof(buf)); - OSMO_ASSERT(res && !strcmp(res, "1.2.3.4")); - printf("res = %s\n", res); -} - -static void test_in46p_ntoa(void) -{ - const struct in46_prefix ip46 = { - .prefixlen = 24, - .addr = { - .len = 4, - .v4.s_addr = htonl(0x10203000), - }, - }; - printf("in46p_ntoa() returns %s\n", in46p_ntoa(&ip46)); -} - -static void test_in46a_equal(void) -{ - struct in46_addr b; - - printf("Testing in46a_equal() with IPv4 addresses\n"); - - memset(&b, 0xff, sizeof(b)); - b.len = g_ia4.len; - b.v4.s_addr = g_ia4.v4.s_addr; - OSMO_ASSERT(in46a_equal(&g_ia4, &b)); -} - -static int log_in46a_within_mask(const struct in46_addr *addr, const struct in46_addr *net, - size_t prefixlen) -{ - int rc; - - printf("in46a_within_mask(%s, ", in46a_ntoa(addr)); - printf("%s, %lu) = ", in46a_ntoa(net), prefixlen); - - rc = in46a_within_mask(addr, net, prefixlen); - printf("%d\n", rc); - - return rc; -} - -static void test_in46a_within_mask(void) -{ - struct in46_addr addr, mask; - - printf("Testing in46a_within_mask() with IPv4 addresses\n"); - - addr = g_ia4; - mask = g_ia4; - OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 32)); - - mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfffffffC ); - OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 30)); - - mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfff80000 ); - OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 13)); - - addr.v4.s_addr = htonl(ntohl(addr.v4.s_addr) + 1); - mask = g_ia4; - OSMO_ASSERT(!log_in46a_within_mask(&addr, &mask, 32)); - mask.v4.s_addr = htonl( ntohl(mask.v4.s_addr) & 0xfffffffC ); - OSMO_ASSERT(log_in46a_within_mask(&addr, &mask, 30)); -} - -static void test_in46a_to_eua(void) -{ - struct ul66_t eua; - - printf("testing in46a_to_eua() with IPv4 addresses\n"); - -#if 0 /* triggers assert in current implementation */ - const struct in46_addr ia_invalid = { .len = 3, }; - OSMO_ASSERT(in46a_to_eua(&ia_invalid, &eua) < 0); -#endif - - /* IPv4 address */ - OSMO_ASSERT(in46a_to_eua(&g_ia4, 1, &eua) == 0); - OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); - OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v4); - OSMO_ASSERT(osmo_load32le(&eua.v[2]) == g_ia4.v4.s_addr); -} - -static void test_in46a_from_eua(void) -{ - struct in46_addr ia[2]; - struct ul66_t eua; - const uint8_t v4_unspec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4 }; - const uint8_t v4_spec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4, 1,2,3,4 }; - memset(&eua, 0, sizeof(eua)); - - printf("Testing in46a_from_eua() with IPv4 addresses\n"); - - /* default: v4 unspec */ - OSMO_ASSERT(in46a_from_eua(&eua, ia) == 1); - OSMO_ASSERT(ia[0].len == 4); - OSMO_ASSERT(ia[0].v4.s_addr == 0); - - /* invalid */ - eua.v[0] = 0x23; - eua.v[1] = PDP_EUA_TYPE_v4; - eua.l = 6; - OSMO_ASSERT(in46a_from_eua(&eua, ia) < 0); - - /* invalid */ - eua.v[0] = PDP_EUA_ORG_IETF; - eua.v[1] = 0x23; - eua.l = 6; - OSMO_ASSERT(in46a_from_eua(&eua, ia) < 0); - - /* unspecified V4 */ - memcpy(eua.v, v4_unspec, sizeof(v4_unspec)); - eua.l = sizeof(v4_unspec); - OSMO_ASSERT(in46a_from_eua(&eua, ia) == 1); - OSMO_ASSERT(ia[0].len == 4); - OSMO_ASSERT(ia[0].v4.s_addr == 0); - - /* specified V4 */ - memcpy(eua.v, v4_spec, sizeof(v4_spec)); - eua.l = sizeof(v4_spec); - OSMO_ASSERT(in46a_from_eua(&eua, ia) == 1); - OSMO_ASSERT(ia[0].len == 4); - OSMO_ASSERT(ia[0].v4.s_addr == htonl(0x01020304)); -} - -static void test_in46a_netmasklen(void) -{ - struct in46_addr netmask; - unsigned int len; - - printf("Testing in46a_netmasklen() with IPv4 addresses\n"); - netmask.len = 4; - - netmask.v4.s_addr = 0xffffffff; - len = in46a_netmasklen(&netmask); - OSMO_ASSERT(len == 32); - - netmask.v4.s_addr = 0x00ffffff; - len = in46a_netmasklen(&netmask); - OSMO_ASSERT(len == 24); - - netmask.v4.s_addr = 0x00f0ffff; - len = in46a_netmasklen(&netmask); - OSMO_ASSERT(len == 20); - - netmask.v4.s_addr = 0x000000fe; - len = in46a_netmasklen(&netmask); - OSMO_ASSERT(len == 7); - - netmask.v4.s_addr = 0x00000000; - len = in46a_netmasklen(&netmask); - OSMO_ASSERT(len == 0); -} - -/* IPv6 specific tests */ - -static const struct in46_addr g_ia6 = { - .len = 16, - .v6.s6_addr = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }, -}; - -static void test_in46a_to_af_v6(void) -{ - struct in46_addr ia; - - printf("Testing in46a_to_af() with IPv6 addresses\n"); - - OSMO_ASSERT(in46a_to_af(&g_ia6) == AF_INET6); - - ia.len = 8; - OSMO_ASSERT(in46a_to_af(&ia) == AF_INET6); -} - -static void test_in46a_to_sas_v6(void) -{ - struct sockaddr_storage ss; - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &ss; - - printf("Testing in46a_to_sas() with IPv6 addresses\n"); - - memset(&ss, 0, sizeof(ss)); - OSMO_ASSERT(in46a_to_sas(&ss, &g_ia6) == 0); - OSMO_ASSERT(sin6->sin6_family == AF_INET6); - OSMO_ASSERT(!memcmp(&sin6->sin6_addr, &g_ia6.v6, sizeof(sin6->sin6_addr))); -} - -static void test_in46a_ntop_v6(void) -{ - char buf[256]; - const char *res; - - printf("Testing in46a_ntop() with IPv6 addresses\n"); - - res = in46a_ntop(&g_ia6, buf, sizeof(buf)); - OSMO_ASSERT(res && !strcmp(res, "102:304:506:708:90a:b0c:d0e:f10")); - printf("res = %s\n", res); -} - -static void test_in46a_equal_v6(void) -{ - struct in46_addr b; - - printf("Testing in46a_equal() with IPv6 addresses\n"); - - memset(&b, 0xff, sizeof(b)); - b.len = g_ia6.len; - b.v6 = g_ia6.v6; - OSMO_ASSERT(in46a_equal(&g_ia6, &b)); -} - -static void test_in46a_to_eua_v6(void) -{ - const struct in46_addr ia_v6_8 = { - .len = 8, - .v6.s6_addr = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }, - }; - struct ul66_t eua; - - printf("Testing in46a_to_eua() with IPv6 addresses\n"); - - /* IPv6 address */ - OSMO_ASSERT(in46a_to_eua(&g_ia6, 1, &eua) == 0); - OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); - OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v6); - OSMO_ASSERT(!memcmp(&eua.v[2], &g_ia6.v6, 16)); - - /* IPv6 address with prefix / length 8 */ - OSMO_ASSERT(in46a_to_eua(&ia_v6_8, 1, &eua) == 0); - OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); - OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v6); - OSMO_ASSERT(!memcmp(&eua.v[2], &ia_v6_8.v6, 16)); -} - -static void test_in46a_to_eua_v4v6() { - const struct in46_addr ia_v4v6[2] = { - { - .len = 16, - .v6.s6_addr = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }, - }, - { - .len = 4, - .v4.s_addr = 0x0d0c0b0a, - } - }; - struct ul66_t eua; - printf("Testing in46a_to_eua() with IPv4v6 addresses\n"); - - /* IPv4 address */ - OSMO_ASSERT(in46a_to_eua(ia_v4v6, 2, &eua) == 0); - OSMO_ASSERT(eua.v[0] == PDP_EUA_ORG_IETF); - OSMO_ASSERT(eua.v[1] == PDP_EUA_TYPE_v4v6); - OSMO_ASSERT(osmo_load32le(&eua.v[2]) == g_ia4.v4.s_addr); - OSMO_ASSERT(!memcmp(&eua.v[6], &g_ia6.v6, 16)); -} - -static void test_in46a_from_eua_v6(void) -{ - struct in46_addr ia[2]; - struct ul66_t eua; - const uint8_t v6_unspec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v6 }; - const uint8_t v6_spec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v6, - 1,2,3,4,5,6,7,8,9,0xa,0xb,0xc,0xd,0xe,0xf,0x10 }; - - memset(&eua, 0, sizeof(eua)); - - printf("Testing in46a_from_eua() with IPv6 addresses\n"); - - /* unspecified V6 */ - memcpy(eua.v, v6_unspec, sizeof(v6_unspec)); - eua.l = sizeof(v6_unspec); - OSMO_ASSERT(in46a_from_eua(&eua, ia) == 1); - OSMO_ASSERT(ia[0].len == 16); - OSMO_ASSERT(IN6_IS_ADDR_UNSPECIFIED(&ia[0].v6)); - - /* specified V6 */ - memcpy(eua.v, v6_spec, sizeof(v6_spec)); - eua.l = sizeof(v6_spec); - OSMO_ASSERT(in46a_from_eua(&eua, ia) == 1); - OSMO_ASSERT(ia[0].len == 16); - OSMO_ASSERT(!memcmp(&ia[0].v6, v6_spec+2, ia[0].len)); -} - -static void test_in46a_from_eua_v4v6(void) { - struct in46_addr ia[2]; - struct ul66_t eua; - const uint8_t v4_unspec_v6_unspec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4v6 }; - const uint8_t v4_spec_v6_unspec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4v6, 1,2,3,4 }; - const uint8_t v4_unspec_v6_spec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4v6, 1,2,3,4,5,6,7,8,9,0xa,0xb,0xc,0xd,0xe,0xf,0x10 }; - const uint8_t v4_spec_v6_spec[] = { PDP_EUA_ORG_IETF, PDP_EUA_TYPE_v4v6, 1,2,3,4, 1,2,3,4,5,6,7,8,9,0xa,0xb,0xc,0xd,0xe,0xf,0x10 }; - - memset(&eua, 0, sizeof(eua)); - - printf("Testing in46a_from_eua() with IPv4v6 addresses\n"); - - /* unspecified V4 & V6 */ - memcpy(eua.v, v4_unspec_v6_unspec, sizeof(v4_unspec_v6_unspec)); - eua.l = sizeof(v4_unspec_v6_unspec); - OSMO_ASSERT(in46a_from_eua(&eua, ia) == 2); - OSMO_ASSERT(ia[0].len == 4); - OSMO_ASSERT(ia[1].len == 16); - OSMO_ASSERT(ia[0].v4.s_addr == 0); - OSMO_ASSERT(IN6_IS_ADDR_UNSPECIFIED(&ia[1].v6)); - - /* specified V4, unspecified V6 */ - memcpy(eua.v, v4_spec_v6_unspec, sizeof(v4_spec_v6_unspec)); - eua.l = sizeof(v4_spec_v6_unspec); - OSMO_ASSERT(in46a_from_eua(&eua, ia) == 2); - OSMO_ASSERT(ia[0].len == 4); - OSMO_ASSERT(ia[1].len == 16); - OSMO_ASSERT(ia[0].v4.s_addr == htonl(0x01020304)); - OSMO_ASSERT(IN6_IS_ADDR_UNSPECIFIED(&ia[1].v6)); - - /* unspecified V4, specified V6 */ - memcpy(eua.v, v4_unspec_v6_spec, sizeof(v4_unspec_v6_spec)); - eua.l = sizeof(v4_unspec_v6_spec); - OSMO_ASSERT(in46a_from_eua(&eua, ia) == 2); - OSMO_ASSERT(ia[0].len == 4); - OSMO_ASSERT(ia[1].len == 16); - OSMO_ASSERT(ia[0].v4.s_addr == 0); - OSMO_ASSERT(!memcmp(&ia[1].v6, v4_unspec_v6_spec+2, ia[1].len)); - - /* specified V4, specified V6 */ - memcpy(eua.v, v4_spec_v6_spec, sizeof(v4_spec_v6_spec)); - eua.l = sizeof(v4_spec_v6_spec); - OSMO_ASSERT(in46a_from_eua(&eua, ia) == 2); - OSMO_ASSERT(ia[0].len == 4); - OSMO_ASSERT(ia[1].len == 16); - OSMO_ASSERT(ia[0].v4.s_addr == htonl(0x01020304)); - OSMO_ASSERT(!memcmp(&ia[1].v6, v4_spec_v6_spec+6, ia[1].len)); -} - -static void test_in46a_netmasklen_v6(void) -{ - unsigned int len; - printf("Testing in46a_netmasklen() with IPv6 addresses\n"); - const struct in46_addr netmaskA = { - .len = 16, - .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}, - }; - len = in46a_netmasklen(&netmaskA); - OSMO_ASSERT(len == 128); - - const struct in46_addr netmaskB = { - .len = 16, - .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00}, - }; - len = in46a_netmasklen(&netmaskB); - OSMO_ASSERT(len == 104); - - const struct in46_addr netmaskC = { - .len = 16, - .v6.s6_addr = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00}, - }; - len = in46a_netmasklen(&netmaskC); - OSMO_ASSERT(len == 103); - - const struct in46_addr netmaskD = { - .len = 16, - .v6.s6_addr = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, - }; - len = in46a_netmasklen(&netmaskD); - OSMO_ASSERT(len == 0); -} - -int main(int argc, char **argv) -{ - void *tall_ctx = talloc_named_const(NULL, 1, "Root context"); - msgb_talloc_ctx_init(tall_ctx, 0); - osmo_init_logging2(tall_ctx, &log_info); - log_set_use_color(osmo_stderr_target, 0); - log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE); - - srand(time(NULL)); - - if (argc < 2 || strcmp(argv[1], "-v6")) { - test_in46a_to_af(); - test_in46a_to_sas(); - test_in46a_ntop(); - test_in46p_ntoa(); - test_in46a_equal(); - test_in46a_within_mask(); - test_in46a_to_eua(); - test_in46a_from_eua(); - test_in46a_netmasklen(); - } else { - test_in46a_to_af_v6(); - test_in46a_to_sas_v6(); - test_in46a_ntop_v6(); - test_in46a_equal_v6(); - test_in46a_to_eua_v6(); - test_in46a_from_eua_v6(); - test_in46a_to_eua_v4v6(); - test_in46a_from_eua_v4v6(); - test_in46a_netmasklen_v6(); - } - return 0; -} diff --git a/tests/lib/in46a_test.ok b/tests/lib/in46a_test.ok deleted file mode 100644 index b497ad1..0000000 --- a/tests/lib/in46a_test.ok +++ /dev/null @@ -1,17 +0,0 @@ -Testing in46a_to_af() with IPv4 addresses -Testing in46a_to_sas() with IPv4 addresses -Testing in46a_ntop() with IPv4 addresses -res = UNDEFINED -res = UNDEFINED -res = 1.2.3.4 -in46p_ntoa() returns 16.32.48.0/24 -Testing in46a_equal() with IPv4 addresses -Testing in46a_within_mask() with IPv4 addresses -in46a_within_mask(10.11.12.13, 10.11.12.13, 32) = 1 -in46a_within_mask(10.11.12.13, 10.11.12.12, 30) = 1 -in46a_within_mask(10.11.12.13, 10.8.0.0, 13) = 1 -in46a_within_mask(10.11.12.14, 10.11.12.13, 32) = 0 -in46a_within_mask(10.11.12.14, 10.11.12.12, 30) = 1 -testing in46a_to_eua() with IPv4 addresses -Testing in46a_from_eua() with IPv4 addresses -Testing in46a_netmasklen() with IPv4 addresses diff --git a/tests/lib/in46a_v6_test.ok b/tests/lib/in46a_v6_test.ok deleted file mode 100644 index 10dc7f4..0000000 --- a/tests/lib/in46a_v6_test.ok +++ /dev/null @@ -1,10 +0,0 @@ -Testing in46a_to_af() with IPv6 addresses -Testing in46a_to_sas() with IPv6 addresses -Testing in46a_ntop() with IPv6 addresses -res = 102:304:506:708:90a:b0c:d0e:f10 -Testing in46a_equal() with IPv6 addresses -Testing in46a_to_eua() with IPv6 addresses -Testing in46a_from_eua() with IPv6 addresses -Testing in46a_to_eua() with IPv4v6 addresses -Testing in46a_from_eua() with IPv4v6 addresses -Testing in46a_netmasklen() with IPv6 addresses diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c index 2af4a38..17f8fed 100644 --- a/tests/lib/ippool_test.c +++ b/tests/lib/ippool_test.c @@ -8,8 +8,8 @@ #include <osmocom/core/application.h> #include <osmocom/core/logging.h> #include <osmocom/core/msgb.h> +#include <osmocom/core/in46_addr.h> -#include "../../lib/in46_addr.h" #include "../../lib/ippool.h" #include "../../lib/syserr.h" diff --git a/tests/testsuite.at b/tests/testsuite.at index 2602a3a..5ba99cb 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -15,18 +15,6 @@ AT_CHECK([$abs_top_builddir/tests/lib/ippool_test -v6], [], [expout], [experr]) AT_CLEANUP -AT_SETUP([in46a]) -AT_KEYWORDS([in46a]) -cat $abs_srcdir/lib/in46a_test.ok > expout -AT_CHECK([$abs_top_builddir/tests/lib/in46a_test], [], [expout], []) -AT_CLEANUP - -AT_SETUP([in46a_v6]) -AT_KEYWORDS([in46a_v6]) -cat $abs_srcdir/lib/in46a_v6_test.ok > expout -AT_CHECK([$abs_top_builddir/tests/lib/in46a_test -v6], [], [expout], []) -AT_CLEANUP - AT_SETUP([gtpie]) AT_KEYWORDS([gtpie]) cat $abs_srcdir/gtp/gtpie_test.ok > expout -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/36070?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I8f4d9d78689909a149683583cfe36bcdc3f7cbc7 Gerrit-Change-Number: 36070 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-ggsn[master]: Cosmetic: {lib,gtp}/Makefile.am: diff friendly
by osmith 23 Feb '24

23 Feb '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/36065?usp=email ) Change subject: Cosmetic: {lib,gtp}/Makefile.am: diff friendly ...................................................................... Cosmetic: {lib,gtp}/Makefile.am: diff friendly Change-Id: Ib1956794edc6e82cfa6c5419b2609565674d98a4 --- M gtp/Makefile.am M lib/Makefile.am 2 files changed, 52 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/65/36065/1 diff --git a/gtp/Makefile.am b/gtp/Makefile.am index f96f429..666befe 100644 --- a/gtp/Makefile.am +++ b/gtp/Makefile.am @@ -15,6 +15,20 @@ $(LIBOSMOCORE_CFLAGS) \ $(NULL) -libgtp_la_SOURCES = gtp.c gtp.h gsn.c gsn.h gtpie.c gtpie.h pdp.c pdp.h lookupa.c lookupa.h queue.c queue.h +libgtp_la_SOURCES = \ + gsn.c \ + gsn.h \ + gtp.c \ + gtp.h \ + gtpie.c \ + gtpie.h \ + lookupa.c \ + lookupa.h \ + pdp.c \ + pdp.h \ + queue.c \ + queue.h \ + $(NULL) + libgtp_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined libgtp_la_LIBADD = $(LIBOSMOCORE_LIBS) diff --git a/lib/Makefile.am b/lib/Makefile.am index 9dfd456..bef8962 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,6 +1,19 @@ noinst_LIBRARIES = libmisc.a -noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h in46_addr.h netdev.h gtp-kernel.h netns.h util.h icmpv6.h checksum.h +noinst_HEADERS = \ + checksum.h \ + gnugetopt.h \ + gtp-kernel.h \ + icmpv6.h \ + in46_addr.h \ + ippool.h \ + lookup.h \ + netdev.h \ + netns.h \ + syserr.h \ + tun.h \ + util.h \ + $(NULL) AM_CFLAGS = \ -fno-builtin \ @@ -9,7 +22,20 @@ $(LIBOSMOCORE_CFLAGS) \ $(NULL) -libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c in46_addr.c netdev.c netns.c util.c icmpv6.c checksum.c +libmisc_a_SOURCES = \ + checksum.c \ + debug.c \ + getopt.c \ + getopt1.c \ + icmpv6.c \ + in46_addr.c \ + ippool.c \ + lookup.c \ + netdev.c \ + netns.c \ + tun.c \ + util.c \ + $(NULL) if ENABLE_GTP_KERNEL AM_CFLAGS += -DGTP_KERNEL $(LIBGTPNL_CFLAGS) -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/36065?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: Ib1956794edc6e82cfa6c5419b2609565674d98a4 Gerrit-Change-Number: 36065 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-ggsn[master]: Cosmetic: AM_CFLAGS: make diff friendly
by osmith 23 Feb '24

23 Feb '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/36064?usp=email ) Change subject: Cosmetic: AM_CFLAGS: make diff friendly ...................................................................... Cosmetic: AM_CFLAGS: make diff friendly Change-Id: I3303cd8ba8c8b21ff267608833d9fb4833ffc471 --- M ggsn/Makefile.am M gtp/Makefile.am M lib/Makefile.am M sgsnemu/Makefile.am M tests/gtp/Makefile.am M tests/lib/Makefile.am 6 files changed, 51 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/64/36064/1 diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index d4c82ad..0c6f334 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -2,7 +2,15 @@ AM_LDFLAGS = @EXEC_LDFLAGS@ -AM_CFLAGS = -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) +AM_CFLAGS = \ + -D_GNU_SOURCE \ + -fno-builtin \ + -Wall \ + -DSBINDIR='"$(sbindir)"' \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOCTRL_CFLAGS) \ + $(LIBOSMOVTY_CFLAGS) \ + $(NULL) osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) diff --git a/gtp/Makefile.am b/gtp/Makefile.am index 99ad8bb..f96f429 100644 --- a/gtp/Makefile.am +++ b/gtp/Makefile.am @@ -8,7 +8,12 @@ include_HEADERS = gtp.h gsn.h pdp.h gtpie.h -AM_CFLAGS = -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' $(LIBOSMOCORE_CFLAGS) +AM_CFLAGS = \ + -fno-builtin \ + -Wall \ + -DSBINDIR='"$(sbindir)"' \ + $(LIBOSMOCORE_CFLAGS) \ + $(NULL) libgtp_la_SOURCES = gtp.c gtp.h gsn.c gsn.h gtpie.c gtpie.h pdp.c pdp.h lookupa.c lookupa.h queue.c queue.h libgtp_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined diff --git a/lib/Makefile.am b/lib/Makefile.am index 9dcd13b..9dfd456 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -2,7 +2,12 @@ noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h in46_addr.h netdev.h gtp-kernel.h netns.h util.h icmpv6.h checksum.h -AM_CFLAGS = -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' $(LIBOSMOCORE_CFLAGS) +AM_CFLAGS = \ + -fno-builtin \ + -Wall \ + -DSBINDIR='"$(sbindir)"' \ + $(LIBOSMOCORE_CFLAGS) \ + $(NULL) libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c in46_addr.c netdev.c netns.c util.c icmpv6.c checksum.c diff --git a/sgsnemu/Makefile.am b/sgsnemu/Makefile.am index 1f75de0..7e7fdbb 100644 --- a/sgsnemu/Makefile.am +++ b/sgsnemu/Makefile.am @@ -2,12 +2,21 @@ AM_LDFLAGS = @EXEC_LDFLAGS@ -AM_CFLAGS = -D_GNU_SOURCE -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' $(LIBOSMOCORE_CFLAGS) +AM_CFLAGS = \ + -D_GNU_SOURCE \ + -fno-builtin \ + -Wall \ + -DSBINDIR='"$(sbindir)"' \ + $(LIBOSMOCORE_CFLAGS) \ + $(NULL) sgsnemu_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) if ENABLE_GTP_KERNEL -AM_CFLAGS += -DGTP_KERNEL $(LIBGTPNL_CFLAGS) +AM_CFLAGS += \ + -DGTP_KERNEL \ + $(LIBGTPNL_CFLAGS) \ + $(NULL) sgsnemu_LDADD += $(LIBGTPNL_LIBS) endif diff --git a/tests/gtp/Makefile.am b/tests/gtp/Makefile.am index ef69260..ad2ed82 100644 --- a/tests/gtp/Makefile.am +++ b/tests/gtp/Makefile.am @@ -1,4 +1,8 @@ -AM_CFLAGS = -Wall -I$(top_srcdir)/include $(LIBOSMOCORE_CFLAGS) +AM_CFLAGS = \ + -Wall \ + -I$(top_srcdir)/include \ + $(LIBOSMOCORE_CFLAGS) \ + $(NULL) AM_LDFLAGS = -no-install EXTRA_DIST = \ diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index e807281..7c01915 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -1,4 +1,8 @@ -AM_CFLAGS = -Wall -I$(top_srcdir)/include $(LIBOSMOCORE_CFLAGS) +AM_CFLAGS = \ + -Wall \ + -I$(top_srcdir)/include \ + $(LIBOSMOCORE_CFLAGS) \ + $(NULL) AM_LDFLAGS = -no-install EXTRA_DIST = ippool_test.ok \ -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/36064?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I3303cd8ba8c8b21ff267608833d9fb4833ffc471 Gerrit-Change-Number: 36064 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-ggsn[master]: gtp/gsn_internal.h: new file
by osmith 23 Feb '24

23 Feb '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/36067?usp=email ) Change subject: gtp/gsn_internal.h: new file ...................................................................... gtp/gsn_internal.h: new file Change-Id: I999462e39411fc4ec7e50bd0212e870006fbc4f1 --- M gtp/Makefile.am M gtp/gsn.c A gtp/gsn_internal.h M gtp/gtp.c M include/osmocom/gtp/gsn.h 5 files changed, 15 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/67/36067/1 diff --git a/gtp/Makefile.am b/gtp/Makefile.am index a2631dd..13d1e18 100644 --- a/gtp/Makefile.am +++ b/gtp/Makefile.am @@ -17,6 +17,7 @@ libgtp_la_SOURCES = \ gsn.c \ gsn.h \ + gsn_internal.h \ gtp.c \ gtp.h \ gtpie.c \ diff --git a/gtp/gsn.c b/gtp/gsn.c index e326f80..c23fb2a 100644 --- a/gtp/gsn.c +++ b/gtp/gsn.c @@ -62,6 +62,7 @@ #include <osmocom/gtp/gtpie.h> #include "queue.h" +#include "gsn_internal.h" /* Error reporting functions */ diff --git a/gtp/gsn_internal.h b/gtp/gsn_internal.h new file mode 100644 index 0000000..deb60c3 --- /dev/null +++ b/gtp/gsn_internal.h @@ -0,0 +1,3 @@ +#pragma once + +void gtp_queue_timer_start(struct gsn_t *gsn); diff --git a/gtp/gtp.c b/gtp/gtp.c index 8921802..bdf7e7d 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -60,6 +60,7 @@ #include <osmocom/gtp/gtpie.h> #include "queue.h" +#include "gsn_internal.h" /* Error reporting functions */ diff --git a/include/osmocom/gtp/gsn.h b/include/osmocom/gtp/gsn.h index 8e47ce3..936db9b 100644 --- a/include/osmocom/gtp/gsn.h +++ b/include/osmocom/gtp/gsn.h @@ -175,7 +175,4 @@ extern int gtp_retrans(struct gsn_t *gsn) OSMO_DEPRECATED("This API is a no-op, libgtp already does the job internally"); extern int gtp_retranstimeout(struct gsn_t *gsn, struct timeval *timeout) OSMO_DEPRECATED("This API is a no-op and will return a 1 day timeout"); -/* Internal APIs: */ -void gtp_queue_timer_start(struct gsn_t *gsn); - #endif /* !_GSN_H */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/36067?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I999462e39411fc4ec7e50bd0212e870006fbc4f1 Gerrit-Change-Number: 36067 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-ggsn[master]: Cosmetic: Makefile.am: make SUBDIRS diff friendly
by osmith 23 Feb '24

23 Feb '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/36063?usp=email ) Change subject: Cosmetic: Makefile.am: make SUBDIRS diff friendly ...................................................................... Cosmetic: Makefile.am: make SUBDIRS diff friendly Change-Id: I49e1b08e48dc324f313228e8c69679c37aa774f4 --- M Makefile.am 1 file changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/63/36063/1 diff --git a/Makefile.am b/Makefile.am index 7fb2529..5db4ac6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,14 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = lib gtp ggsn sgsnemu doc contrib utils tests +SUBDIRS = \ + lib \ + gtp \ + ggsn \ + sgsnemu \ + doc \ + contrib \ + utils \ + tests \ + $(NULL) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libgtp.pc -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/36063?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I49e1b08e48dc324f313228e8c69679c37aa774f4 Gerrit-Change-Number: 36063 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-ggsn[master]: gtp/gtp_internal.h: new file
by osmith 23 Feb '24

23 Feb '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/36068?usp=email ) Change subject: gtp/gtp_internal.h: new file ...................................................................... gtp/gtp_internal.h: new file While at it, move internal functions of gtp.h to a separate file too. The following APIs are unexpectedly public: * imsi_gtp2str gets used by pdp.h * gsna2in_addr, gtp_echo_req gets used by osmo-sgsn Change-Id: I72c40cbdec33449ca8104fb3cad8df1a9e07dfd7 --- M ggsn/ggsn.c M ggsn/ggsn_vty.c M ggsn/sgsn.c M gtp/Makefile.am M gtp/gsn_internal.h M gtp/gtp.c A gtp/gtp_internal.h M include/osmocom/gtp/gtp.h M sgsnemu/sgsnemu.c 9 files changed, 75 insertions(+), 51 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/68/36068/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 2644ac5..d64e82f 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -58,6 +58,7 @@ #include "../lib/icmpv6.h" #include "pco.h" #include "ggsn.h" +#include "../gtp/gtp_internal.h" static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what); static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len); diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index a661869..f70daf1 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -42,6 +42,7 @@ #include "ggsn.h" #include "sgsn.h" +#include "../gtp/gtp_internal.h" #define PREFIX_STR "Prefix (Network/Netmask)\n" #define IFCONFIG_STR "GGSN-based interface configuration\n" diff --git a/ggsn/sgsn.c b/ggsn/sgsn.c index 15548ef..b324fd7 100644 --- a/ggsn/sgsn.c +++ b/ggsn/sgsn.c @@ -1,6 +1,6 @@ #include "sgsn.h" #include "ggsn.h" - +#include "../gtp/gtp_internal.h" static bool sgsn_peer_attempt_free(struct sgsn_peer *sgsn) { diff --git a/gtp/Makefile.am b/gtp/Makefile.am index 13d1e18..32f1414 100644 --- a/gtp/Makefile.am +++ b/gtp/Makefile.am @@ -20,6 +20,7 @@ gsn_internal.h \ gtp.c \ gtp.h \ + gtp_internal.h \ gtpie.c \ gtpie.h \ lookupa.c \ diff --git a/gtp/gsn_internal.h b/gtp/gsn_internal.h index deb60c3..732cb17 100644 --- a/gtp/gsn_internal.h +++ b/gtp/gsn_internal.h @@ -1,3 +1,4 @@ #pragma once +#include <osmocom/core/in46_addr.h> void gtp_queue_timer_start(struct gsn_t *gsn); diff --git a/gtp/gtp.c b/gtp/gtp.c index bdf7e7d..f426e6d 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -61,6 +61,7 @@ #include "queue.h" #include "gsn_internal.h" +#include "gtp_internal.h" /* Error reporting functions */ diff --git a/gtp/gtp_internal.h b/gtp/gtp_internal.h new file mode 100644 index 0000000..826ea59 --- /dev/null +++ b/gtp/gtp_internal.h @@ -0,0 +1,52 @@ +#pragma once + +int gtp_echo_resp(struct gsn_t *gsn, int version, + struct sockaddr_in *peer, int fd, + void *pack, unsigned len); +int gtp_echo_ind(struct gsn_t *gsn, int version, + struct sockaddr_in *peer, int fd, + void *pack, unsigned len); +int gtp_echo_conf(struct gsn_t *gsn, int version, + struct sockaddr_in *peer, void *pack, unsigned len); + +int gtp_unsup_req(struct gsn_t *gsn, int version, + struct sockaddr_in *peer, + int fd, void *pack, unsigned len); +int gtp_unsup_ind(struct gsn_t *gsn, struct sockaddr_in *peer, + void *pack, unsigned len); + +int gtp_create_pdp_resp(struct gsn_t *gsn, int version, + struct pdp_t *pdp, uint8_t cause); + +int gtp_create_pdp_ind(struct gsn_t *gsn, int version, + struct sockaddr_in *peer, int fd, + void *pack, unsigned len); + +int gtp_create_pdp_conf(struct gsn_t *gsn, int version, + struct sockaddr_in *peer, + void *pack, unsigned len); + +int gtp_update_pdp_req(struct gsn_t *gsn, int version, void *cbp, + struct in_addr *inetaddr, struct pdp_t *pdp); + +int gtp_delete_pdp_req(struct gsn_t *gsn, int version, void *cbp, + struct pdp_t *pdp); + +int gtp_delete_pdp_resp(struct gsn_t *gsn, int version, + struct sockaddr_in *peer, int fd, + void *pack, unsigned len, + struct pdp_t *pdp, struct pdp_t *linked_pdp, + uint8_t cause, int teardown); + +int gtp_delete_pdp_ind(struct gsn_t *gsn, int version, + struct sockaddr_in *peer, int fd, + void *pack, unsigned len); + +int gtp_delete_pdp_conf(struct gsn_t *gsn, int version, + struct sockaddr_in *peer, + void *pack, unsigned len); + +int ipv42eua(struct ul66_t *eua, struct in_addr *src); +int eua2ipv4(struct in_addr *dst, struct ul66_t *eua); +int in_addr2gsna(struct ul16_t *gsna, struct in_addr *src); +uint64_t gtp_imsi_str2gtp(const char *str); diff --git a/include/osmocom/gtp/gtp.h b/include/osmocom/gtp/gtp.h index 7465cf1..e3c66c9 100644 --- a/include/osmocom/gtp/gtp.h +++ b/include/osmocom/gtp/gtp.h @@ -265,61 +265,12 @@ extern int gtp_decaps0(struct gsn_t *gsn); extern int gtp_decaps1c(struct gsn_t *gsn); extern int gtp_decaps1u(struct gsn_t *gsn); -/* Internal functions (not part of the API) */ extern int gtp_echo_req(struct gsn_t *gsn, int version, void *cbp, struct in_addr *inetaddrs); -extern int gtp_echo_resp(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, - void *pack, unsigned len); -extern int gtp_echo_ind(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, - void *pack, unsigned len); -extern int gtp_echo_conf(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, void *pack, unsigned len); -extern int gtp_unsup_req(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, - int fd, void *pack, unsigned len); -extern int gtp_unsup_ind(struct gsn_t *gsn, struct sockaddr_in *peer, - void *pack, unsigned len); - -extern int gtp_create_pdp_resp(struct gsn_t *gsn, int version, - struct pdp_t *pdp, uint8_t cause); - -extern int gtp_create_pdp_ind(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, - void *pack, unsigned len); - -extern int gtp_create_pdp_conf(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, - void *pack, unsigned len); - -extern int gtp_update_pdp_req(struct gsn_t *gsn, int version, void *cbp, - struct in_addr *inetaddr, struct pdp_t *pdp); - -extern int gtp_delete_pdp_req(struct gsn_t *gsn, int version, void *cbp, - struct pdp_t *pdp); - -extern int gtp_delete_pdp_resp(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, - void *pack, unsigned len, - struct pdp_t *pdp, struct pdp_t *linked_pdp, - uint8_t cause, int teardown); - -extern int gtp_delete_pdp_ind(struct gsn_t *gsn, int version, - struct sockaddr_in *peer, int fd, - void *pack, unsigned len); - -extern int gtp_delete_pdp_conf(struct gsn_t *gsn, int version, - 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); -extern uint64_t gtp_imsi_str2gtp(const char *str); #endif /* !_GTP_H */ diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index de7af4a..152b05b 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -62,6 +62,7 @@ #include "../lib/syserr.h" #include "../lib/netns.h" #include "../lib/icmpv6.h" +#include "../gtp/gtp_internal.h" #include "cmdline.h" #define IPADDRLEN 256 /* Character length of addresses */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/36068?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I72c40cbdec33449ca8104fb3cad8df1a9e07dfd7 Gerrit-Change-Number: 36068 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-ggsn[master]: libgtp: move includes to osmocom/include/gtp
by osmith 23 Feb '24

23 Feb '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/36066?usp=email ) Change subject: libgtp: move includes to osmocom/include/gtp ...................................................................... libgtp: move includes to osmocom/include/gtp Move all includes from /usr/include/….h to /usr/include/osmocom/gtp/….h to be more consistent with other Osmocom projects, and to not "pollute" the top include directory if we add more header files. Also the new directory structure makes more obvious, which headers are public and which ones aren't. Leave stub files in /usr/include/….h that include the files from the new paths, for backwards compatibility. Related: OS#6373 Change-Id: If7e01c61168819bf7120667344e40c857da5490b --- M Makefile.am M configure.ac M ggsn/Makefile.am M ggsn/ggsn.c M ggsn/ggsn.h M ggsn/ggsn_vty.c M ggsn/pco.h M ggsn/sgsn.h M gtp/Makefile.am M gtp/gsn.c M gtp/gtp.c A include/Makefile.am A include/gsn.h A include/gtp.h A include/gtpie.h A include/osmocom/Makefile.am A include/osmocom/gtp/Makefile.am R include/osmocom/gtp/gsn.h R include/osmocom/gtp/gtp.h R include/osmocom/gtp/gtpie.h R include/osmocom/gtp/pdp.h A include/pdp.h M lib/Makefile.am M lib/gtp-kernel.c M lib/icmpv6.c M lib/icmpv6.h M lib/in46_addr.c M lib/in46_addr.h M lib/ippool.h M lib/util.c M sgsnemu/Makefile.am M sgsnemu/sgsnemu.c M tests/gtp/gtpie_test.c 33 files changed, 94 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/66/36066/1 diff --git a/Makefile.am b/Makefile.am index 5db4ac6..f5ec81c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ ## Process this file with automake to produce Makefile.in SUBDIRS = \ + include \ lib \ gtp \ ggsn \ diff --git a/configure.ac b/configure.ac index ae93974..d190059 100644 --- a/configure.ac +++ b/configure.ac @@ -266,6 +266,9 @@ tests/Makefile tests/lib/Makefile tests/gtp/Makefile + include/Makefile + include/osmocom/Makefile + include/osmocom/gtp/Makefile libgtp.pc]) AC_OUTPUT diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index 0c6f334..ad6b2b2 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -7,6 +7,7 @@ -fno-builtin \ -Wall \ -DSBINDIR='"$(sbindir)"' \ + -I$(top_srcdir)/include \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0cd0feb..2644ac5 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -46,14 +46,15 @@ #include <osmocom/ctrl/control_if.h> #include <osmocom/gsm/apn.h> +#include <osmocom/gtp/pdp.h> +#include <osmocom/gtp/gtp.h> + #include "../lib/tun.h" #include "../lib/ippool.h" #include "../lib/syserr.h" #include "../lib/in46_addr.h" #include "../lib/gtp-kernel.h" #include "../lib/util.h" -#include "../gtp/pdp.h" -#include "../gtp/gtp.h" #include "../lib/icmpv6.h" #include "pco.h" #include "ggsn.h" diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h index 1abbc9a..7a3204f 100644 --- a/ggsn/ggsn.h +++ b/ggsn/ggsn.h @@ -8,12 +8,12 @@ #include <osmocom/core/timer.h> #include <osmocom/core/tdef.h> #include <osmocom/ctrl/control_if.h> +#include <osmocom/gtp/gtp.h> #include "../lib/tun.h" #include "../lib/ippool.h" #include "../lib/syserr.h" #include "../lib/in46_addr.h" -#include "../gtp/gtp.h" #include "sgsn.h" diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c index 7414b6a..a661869 100644 --- a/ggsn/ggsn_vty.c +++ b/ggsn/ggsn_vty.c @@ -35,8 +35,8 @@ #include <osmocom/vty/misc.h> #include <osmocom/vty/tdef_vty.h> -#include "../gtp/gtp.h" -#include "../gtp/pdp.h" +#include <osmocom/gtp/gtp.h> +#include <osmocom/gtp/pdp.h> #include "../lib/util.h" diff --git a/ggsn/pco.h b/ggsn/pco.h index 2f95d09..bedfa8a 100644 --- a/ggsn/pco.h +++ b/ggsn/pco.h @@ -2,7 +2,7 @@ #include <stdint.h> -#include "../gtp/pdp.h" +#include <osmocom/gtp/pdp.h> /* 3GPP TS 24.008 10.5.6.3 */ enum pco_protocols { diff --git a/ggsn/sgsn.h b/ggsn/sgsn.h index d2c3c0c..3bc94e3 100644 --- a/ggsn/sgsn.h +++ b/ggsn/sgsn.h @@ -8,7 +8,7 @@ #include <osmocom/core/linuxlist.h> #include <osmocom/core/timer.h> -#include "../gtp/pdp.h" +#include <osmocom/gtp/pdp.h> struct ggsn_ctx; struct pdp_priv_t; diff --git a/gtp/Makefile.am b/gtp/Makefile.am index 666befe..a2631dd 100644 --- a/gtp/Makefile.am +++ b/gtp/Makefile.am @@ -6,12 +6,11 @@ lib_LTLIBRARIES = libgtp.la -include_HEADERS = gtp.h gsn.h pdp.h gtpie.h - AM_CFLAGS = \ -fno-builtin \ -Wall \ -DSBINDIR='"$(sbindir)"' \ + -I$(top_srcdir)/include \ $(LIBOSMOCORE_CFLAGS) \ $(NULL) diff --git a/gtp/gsn.c b/gtp/gsn.c index e66dc99..e326f80 100644 --- a/gtp/gsn.c +++ b/gtp/gsn.c @@ -57,9 +57,10 @@ /* #include <stdint.h> ISO C99 types */ -#include "pdp.h" -#include "gtp.h" -#include "gtpie.h" +#include <osmocom/gtp/pdp.h> +#include <osmocom/gtp/gtp.h> +#include <osmocom/gtp/gtpie.h> + #include "queue.h" /* Error reporting functions */ diff --git a/gtp/gtp.c b/gtp/gtp.c index 43e56b5..8921802 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -55,9 +55,10 @@ /* #include <stdint.h> ISO C99 types */ -#include "pdp.h" -#include "gtp.h" -#include "gtpie.h" +#include <osmocom/gtp/pdp.h> +#include <osmocom/gtp/gtp.h> +#include <osmocom/gtp/gtpie.h> + #include "queue.h" /* Error reporting functions */ diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..d5db322 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,12 @@ +SUBDIRS = \ + osmocom \ + $(NULL) + +# Legacy headers files outside of osmocom/gtp dir. These files are stubs that +# include the files from the proper paths. +include_HEADERS = \ + gsn.h \ + gtp.h \ + gtpie.h \ + pdp.h \ + $(NULL) diff --git a/include/gsn.h b/include/gsn.h new file mode 100644 index 0000000..ef8ba54 --- /dev/null +++ b/include/gsn.h @@ -0,0 +1,2 @@ +#pragma once +#include <osmocom/gtp/gsn.h> diff --git a/include/gtp.h b/include/gtp.h new file mode 100644 index 0000000..8d07b57 --- /dev/null +++ b/include/gtp.h @@ -0,0 +1,2 @@ +#pragma once +#include <osmocom/gtp/gtp.h> diff --git a/include/gtpie.h b/include/gtpie.h new file mode 100644 index 0000000..e69d3fd --- /dev/null +++ b/include/gtpie.h @@ -0,0 +1,2 @@ +#pragma once +#include <osmocom/gtp/gtpie.h> diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am new file mode 100644 index 0000000..2a96bba --- /dev/null +++ b/include/osmocom/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + gtp \ + $(NULL) diff --git a/include/osmocom/gtp/Makefile.am b/include/osmocom/gtp/Makefile.am new file mode 100644 index 0000000..db696e5 --- /dev/null +++ b/include/osmocom/gtp/Makefile.am @@ -0,0 +1,8 @@ +libgtp_HEADERS = \ + gsn.h \ + gtp.h \ + gtpie.h \ + pdp.h \ + $(NULL) + +libgtpdir = $(includedir)/osmocom/gtp diff --git a/gtp/gsn.h b/include/osmocom/gtp/gsn.h similarity index 100% rename from gtp/gsn.h rename to include/osmocom/gtp/gsn.h diff --git a/gtp/gtp.h b/include/osmocom/gtp/gtp.h similarity index 100% rename from gtp/gtp.h rename to include/osmocom/gtp/gtp.h diff --git a/gtp/gtpie.h b/include/osmocom/gtp/gtpie.h similarity index 100% rename from gtp/gtpie.h rename to include/osmocom/gtp/gtpie.h diff --git a/gtp/pdp.h b/include/osmocom/gtp/pdp.h similarity index 100% rename from gtp/pdp.h rename to include/osmocom/gtp/pdp.h diff --git a/include/pdp.h b/include/pdp.h new file mode 100644 index 0000000..304dee5 --- /dev/null +++ b/include/pdp.h @@ -0,0 +1,2 @@ +#pragma once +#include <osmocom/gtp/pdp.h> diff --git a/lib/Makefile.am b/lib/Makefile.am index bef8962..1fdc93f 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -19,6 +19,7 @@ -fno-builtin \ -Wall \ -DSBINDIR='"$(sbindir)"' \ + -I$(top_srcdir)/include \ $(LIBOSMOCORE_CFLAGS) \ $(NULL) diff --git a/lib/gtp-kernel.c b/lib/gtp-kernel.c index 9bfb380..9f2ad65 100644 --- a/lib/gtp-kernel.c +++ b/lib/gtp-kernel.c @@ -23,12 +23,13 @@ #include <time.h> +#include <osmocom/gtp/pdp.h> +#include <osmocom/gtp/gtp.h> + #include "../lib/tun.h" #include "../lib/syserr.h" #include "../lib/util.h" #include "../lib/ippool.h" -#include "../gtp/pdp.h" -#include "../gtp/gtp.h" #include "gtp-kernel.h" diff --git a/lib/icmpv6.c b/lib/icmpv6.c index ac1474d..b6994cd 100644 --- a/lib/icmpv6.c +++ b/lib/icmpv6.c @@ -21,10 +21,11 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/utils.h> -#include "checksum.h" -#include "../gtp/gtp.h" -#include "../gtp/pdp.h" +#include <osmocom/gtp/gtp.h> +#include <osmocom/gtp/pdp.h> + +#include "checksum.h" #include "ippool.h" #include "syserr.h" #include "icmpv6.h" diff --git a/lib/icmpv6.h b/lib/icmpv6.h index ee5ef29..5bed5c6 100644 --- a/lib/icmpv6.h +++ b/lib/icmpv6.h @@ -5,8 +5,8 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/endian.h> -#include "../gtp/gtp.h" -#include "../gtp/pdp.h" +#include <osmocom/gtp/gtp.h> +#include <osmocom/gtp/pdp.h> #define ICMPv6_OPT_TYPE_PREFIX_INFO 0x03 diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 648fe7e..c5157be 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -10,7 +10,7 @@ */ #include "../lib/in46_addr.h" -#include "../gtp/pdp.h" +#include <osmocom/gtp/pdp.h> #include <osmocom/core/utils.h> diff --git a/lib/in46_addr.h b/lib/in46_addr.h index 5589f94..89e1e22 100644 --- a/lib/in46_addr.h +++ b/lib/in46_addr.h @@ -2,7 +2,7 @@ #include <stdint.h> #include <netinet/in.h> -#include "../gtp/pdp.h" +#include <osmocom/gtp/pdp.h> /* a simple wrapper around an in6_addr to also contain the length of the address, * thereby implicitly indicating the address family of the address */ diff --git a/lib/ippool.h b/lib/ippool.h index efb274b..406938e 100644 --- a/lib/ippool.h +++ b/lib/ippool.h @@ -13,7 +13,7 @@ #define _IPPOOL_H #include "../lib/in46_addr.h" -#include "../gtp/gtp.h" +#include <osmocom/gtp/gtp.h> /* Assuming that the address space is fragmented we need a hash table in order to return the addresses. diff --git a/lib/util.c b/lib/util.c index 6bb0d85..f29884a 100644 --- a/lib/util.c +++ b/lib/util.c @@ -9,7 +9,7 @@ * */ -#include "../gtp/pdp.h" +#include <osmocom/gtp/pdp.h> #include "ippool.h" #include "in46_addr.h" diff --git a/sgsnemu/Makefile.am b/sgsnemu/Makefile.am index 7e7fdbb..5d88c7f 100644 --- a/sgsnemu/Makefile.am +++ b/sgsnemu/Makefile.am @@ -7,6 +7,7 @@ -fno-builtin \ -Wall \ -DSBINDIR='"$(sbindir)"' \ + -I$(top_srcdir)/include \ $(LIBOSMOCORE_CFLAGS) \ $(NULL) diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 7893f4f..de7af4a 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -54,13 +54,14 @@ #endif // HAVE_IN6_ADDR_GEN_MODE_NONE #endif +#include <osmocom/gtp/pdp.h> +#include <osmocom/gtp/gtp.h> + #include "../lib/tun.h" #include "../lib/ippool.h" #include "../lib/syserr.h" #include "../lib/netns.h" #include "../lib/icmpv6.h" -#include "../gtp/pdp.h" -#include "../gtp/gtp.h" #include "cmdline.h" #define IPADDRLEN 256 /* Character length of addresses */ diff --git a/tests/gtp/gtpie_test.c b/tests/gtp/gtpie_test.c index ed1f26e..46c0a98 100644 --- a/tests/gtp/gtpie_test.c +++ b/tests/gtp/gtpie_test.c @@ -10,8 +10,9 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/bits.h> +#include <osmocom/gtp/gtpie.h> + #include "../../lib/syserr.h" -#include "../../gtp/gtpie.h" static const uint8_t in[] = { 1,2,3,4,5,6 }; static uint8_t buf[256]; -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/36066?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: If7e01c61168819bf7120667344e40c857da5490b Gerrit-Change-Number: 36066 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: Change struct osmo_io_ops to contain struct, not union
by pespin 23 Feb '24

23 Feb '24
Attention is currently required from: daniel, jolly, laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/36062?usp=email ) Change subject: osmo_io: Change struct osmo_io_ops to contain struct, not union ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: I think I already provided my opinion on this previously, I see no need to change it to struct, but if others feel more secure doing that, I won't oppose. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36062?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I9d302df8d00369e7b30437a52deb205f75882be3 Gerrit-Change-Number: 36062 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Fri, 23 Feb 2024 15:57:32 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: osmo_io: Change struct osmo_io_ops to contain struct, not union
by laforge 23 Feb '24

23 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/36062?usp=email ) Change subject: osmo_io: Change struct osmo_io_ops to contain struct, not union ...................................................................... osmo_io: Change struct osmo_io_ops to contain struct, not union As we introduce more modes, and each mode aliases call-back function pointers to those of another mode, we have more and more error cases where we (for exampele) access read_cb, but in reality the user has populated recvfrom_cb. Let's use a struct, meaning that call-backs of one mode no longer alias to the same memory locations of call-backs fro another mode. This allows us to properly check if the user actually provided the right callbacks for the given mode of the iofd. This breaks ABI, but luckily not API. So a simple recompile of higher-layer library + application code will work. Change-Id: I9d302df8d00369e7b30437a52deb205f75882be3 --- M TODO-RELEASE M include/osmocom/core/osmo_io.h M src/core/osmo_io.c M src/core/osmo_io_poll.c 4 files changed, 96 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/62/36062/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index a8e812b..3e75184 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -12,6 +12,8 @@ core ADD osmo_sock_sctp_get_peer_addr_info() core ADD gsmtap_inst_fd2() core, DEPRECATE gsmtap_inst_fd() core behavior change osmo_tdef_fsm_inst_state_chg(): allow millisecond precision +core ABI change osmo_io_ops now contains a struct of structs, not union of structs +core ABI change osmo_iofd_set_ioops() now returns a value (error code) isdn ABI change add states and flags for external T200 handling isdn ADD initial implementation of the V.110 Terminal Adapter gsm ABI change add T200 timer states to lapdm_datalink diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h index 46e1a53..3c704be 100644 --- a/include/osmocom/core/osmo_io.h +++ b/include/osmocom/core/osmo_io.h @@ -35,37 +35,35 @@ { return get_value_string(osmo_io_backend_names, val); } struct osmo_io_ops { - union { - /* mode OSMO_IO_FD_MODE_READ_WRITE: */ - struct { - /*! call-back function when something was read from fd */ - void (*read_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg); - /*! call-back function when write has completed on fd */ - void (*write_cb)(struct osmo_io_fd *iofd, int res, - struct msgb *msg); - /*! call-back function to segment the data at message boundaries. - * Needs to return the size of the next message. If it returns - * -EAGAIN or a value larger than msgb_length() (message is incomplete) - * osmo_io will wait for more data to be read. Other negative values - * cause the msg to be discarded. - * If a full message was received (segmentation_cb() returns a value <= msgb_length()) - * the msgb will be trimmed to size by osmo_io and forwarded to the read call-back. Any - * parsing done to the msgb by segmentation_cb() will be preserved for the read_cb() - * (e.g. setting lxh or msgb->cb). */ - int (*segmentation_cb)(struct msgb *msg); - }; + /* mode OSMO_IO_FD_MODE_READ_WRITE: */ + struct { + /*! call-back function when something was read from fd */ + void (*read_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg); + /*! call-back function when write has completed on fd */ + void (*write_cb)(struct osmo_io_fd *iofd, int res, + struct msgb *msg); + /*! call-back function to segment the data at message boundaries. + * Needs to return the size of the next message. If it returns + * -EAGAIN or a value larger than msgb_length() (message is incomplete) + * osmo_io will wait for more data to be read. Other negative values + * cause the msg to be discarded. + * If a full message was received (segmentation_cb() returns a value <= msgb_length()) + * the msgb will be trimmed to size by osmo_io and forwarded to the read call-back. Any + * parsing done to the msgb by segmentation_cb() will be preserved for the read_cb() + * (e.g. setting lxh or msgb->cb). */ + int (*segmentation_cb)(struct msgb *msg); + }; - /* mode OSMO_IO_FD_MODE_RECVFROM_SENDTO: */ - struct { - /*! call-back function emulating recvfrom */ - void (*recvfrom_cb)(struct osmo_io_fd *iofd, int res, - struct msgb *msg, - const struct osmo_sockaddr *saddr); - /*! call-back function emulating sendto */ - void (*sendto_cb)(struct osmo_io_fd *iofd, int res, - struct msgb *msg, - const struct osmo_sockaddr *daddr); - }; + /* mode OSMO_IO_FD_MODE_RECVFROM_SENDTO: */ + struct { + /*! call-back function emulating recvfrom */ + void (*recvfrom_cb)(struct osmo_io_fd *iofd, int res, + struct msgb *msg, + const struct osmo_sockaddr *saddr); + /*! call-back function emulating sendto */ + void (*sendto_cb)(struct osmo_io_fd *iofd, int res, + struct msgb *msg, + const struct osmo_sockaddr *daddr); }; }; @@ -98,4 +96,4 @@ const char *osmo_iofd_get_name(const struct osmo_io_fd *iofd); void osmo_iofd_set_name(struct osmo_io_fd *iofd, const char *name); -void osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops); +int osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops); diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index e059f87..9de9e2e 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -306,6 +306,8 @@ int res; struct msgb *pending = NULL; + OSMO_ASSERT(iofd->mode == OSMO_IO_FD_MODE_READ_WRITE); + if (rc <= 0) { iofd->io_ops.read_cb(iofd, rc, msg); return; @@ -473,6 +475,24 @@ return 0; } +static int check_mode_callback_compat(enum osmo_io_fd_mode mode, const struct osmo_io_ops *ops) +{ + switch (mode) { + case OSMO_IO_FD_MODE_READ_WRITE: + if (ops->recvfrom_cb || ops->sendto_cb) + return false; + break; + case OSMO_IO_FD_MODE_RECVFROM_SENDTO: + if (ops->read_cb || ops->write_cb) + return false; + break; + default: + break; + } + + return true; +} + /*! Allocate and setup a new iofd. * \param[in] ctx the parent context from which to allocate * \param[in] fd the underlying system file descriptor @@ -496,6 +516,9 @@ return NULL; } + if (!check_mode_callback_compat(mode, ioops)) + return NULL; + iofd = talloc_zero(ctx, struct osmo_io_fd); if (!iofd) return NULL; @@ -543,8 +566,10 @@ return rc; IOFD_FLAG_UNSET(iofd, IOFD_FLAG_CLOSED); - if (iofd->io_ops.read_cb) + if ((iofd->mode == OSMO_IO_FD_MODE_READ_WRITE && iofd->io_ops.read_cb) || + (iofd->mode == OSMO_IO_FD_MODE_RECVFROM_SENDTO && iofd->io_ops.recvfrom_cb)) { osmo_iofd_ops.read_enable(iofd); + } if (iofd->tx_queue.current_length > 0) osmo_iofd_ops.write_enable(iofd); @@ -722,8 +747,11 @@ /*! Set the osmo_io_ops for an iofd. * \param[in] iofd Target iofd file descriptor * \param[in] ioops osmo_io_ops structure to be set */ -void osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops) +int osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops) { + if (!check_mode_callback_compat(iofd->mode, ioops)) + return -EINVAL; + iofd->io_ops = *ioops; switch (iofd->mode) { @@ -743,6 +771,8 @@ default: OSMO_ASSERT(0); } + + return 0; } /*! Notify the user if/when the socket is connected. diff --git a/src/core/osmo_io_poll.c b/src/core/osmo_io_poll.c index 5000dca..d7f80c0 100644 --- a/src/core/osmo_io_poll.c +++ b/src/core/osmo_io_poll.c @@ -81,10 +81,18 @@ rc = sendmsg(ofd->fd, &msghdr->hdr, msghdr->flags); iofd_handle_send_completion(iofd, rc, msghdr); } else { - if (iofd->mode == OSMO_IO_FD_MODE_READ_WRITE) - /* Socket is writable, but we have no data to send. A non-blocking/async - connect() is signalled this way. */ + /* Socket is writable, but we have no data to send. A non-blocking/async + connect() is signalled this way. */ + switch (iofd->mode) { + case OSMO_IO_FD_MODE_READ_WRITE: iofd->io_ops.write_cb(iofd, 0, NULL); + break; + case OSMO_IO_FD_MODE_RECVFROM_SENDTO: + iofd->io_ops.sendto_cb(iofd, 0, NULL, NULL); + break; + default: + break; + } if (osmo_iofd_txqueue_len(iofd) == 0) iofd_poll_ops.write_disable(iofd); } -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36062?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I9d302df8d00369e7b30437a52deb205f75882be3 Gerrit-Change-Number: 36062 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in ...osmo-epdg[master]: Use osmocom gtplib pointing to newer version of code
by pespin 23 Feb '24

23 Feb '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36052?usp=email ) Change subject: Use osmocom gtplib pointing to newer version of code ...................................................................... Use osmocom gtplib pointing to newer version of code Change-Id: Iaf2e195aaeac6d1b157a4b0dd6cd3d80deaa1308 --- M rebar.config M rebar.lock 2 files changed, 12 insertions(+), 6 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/rebar.config b/rebar.config index 8541410..1dd0b08 100644 --- a/rebar.config +++ b/rebar.config @@ -4,7 +4,7 @@ {deps, [ {lager, {git, "https://github.com/erlang-lager/lager", {tag, "3.9.2"}}}, - {gtplib, "3.2.0"}, + {gtplib, {git, "https://github.com/osmocom/gtplib", {branch, "osmocom/master"}}}, {gtp_u_kmod, {git, "https://github.com/osmocom/gtp_u_kmod", {branch, "osmocom/master"}}}, {osmo_ss7, {git, "https://gitea.osmocom.org/erlang/osmo_ss7", {ref, "9f294d3612f998860004820d1d85b4264721577b"}}}, {osmo_gsup, {git, "https://gerrit.osmocom.org/erlang/osmo_gsup", {branch, "osmocom/epdg"}}} diff --git a/rebar.lock b/rebar.lock index 0a492b3..da93a4f 100644 --- a/rebar.lock +++ b/rebar.lock @@ -21,21 +21,20 @@ {git,"https://github.com/osmocom/gtp_u_kmod", {ref,"b3656ebb11528a2db3171dbf94f1a8bf0d6ffd00"}}, 0}, - {<<"gtplib">>,{pkg,<<"gtplib">>,<<"3.2.0">>},0}, {<<"lager">>, {git,"https://github.com/erlang-lager/lager", {ref,"459a3b2cdd9eadd29e5a7ce5c43932f5ccd6eb88"}}, 0}, {<<"osmo_gsup">>, {git,"https://gerrit.osmocom.org/erlang/osmo_gsup", - {ref,"1391d074f610e736368319d56fd958fa36e3addf"}}, + {ref,"25ace76f98f7f931691fb02d86667062b4f2c8ad"}}, 0}, {<<"osmo_ss7">>, {git,"https://gitea.osmocom.org/erlang/osmo_ss7", {ref,"9f294d3612f998860004820d1d85b4264721577b"}}, 0}, {<<"parse_trans">>, - {git,"https://github.com/uwiger/parse_trans", + {git,"https://github.com/uwiger/parse_trans.git", {ref,"d99fb36755c813a5db23e6f93741aa58323ef911"}}, 1}, {<<"pkt">>, @@ -47,11 +46,9 @@ {pkg_hash,[ {<<"cut">>, <<"1577F2F3BC0F2BF3B97903B7426F8A3D79523687B6A444D0F59A095EF69A0E81">>}, {<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>}, - {<<"gtplib">>, <<"41E8E14BE21DD6E08B2CBB9D708BCF8FDD47CA49D7FFA480219CAB29F5AE2760">>}, {<<"ppplib">>, <<"F9EC2690532BAF590277A305A2276FCFAD0285557E1055552F8A2FCAF1BF081A">>}]}, {pkg_hash_ext,[ {<<"cut">>, <<"1A4A25DB2B7C5565FD28B314A4EEB898B1ED3CAFFA1AB09149345FB5731ED04B">>}, {<<"goldrush">>, <<"99CB4128CFFCB3227581E5D4D803D5413FA643F4EB96523F77D9E6937D994CEB">>}, - {<<"gtplib">>, <<"264626E6993C17B00CA3C083B9BF23D16B88BEEDDDE35F62C954832C21B57AEF">>}, {<<"ppplib">>, <<"32440D630F55DD29F849847DD8F15F69175FDDC210AA88517AC8AD2854CD6FA1">>}]} ]. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36052?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: erlang/osmo-epdg Gerrit-Branch: master Gerrit-Change-Id: Iaf2e195aaeac6d1b157a4b0dd6cd3d80deaa1308 Gerrit-Change-Number: 36052 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: lynxis lazus <lynxis(a)fe80.eu> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • ...
  • 175
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.