gerrit-log
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
November 2022
- 2 participants
- 2503 discussions
Change in osmo-hnbgw[master]: vty: Fix timers not printed when dumping running-config
by pespin 03 Nov '22
by pespin 03 Nov '22
03 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29968 )
Change subject: vty: Fix timers not printed when dumping running-config
......................................................................
vty: Fix timers not printed when dumping running-config
Change-Id: I129bf412cd4b74e9f515411ef8f812a8261e57b2
---
M src/osmo-hnbgw/hnbgw_vty.c
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/osmo-hnbgw/hnbgw_vty.c b/src/osmo-hnbgw/hnbgw_vty.c
index 2228260..5c2c42d 100644
--- a/src/osmo-hnbgw/hnbgw_vty.c
+++ b/src/osmo-hnbgw/hnbgw_vty.c
@@ -416,6 +416,7 @@
VTY_NEWLINE);
if (g_hnb_gw->config.max_sccp_cr_payload_len != 999999)
vty_out(vty, " sccp cr max-payload-len %u%s", g_hnb_gw->config.max_sccp_cr_payload_len, VTY_NEWLINE);
+ osmo_tdef_vty_groups_write(vty, " ");
return CMD_SUCCESS;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29968
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I129bf412cd4b74e9f515411ef8f812a8261e57b2
Gerrit-Change-Number: 29968
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
1
0
03 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/29965 )
Change subject: Split gsn_t related APIs out of gtp.{c,h}
......................................................................
Split gsn_t related APIs out of gtp.{c,h}
This way we split the gsn_t object API/logic from the protocol (message
handling) code.
Change-Id: I47cebb51bf08b9fcf7f115fc8dbea5f3493d4388
---
M gtp/Makefile.am
A gtp/gsn.c
A gtp/gsn.h
M gtp/gtp.c
M gtp/gtp.h
5 files changed, 710 insertions(+), 611 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved; Verified
diff --git a/gtp/Makefile.am b/gtp/Makefile.am
index 50c582c..77f81cf 100644
--- a/gtp/Makefile.am
+++ b/gtp/Makefile.am
@@ -6,10 +6,10 @@
lib_LTLIBRARIES = libgtp.la
-include_HEADERS = gtp.h pdp.h gtpie.h
+include_HEADERS = gtp.h gsn.h pdp.h gtpie.h
AM_CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb $(LIBOSMOCORE_CFLAGS)
-libgtp_la_SOURCES = gtp.c gtp.h gtpie.c gtpie.h pdp.c pdp.h lookupa.c lookupa.h queue.c queue.h
+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
libgtp_la_LIBADD = $(LIBOSMOCORE_LIBS)
diff --git a/gtp/gsn.c b/gtp/gsn.c
new file mode 100644
index 0000000..8fb0fdb
--- /dev/null
+++ b/gtp/gsn.c
@@ -0,0 +1,536 @@
+/*
+ * OsmoGGSN - Gateway GPRS Support Node
+ * Copyright (C) 2002, 2003, 2004 Mondru AB.
+ * Copyright (C) 2010-2011, 2016-2017 Harald Welte <laforge(a)gnumonks.org>
+ * Copyright (C) 2015-2017 sysmocom - s.f.m.c. GmbH
+ *
+ * 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.
+ *
+ */
+
+/*
+ * gtp.c: Contains all GTP functionality. Should be able to handle multiple
+ * tunnels in the same program.
+ *
+ * TODO:
+ * - Do we need to handle fragmentation?
+ */
+
+#ifdef __linux__
+#define _GNU_SOURCE 1
+#endif
+
+#include <osmocom/core/logging.h>
+#include <osmocom/core/utils.h>
+
+#if defined(__FreeBSD__)
+#include <sys/endian.h>
+#endif
+
+#include "../config.h"
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+
+#include <arpa/inet.h>
+
+/* #include <stdint.h> ISO C99 types */
+
+#include "pdp.h"
+#include "gtp.h"
+#include "gtpie.h"
+#include "queue.h"
+
+/* According to section 14.2 of 3GPP TS 29.006 version 6.9.0 */
+#define N3_REQUESTS 5
+
+#define T3_REQUEST 3
+
+/* Error reporting functions */
+
+#define LOGP_WITH_ADDR(ss, level, addr, fmt, args...) \
+ LOGP(ss, level, "addr(%s:%d) " fmt, \
+ inet_ntoa((addr).sin_addr), htons((addr).sin_port), \
+ ##args);
+
+/* API Functions */
+
+/* Deprecated, use gtp_pdp_newpdp() instead */
+int gtp_newpdp(struct gsn_t *gsn, struct pdp_t **pdp,
+ uint64_t imsi, uint8_t nsapi)
+{
+ int rc;
+ rc = gtp_pdp_newpdp(gsn, pdp, imsi, nsapi, NULL);
+ return rc;
+}
+
+int gtp_freepdp(struct gsn_t *gsn, struct pdp_t *pdp)
+{
+ if (gsn->cb_delete_context)
+ gsn->cb_delete_context(pdp);
+ return pdp_freepdp(pdp);
+}
+
+/* Free pdp and all its secondary PDP contexts. Must be called on the primary PDP context. */
+int gtp_freepdp_teardown(struct gsn_t *gsn, struct pdp_t *pdp)
+{
+ int n;
+ struct pdp_t *secondary_pdp;
+ OSMO_ASSERT(!pdp->secondary);
+
+ for (n = 0; n < PDP_MAXNSAPI; n++) {
+ if (pdp->secondary_tei[n]) {
+ if (gtp_pdp_getgtp1(gsn, &secondary_pdp,
+ pdp->secondary_tei[n])) {
+ LOGP(DLGTP, LOGL_ERROR,
+ "Unknown secondary PDP context\n");
+ continue;
+ }
+ if (pdp != secondary_pdp) {
+ gtp_freepdp(gsn, secondary_pdp);
+ }
+ }
+ }
+
+ return gtp_freepdp(gsn, pdp);
+}
+
+/* gtp_gpdu */
+
+extern int gtp_fd(struct gsn_t *gsn)
+{
+ return gsn->fd0;
+}
+
+int gtp_set_cb_unsup_ind(struct gsn_t *gsn,
+ int (*cb) (struct sockaddr_in * peer))
+{
+ gsn->cb_unsup_ind = cb;
+ return 0;
+}
+
+int gtp_set_cb_extheader_ind(struct gsn_t *gsn,
+ int (*cb) (struct sockaddr_in * peer))
+{
+ gsn->cb_extheader_ind = cb;
+ return 0;
+}
+
+int gtp_set_cb_ran_info_relay_ind(struct gsn_t *gsn,
+ int (*cb) (struct sockaddr_in * peer, union gtpie_member **ie))
+{
+ gsn->cb_ran_info_relay_ind = cb;
+ return 0;
+}
+
+/* API: Initialise delete context callback */
+/* Called whenever a pdp context is deleted for any reason */
+int gtp_set_cb_delete_context(struct gsn_t *gsn, int (*cb) (struct pdp_t * pdp))
+{
+ gsn->cb_delete_context = cb;
+ return 0;
+}
+
+int gtp_set_cb_conf(struct gsn_t *gsn,
+ int (*cb) (int type, int cause,
+ struct pdp_t * pdp, void *cbp))
+{
+ gsn->cb_conf = cb;
+ return 0;
+}
+
+int gtp_set_cb_recovery(struct gsn_t *gsn,
+ int (*cb) (struct sockaddr_in * peer, uint8_t recovery))
+{
+ gsn->cb_recovery = cb;
+ return 0;
+}
+
+/* cb_recovery()
+ * pdp may be NULL if Recovery IE was received from a message independent
+ * of any PDP ctx (such as Echo Response), or because pdp ctx is unknown to the
+ * local setup. In case pdp is known, caller may want to keep that pdp alive to
+ * handle subsequent msg cb as this specific pdp ctx is still valid according to
+ * specs.
+ */
+int gtp_set_cb_recovery2(struct gsn_t *gsn,
+ int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery))
+{
+ gsn->cb_recovery2 = cb_recovery2;
+ return 0;
+}
+
+/* cb_recovery()
+ * pdp may be NULL if Recovery IE was received from a message independent
+ * of any PDP ctx (such as Echo Response), or because pdp ctx is unknown to the
+ * local setup. In case pdp is known, caller may want to keep that pdp alive to
+ * handle subsequent msg cb as this specific pdp ctx is still valid according to
+ * specs.
+ */
+int gtp_set_cb_recovery3(struct gsn_t *gsn,
+ int (*cb_recovery3) (struct gsn_t *gsn, struct sockaddr_in *peer,
+ struct pdp_t *pdp, uint8_t recovery))
+{
+ gsn->cb_recovery3 = cb_recovery3;
+ return 0;
+}
+
+int gtp_set_cb_data_ind(struct gsn_t *gsn,
+ int (*cb_data_ind) (struct pdp_t * pdp,
+ void *pack, unsigned len))
+{
+ gsn->cb_data_ind = cb_data_ind;
+ return 0;
+}
+
+static int queue_timer_retrans(struct gsn_t *gsn)
+{
+ /* Retransmit any outstanding packets */
+ /* Remove from queue if maxretrans exceeded */
+ time_t now;
+ struct qmsg_t *qmsg;
+ now = time(NULL);
+
+ /* get first element in queue, as long as the timeout of that
+ * element has expired */
+ while ((!queue_getfirst(gsn->queue_req, &qmsg)) &&
+ (qmsg->timeout <= now)) {
+ if (qmsg->retrans > N3_REQUESTS) { /* Too many retrans */
+ LOGP(DLGTP, LOGL_NOTICE, "Retransmit req queue timeout of seq %" PRIu16 "\n",
+ qmsg->seq);
+ if (gsn->cb_conf)
+ gsn->cb_conf(qmsg->type, EOF, NULL, qmsg->cbp);
+ queue_freemsg(gsn->queue_req, qmsg);
+ } else {
+ LOGP(DLGTP, LOGL_INFO, "Retransmit (%d) of seq %" PRIu16 "\n",
+ qmsg->retrans, qmsg->seq);
+ if (sendto(qmsg->fd, &qmsg->p, qmsg->l, 0,
+ (struct sockaddr *)&qmsg->peer,
+ sizeof(struct sockaddr_in)) < 0) {
+ gsn->err_sendto++;
+ LOGP(DLGTP, LOGL_ERROR,
+ "Sendto(fd0=%d, msg=%lx, len=%d) failed: Error = %s\n",
+ gsn->fd0, (unsigned long)&qmsg->p,
+ qmsg->l, strerror(errno));
+ }
+ queue_back(gsn->queue_req, qmsg);
+ qmsg->timeout = now + T3_REQUEST;
+ qmsg->retrans++;
+ }
+ }
+
+ /* Also clean up reply timeouts */
+ while ((!queue_getfirst(gsn->queue_resp, &qmsg)) &&
+ (qmsg->timeout < now)) {
+ LOGP(DLGTP, LOGL_DEBUG, "Retransmit resp queue seq %"
+ PRIu16 " expired, removing from queue\n", qmsg->seq);
+ queue_freemsg(gsn->queue_resp, qmsg);
+ }
+
+ return 0;
+}
+
+static int queue_timer_retranstimeout(struct gsn_t *gsn, struct timeval *timeout)
+{
+ time_t now, later, diff;
+ struct qmsg_t *qmsg;
+ timeout->tv_usec = 0;
+
+ if (queue_getfirst(gsn->queue_req, &qmsg)) {
+ timeout->tv_sec = 10;
+ } else {
+ now = time(NULL);
+ later = qmsg->timeout;
+ timeout->tv_sec = later - now;
+ if (timeout->tv_sec < 0)
+ timeout->tv_sec = 0; /* No negative allowed */
+ if (timeout->tv_sec > 10)
+ timeout->tv_sec = 10; /* Max sleep for 10 sec */
+ }
+
+ if (queue_getfirst(gsn->queue_resp, &qmsg)) {
+ /* already set by queue_req, do nothing */
+ } else { /* trigger faster if earlier timeout exists in queue_resp */
+ now = time(NULL);
+ later = qmsg->timeout;
+ diff = later - now;
+ if (diff < 0)
+ diff = 0;
+ if (diff < timeout->tv_sec)
+ timeout->tv_sec = diff;
+ }
+
+ return 0;
+}
+
+void gtp_queue_timer_start(struct gsn_t *gsn)
+{
+ struct timeval next;
+
+ /* Retrieve next retransmission as timeval */
+ queue_timer_retranstimeout(gsn, &next);
+
+ /* re-schedule the timer */
+ osmo_timer_schedule(&gsn->queue_timer, next.tv_sec, next.tv_usec/1000);
+}
+
+/* timer callback for libgtp retransmission and ping */
+static void queue_timer_cb(void *data)
+{
+ struct gsn_t *gsn = data;
+
+ /* do all the retransmissions as needed */
+ queue_timer_retrans(gsn);
+
+ gtp_queue_timer_start(gsn);
+}
+
+
+/**
+ * @brief clear the request and response queue. Useful for debugging to reset "some" state.
+ * @param gsn The GGSN instance
+ */
+void gtp_clear_queues(struct gsn_t *gsn)
+{
+ struct qmsg_t *qmsg;
+
+ LOGP(DLGTP, LOGL_INFO, "Clearing req & resp retransmit queues\n");
+ while (!queue_getfirst(gsn->queue_req, &qmsg)) {
+ queue_freemsg(gsn->queue_req, qmsg);
+ }
+
+ while (!queue_getfirst(gsn->queue_resp, &qmsg)) {
+ queue_freemsg(gsn->queue_resp, qmsg);
+ }
+}
+
+/* Perform restoration and recovery error handling as described in 29.060 */
+static void log_restart(struct gsn_t *gsn)
+{
+ FILE *f;
+ int i, rc;
+ int counter = 0;
+ char *filename;
+
+ filename = talloc_asprintf(NULL, "%s/%s", gsn->statedir, RESTART_FILE);
+ OSMO_ASSERT(filename);
+
+ /* We try to open file. On failure we will later try to create file */
+ if (!(f = fopen(filename, "r"))) {
+ LOGP(DLGTP, LOGL_NOTICE,
+ "State information file (%s) not found. Creating new file.\n",
+ filename);
+ } else {
+ rc = fscanf(f, "%d", &counter);
+ if (rc != 1) {
+ LOGP(DLGTP, LOGL_ERROR,
+ "fscanf failed to read counter value\n");
+ goto close_file;
+ }
+ if (fclose(f)) {
+ LOGP(DLGTP, LOGL_ERROR,
+ "fclose failed: Error = %s\n", strerror(errno));
+ }
+ }
+
+ gsn->restart_counter = (unsigned char)counter;
+ gsn->restart_counter++;
+
+ /* Keep the umask closely wrapped around our fopen() call in case the
+ * log outputs cause file creation. */
+ i = umask(022);
+ f = fopen(filename, "w");
+ umask(i);
+ if (!f) {
+ LOGP(DLGTP, LOGL_ERROR,
+ "fopen(path=%s, mode=%s) failed: Error = %s\n", filename,
+ "w", strerror(errno));
+ goto free_filename;
+ }
+
+ fprintf(f, "%d\n", gsn->restart_counter);
+close_file:
+ if (fclose(f))
+ LOGP(DLGTP, LOGL_ERROR,
+ "fclose failed: Error = %s\n", strerror(errno));
+free_filename:
+ talloc_free(filename);
+}
+
+int gtp_new(struct gsn_t **gsn, char *statedir, struct in_addr *listen,
+ int mode)
+{
+ struct sockaddr_in addr;
+
+ LOGP(DLGTP, LOGL_NOTICE, "GTP: gtp_newgsn() started at %s\n", inet_ntoa(*listen));
+
+ *gsn = calloc(sizeof(struct gsn_t), 1); /* TODO */
+
+ (*gsn)->statedir = statedir;
+ log_restart(*gsn);
+
+ /* Initialise sequence number */
+ (*gsn)->seq_next = (*gsn)->restart_counter * 1024;
+
+ /* Initialise request retransmit queue */
+ queue_new(&(*gsn)->queue_req);
+ queue_new(&(*gsn)->queue_resp);
+
+ /* Initialise pdp table */
+ pdp_init(*gsn);
+
+ /* Initialize internal queue timer */
+ osmo_timer_setup(&(*gsn)->queue_timer, queue_timer_cb, *gsn);
+
+ /* Initialise call back functions */
+ (*gsn)->cb_create_context_ind = 0;
+ (*gsn)->cb_delete_context = 0;
+ (*gsn)->cb_unsup_ind = 0;
+ (*gsn)->cb_conf = 0;
+ (*gsn)->cb_data_ind = 0;
+
+ /* Store function parameters */
+ (*gsn)->gsnc = *listen;
+ (*gsn)->gsnu = *listen;
+ (*gsn)->mode = mode;
+
+ /* Create GTP version 0 socket */
+ if (((*gsn)->fd0 = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ (*gsn)->err_socket++;
+ LOGP(DLGTP, LOGL_ERROR,
+ "GTPv0 socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n",
+ AF_INET, SOCK_DGRAM, 0, strerror(errno));
+ return -errno;
+ }
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_addr = *listen; /* Same IP for user traffic and signalling */
+ addr.sin_port = htons(GTP0_PORT);
+#if defined(__FreeBSD__) || defined(__APPLE__)
+ addr.sin_len = sizeof(addr);
+#endif
+
+ if (bind((*gsn)->fd0, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
+ (*gsn)->err_socket++;
+ LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr,
+ "bind(fd0=%d) failed: Error = %s\n",
+ (*gsn)->fd0, strerror(errno));
+ return -errno;
+ }
+
+ /* Create GTP version 1 control plane socket */
+ if (((*gsn)->fd1c = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ (*gsn)->err_socket++;
+ LOGP(DLGTP, LOGL_ERROR,
+ "GTPv1 control plane socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n",
+ AF_INET, SOCK_DGRAM, 0, strerror(errno));
+ return -errno;
+ }
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_addr = *listen; /* Same IP for user traffic and signalling */
+ addr.sin_port = htons(GTP1C_PORT);
+#if defined(__FreeBSD__) || defined(__APPLE__)
+ addr.sin_len = sizeof(addr);
+#endif
+
+ if (bind((*gsn)->fd1c, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
+ (*gsn)->err_socket++;
+ LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr,
+ "bind(fd1c=%d) failed: Error = %s\n",
+ (*gsn)->fd1c, strerror(errno));
+ return -errno;
+ }
+
+ /* Create GTP version 1 user plane socket */
+ if (((*gsn)->fd1u = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ (*gsn)->err_socket++;
+ LOGP(DLGTP, LOGL_ERROR,
+ "GTPv1 user plane socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n",
+ AF_INET, SOCK_DGRAM, 0, strerror(errno));
+ return -errno;
+ }
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_addr = *listen; /* Same IP for user traffic and signalling */
+ addr.sin_port = htons(GTP1U_PORT);
+#if defined(__FreeBSD__) || defined(__APPLE__)
+ addr.sin_len = sizeof(addr);
+#endif
+
+ if (bind((*gsn)->fd1u, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
+ (*gsn)->err_socket++;
+ LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr,
+ "bind(fd1u=%d) failed: Error = %s\n",
+ (*gsn)->fd1u, strerror(errno));
+ return -errno;
+ }
+
+ /* Start internal queue timer */
+ gtp_queue_timer_start(*gsn);
+
+ return 0;
+}
+
+int gtp_free(struct gsn_t *gsn)
+{
+
+ /* Cleanup internal queue timer */
+ osmo_timer_del(&gsn->queue_timer);
+
+ /* Clean up retransmit queues */
+ queue_free(gsn->queue_req);
+ queue_free(gsn->queue_resp);
+
+ close(gsn->fd0);
+ close(gsn->fd1c);
+ close(gsn->fd1u);
+
+ free(gsn);
+ return 0;
+}
+
+/* API: Register create context indication callback */
+int gtp_set_cb_create_context_ind(struct gsn_t *gsn,
+ int (*cb_create_context_ind) (struct pdp_t *
+ pdp))
+{
+ gsn->cb_create_context_ind = cb_create_context_ind;
+ return 0;
+}
+
+int gtp_retrans(struct gsn_t *gsn)
+{
+ /* dummy API, deprecated. */
+ return 0;
+}
+
+int gtp_retranstimeout(struct gsn_t *gsn, struct timeval *timeout)
+{
+ timeout->tv_sec = 24*60*60;
+ timeout->tv_usec = 0;
+ /* dummy API, deprecated. Return a huge timer to do nothing */
+ return 0;
+}
\ No newline at end of file
diff --git a/gtp/gsn.h b/gtp/gsn.h
new file mode 100644
index 0000000..18a6d58
--- /dev/null
+++ b/gtp/gsn.h
@@ -0,0 +1,167 @@
+/*
+ * OsmoGGSN - Gateway GPRS Support Node
+ * Copyright (C) 2002, 2003, 2004 Mondru AB.
+ *
+ * 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.
+ *
+ */
+
+#ifndef _GSN_H
+#define _GSN_H
+
+#include <osmocom/core/utils.h>
+#include <osmocom/core/defs.h>
+#include <osmocom/core/timer.h>
+
+#include "pdp.h"
+
+#define GTP_MODE_GGSN 1
+#define GTP_MODE_SGSN 2
+
+#define RESTART_FILE "gsn_restart"
+
+/* ***********************************************************
+ * Information storage for each gsn instance
+ *
+ * Normally each instance of the application corresponds to
+ * one instance of a gsn.
+ *
+ * In order to avoid global variables in the application, and
+ * also in order to allow several instances of a gsn in the same
+ * application this struct is provided in order to store all
+ * relevant information related to the gsn.
+ *
+ * Note that this does not include information storage for '
+ * each pdp context. This is stored in another struct.
+ *************************************************************/
+
+struct gsn_t {
+ /* Parameters related to the network interface */
+
+ int fd0; /* GTP0 file descriptor */
+ int fd1c; /* GTP1 control plane file descriptor */
+ int fd1u; /* GTP0 user plane file descriptor */
+ int mode; /* Mode of operation: GGSN or SGSN */
+ struct in_addr gsnc; /* IP address of this gsn for signalling */
+ struct in_addr gsnu; /* IP address of this gsn for user traffic */
+
+ /* Parameters related to signalling messages */
+ uint16_t seq_next; /* Next sequence number to use */
+ int seq_first; /* First packet in queue (oldest timeout) */
+ int seq_last; /* Last packet in queue (youngest timeout) */
+
+ unsigned char restart_counter; /* Increment on restart. Stored on disk */
+ char *statedir; /* Disk location for permanent storage */
+ void *priv; /* used by libgtp users to attach their own state) */
+ struct queue_t *queue_req; /* Request queue */
+ struct queue_t *queue_resp; /* Response queue */
+
+ struct pdp_t pdpa[PDP_MAX]; /* PDP storage */
+ struct pdp_t *hashtid[PDP_MAX]; /* Hash table for IMSI + NSAPI */
+
+ struct osmo_timer_list queue_timer; /* internal queue_{req,resp} timer */
+
+ /* Call back functions */
+ int (*cb_delete_context) (struct pdp_t *);
+ int (*cb_create_context_ind) (struct pdp_t *);
+ int (*cb_unsup_ind) (struct sockaddr_in * peer);
+ int (*cb_extheader_ind) (struct sockaddr_in * peer);
+ int (*cb_ran_info_relay_ind) (struct sockaddr_in *peer, union gtpie_member **ie);
+ int (*cb_conf) (int type, int cause, struct pdp_t * pdp, void *cbp);
+ int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len);
+ int (*cb_recovery) (struct sockaddr_in * peer, uint8_t recovery);
+ int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery);
+ int (*cb_recovery3) (struct gsn_t *gsn, struct sockaddr_in *peer, struct pdp_t *pdp, uint8_t recovery);
+
+ /* Counters */
+
+ uint64_t err_socket; /* Number of socket errors */
+ uint64_t err_readfrom; /* Number of readfrom errors */
+ uint64_t err_sendto; /* Number of sendto errors */
+ uint64_t err_memcpy; /* Number of memcpy */
+ uint64_t err_queuefull; /* Number of times queue was full */
+ uint64_t err_seq; /* Number of seq out of range */
+ uint64_t err_address; /* GSN address conversion failed */
+ uint64_t err_unknownpdp; /* GSN address conversion failed */
+ uint64_t err_unknowntid; /* Application supplied unknown imsi+nsapi */
+ uint64_t err_cause; /* Unexpected cause value received */
+ uint64_t err_outofpdp; /* Out of storage for PDP contexts */
+
+ uint64_t empty; /* Number of empty packets */
+ uint64_t unsup; /* Number of unsupported version 29.60 11.1.1 */
+ uint64_t tooshort; /* Number of too short headers 29.60 11.1.2 */
+ uint64_t unknown; /* Number of unknown messages 29.60 11.1.3 */
+ uint64_t unexpect; /* Number of unexpected messages 29.60 11.1.4 */
+ uint64_t duplicate; /* Number of duplicate or unsolicited replies */
+ uint64_t missing; /* Number of missing information field messages */
+ uint64_t incorrect; /* Number of incorrect information field messages */
+ uint64_t invalid; /* Number of invalid message format messages */
+};
+
+/* External API functions */
+
+extern int gtp_new(struct gsn_t **gsn, char *statedir, struct in_addr *listen,
+ int mode);
+
+extern int gtp_free(struct gsn_t *gsn);
+
+extern int gtp_newpdp(struct gsn_t *gsn, struct pdp_t **pdp,
+ uint64_t imsi, uint8_t nsapi) OSMO_DEPRECATED("Use gtp_pdp_newpdp() instead");
+extern int gtp_freepdp(struct gsn_t *gsn, struct pdp_t *pdp);
+extern int gtp_freepdp_teardown(struct gsn_t *gsn, struct pdp_t *pdp);
+
+extern int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp,
+ void *cbp);
+
+extern int gtp_set_cb_create_context_ind(struct gsn_t *gsn,
+ int (*cb_create_context_ind) (struct
+ pdp_t *
+ pdp));
+extern int gtp_set_cb_data_ind(struct gsn_t *gsn,
+ int (*cb_data_ind) (struct pdp_t * pdp,
+ void *pack, unsigned len));
+extern int gtp_set_cb_delete_context(struct gsn_t *gsn,
+ int (*cb_delete_context) (struct pdp_t *
+ pdp));
+/*extern int gtp_set_cb_create_context(struct gsn_t *gsn,
+ int (*cb_create_context) (struct pdp_t* pdp)); */
+
+extern int gtp_set_cb_unsup_ind(struct gsn_t *gsn,
+ int (*cb) (struct sockaddr_in * peer));
+
+extern int gtp_set_cb_extheader_ind(struct gsn_t *gsn,
+ int (*cb) (struct sockaddr_in * peer));
+
+extern int gtp_set_cb_ran_info_relay_ind(struct gsn_t *gsn,
+ int (*cb) (struct sockaddr_in * peer, union gtpie_member **ie));
+
+extern int gtp_set_cb_conf(struct gsn_t *gsn,
+ int (*cb) (int type, int cause, struct pdp_t * pdp,
+ void *cbp));
+
+int gtp_set_cb_recovery(struct gsn_t *gsn,
+ int (*cb) (struct sockaddr_in * peer,
+ uint8_t recovery))
+ OSMO_DEPRECATED("Use gtp_set_cb_recovery2() instead, to obtain pdp ctx originating the recovery");
+int gtp_set_cb_recovery2(struct gsn_t *gsn,
+ int (*cb) (struct sockaddr_in * peer,
+ struct pdp_t * pdp,
+ uint8_t recovery))
+ OSMO_DEPRECATED("Use gtp_set_cb_recovery3() instead, to obtain gsn handling the recovery");
+int gtp_set_cb_recovery3(struct gsn_t *gsn,
+ int (*cb) (struct gsn_t * gsn, struct sockaddr_in * peer,
+ struct pdp_t * pdp,
+ uint8_t recovery));
+void gtp_clear_queues(struct gsn_t *gsn);
+extern int gtp_fd(struct gsn_t *gsn);
+
+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 */
diff --git a/gtp/gtp.c b/gtp/gtp.c
index d2f2219..5585256 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -131,93 +131,7 @@
{ 0, NULL }
};
-/* Deprecated, use gtp_pdp_newpdp() instead */
-int gtp_newpdp(struct gsn_t *gsn, struct pdp_t **pdp,
- uint64_t imsi, uint8_t nsapi)
-{
- int rc;
- rc = gtp_pdp_newpdp(gsn, pdp, imsi, nsapi, NULL);
- return rc;
-}
-int gtp_freepdp(struct gsn_t *gsn, struct pdp_t *pdp)
-{
- if (gsn->cb_delete_context)
- gsn->cb_delete_context(pdp);
- return pdp_freepdp(pdp);
-}
-
-/* Free pdp and all its secondary PDP contexts. Must be called on the primary PDP context. */
-int gtp_freepdp_teardown(struct gsn_t *gsn, struct pdp_t *pdp)
-{
- int n;
- struct pdp_t *secondary_pdp;
- OSMO_ASSERT(!pdp->secondary);
-
- for (n = 0; n < PDP_MAXNSAPI; n++) {
- if (pdp->secondary_tei[n]) {
- if (gtp_pdp_getgtp1(gsn, &secondary_pdp,
- pdp->secondary_tei[n])) {
- LOGP(DLGTP, LOGL_ERROR,
- "Unknown secondary PDP context\n");
- continue;
- }
- if (pdp != secondary_pdp) {
- gtp_freepdp(gsn, secondary_pdp);
- }
- }
- }
-
- return gtp_freepdp(gsn, pdp);
-}
-
-/* gtp_gpdu */
-
-extern int gtp_fd(struct gsn_t *gsn)
-{
- return gsn->fd0;
-}
-
-/* gtp_decaps */
-/* gtp_retrans */
-/* gtp_retranstimeout */
-
-int gtp_set_cb_unsup_ind(struct gsn_t *gsn,
- int (*cb) (struct sockaddr_in * peer))
-{
- gsn->cb_unsup_ind = cb;
- return 0;
-}
-
-int gtp_set_cb_extheader_ind(struct gsn_t *gsn,
- int (*cb) (struct sockaddr_in * peer))
-{
- gsn->cb_extheader_ind = cb;
- return 0;
-}
-
-int gtp_set_cb_ran_info_relay_ind(struct gsn_t *gsn,
- int (*cb) (struct sockaddr_in * peer, union gtpie_member **ie))
-{
- gsn->cb_ran_info_relay_ind = cb;
- return 0;
-}
-
-/* API: Initialise delete context callback */
-/* Called whenever a pdp context is deleted for any reason */
-int gtp_set_cb_delete_context(struct gsn_t *gsn, int (*cb) (struct pdp_t * pdp))
-{
- gsn->cb_delete_context = cb;
- return 0;
-}
-
-int gtp_set_cb_conf(struct gsn_t *gsn,
- int (*cb) (int type, int cause,
- struct pdp_t * pdp, void *cbp))
-{
- gsn->cb_conf = cb;
- return 0;
-}
static void emit_cb_recovery(struct gsn_t *gsn, struct sockaddr_in * peer,
struct pdp_t * pdp, uint8_t recovery)
@@ -230,50 +144,6 @@
gsn->cb_recovery3(gsn, peer, pdp, recovery);
}
-int gtp_set_cb_recovery(struct gsn_t *gsn,
- int (*cb) (struct sockaddr_in * peer, uint8_t recovery))
-{
- gsn->cb_recovery = cb;
- return 0;
-}
-
-/* cb_recovery()
- * pdp may be NULL if Recovery IE was received from a message independent
- * of any PDP ctx (such as Echo Response), or because pdp ctx is unknown to the
- * local setup. In case pdp is known, caller may want to keep that pdp alive to
- * handle subsequent msg cb as this specific pdp ctx is still valid according to
- * specs.
- */
-int gtp_set_cb_recovery2(struct gsn_t *gsn,
- int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery))
-{
- gsn->cb_recovery2 = cb_recovery2;
- return 0;
-}
-
-/* cb_recovery()
- * pdp may be NULL if Recovery IE was received from a message independent
- * of any PDP ctx (such as Echo Response), or because pdp ctx is unknown to the
- * local setup. In case pdp is known, caller may want to keep that pdp alive to
- * handle subsequent msg cb as this specific pdp ctx is still valid according to
- * specs.
- */
-int gtp_set_cb_recovery3(struct gsn_t *gsn,
- int (*cb_recovery3) (struct gsn_t *gsn, struct sockaddr_in *peer,
- struct pdp_t *pdp, uint8_t recovery))
-{
- gsn->cb_recovery3 = cb_recovery3;
- return 0;
-}
-
-int gtp_set_cb_data_ind(struct gsn_t *gsn,
- int (*cb_data_ind) (struct pdp_t * pdp,
- void *pack, unsigned len))
-{
- gsn->cb_data_ind = cb_data_ind;
- return 0;
-}
-
/**
* get_default_gtp()
* Generate a GPRS Tunneling Protocol signalling packet header, depending
@@ -393,108 +263,6 @@
}
}
-static int queue_timer_retrans(struct gsn_t *gsn)
-{
- /* Retransmit any outstanding packets */
- /* Remove from queue if maxretrans exceeded */
- time_t now;
- struct qmsg_t *qmsg;
- now = time(NULL);
-
- /* get first element in queue, as long as the timeout of that
- * element has expired */
- while ((!queue_getfirst(gsn->queue_req, &qmsg)) &&
- (qmsg->timeout <= now)) {
- if (qmsg->retrans > N3_REQUESTS) { /* Too many retrans */
- LOGP(DLGTP, LOGL_NOTICE, "Retransmit req queue timeout of seq %" PRIu16 "\n",
- qmsg->seq);
- if (gsn->cb_conf)
- gsn->cb_conf(qmsg->type, EOF, NULL, qmsg->cbp);
- queue_freemsg(gsn->queue_req, qmsg);
- } else {
- LOGP(DLGTP, LOGL_INFO, "Retransmit (%d) of seq %" PRIu16 "\n",
- qmsg->retrans, qmsg->seq);
- if (sendto(qmsg->fd, &qmsg->p, qmsg->l, 0,
- (struct sockaddr *)&qmsg->peer,
- sizeof(struct sockaddr_in)) < 0) {
- gsn->err_sendto++;
- LOGP(DLGTP, LOGL_ERROR,
- "Sendto(fd0=%d, msg=%lx, len=%d) failed: Error = %s\n",
- gsn->fd0, (unsigned long)&qmsg->p,
- qmsg->l, strerror(errno));
- }
- queue_back(gsn->queue_req, qmsg);
- qmsg->timeout = now + T3_REQUEST;
- qmsg->retrans++;
- }
- }
-
- /* Also clean up reply timeouts */
- while ((!queue_getfirst(gsn->queue_resp, &qmsg)) &&
- (qmsg->timeout < now)) {
- LOGP(DLGTP, LOGL_DEBUG, "Retransmit resp queue seq %"
- PRIu16 " expired, removing from queue\n", qmsg->seq);
- queue_freemsg(gsn->queue_resp, qmsg);
- }
-
- return 0;
-}
-
-static int queue_timer_retranstimeout(struct gsn_t *gsn, struct timeval *timeout)
-{
- time_t now, later, diff;
- struct qmsg_t *qmsg;
- timeout->tv_usec = 0;
-
- if (queue_getfirst(gsn->queue_req, &qmsg)) {
- timeout->tv_sec = 10;
- } else {
- now = time(NULL);
- later = qmsg->timeout;
- timeout->tv_sec = later - now;
- if (timeout->tv_sec < 0)
- timeout->tv_sec = 0; /* No negative allowed */
- if (timeout->tv_sec > 10)
- timeout->tv_sec = 10; /* Max sleep for 10 sec */
- }
-
- if (queue_getfirst(gsn->queue_resp, &qmsg)) {
- /* already set by queue_req, do nothing */
- } else { /* trigger faster if earlier timeout exists in queue_resp */
- now = time(NULL);
- later = qmsg->timeout;
- diff = later - now;
- if (diff < 0)
- diff = 0;
- if (diff < timeout->tv_sec)
- timeout->tv_sec = diff;
- }
-
- return 0;
-}
-
-static void queue_timer_start(struct gsn_t *gsn)
-{
- struct timeval next;
-
- /* Retrieve next retransmission as timeval */
- queue_timer_retranstimeout(gsn, &next);
-
- /* re-schedule the timer */
- osmo_timer_schedule(&gsn->queue_timer, next.tv_sec, next.tv_usec/1000);
-}
-
-/* timer callback for libgtp retransmission and ping */
-static void queue_timer_cb(void *data)
-{
- struct gsn_t *gsn = data;
-
- /* do all the retransmissions as needed */
- queue_timer_retrans(gsn);
-
- queue_timer_start(gsn);
-}
-
/* ***********************************************************
* Reliable delivery of signalling messages
*
@@ -646,31 +414,12 @@
/* Rearm timer: Retrans time for qmsg just queued may be required
before an existing one (for instance a gtp echo req) */
- queue_timer_start(gsn);
+ gtp_queue_timer_start(gsn);
}
gsn->seq_next++; /* Count up this time */
return 0;
}
-
-/**
- * @brief clear the request and response queue. Useful for debugging to reset "some" state.
- * @param gsn The GGSN instance
- */
-void gtp_clear_queues(struct gsn_t *gsn)
-{
- struct qmsg_t *qmsg;
-
- LOGP(DLGTP, LOGL_INFO, "Clearing req & resp retransmit queues\n");
- while (!queue_getfirst(gsn->queue_req, &qmsg)) {
- queue_freemsg(gsn->queue_req, qmsg);
- }
-
- while (!queue_getfirst(gsn->queue_resp, &qmsg)) {
- queue_freemsg(gsn->queue_resp, qmsg);
- }
-}
-
/* gtp_conf
* Remove signalling packet from retransmission queue.
* return 0 on success, EOF if packet was not found */
@@ -705,20 +454,6 @@
return 0;
}
-int gtp_retrans(struct gsn_t *gsn)
-{
- /* dummy API, deprecated. */
- return 0;
-}
-
-int gtp_retranstimeout(struct gsn_t *gsn, struct timeval *timeout)
-{
- timeout->tv_sec = 24*60*60;
- timeout->tv_usec = 0;
- /* dummy API, deprecated. Return a huge timer to do nothing */
- return 0;
-}
-
static int gtp_resp(uint8_t version, struct gsn_t *gsn, struct pdp_t *pdp,
union gtp_packet *packet, int len,
struct sockaddr_in *peer, int fd, uint16_t seq, uint64_t tid)
@@ -782,7 +517,7 @@
/* Rearm timer: Retrans time for qmsg just queued may be required
before an existing one (for instance a gtp echo req) */
- queue_timer_start(gsn);
+ gtp_queue_timer_start(gsn);
}
return 0;
}
@@ -864,195 +599,6 @@
return 0;
}
-/* Perform restoration and recovery error handling as described in 29.060 */
-static void log_restart(struct gsn_t *gsn)
-{
- FILE *f;
- int i, rc;
- int counter = 0;
- char *filename;
-
- filename = talloc_asprintf(NULL, "%s/%s", gsn->statedir, RESTART_FILE);
- OSMO_ASSERT(filename);
-
- /* We try to open file. On failure we will later try to create file */
- if (!(f = fopen(filename, "r"))) {
- LOGP(DLGTP, LOGL_NOTICE,
- "State information file (%s) not found. Creating new file.\n",
- filename);
- } else {
- rc = fscanf(f, "%d", &counter);
- if (rc != 1) {
- LOGP(DLGTP, LOGL_ERROR,
- "fscanf failed to read counter value\n");
- goto close_file;
- }
- if (fclose(f)) {
- LOGP(DLGTP, LOGL_ERROR,
- "fclose failed: Error = %s\n", strerror(errno));
- }
- }
-
- gsn->restart_counter = (unsigned char)counter;
- gsn->restart_counter++;
-
- /* Keep the umask closely wrapped around our fopen() call in case the
- * log outputs cause file creation. */
- i = umask(022);
- f = fopen(filename, "w");
- umask(i);
- if (!f) {
- LOGP(DLGTP, LOGL_ERROR,
- "fopen(path=%s, mode=%s) failed: Error = %s\n", filename,
- "w", strerror(errno));
- goto free_filename;
- }
-
- fprintf(f, "%d\n", gsn->restart_counter);
-close_file:
- if (fclose(f))
- LOGP(DLGTP, LOGL_ERROR,
- "fclose failed: Error = %s\n", strerror(errno));
-free_filename:
- talloc_free(filename);
-}
-
-int gtp_new(struct gsn_t **gsn, char *statedir, struct in_addr *listen,
- int mode)
-{
- struct sockaddr_in addr;
-
- LOGP(DLGTP, LOGL_NOTICE, "GTP: gtp_newgsn() started at %s\n", inet_ntoa(*listen));
-
- *gsn = calloc(sizeof(struct gsn_t), 1); /* TODO */
-
- (*gsn)->statedir = statedir;
- log_restart(*gsn);
-
- /* Initialise sequence number */
- (*gsn)->seq_next = (*gsn)->restart_counter * 1024;
-
- /* Initialise request retransmit queue */
- queue_new(&(*gsn)->queue_req);
- queue_new(&(*gsn)->queue_resp);
-
- /* Initialise pdp table */
- pdp_init(*gsn);
-
- /* Initialize internal queue timer */
- osmo_timer_setup(&(*gsn)->queue_timer, queue_timer_cb, *gsn);
-
- /* Initialise call back functions */
- (*gsn)->cb_create_context_ind = 0;
- (*gsn)->cb_delete_context = 0;
- (*gsn)->cb_unsup_ind = 0;
- (*gsn)->cb_conf = 0;
- (*gsn)->cb_data_ind = 0;
-
- /* Store function parameters */
- (*gsn)->gsnc = *listen;
- (*gsn)->gsnu = *listen;
- (*gsn)->mode = mode;
-
- /* Create GTP version 0 socket */
- if (((*gsn)->fd0 = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- (*gsn)->err_socket++;
- LOGP(DLGTP, LOGL_ERROR,
- "GTPv0 socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n",
- AF_INET, SOCK_DGRAM, 0, strerror(errno));
- return -errno;
- }
-
- memset(&addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- addr.sin_addr = *listen; /* Same IP for user traffic and signalling */
- addr.sin_port = htons(GTP0_PORT);
-#if defined(__FreeBSD__) || defined(__APPLE__)
- addr.sin_len = sizeof(addr);
-#endif
-
- if (bind((*gsn)->fd0, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
- (*gsn)->err_socket++;
- LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr,
- "bind(fd0=%d) failed: Error = %s\n",
- (*gsn)->fd0, strerror(errno));
- return -errno;
- }
-
- /* Create GTP version 1 control plane socket */
- if (((*gsn)->fd1c = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- (*gsn)->err_socket++;
- LOGP(DLGTP, LOGL_ERROR,
- "GTPv1 control plane socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n",
- AF_INET, SOCK_DGRAM, 0, strerror(errno));
- return -errno;
- }
-
- memset(&addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- addr.sin_addr = *listen; /* Same IP for user traffic and signalling */
- addr.sin_port = htons(GTP1C_PORT);
-#if defined(__FreeBSD__) || defined(__APPLE__)
- addr.sin_len = sizeof(addr);
-#endif
-
- if (bind((*gsn)->fd1c, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
- (*gsn)->err_socket++;
- LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr,
- "bind(fd1c=%d) failed: Error = %s\n",
- (*gsn)->fd1c, strerror(errno));
- return -errno;
- }
-
- /* Create GTP version 1 user plane socket */
- if (((*gsn)->fd1u = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- (*gsn)->err_socket++;
- LOGP(DLGTP, LOGL_ERROR,
- "GTPv1 user plane socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n",
- AF_INET, SOCK_DGRAM, 0, strerror(errno));
- return -errno;
- }
-
- memset(&addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- addr.sin_addr = *listen; /* Same IP for user traffic and signalling */
- addr.sin_port = htons(GTP1U_PORT);
-#if defined(__FreeBSD__) || defined(__APPLE__)
- addr.sin_len = sizeof(addr);
-#endif
-
- if (bind((*gsn)->fd1u, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
- (*gsn)->err_socket++;
- LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr,
- "bind(fd1u=%d) failed: Error = %s\n",
- (*gsn)->fd1u, strerror(errno));
- return -errno;
- }
-
- /* Start internal queue timer */
- queue_timer_start(*gsn);
-
- return 0;
-}
-
-int gtp_free(struct gsn_t *gsn)
-{
-
- /* Cleanup internal queue timer */
- osmo_timer_del(&gsn->queue_timer);
-
- /* Clean up retransmit queues */
- queue_free(gsn->queue_req);
- queue_free(gsn->queue_resp);
-
- close(gsn->fd0);
- close(gsn->fd1c);
- close(gsn->fd1u);
-
- free(gsn);
- return 0;
-}
-
/* ***********************************************************
* Path management messages
* Messages: echo and version not supported.
@@ -1455,15 +1001,6 @@
return 0;
}
-/* API: Register create context indication callback */
-int gtp_set_cb_create_context_ind(struct gsn_t *gsn,
- int (*cb_create_context_ind) (struct pdp_t *
- pdp))
-{
- gsn->cb_create_context_ind = cb_create_context_ind;
- return 0;
-}
-
/* Send Create PDP Context Response */
int gtp_create_pdp_resp(struct gsn_t *gsn, int version, struct pdp_t *pdp,
uint8_t cause)
diff --git a/gtp/gtp.h b/gtp/gtp.h
index 0583025..ede6f73 100644
--- a/gtp/gtp.h
+++ b/gtp/gtp.h
@@ -13,14 +13,10 @@
#define _GTP_H
#include <osmocom/core/utils.h>
-#include <osmocom/core/defs.h>
-#include <osmocom/core/timer.h>
#include "gtpie.h"
#include "pdp.h"
-
-#define GTP_MODE_GGSN 1
-#define GTP_MODE_SGSN 2
+#include "gsn.h"
#define GTP0_PORT 3386
#define GTP1C_PORT 2123
@@ -32,12 +28,10 @@
#define GTP1_HEADER_SIZE_SHORT 8
#define GTP1_HEADER_SIZE_LONG 12
+#define NAMESIZE 1024
#define SYSLOG_PRINTSIZE 255
#define ERRMSG_SIZE 255
-#define RESTART_FILE "gsn_restart"
-#define NAMESIZE 1024
-
/* GTP version 1 extension header type definitions. */
#define GTP_EXT_PDCP_PDU 0xC0 /* PDCP PDU Number */
@@ -232,105 +226,13 @@
struct gtp1_packet_long gtp1l;
} __attribute__ ((packed));
-/* ***********************************************************
- * Information storage for each gsn instance
- *
- * Normally each instance of the application corresponds to
- * one instance of a gsn.
- *
- * In order to avoid global variables in the application, and
- * also in order to allow several instances of a gsn in the same
- * application this struct is provided in order to store all
- * relevant information related to the gsn.
- *
- * Note that this does not include information storage for '
- * each pdp context. This is stored in another struct.
- *************************************************************/
-
-struct gsn_t {
- /* Parameters related to the network interface */
-
- int fd0; /* GTP0 file descriptor */
- int fd1c; /* GTP1 control plane file descriptor */
- int fd1u; /* GTP0 user plane file descriptor */
- int mode; /* Mode of operation: GGSN or SGSN */
- struct in_addr gsnc; /* IP address of this gsn for signalling */
- struct in_addr gsnu; /* IP address of this gsn for user traffic */
-
- /* Parameters related to signalling messages */
- uint16_t seq_next; /* Next sequence number to use */
- int seq_first; /* First packet in queue (oldest timeout) */
- int seq_last; /* Last packet in queue (youngest timeout) */
-
- unsigned char restart_counter; /* Increment on restart. Stored on disk */
- char *statedir; /* Disk location for permanent storage */
- void *priv; /* used by libgtp users to attach their own state) */
- struct queue_t *queue_req; /* Request queue */
- struct queue_t *queue_resp; /* Response queue */
-
- struct pdp_t pdpa[PDP_MAX]; /* PDP storage */
- struct pdp_t *hashtid[PDP_MAX]; /* Hash table for IMSI + NSAPI */
-
- struct osmo_timer_list queue_timer; /* internal queue_{req,resp} timer */
-
- /* Call back functions */
- int (*cb_delete_context) (struct pdp_t *);
- int (*cb_create_context_ind) (struct pdp_t *);
- int (*cb_unsup_ind) (struct sockaddr_in * peer);
- int (*cb_extheader_ind) (struct sockaddr_in * peer);
- int (*cb_ran_info_relay_ind) (struct sockaddr_in *peer, union gtpie_member **ie);
- int (*cb_conf) (int type, int cause, struct pdp_t * pdp, void *cbp);
- int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len);
- int (*cb_recovery) (struct sockaddr_in * peer, uint8_t recovery);
- int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery);
- int (*cb_recovery3) (struct gsn_t *gsn, struct sockaddr_in *peer, struct pdp_t *pdp, uint8_t recovery);
-
- /* Counters */
-
- uint64_t err_socket; /* Number of socket errors */
- uint64_t err_readfrom; /* Number of readfrom errors */
- uint64_t err_sendto; /* Number of sendto errors */
- uint64_t err_memcpy; /* Number of memcpy */
- uint64_t err_queuefull; /* Number of times queue was full */
- uint64_t err_seq; /* Number of seq out of range */
- uint64_t err_address; /* GSN address conversion failed */
- uint64_t err_unknownpdp; /* GSN address conversion failed */
- uint64_t err_unknowntid; /* Application supplied unknown imsi+nsapi */
- uint64_t err_cause; /* Unexpected cause value received */
- uint64_t err_outofpdp; /* Out of storage for PDP contexts */
-
- uint64_t empty; /* Number of empty packets */
- uint64_t unsup; /* Number of unsupported version 29.60 11.1.1 */
- uint64_t tooshort; /* Number of too short headers 29.60 11.1.2 */
- uint64_t unknown; /* Number of unknown messages 29.60 11.1.3 */
- uint64_t unexpect; /* Number of unexpected messages 29.60 11.1.4 */
- uint64_t duplicate; /* Number of duplicate or unsolicited replies */
- uint64_t missing; /* Number of missing information field messages */
- uint64_t incorrect; /* Number of incorrect information field messages */
- uint64_t invalid; /* Number of invalid message format messages */
-};
-
/* External API functions */
extern const char *gtp_version();
-extern int gtp_new(struct gsn_t **gsn, char *statedir, struct in_addr *listen,
- int mode);
-
-extern int gtp_free(struct gsn_t *gsn);
-
-extern int gtp_newpdp(struct gsn_t *gsn, struct pdp_t **pdp,
- uint64_t imsi, uint8_t nsapi) OSMO_DEPRECATED("Use gtp_pdp_newpdp() instead");
-extern int gtp_freepdp(struct gsn_t *gsn, struct pdp_t *pdp);
-extern int gtp_freepdp_teardown(struct gsn_t *gsn, struct pdp_t *pdp);
extern int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp,
void *cbp);
-extern int gtp_set_cb_create_context_ind(struct gsn_t *gsn,
- int (*cb_create_context_ind) (struct
- pdp_t *
- pdp));
-
extern int gtp_create_context_resp(struct gsn_t *gsn, struct pdp_t *pdp,
int cause);
@@ -351,53 +253,10 @@
const uint8_t *rim_route_addr, size_t rim_route_addr_len,
uint8_t rim_route_addr_discr);
-extern int gtp_set_cb_data_ind(struct gsn_t *gsn,
- int (*cb_data_ind) (struct pdp_t * pdp,
- void *pack, unsigned len));
-
-extern int gtp_fd(struct gsn_t *gsn);
extern int gtp_decaps0(struct gsn_t *gsn);
extern int gtp_decaps1c(struct gsn_t *gsn);
extern int gtp_decaps1u(struct gsn_t *gsn);
-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");
-
-extern int gtp_set_cb_delete_context(struct gsn_t *gsn,
- int (*cb_delete_context) (struct pdp_t *
- pdp));
-/*extern int gtp_set_cb_create_context(struct gsn_t *gsn,
- int (*cb_create_context) (struct pdp_t* pdp)); */
-
-extern int gtp_set_cb_unsup_ind(struct gsn_t *gsn,
- int (*cb) (struct sockaddr_in * peer));
-
-extern int gtp_set_cb_extheader_ind(struct gsn_t *gsn,
- int (*cb) (struct sockaddr_in * peer));
-
-extern int gtp_set_cb_ran_info_relay_ind(struct gsn_t *gsn,
- int (*cb) (struct sockaddr_in * peer, union gtpie_member **ie));
-
-extern int gtp_set_cb_conf(struct gsn_t *gsn,
- int (*cb) (int type, int cause, struct pdp_t * pdp,
- void *cbp));
-
-int gtp_set_cb_recovery(struct gsn_t *gsn,
- int (*cb) (struct sockaddr_in * peer,
- uint8_t recovery))
- OSMO_DEPRECATED("Use gtp_set_cb_recovery2() instead, to obtain pdp ctx originating the recovery");
-int gtp_set_cb_recovery2(struct gsn_t *gsn,
- int (*cb) (struct sockaddr_in * peer,
- struct pdp_t * pdp,
- uint8_t recovery))
- OSMO_DEPRECATED("Use gtp_set_cb_recovery3() instead, to obtain gsn handling the recovery");;
-int gtp_set_cb_recovery3(struct gsn_t *gsn,
- int (*cb) (struct gsn_t * gsn, struct sockaddr_in * peer,
- struct pdp_t * pdp,
- uint8_t recovery));
-
-void gtp_clear_queues(struct gsn_t *gsn);
-
-/* Internal functions (not part of the API */
+/* Internal functions (not part of the API) */
extern int gtp_echo_req(struct gsn_t *gsn, int version, void *cbp,
struct in_addr *inetaddrs);
--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/29965
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I47cebb51bf08b9fcf7f115fc8dbea5f3493d4388
Gerrit-Change-Number: 29965
Gerrit-PatchSet: 2
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-MessageType: merged
1
0
03 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/29966 )
Change subject: Use rate_ctr for gsn_t available_counters
......................................................................
Use rate_ctr for gsn_t available_counters
This way they can be inspected with regular osmocom means.
Change-Id: I529305b4f824600c6e733a3c0d2c2c6673f99faf
---
M gtp/gsn.c
M gtp/gsn.h
M gtp/gtp.c
3 files changed, 172 insertions(+), 132 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/gtp/gsn.c b/gtp/gsn.c
index 8fb0fdb..2189725 100644
--- a/gtp/gsn.c
+++ b/gtp/gsn.c
@@ -25,6 +25,8 @@
#include <osmocom/core/logging.h>
#include <osmocom/core/utils.h>
+#include <osmocom/core/stats.h>
+#include <osmocom/core/rate_ctr.h>
#if defined(__FreeBSD__)
#include <sys/endian.h>
@@ -72,6 +74,37 @@
inet_ntoa((addr).sin_addr), htons((addr).sin_port), \
##args);
+static const struct rate_ctr_desc gsn_ctr_description[] = {
+ [GSN_CTR_ERR_SOCKET] = { "err:socket", "Socket error" },
+ [GSN_CTR_ERR_READFROM] = { "err:readfrom", "readfrom() errors" },
+ [GSN_CTR_ERR_SENDTO] = { "err:sendto", "sendto() errors" },
+ [GSN_CTR_ERR_QUEUEFULL] = { "err:queuefull", "Failed to queue message because queue is full" },
+ [GSN_CTR_ERR_SEQ] = { "err:seq", "Sequence number out of range" },
+ [GSN_CTR_ERR_ADDRESS] = { "err:address", "GSN address conversion failed" },
+ [GSN_CTR_ERR_UNKNOWN_PDP] = { "err:unknown_pdp", "Failed looking up PDP context" },
+ [GSN_CTR_ERR_UNEXPECTED_CAUSE] = { "err:unexpected_cause", "Unexpected cause value received" },
+ [GSN_CTR_ERR_OUT_OF_PDP] = { "err:out_of_pdp", "Out of storage for PDP contexts" },
+ [GSN_CTR_PKT_EMPTY] = { "pkt:empty", "Empty packet received" },
+ [GSN_CTR_PKT_UNSUP] = { "pkt:unsupported", "Unsupported GTP version received" },
+ [GSN_CTR_PKT_TOOSHORT] = { "pkt:too_short", "Packet too short received" },
+ [GSN_CTR_PKT_UNKNOWN] = { "pkt:unknown", "Unknown packet type received" },
+ [GSN_CTR_PKT_UNEXPECT] = { "pkt:unexpected", "Unexpected packet type received" },
+ [GSN_CTR_PKT_DUPLICATE] = { "pkt:duplicate", "Duplicate or unsolicited packet received" },
+ [GSN_CTR_PKT_MISSING] = { "pkt:missing", "Missing IE in packet received" },
+ [GSN_CTR_PKT_INCORRECT] = { "pkt:incorrect", "Incorrect IE in packet received" },
+ [GSN_CTR_PKT_INVALID] = { "pkt:invalid", "Invalid format in packet received" },
+};
+
+static const struct rate_ctr_group_desc gsn_ctrg_desc = {
+ "gsn",
+ "GSN Statistics",
+ OSMO_STATS_CLASS_PEER,
+ ARRAY_SIZE(gsn_ctr_description),
+ gsn_ctr_description,
+};
+static unsigned int gsn_ctr_next_idx = 0;
+
+
/* API Functions */
/* Deprecated, use gtp_pdp_newpdp() instead */
@@ -226,7 +259,7 @@
if (sendto(qmsg->fd, &qmsg->p, qmsg->l, 0,
(struct sockaddr *)&qmsg->peer,
sizeof(struct sockaddr_in)) < 0) {
- gsn->err_sendto++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_SENDTO);
LOGP(DLGTP, LOGL_ERROR,
"Sendto(fd0=%d, msg=%lx, len=%d) failed: Error = %s\n",
gsn->fd0, (unsigned long)&qmsg->p,
@@ -401,6 +434,9 @@
/* Initialize internal queue timer */
osmo_timer_setup(&(*gsn)->queue_timer, queue_timer_cb, *gsn);
+ /* Initialize counter group: */
+ (*gsn)->ctrg = rate_ctr_group_alloc(NULL, &gsn_ctrg_desc, gsn_ctr_next_idx++);
+
/* Initialise call back functions */
(*gsn)->cb_create_context_ind = 0;
(*gsn)->cb_delete_context = 0;
@@ -415,7 +451,7 @@
/* Create GTP version 0 socket */
if (((*gsn)->fd0 = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- (*gsn)->err_socket++;
+ rate_ctr_inc2((*gsn)->ctrg, GSN_CTR_ERR_SOCKET);
LOGP(DLGTP, LOGL_ERROR,
"GTPv0 socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n",
AF_INET, SOCK_DGRAM, 0, strerror(errno));
@@ -431,7 +467,7 @@
#endif
if (bind((*gsn)->fd0, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
- (*gsn)->err_socket++;
+ rate_ctr_inc2((*gsn)->ctrg, GSN_CTR_ERR_SOCKET);
LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr,
"bind(fd0=%d) failed: Error = %s\n",
(*gsn)->fd0, strerror(errno));
@@ -440,7 +476,7 @@
/* Create GTP version 1 control plane socket */
if (((*gsn)->fd1c = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- (*gsn)->err_socket++;
+ rate_ctr_inc2((*gsn)->ctrg, GSN_CTR_ERR_SOCKET);
LOGP(DLGTP, LOGL_ERROR,
"GTPv1 control plane socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n",
AF_INET, SOCK_DGRAM, 0, strerror(errno));
@@ -456,7 +492,7 @@
#endif
if (bind((*gsn)->fd1c, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
- (*gsn)->err_socket++;
+ rate_ctr_inc2((*gsn)->ctrg, GSN_CTR_ERR_SOCKET);
LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr,
"bind(fd1c=%d) failed: Error = %s\n",
(*gsn)->fd1c, strerror(errno));
@@ -465,7 +501,7 @@
/* Create GTP version 1 user plane socket */
if (((*gsn)->fd1u = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- (*gsn)->err_socket++;
+ rate_ctr_inc2((*gsn)->ctrg, GSN_CTR_ERR_SOCKET);
LOGP(DLGTP, LOGL_ERROR,
"GTPv1 user plane socket(domain=%d, type=%d, protocol=%d) failed: Error = %s\n",
AF_INET, SOCK_DGRAM, 0, strerror(errno));
@@ -481,7 +517,7 @@
#endif
if (bind((*gsn)->fd1u, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
- (*gsn)->err_socket++;
+ rate_ctr_inc2((*gsn)->ctrg, GSN_CTR_ERR_SOCKET);
LOGP_WITH_ADDR(DLGTP, LOGL_ERROR, addr,
"bind(fd1u=%d) failed: Error = %s\n",
(*gsn)->fd1u, strerror(errno));
@@ -508,6 +544,8 @@
close(gsn->fd1c);
close(gsn->fd1u);
+ rate_ctr_group_free(gsn->ctrg);
+
free(gsn);
return 0;
}
diff --git a/gtp/gsn.h b/gtp/gsn.h
index 18a6d58..cbe5b27 100644
--- a/gtp/gsn.h
+++ b/gtp/gsn.h
@@ -15,6 +15,7 @@
#include <osmocom/core/utils.h>
#include <osmocom/core/defs.h>
#include <osmocom/core/timer.h>
+#include <osmocom/core/rate_ctr.h>
#include "pdp.h"
@@ -38,6 +39,27 @@
* each pdp context. This is stored in another struct.
*************************************************************/
+enum gsn_rate_ctr_keys {
+ GSN_CTR_ERR_SOCKET,
+ GSN_CTR_ERR_READFROM, /* Number of readfrom errors */
+ GSN_CTR_ERR_SENDTO, /* Number of sendto errors */
+ GSN_CTR_ERR_QUEUEFULL, /* Number of times queue was full */
+ GSN_CTR_ERR_SEQ, /* Number of seq out of range */
+ GSN_CTR_ERR_ADDRESS, /* GSN address conversion failed */
+ GSN_CTR_ERR_UNKNOWN_PDP, /* GSN address conversion failed */
+ GSN_CTR_ERR_UNEXPECTED_CAUSE, /* Unexpected cause value received */
+ GSN_CTR_ERR_OUT_OF_PDP, /* Out of storage for PDP contexts */
+ GSN_CTR_PKT_EMPTY, /* Number of empty packets */
+ GSN_CTR_PKT_UNSUP, /* Number of unsupported version 29.60 11.1.1 */
+ GSN_CTR_PKT_TOOSHORT, /* Number of too short headers 29.60 11.1.2 */
+ GSN_CTR_PKT_UNKNOWN, /* Number of unknown messages 29.60 11.1.3 */
+ GSN_CTR_PKT_UNEXPECT, /* Number of unexpected messages 29.60 11.1.4 */
+ GSN_CTR_PKT_DUPLICATE, /* Number of duplicate or unsolicited replies */
+ GSN_CTR_PKT_MISSING, /* Number of missing information field messages */
+ GSN_CTR_PKT_INCORRECT, /* Number of incorrect information field messages */
+ GSN_CTR_PKT_INVALID, /* Number of invalid message format messages */
+};
+
struct gsn_t {
/* Parameters related to the network interface */
@@ -77,28 +99,7 @@
int (*cb_recovery3) (struct gsn_t *gsn, struct sockaddr_in *peer, struct pdp_t *pdp, uint8_t recovery);
/* Counters */
-
- uint64_t err_socket; /* Number of socket errors */
- uint64_t err_readfrom; /* Number of readfrom errors */
- uint64_t err_sendto; /* Number of sendto errors */
- uint64_t err_memcpy; /* Number of memcpy */
- uint64_t err_queuefull; /* Number of times queue was full */
- uint64_t err_seq; /* Number of seq out of range */
- uint64_t err_address; /* GSN address conversion failed */
- uint64_t err_unknownpdp; /* GSN address conversion failed */
- uint64_t err_unknowntid; /* Application supplied unknown imsi+nsapi */
- uint64_t err_cause; /* Unexpected cause value received */
- uint64_t err_outofpdp; /* Out of storage for PDP contexts */
-
- uint64_t empty; /* Number of empty packets */
- uint64_t unsup; /* Number of unsupported version 29.60 11.1.1 */
- uint64_t tooshort; /* Number of too short headers 29.60 11.1.2 */
- uint64_t unknown; /* Number of unknown messages 29.60 11.1.3 */
- uint64_t unexpect; /* Number of unexpected messages 29.60 11.1.4 */
- uint64_t duplicate; /* Number of duplicate or unsolicited replies */
- uint64_t missing; /* Number of missing information field messages */
- uint64_t incorrect; /* Number of incorrect information field messages */
- uint64_t invalid; /* Number of invalid message format messages */
+ struct rate_ctr_group *ctrg;
};
/* External API functions */
diff --git a/gtp/gtp.c b/gtp/gtp.c
index 5585256..7e1a03f 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -388,7 +388,7 @@
if (sendto(fd, packet, len, 0,
(struct sockaddr *)&addr, sizeof(addr)) < 0) {
- gsn->err_sendto++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_SENDTO);
LOGP(DLGTP, LOGL_ERROR, "Sendto(fd=%d, msg=%lx, len=%d, dst=%s) failed: Error = %s\n", fd,
(unsigned long)&packet, len, inet_ntoa(addr.sin_addr), strerror(errno));
return -1;
@@ -396,7 +396,7 @@
/* Use new queue structure */
if (queue_newmsg(gsn->queue_req, &qmsg, &addr, gsn->seq_next)) {
- gsn->err_queuefull++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_QUEUEFULL);
LOGP(DLGTP, LOGL_ERROR, "Retransmit req queue is full (seq=%" PRIu16 ")\n",
gsn->seq_next);
} else {
@@ -444,7 +444,7 @@
"Freeing seq=%" PRIu16 " from retransmit req queue\n",
seq);
if (queue_freemsg_seq(gsn->queue_req, peer, seq, type, cbp)) {
- gsn->err_seq++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_SEQ);
GTP_LOGPKG(LOGL_ERROR, peer, packet, len,
"Confirmation packet not found in retransmit req queue (seq=%"
PRIu16 ")\n", seq);
@@ -489,7 +489,7 @@
if (sendto(fd, packet, len, 0,
(struct sockaddr *)peer, sizeof(struct sockaddr_in)) < 0) {
- gsn->err_sendto++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_SENDTO);
LOGP(DLGTP, LOGL_ERROR,
"Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd,
(unsigned long)&packet, len, strerror(errno));
@@ -498,7 +498,7 @@
/* Use new queue structure */
if (queue_newmsg(gsn->queue_resp, &qmsg, peer, seq)) {
- gsn->err_queuefull++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_QUEUEFULL);
LOGP(DLGTP, LOGL_ERROR, "Retransmit resp queue is full (seq=%" PRIu16 ")\n",
seq);
} else {
@@ -558,7 +558,7 @@
if (sendto(fd, packet, len, 0,
(struct sockaddr *)&addr, sizeof(struct sockaddr_in)) < 0) {
- gsn->err_sendto++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_SENDTO);
LOGP(DLGTP, LOGL_ERROR,
"Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd,
(unsigned long)&packet, len, strerror(errno));
@@ -582,6 +582,7 @@
inet_ntop(AF_INET, &peer->sin_addr, buf, sizeof(buf));
LOGP(DLGTP, LOGL_INFO,
"Rx duplicate seq=%" PRIu16 " from %s, retrans resp\n", seq, buf);
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_DUPLICATE);
if (fcntl(qmsg->fd, F_SETFL, 0)) {
LOGP(DLGTP, LOGL_ERROR, "fnctl()\n");
@@ -590,7 +591,7 @@
if (sendto(qmsg->fd, &qmsg->p, qmsg->l, 0,
(struct sockaddr *)peer, sizeof(struct sockaddr_in)) < 0) {
- gsn->err_sendto++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_SENDTO);
LOGP(DLGTP, LOGL_ERROR,
"Sendto(fd=%d, msg=%lx, len=%d) failed: Error = %s\n",
qmsg->fd, (unsigned long)&qmsg->p, qmsg->l,
@@ -678,7 +679,7 @@
/* Extract information elements into a pointer array */
if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) {
- gsn->invalid++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INVALID);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Invalid message format\n");
if (gsn->cb_conf)
@@ -687,7 +688,7 @@
}
if (gtpie_gettv1(ie, GTPIE_RECOVERY, 0, &recovery)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Missing mandatory field\n");
if (gsn->cb_conf)
@@ -785,7 +786,7 @@
/* Decode information elements */
if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) {
- gsn->invalid++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INVALID);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Invalid message format (AN Information Relay)\n");
return -EINVAL;
@@ -1097,7 +1098,7 @@
/* Decode information elements */
if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) {
- gsn->invalid++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INVALID);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Invalid message format\n");
if (0 == version)
@@ -1117,7 +1118,7 @@
/* Find the primary PDP context */
if (gtp_pdp_getgtp1(gsn, &linked_pdp, get_tei(pack))) {
- gsn->incorrect++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INCORRECT);
GTP_LOGPKG(LOGL_ERROR, peer,
pack, len,
"Incorrect optional information field\n");
@@ -1127,7 +1128,7 @@
/* Check that the primary PDP context matches linked nsapi */
if (linked_pdp->nsapi != linked_nsapi) {
- gsn->incorrect++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INCORRECT);
GTP_LOGPKG(LOGL_ERROR, peer,
pack, len,
"Incorrect optional information field\n");
@@ -1152,7 +1153,7 @@
included in the message. */
if (gtpie_gettv0
(ie, GTPIE_IMSI, 0, &pdp->imsi, sizeof(pdp->imsi))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing IMSI not supported\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1162,7 +1163,7 @@
/* TEID (mandatory) */
if (gtpie_gettv4(ie, GTPIE_TEI_DI, 0, &pdp->teid_gn)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1171,7 +1172,7 @@
/* TEIC (conditional) */
if (!linked_pdp) { /* Not Secondary PDP Context Activation Procedure */
if (gtpie_gettv4(ie, GTPIE_TEI_C, 0, &pdp->teic_gn)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer,
pack, len,
"Missing mandatory information field\n");
@@ -1181,7 +1182,7 @@
}
/* NSAPI (mandatory) */
if (gtpie_gettv1(ie, GTPIE_NSAPI, 0, &pdp->nsapi)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1190,7 +1191,7 @@
/* QoS (mandatory) */
if (gtpie_gettlv(ie, GTPIE_QOS_PROFILE, 0, &pdp->qos_req.l,
&pdp->qos_req.v, sizeof(pdp->qos_req.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1205,21 +1206,21 @@
case 0:
if (gtpie_gettv0(ie, GTPIE_QOS_PROFILE0, 0,
pdp->qos_req0, sizeof(pdp->qos_req0))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
GTPCAUSE_MAN_IE_MISSING);
}
if (gtpie_gettv2(ie, GTPIE_FL_DI, 0, &pdp->flru)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
GTPCAUSE_MAN_IE_MISSING);
}
if (gtpie_gettv2(ie, GTPIE_FL_C, 0, &pdp->flrc)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1231,7 +1232,7 @@
/* SGSN address for signalling (mandatory) */
if (gtpie_gettlv(ie, GTPIE_GSN_ADDR, 0, &pdp->gsnrc.l,
&pdp->gsnrc.v, sizeof(pdp->gsnrc.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1241,7 +1242,7 @@
/* SGSN address for user traffic (mandatory) */
if (gtpie_gettlv(ie, GTPIE_GSN_ADDR, 1, &pdp->gsnru.l,
&pdp->gsnru.v, sizeof(pdp->gsnru.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1257,7 +1258,7 @@
/* Selection mode (conditional) */
if (gtpie_gettv0(ie, GTPIE_SELECTION_MODE, 0,
&pdp->selmode, sizeof(pdp->selmode))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1266,7 +1267,7 @@
/* End User Address (conditional) */
if (gtpie_gettlv(ie, GTPIE_EUA, 0, &pdp->eua.l,
&pdp->eua.v, sizeof(pdp->eua.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1275,7 +1276,7 @@
/* APN */
if (gtpie_gettlv(ie, GTPIE_APN, 0, &pdp->apn_req.l,
&pdp->apn_req.v, sizeof(pdp->apn_req.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1288,7 +1289,7 @@
/* MSISDN (conditional) */
if (gtpie_gettlv(ie, GTPIE_MSISDN, 0, &pdp->msisdn.l,
&pdp->msisdn.v, sizeof(pdp->msisdn.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_create_pdp_resp(gsn, version, pdp,
@@ -1406,7 +1407,7 @@
/* Find the context in question */
if (gtp_pdp_getgtp1(gsn, &pdp, get_tei(pack))) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: %u\n", get_tei(pack));
if (gsn->cb_conf)
@@ -1416,7 +1417,7 @@
/* Decode information elements */
if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) {
- gsn->invalid++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INVALID);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Invalid message format\n");
if (gsn->cb_conf)
@@ -1426,7 +1427,7 @@
/* Extract cause value (mandatory) */
if (gtpie_gettv1(ie, GTPIE_CAUSE, 0, &cause)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Missing mandatory information field\n");
if (gsn->cb_conf)
@@ -1451,7 +1452,7 @@
if (gtpie_gettv0(ie, GTPIE_QOS_PROFILE0, 0,
&pdp->qos_neg0,
sizeof(pdp->qos_neg0))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer,
pack, len,
"Missing conditional information field\n");
@@ -1462,7 +1463,7 @@
}
if (gtpie_gettv1(ie, GTPIE_REORDER, 0, &pdp->reorder)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len,
"Missing conditional information field\n");
@@ -1473,7 +1474,7 @@
if (version == 0) {
if (gtpie_gettv2(ie, GTPIE_FL_DI, 0, &pdp->flru)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer,
pack, len,
"Missing conditional information field\n");
@@ -1483,7 +1484,7 @@
}
if (gtpie_gettv2(ie, GTPIE_FL_C, 0, &pdp->flrc)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer,
pack, len,
"Missing conditional information field\n");
@@ -1495,7 +1496,7 @@
if (version == 1) {
if (gtpie_gettv4(ie, GTPIE_TEI_DI, 0, &pdp->teid_gn)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer,
pack, len,
"Missing conditional information field\n");
@@ -1505,7 +1506,7 @@
}
if (gtpie_gettv4(ie, GTPIE_TEI_C, 0, &pdp->teic_gn)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer,
pack, len,
"Missing conditional information field\n");
@@ -1518,7 +1519,7 @@
}
if (gtpie_gettv4(ie, GTPIE_CHARGING_ID, 0, &pdp->cid)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len,
"Missing conditional information field\n");
@@ -1528,7 +1529,7 @@
if (gtpie_gettlv(ie, GTPIE_EUA, 0, &pdp->eua.l,
&pdp->eua.v, sizeof(pdp->eua.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len,
"Missing conditional information field\n");
@@ -1539,7 +1540,7 @@
if (gtpie_gettlv(ie, GTPIE_GSN_ADDR, 0, &pdp->gsnrc.l,
&pdp->gsnrc.v, sizeof(pdp->gsnrc.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len,
"Missing conditional information field\n");
@@ -1550,7 +1551,7 @@
if (gtpie_gettlv(ie, GTPIE_GSN_ADDR, 1, &pdp->gsnru.l,
&pdp->gsnru.v, sizeof(pdp->gsnru.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len,
"Missing conditional information field\n");
@@ -1563,7 +1564,7 @@
if (gtpie_gettlv
(ie, GTPIE_QOS_PROFILE, 0, &pdp->qos_neg.l,
&pdp->qos_neg.v, sizeof(pdp->qos_neg.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer,
pack, len,
"Missing conditional information field\n");
@@ -1739,7 +1740,7 @@
/* Decode information elements */
if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) {
- gsn->invalid++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INVALID);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Invalid message format\n");
if (0 == version)
@@ -1757,7 +1758,7 @@
if (version == 0) {
/* Find the context in question */
if (gtp_pdp_tidget(gsn, &pdp, get_tid(pack))) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: TID=0x%" PRIx64 "\n",
get_tid(pack));
@@ -1771,7 +1772,7 @@
} else if (version == 1) {
/* NSAPI (mandatory) */
if (gtpie_gettv1(ie, GTPIE_NSAPI, 0, &nsapi)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_update_pdp_resp(gsn, version, peer, fd, pack,
@@ -1783,7 +1784,7 @@
if (gtpie_gettv0(ie, GTPIE_IMSI, 0, &imsi, sizeof(imsi))) {
/* Find the context in question */
if (gtp_pdp_getgtp1(gsn, &pdp, get_tei(pack))) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: TEI=0x%" PRIx32 "\n",
get_tei(pack));
@@ -1794,7 +1795,7 @@
} else {
/* Find the context in question */
if (gtp_pdp_getimsi(gsn, &pdp, imsi, nsapi)) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: IMSI=0x%" PRIx64
" NSAPI=%" PRIu8 "\n", imsi, nsapi);
@@ -1814,7 +1815,7 @@
if (version == 0) {
if (gtpie_gettv0(ie, GTPIE_QOS_PROFILE0, 0,
pdp->qos_req0, sizeof(pdp->qos_req0))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
memcpy(pdp, &pdp_backup, sizeof(pdp_backup));
@@ -1831,7 +1832,7 @@
if (version == 0) {
if (gtpie_gettv2(ie, GTPIE_FL_DI, 0, &pdp->flru)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
memcpy(pdp, &pdp_backup, sizeof(pdp_backup));
@@ -1841,7 +1842,7 @@
}
if (gtpie_gettv2(ie, GTPIE_FL_C, 0, &pdp->flrc)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
memcpy(pdp, &pdp_backup, sizeof(pdp_backup));
@@ -1854,7 +1855,7 @@
if (version == 1) {
/* TEID (mandatory) */
if (gtpie_gettv4(ie, GTPIE_TEI_DI, 0, &pdp->teid_gn)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
memcpy(pdp, &pdp_backup, sizeof(pdp_backup));
@@ -1871,7 +1872,7 @@
/* NSAPI (mandatory) */
if (gtpie_gettv1(ie, GTPIE_NSAPI, 0, &pdp->nsapi)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
memcpy(pdp, &pdp_backup, sizeof(pdp_backup));
@@ -1887,7 +1888,7 @@
/* End User Address (conditional) TODO: GGSN Initiated
if (gtpie_gettlv(ie, GTPIE_EUA, 0, &pdp->eua.l,
&pdp->eua.v, sizeof(pdp->eua.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Missing mandatory information field");
memcpy(pdp, &pdp_backup, sizeof(pdp_backup));
@@ -1899,7 +1900,7 @@
/* It is weird that this is mandatory when TEIC is conditional */
if (gtpie_gettlv(ie, GTPIE_GSN_ADDR, 0, &pdp->gsnrc.l,
&pdp->gsnrc.v, sizeof(pdp->gsnrc.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Missing mandatory information field\n");
memcpy(pdp, &pdp_backup, sizeof(pdp_backup));
@@ -1910,7 +1911,7 @@
/* SGSN address for user traffic (mandatory) */
if (gtpie_gettlv(ie, GTPIE_GSN_ADDR, 1, &pdp->gsnru.l,
&pdp->gsnru.v, sizeof(pdp->gsnru.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Missing mandatory information field\n");
memcpy(pdp, &pdp_backup, sizeof(pdp_backup));
@@ -1922,7 +1923,7 @@
/* QoS (mandatory) */
if (gtpie_gettlv(ie, GTPIE_QOS_PROFILE, 0, &pdp->qos_req.l,
&pdp->qos_req.v, sizeof(pdp->qos_req.v))) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
memcpy(pdp, &pdp_backup, sizeof(pdp_backup));
@@ -1964,7 +1965,7 @@
/* Decode information elements */
if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) {
- gsn->invalid++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INVALID);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Invalid message format\n");
goto err_out;
@@ -1988,7 +1989,7 @@
if (cause != GTPCAUSE_NON_EXIST && cause != GTPCAUSE_CONTEXT_NOT_FOUND) {
/* Find the context in question */
if (gtp_pdp_getgtp1(gsn, &pdp, get_tei(pack))) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: TEI=0x%" PRIx32 "\n", get_tei(pack));
goto err_out;
@@ -2057,7 +2058,7 @@
return rc; /* Succes */
err_missing:
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Missing information field\n");
err_out:
@@ -2123,7 +2124,7 @@
int count;
if (gsna2in_addr(&addr, &pdp->gsnrc)) {
- gsn->err_address++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_ADDRESS);
LOGP(DLGTP, LOGL_ERROR, "GSN address (len=%u) conversion failed\n", pdp->gsnrc.l);
return EOF;
}
@@ -2225,7 +2226,7 @@
/* Find the linked context in question */
if (gtp_pdp_getgtp1(gsn, &linked_pdp, get_tei(pack))) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: TEI=0x%" PRIx32 "\n", get_tei(pack));
return gtp_delete_pdp_resp(gsn, version, peer, fd, pack, len,
@@ -2239,7 +2240,7 @@
/* Decode information elements */
if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) {
- gsn->invalid++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INVALID);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Invalid message format\n");
if (0 == version)
@@ -2254,7 +2255,7 @@
if (version == 1) {
/* NSAPI (mandatory) */
if (gtpie_gettv1(ie, GTPIE_NSAPI, 0, &nsapi)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack,
len, "Missing mandatory information field\n");
return gtp_delete_pdp_resp(gsn, version, peer, fd, pack,
@@ -2265,7 +2266,7 @@
/* Find the context in question */
if (gtp_pdp_getgtp1(gsn, &pdp, linked_pdp->secondary_tei[nsapi & 0x0f])) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: Secondary TEI=0x%" PRIx32 "\n",
linked_pdp->secondary_tei[nsapi & 0x0f]);
@@ -2319,7 +2320,7 @@
/* Find the context in question. It may not be available if gtp_delete_context_req
* was used and as a result the PDP ctx was already freed */
if (gtp_pdp_getgtp1(gsn, &pdp, get_tei(pack))) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_NOTICE, peer, pack, len,
"Unknown PDP context: TEI=0x%" PRIx32 " (expected if "
"gtp_delete_context_req is used or pdp ctx was freed "
@@ -2331,7 +2332,7 @@
/* Decode information elements */
if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) {
- gsn->invalid++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INVALID);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Invalid message format\n");
if (gsn->cb_conf)
@@ -2341,7 +2342,7 @@
/* Extract cause value (mandatory) */
if (gtpie_gettv1(ie, GTPIE_CAUSE, 0, &cause)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Missing mandatory information field\n");
if (gsn->cb_conf)
@@ -2351,7 +2352,7 @@
/* Check the cause value (again) */
if ((GTPCAUSE_ACC_REQ != cause) && (GTPCAUSE_NON_EXIST != cause)) {
- gsn->err_cause++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNEXPECTED_CAUSE);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unexpected cause value received: %d\n", cause);
if (gsn->cb_conf)
@@ -2398,7 +2399,7 @@
/* Find the context in question */
if (version == 0) {
if (gtp_pdp_tidget(gsn, &pdp, get_tid(pack))) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: TID=0x%" PRIx64 "\n",
get_tid(pack));
@@ -2411,21 +2412,21 @@
/* Decode information elements */
if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) {
- gsn->invalid++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_INVALID);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Invalid message format\n");
return EOF;
}
if (gtpie_gettv4(ie, GTPIE_TEI_DI, 0, &teid_gn)) {
- gsn->missing++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_MISSING);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Missing mandatory information field\n");
return EOF;
}
if (gtp_pdp_getgtp1_peer_d(gsn, &pdp, peer, teid_gn)) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: Peer TEID=0x%" PRIx32 "\n",
teid_gn);
@@ -2460,7 +2461,7 @@
switch (version) {
case 0:
if (gtp_pdp_getgtp0(gsn, &pdp, get_tei(pack))) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: TEI=0x%" PRIx32 "\n",
get_tei(pack));
@@ -2471,7 +2472,7 @@
break;
case 1:
if (gtp_pdp_getgtp1(gsn, &pdp, get_tei(pack))) {
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,
"Unknown PDP context: TEI=0x%" PRIx32 "\n",
get_tei(pack));
@@ -2493,7 +2494,7 @@
/* If the GPDU was not from the peer GSN tell him to delete context */
if (memcmp(&peer->sin_addr, pdp->gsnru.v, pdp->gsnru.l)) { /* TODO Range? */
- gsn->err_unknownpdp++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown GSN peer %s\n", inet_ntoa(peer->sin_addr));
return gtp_error_ind_resp(gsn, version, peer, fd, pack, len);
}
@@ -2535,7 +2536,7 @@
(struct sockaddr *)&peer, &peerlen)) < 0) {
if (errno == EAGAIN)
return 0;
- gsn->err_readfrom++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_READFROM);
LOGP(DLGTP, LOGL_ERROR,
"recvfrom(fd0=%d, buffer=%lx, len=%zu) failed: status = %d error = %s\n",
gsn->fd0, (unsigned long)buffer, sizeof(buffer),
@@ -2545,7 +2546,7 @@
/* Need at least 1 byte in order to check version */
if (status < (1)) {
- gsn->empty++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_EMPTY);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "Discarding packet - too small\n");
continue;
@@ -2561,7 +2562,7 @@
/* only support version 0, implying that this is the only version */
/* supported on this port */
if (version > 0) {
- gsn->unsup++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNSUP);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status,
"Unsupported GTP version %"PRIu8"\n", version);
gtp_unsup_req(gsn, 0, &peer, gsn->fd0, buffer, status); /* 29.60: 11.1.1 */
@@ -2570,7 +2571,7 @@
/* Check length of gtp0 packet */
if (status < GTP0_HEADER_SIZE) {
- gsn->tooshort++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_TOOSHORT);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "GTP0 packet too short\n");
continue; /* Silently discard 29.60: 11.1.2 */
@@ -2578,7 +2579,7 @@
/* Check packet length field versus length of packet */
if (status != (ntoh16(pheader->length) + GTP0_HEADER_SIZE)) {
- gsn->tooshort++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_TOOSHORT);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status,
"GTP packet length field does not match actual length\n");
@@ -2588,7 +2589,7 @@
if ((gsn->mode == GTP_MODE_GGSN) &&
((pheader->type == GTP_CREATE_PDP_RSP) ||
(pheader->type == GTP_UPDATE_PDP_RSP))) {
- gsn->unexpect++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNEXPECT);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status,
"Unexpected GTPv0 Signalling Message '%s'\n",
@@ -2599,7 +2600,7 @@
if ((gsn->mode == GTP_MODE_SGSN) &&
((pheader->type == GTP_CREATE_PDP_REQ) ||
(pheader->type == GTP_UPDATE_PDP_REQ))) {
- gsn->unexpect++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNEXPECT);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status,
"Unexpected GTPv0 Signalling Message '%s'\n",
@@ -2648,7 +2649,7 @@
gtp_gpdu_ind(gsn, version, &peer, fd, buffer, status);
break;
default:
- gsn->unknown++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNKNOWN);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status,
"Unknown GTP message type received: %d\n",
pheader->type);
@@ -2682,7 +2683,7 @@
(struct sockaddr *)&peer, &peerlen)) < 0) {
if (errno == EAGAIN)
return 0;
- gsn->err_readfrom++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_READFROM);
LOGP(DLGTP, LOGL_ERROR,
"recvfrom(fd=%d, buffer=%lx, len=%zu) failed: status = %d error = %s\n",
fd, (unsigned long)buffer, sizeof(buffer),
@@ -2692,7 +2693,7 @@
/* Need at least 1 byte in order to check version */
if (status < (1)) {
- gsn->empty++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_EMPTY);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "Discarding packet - too small\n");
continue;
@@ -2704,7 +2705,7 @@
/* Version must be no larger than GTP 1 */
if (version > 1) {
- gsn->unsup++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNSUP);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status,
"Unsupported GTP version %"PRIu8"\n", version);
gtp_unsup_req(gsn, version, &peer, fd, buffer, status);
@@ -2717,7 +2718,7 @@
/* GTP 1 messages. If GTP 0 message is received we silently discard */
/* the message */
if (version < 1) {
- gsn->unsup++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNSUP);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status,
"Unsupported GTP version %"PRIu8"\n", version);
continue;
@@ -2725,7 +2726,7 @@
/* Check packet flag field */
if (((pheader->flags & 0xf7) != 0x32)) {
- gsn->unsup++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNSUP);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "Unsupported packet flags: 0x%02x\n", pheader->flags);
continue;
@@ -2733,7 +2734,7 @@
/* Check length of packet */
if (status < GTP1_HEADER_SIZE_LONG) {
- gsn->tooshort++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_TOOSHORT);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "GTP packet too short\n");
continue; /* Silently discard 29.60: 11.1.2 */
@@ -2742,7 +2743,7 @@
/* Check packet length field versus length of packet */
if (status !=
(ntoh16(pheader->length) + GTP1_HEADER_SIZE_SHORT)) {
- gsn->tooshort++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_TOOSHORT);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status,
"GTP packet length field does not match actual length\n");
@@ -2753,7 +2754,7 @@
/* TODO: We really should cycle through the headers and determine */
/* if any have the comprehension required flag set */
if (((pheader->flags & GTP1HDR_F_EXT) != 0x00)) {
- gsn->unsup++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNSUP);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "Unsupported extension header\n");
gtp_extheader_req(gsn, version, &peer, fd, buffer,
@@ -2765,7 +2766,7 @@
if ((gsn->mode == GTP_MODE_GGSN) &&
((pheader->type == GTP_CREATE_PDP_RSP) ||
(pheader->type == GTP_UPDATE_PDP_RSP))) {
- gsn->unexpect++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNEXPECT);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status,
"Unexpected GTPv1 Signalling Message '%s'\n",
@@ -2776,7 +2777,7 @@
if ((gsn->mode == GTP_MODE_SGSN) &&
((pheader->type == GTP_CREATE_PDP_REQ) ||
(pheader->type == GTP_UPDATE_PDP_REQ))) {
- gsn->unexpect++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNEXPECT);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status,
"Unexpected GTPv1 Signalling Message '%s'\n",
@@ -2828,7 +2829,7 @@
gtp_ran_info_relay_ind(gsn, version, &peer, buffer, status);
break;
default:
- gsn->unknown++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNKNOWN);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status,
"Unknown GTP message type received: %u\n",
pheader->type);
@@ -2862,7 +2863,7 @@
(struct sockaddr *)&peer, &peerlen)) < 0) {
if (errno == EAGAIN)
return 0;
- gsn->err_readfrom++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_READFROM);
LOGP(DLGTP, LOGL_ERROR,
"recvfrom(fd1u=%d, buffer=%lx, len=%zu) failed: status = %d error = %s\n",
gsn->fd1u, (unsigned long)buffer,
@@ -2873,7 +2874,7 @@
/* Need at least 1 byte in order to check version */
if (status < (1)) {
- gsn->empty++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_EMPTY);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "Discarding packet - too small\n");
continue;
@@ -2885,7 +2886,7 @@
/* Version must be no larger than GTP 1 */
if (version > 1) {
- gsn->unsup++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNSUP);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status,
"Unsupported GTP version %"PRIu8"\n", version);
gtp_unsup_req(gsn, 1, &peer, gsn->fd1c, buffer, status); /*29.60: 11.1.1 */
@@ -2897,7 +2898,7 @@
/* GTP 1 messages. If GTP 0 message is received we silently discard */
/* the message */
if (version < 1) {
- gsn->unsup++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNSUP);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status,
"Unsupported GTP version %"PRIu8"\n", version);
continue;
@@ -2905,7 +2906,7 @@
/* Check packet flag field (allow both with and without sequence number) */
if (((pheader->flags & 0xf5) != 0x30)) {
- gsn->unsup++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNSUP);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "Unsupported packet flags 0x%02x\n", pheader->flags);
continue;
@@ -2913,7 +2914,7 @@
/* Check length of packet */
if (status < GTP1_HEADER_SIZE_SHORT) {
- gsn->tooshort++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_TOOSHORT);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "GTP packet too short\n");
continue; /* Silently discard 29.60: 11.1.2 */
@@ -2922,7 +2923,7 @@
/* Check packet length field versus length of packet */
if (status !=
(ntoh16(pheader->length) + GTP1_HEADER_SIZE_SHORT)) {
- gsn->tooshort++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_TOOSHORT);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status,
"GTP packet length field does not match actual length\n");
@@ -2933,7 +2934,7 @@
/* TODO: We really should cycle through the headers and determine */
/* if any have the comprehension required flag set */
if (((pheader->flags & GTP1HDR_F_EXT) != 0x00)) {
- gsn->unsup++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNSUP);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer,
status, "Unsupported extension header\n");
gtp_extheader_req(gsn, version, &peer, fd, buffer,
@@ -2960,7 +2961,7 @@
gtp_gpdu_ind(gsn, version, &peer, fd, buffer, status);
break;
default:
- gsn->unknown++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_PKT_UNKNOWN);
GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status,
"Unknown GTP message type received: %u\n",
pheader->type);
@@ -3041,7 +3042,7 @@
}
if (sendmsg(fd, &msgh, 0) < 0) {
- gsn->err_sendto++;
+ rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_SENDTO);
LOGP(DLGTP, LOGL_ERROR,
"sendmsg(fd=%d, msg=%lx, len=%d) failed: Error = %s\n", fd,
(unsigned long)&packet, GTP0_HEADER_SIZE + len,
--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/29966
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I529305b4f824600c6e733a3c0d2c2c6673f99faf
Gerrit-Change-Number: 29966
Gerrit-PatchSet: 1
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-MessageType: merged
1
0
Change in docker-playground[master]: ttcn3-bsc-test: Fix ttcn3-bsc_sccplite-latest
by daniel 03 Nov '22
by daniel 03 Nov '22
03 Nov '22
daniel has submitted this change. ( https://gerrit.osmocom.org/c/docker-playground/+/29967 )
Change subject: ttcn3-bsc-test: Fix ttcn3-bsc_sccplite-latest
......................................................................
ttcn3-bsc-test: Fix ttcn3-bsc_sccplite-latest
Re-add the msc 0->mgw config line since the "latest" version of osmo-bsc still uses
it. This was probably caused by fixing fallout from osmo-bsc.git commit
da4af65a51ee8b8d7b380330c0301de293347563 in master.
The config line is ignored in master so should be safe to keep until a
new osmo-bsc version is released.
Change-Id: I85231bf66a78232567eb91b92b8542ca7f728beb
---
M ttcn3-bsc-test/sccplite/osmo-bsc.cfg
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/ttcn3-bsc-test/sccplite/osmo-bsc.cfg b/ttcn3-bsc-test/sccplite/osmo-bsc.cfg
index 1bb164e..c680ef7 100644
--- a/ttcn3-bsc-test/sccplite/osmo-bsc.cfg
+++ b/ttcn3-bsc-test/sccplite/osmo-bsc.cfg
@@ -479,6 +479,8 @@
amr-config 4_75k forbidden
codec-list fr1 fr2 fr3 hr1 hr3
asp-protocol ipa
+ ! REMOVE after OsmoBSC > 1.8.0 is released
+ mgw remote-ip 172.18.12.203
bsc
mid-call-timeout 0
no missing-msc-text
--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/29967
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I85231bf66a78232567eb91b92b8542ca7f728beb
Gerrit-Change-Number: 29967
Gerrit-PatchSet: 3
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
1
0
Change in libosmo-abis[master]: trau_sync: support more than 40 bytes sync pattern.
by dexter 03 Nov '22
by dexter 03 Nov '22
03 Nov '22
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/29999 )
Change subject: trau_sync: support more than 40 bytes sync pattern.
......................................................................
trau_sync: support more than 40 bytes sync pattern.
40 byte sync pattern size is fine for 16 subslots but with an E1 line we
can go up to 64kbps, which is 4 times as much. Lets increase the maximum
pattern size to 160 to be prepared for full 64k slots.
Change-Id: I5be127ed5e39cb154e949b16fb08c26a1d816357
Related: OS#5198
---
M src/trau/trau_sync.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/99/29999/1
diff --git a/src/trau/trau_sync.c b/src/trau/trau_sync.c
index dba9cd1..f0af26d 100644
--- a/src/trau/trau_sync.c
+++ b/src/trau/trau_sync.c
@@ -31,7 +31,7 @@
#define S(x) (1 << (x))
-#define MAX_TRAU_BYTES 40
+#define MAX_TRAU_BYTES 160
#define T_SYNC 1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/29999
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I5be127ed5e39cb154e949b16fb08c26a1d816357
Gerrit-Change-Number: 29999
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newchange
1
0
03 Nov '22
Attention is currently required from: osmith.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/29998 )
Change subject: jobs/obs: don't upload to build.opensuse.org
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29998
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: If6f87dc6dbb4bafa3abb1d840f8d43cce6432dfd
Gerrit-Change-Number: 29998
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 03 Nov 2022 20:46:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
1
0
03 Nov '22
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29998 )
Change subject: jobs/obs: don't upload to build.opensuse.org
......................................................................
jobs/obs: don't upload to build.opensuse.org
The transitional phase where we upload to both the old and new OBS
server is over, so just upload to the new server from now on.
Related: OS#5557
Change-Id: If6f87dc6dbb4bafa3abb1d840f8d43cce6432dfd
---
M jobs/osmocom-obs.yml
1 file changed, 0 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/98/29998/1
diff --git a/jobs/osmocom-obs.yml b/jobs/osmocom-obs.yml
index 0036493..25e48c3 100644
--- a/jobs/osmocom-obs.yml
+++ b/jobs/osmocom-obs.yml
@@ -13,15 +13,8 @@
- latest:
conflict_version: ""
server:
- - build.opensuse.org:
- proj: "network:osmocom"
- obs.osmocom.org:
proj: "osmocom"
- # Pushing to build.opensuse.org is legacy, will be disabled soon (OS#5557).
- # Don't push the new master repository there.
- exclude:
- - type: master
- server: build.opensuse.org
- job-template:
name: 'Osmocom_OBS_{type}_{server}'
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29998
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: If6f87dc6dbb4bafa3abb1d840f8d43cce6432dfd
Gerrit-Change-Number: 29998
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newchange
1
0
Change in osmo-ttcn3-hacks[master]: pcu: Introduce tests TC_ul_tbf_{1,2}phase_while_dl_ass_pch
by pespin 03 Nov '22
by pespin 03 Nov '22
03 Nov '22
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29934 )
Change subject: pcu: Introduce tests TC_ul_tbf_{1,2}phase_while_dl_ass_pch
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
I'm merging this tomorrow if I don't get another +1 given the low reviewer affluence after 3 days.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29934
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6a72c36265bfdc757180cbb466492ad6bbbf16ad
Gerrit-Change-Number: 29934
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 03 Nov 2022 18:03:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
1
0
Change in osmo-ggsn[master]: ggsn: Introduce tdef and make it configurable over VTY
by pespin 03 Nov '22
by pespin 03 Nov '22
03 Nov '22
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/29969 )
Change subject: ggsn: Introduce tdef and make it configurable over VTY
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/29969
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I10bc8e2e197c0e8753b23b684b5ae41025672bf7
Gerrit-Change-Number: 29969
Gerrit-PatchSet: 1
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-Comment-Date: Thu, 03 Nov 2022 18:01:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
1
0
03 Nov '22
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/29966 )
Change subject: Use rate_ctr for gsn_t available_counters
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/29966
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I529305b4f824600c6e733a3c0d2c2c6673f99faf
Gerrit-Change-Number: 29966
Gerrit-PatchSet: 1
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-Comment-Date: Thu, 03 Nov 2022 18:01:34 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
1
0