aboutsummaryrefslogtreecommitdiffstats
path: root/src/libgb
diff options
context:
space:
mode:
Diffstat (limited to 'src/libgb')
-rw-r--r--src/libgb/Makefile.am2
-rw-r--r--src/libgb/Makefile.in6
-rw-r--r--src/libgb/gprs_bssgp.c8
-rw-r--r--src/libgb/gprs_bssgp_util.c6
-rw-r--r--src/libgb/gprs_bssgp_vty.c11
-rw-r--r--src/libgb/gprs_ns.c48
-rw-r--r--src/libgb/gprs_ns_frgre.c18
-rw-r--r--src/libgb/gprs_ns_vty.c11
8 files changed, 57 insertions, 53 deletions
diff --git a/src/libgb/Makefile.am b/src/libgb/Makefile.am
index b48b17791..8ec100699 100644
--- a/src/libgb/Makefile.am
+++ b/src/libgb/Makefile.am
@@ -1,6 +1,6 @@
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS=-Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
-AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS)
+AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOCORE_GSM) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS)
noinst_LIBRARIES = libgb.a
diff --git a/src/libgb/Makefile.in b/src/libgb/Makefile.in
index 7b9dbd98c..c21201c23 100644
--- a/src/libgb/Makefile.in
+++ b/src/libgb/Makefile.in
@@ -35,7 +35,7 @@ POST_UNINSTALL = :
subdir = src/libgb
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -112,6 +112,8 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBOSMOCORE_CFLAGS = @LIBOSMOCORE_CFLAGS@
LIBOSMOCORE_LIBS = @LIBOSMOCORE_LIBS@
+LIBOSMOGSM_CFLAGS = @LIBOSMOGSM_CFLAGS@
+LIBOSMOGSM_LIBS = @LIBOSMOGSM_LIBS@
LIBOSMOSCCP_CFLAGS = @LIBOSMOSCCP_CFLAGS@
LIBOSMOSCCP_LIBS = @LIBOSMOSCCP_LIBS@
LIBOSMOVTY_CFLAGS = @LIBOSMOVTY_CFLAGS@
@@ -182,7 +184,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS)
-AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS)
+AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOCORE_GSM) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS)
noinst_LIBRARIES = libgb.a
libgb_a_SOURCES = gprs_ns.c gprs_ns_frgre.c gprs_ns_vty.c \
gprs_bssgp.c gprs_bssgp_util.c gprs_bssgp_vty.c
diff --git a/src/libgb/gprs_bssgp.c b/src/libgb/gprs_bssgp.c
index eca34b989..b74791c42 100644
--- a/src/libgb/gprs_bssgp.c
+++ b/src/libgb/gprs_bssgp.c
@@ -27,10 +27,10 @@
#include <netinet/in.h>
-#include <osmocore/msgb.h>
-#include <osmocore/tlv.h>
-#include <osmocore/talloc.h>
-#include <osmocore/rate_ctr.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/rate_ctr.h>
#include <openbsc/debug.h>
#include <openbsc/gsm_data.h>
diff --git a/src/libgb/gprs_bssgp_util.c b/src/libgb/gprs_bssgp_util.c
index f8e3b5699..b5393239e 100644
--- a/src/libgb/gprs_bssgp_util.c
+++ b/src/libgb/gprs_bssgp_util.c
@@ -24,9 +24,9 @@
#include <netinet/in.h>
-#include <osmocore/msgb.h>
-#include <osmocore/tlv.h>
-#include <osmocore/talloc.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/core/talloc.h>
#include <openbsc/debug.h>
#include <openbsc/gsm_data.h>
diff --git a/src/libgb/gprs_bssgp_vty.c b/src/libgb/gprs_bssgp_vty.c
index 9ebd09004..a0d74ac94 100644
--- a/src/libgb/gprs_bssgp_vty.c
+++ b/src/libgb/gprs_bssgp_vty.c
@@ -27,11 +27,11 @@
#include <arpa/inet.h>
#include <openbsc/gsm_data.h>
-#include <osmocore/msgb.h>
-#include <osmocore/tlv.h>
-#include <osmocore/talloc.h>
-#include <osmocore/select.h>
-#include <osmocore/rate_ctr.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/select.h>
+#include <osmocom/core/rate_ctr.h>
#include <openbsc/debug.h>
#include <openbsc/signal.h>
#include <openbsc/gprs_ns.h>
@@ -42,6 +42,7 @@
#include <osmocom/vty/command.h>
#include <osmocom/vty/logging.h>
#include <osmocom/vty/telnet_interface.h>
+#include <osmocom/vty/misc.h>
/* FIXME: this should go to some common file as it is copied
* in vty_interface.c of the BSC */
diff --git a/src/libgb/gprs_ns.c b/src/libgb/gprs_ns.c
index 5a8e35860..dab57e663 100644
--- a/src/libgb/gprs_ns.c
+++ b/src/libgb/gprs_ns.c
@@ -59,11 +59,11 @@
#include <arpa/inet.h>
#include <openbsc/gsm_data.h>
-#include <osmocore/msgb.h>
-#include <osmocore/tlv.h>
-#include <osmocore/talloc.h>
-#include <osmocore/select.h>
-#include <osmocore/rate_ctr.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/select.h>
+#include <osmocom/core/rate_ctr.h>
#include <openbsc/debug.h>
#include <openbsc/signal.h>
#include <openbsc/gprs_ns.h>
@@ -166,13 +166,13 @@ struct gprs_nsvc *nsvc_create(struct gprs_ns_inst *nsi, uint16_t nsvci)
void nsvc_delete(struct gprs_nsvc *nsvc)
{
- if (bsc_timer_pending(&nsvc->timer))
- bsc_del_timer(&nsvc->timer);
+ if (osmo_timer_pending(&nsvc->timer))
+ osmo_timer_del(&nsvc->timer);
llist_del(&nsvc->list);
talloc_free(nsvc);
}
-static void ns_dispatch_signal(struct gprs_nsvc *nsvc, unsigned int signal,
+static void ns_osmo_signal_dispatch(struct gprs_nsvc *nsvc, unsigned int signal,
uint8_t cause)
{
struct ns_signal_data nssd;
@@ -180,7 +180,7 @@ static void ns_dispatch_signal(struct gprs_nsvc *nsvc, unsigned int signal,
nssd.nsvc = nsvc;
nssd.cause = cause;
- dispatch_signal(SS_NS, signal, &nssd);
+ osmo_signal_dispatch(SS_NS, signal, &nssd);
}
/* Section 10.3.2, Table 13 */
@@ -405,11 +405,11 @@ static void nsvc_start_timer(struct gprs_nsvc *nsvc, enum nsvc_timer_mode mode)
nsvc->nsei, get_value_string(timer_mode_strs, mode),
seconds);
- if (bsc_timer_pending(&nsvc->timer))
- bsc_del_timer(&nsvc->timer);
+ if (osmo_timer_pending(&nsvc->timer))
+ osmo_timer_del(&nsvc->timer);
nsvc->timer_mode = mode;
- bsc_schedule_timer(&nsvc->timer, seconds, 0);
+ osmo_timer_schedule(&nsvc->timer, seconds, 0);
}
static void gprs_ns_timer_cb(void *data)
@@ -437,8 +437,8 @@ static void gprs_ns_timer_cb(void *data)
"NSEI=%u Tns-alive expired more then "
"%u times, blocking NS-VC\n", nsvc->nsei,
nsvc->nsi->timeout[NS_TOUT_TNS_ALIVE_RETRIES]);
- ns_dispatch_signal(nsvc, S_NS_ALIVE_EXP, 0);
- ns_dispatch_signal(nsvc, S_NS_BLOCK, NS_CAUSE_NSVC_BLOCKED);
+ ns_osmo_signal_dispatch(nsvc, S_NS_ALIVE_EXP, 0);
+ ns_osmo_signal_dispatch(nsvc, S_NS_BLOCK, NS_CAUSE_NSVC_BLOCKED);
return;
}
/* Tns-test case: send NS-ALIVE PDU */
@@ -631,7 +631,7 @@ static int gprs_ns_rx_reset(struct gprs_nsvc *nsvc, struct msgb *msg)
/* inform interested parties about the fact that this NSVC
* has received RESET */
- ns_dispatch_signal(nsvc, S_NS_RESET, *cause);
+ ns_osmo_signal_dispatch(nsvc, S_NS_RESET, *cause);
return gprs_ns_tx_reset_ack(nsvc);
}
@@ -665,7 +665,7 @@ static int gprs_ns_rx_block(struct gprs_nsvc *nsvc, struct msgb *msg)
cause = (uint8_t *) TLVP_VAL(&tp, NS_IE_CAUSE);
//nsvci = (uint16_t *) TLVP_VAL(&tp, NS_IE_VCI);
- ns_dispatch_signal(nsvc, S_NS_BLOCK, *cause);
+ ns_osmo_signal_dispatch(nsvc, S_NS_BLOCK, *cause);
rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]);
return gprs_ns_tx_simple(nsvc, NS_PDUT_BLOCK_ACK);
@@ -786,7 +786,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]);
if (nsvc->persistent || nsvc->remote_end_is_sgsn) {
/* stop RESET timer */
- bsc_del_timer(&nsvc->timer);
+ osmo_timer_del(&nsvc->timer);
}
/* Initiate TEST proc.: Send ALIVE and start timer */
rc = gprs_ns_tx_simple(nsvc, NS_PDUT_ALIVE);
@@ -796,7 +796,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
/* Section 7.2: unblocking procedure */
LOGP(DNS, LOGL_INFO, "NSEI=%u Rx NS UNBLOCK\n", nsvc->nsei);
nsvc->state &= ~NSE_S_BLOCKED;
- ns_dispatch_signal(nsvc, S_NS_UNBLOCK, 0);
+ ns_osmo_signal_dispatch(nsvc, S_NS_UNBLOCK, 0);
rc = gprs_ns_tx_simple(nsvc, NS_PDUT_UNBLOCK_ACK);
break;
case NS_PDUT_UNBLOCK_ACK:
@@ -804,7 +804,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
/* mark NS-VC as unblocked + active */
nsvc->state = NSE_S_ALIVE;
nsvc->remote_state = NSE_S_ALIVE;
- ns_dispatch_signal(nsvc, S_NS_UNBLOCK, 0);
+ ns_osmo_signal_dispatch(nsvc, S_NS_UNBLOCK, 0);
break;
case NS_PDUT_BLOCK:
rc = gprs_ns_rx_block(nsvc, msg);
@@ -858,7 +858,7 @@ void gprs_ns_destroy(struct gprs_ns_inst *nsi)
* We don't support Size Procedure, Configuration Procedure, ChangeWeight Procedure */
/* Read a single NS-over-IP message */
-static struct msgb *read_nsip_msg(struct bsc_fd *bfd, int *error,
+static struct msgb *read_nsip_msg(struct osmo_fd *bfd, int *error,
struct sockaddr_in *saddr)
{
struct msgb *msg = gprs_ns_msgb_alloc();
@@ -890,7 +890,7 @@ static struct msgb *read_nsip_msg(struct bsc_fd *bfd, int *error,
return msg;
}
-static int handle_nsip_read(struct bsc_fd *bfd)
+static int handle_nsip_read(struct osmo_fd *bfd)
{
int error;
struct sockaddr_in saddr;
@@ -907,7 +907,7 @@ static int handle_nsip_read(struct bsc_fd *bfd)
return error;
}
-static int handle_nsip_write(struct bsc_fd *bfd)
+static int handle_nsip_write(struct osmo_fd *bfd)
{
/* FIXME: actually send the data here instead of nsip_sendmsg() */
return -EIO;
@@ -928,7 +928,7 @@ static int nsip_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg)
}
/* UDP Port 23000 carries the LLC-in-BSSGP-in-NS protocol stack */
-static int nsip_fd_cb(struct bsc_fd *bfd, unsigned int what)
+static int nsip_fd_cb(struct osmo_fd *bfd, unsigned int what)
{
int rc = 0;
@@ -946,7 +946,7 @@ int gprs_ns_nsip_listen(struct gprs_ns_inst *nsi)
int ret;
ret = make_sock(&nsi->nsip.fd, IPPROTO_UDP, nsi->nsip.local_ip,
- nsi->nsip.local_port, nsip_fd_cb);
+ nsi->nsip.local_port, 0, nsip_fd_cb, NULL);
if (ret < 0)
return ret;
diff --git a/src/libgb/gprs_ns_frgre.c b/src/libgb/gprs_ns_frgre.c
index 106f410e6..366257239 100644
--- a/src/libgb/gprs_ns_frgre.c
+++ b/src/libgb/gprs_ns_frgre.c
@@ -31,9 +31,9 @@
#include <netinet/ip.h>
#include <arpa/inet.h>
-#include <osmocore/select.h>
-#include <osmocore/msgb.h>
-#include <osmocore/talloc.h>
+#include <osmocom/core/select.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/talloc.h>
#include <openbsc/socket.h>
#include <openbsc/debug.h>
@@ -49,7 +49,7 @@ struct gre_hdr {
} __attribute__ ((packed));
/* IPv4 messages inside the GRE tunnel might be GRE keepalives */
-static int handle_rx_gre_ipv4(struct bsc_fd *bfd, struct msgb *msg,
+static int handle_rx_gre_ipv4(struct osmo_fd *bfd, struct msgb *msg,
struct iphdr *iph, struct gre_hdr *greh)
{
struct gprs_ns_inst *nsi = bfd->data;
@@ -101,7 +101,7 @@ static int handle_rx_gre_ipv4(struct bsc_fd *bfd, struct msgb *msg,
(struct sockaddr *)&daddr, sizeof(daddr));
}
-static struct msgb *read_nsfrgre_msg(struct bsc_fd *bfd, int *error,
+static struct msgb *read_nsfrgre_msg(struct osmo_fd *bfd, int *error,
struct sockaddr_in *saddr)
{
struct msgb *msg = msgb_alloc(NS_ALLOC_SIZE, "Gb/NS/FR/GRE Rx");
@@ -203,7 +203,7 @@ out_err:
int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
struct sockaddr_in *saddr, enum gprs_ns_ll ll);
-static int handle_nsfrgre_read(struct bsc_fd *bfd)
+static int handle_nsfrgre_read(struct osmo_fd *bfd)
{
int rc;
struct sockaddr_in saddr;
@@ -230,7 +230,7 @@ out:
return rc;
}
-static int handle_nsfrgre_write(struct bsc_fd *bfd)
+static int handle_nsfrgre_write(struct osmo_fd *bfd)
{
/* FIXME: actually send the data here instead of nsip_sendmsg() */
return -EIO;
@@ -268,7 +268,7 @@ int gprs_ns_frgre_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg)
return rc;
}
-static int nsfrgre_fd_cb(struct bsc_fd *bfd, unsigned int what)
+static int nsfrgre_fd_cb(struct osmo_fd *bfd, unsigned int what)
{
int rc = 0;
@@ -292,7 +292,7 @@ int gprs_ns_frgre_listen(struct gprs_ns_inst *nsi)
return 0;
rc = make_sock(&nsi->frgre.fd, IPPROTO_GRE, nsi->frgre.local_ip,
- 0, nsfrgre_fd_cb);
+ 0, 0, nsfrgre_fd_cb, NULL);
if (rc < 0) {
LOGP(DNS, LOGL_ERROR, "Error creating GRE socket (%s)\n",
strerror(errno));
diff --git a/src/libgb/gprs_ns_vty.c b/src/libgb/gprs_ns_vty.c
index 39277fc71..14d7691dd 100644
--- a/src/libgb/gprs_ns_vty.c
+++ b/src/libgb/gprs_ns_vty.c
@@ -27,11 +27,11 @@
#include <arpa/inet.h>
#include <openbsc/gsm_data.h>
-#include <osmocore/msgb.h>
-#include <osmocore/tlv.h>
-#include <osmocore/talloc.h>
-#include <osmocore/select.h>
-#include <osmocore/rate_ctr.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/select.h>
+#include <osmocom/core/rate_ctr.h>
#include <openbsc/debug.h>
#include <openbsc/signal.h>
#include <openbsc/gprs_ns.h>
@@ -42,6 +42,7 @@
#include <osmocom/vty/command.h>
#include <osmocom/vty/logging.h>
#include <osmocom/vty/telnet_interface.h>
+#include <osmocom/vty/misc.h>
static struct gprs_ns_inst *vty_nsi = NULL;