aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-08-25 13:26:07 +0200
committerAlexander Couzens <lynxis@fe80.eu>2020-08-25 13:26:07 +0200
commit62b069fc4ca31ad16506e250d808ac29e3a7c696 (patch)
treedc79681df3b3fa5925ee64b0dac903bce2cbaffd
parent946025ddf54d2d4deaa1c9251df31d0445888579 (diff)
-rw-r--r--src/gprs_bssgp_pcu.cpp23
-rw-r--r--src/pcu_l1_if.cpp10
-rw-r--r--src/pcu_vty.c8
-rw-r--r--src/pcu_vty.h1
4 files changed, 12 insertions, 30 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index deb1680..ca76cda 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -894,28 +894,6 @@ static void bvc_timeout(void *_priv)
osmo_timer_schedule(&the_pcu.bvc_timer, the_pcu.bts->fc_interval, 0);
}
-static int gprs_ns_reconnect(struct gprs_nsvc *nsvc)
-{
-
- /* shouldn't the reconnect to be done by the fsm itself? */
-// struct gprs_nsvc *nsvc2;
-
-// if (nsvc != the_pcu.bts->nse) {
-// LOGP(DBSSGP, LOGL_ERROR, "NSE is invalid\n");
-// return -EBADF;
-// }
-
-// if (the_pcu.bts->gb_dialect_sns)
-// nsvc2 = gprs_ns_nsip_connect_sns(pcu_nsi, &nsvc->ip.bts_addr, nsvc->nsei, nsvc->nsvci);
-// else
-// nsvc2 = gprs_ns_nsip_connect(pcu_nsi, &nsvc->ip.bts_addr, nsvc->nsei, nsvc->nsvci);
-// if (!nsvc2) {
-// LOGP(DBSSGP, LOGL_ERROR, "Failed to reconnect NSVC\n");
-// return -EIO;
-// }
-
- return 0;
-}
int gprs_nsvc_create_and_connect(
struct gprs_rlcmac_bts *bts,
@@ -932,7 +910,6 @@ int gprs_nsvc_create_and_connect(
gprs_ns2_free(bts->nsi);
return 1;
}
- gprs_ns2_bind_set_mode(bind, NS2_VC_MODE_ALIVE);
bts->nse = gprs_ns2_nse_by_nsei(bts->nsi, nsei);
if (!bts->nse)
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index fe610cb..bdd5948 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -583,24 +583,24 @@ bssgp_failed:
for (int i=0; i<2; i++) {
struct osmo_sockaddr_str sockstr;
- switch (info_ind->address_family[i]) {
+ switch (info_ind->remote_proto[i]) {
case IPPROTO_IPIP:
local_sockaddr.u.sin.sin_family = AF_INET;
local_sockaddr.u.sin.sin_addr.s_addr = INADDR_ANY;
- local_sockaddr.u.sin.sin_port = info_ind->local_port[i];;
+ local_sockaddr.u.sin.sin_port = htons(info_ind->local_port[i]);
remote_sockaddr.u.sin.sin_family = AF_INET;
remote_sockaddr.u.sin.sin_addr = info_ind->remote_ip[i].ipv4;
- remote_sockaddr.u.sin.sin_port = info_ind->remote_port[i];
+ remote_sockaddr.u.sin.sin_port = htons(info_ind->remote_port[i]);
break;
case IPPROTO_IPV6:
local_sockaddr.u.sin6.sin6_family = AF_INET6;
local_sockaddr.u.sin6.sin6_addr = in6addr_any;
- local_sockaddr.u.sin6.sin6_port = info_ind->local_port[i];
+ local_sockaddr.u.sin6.sin6_port = htons(info_ind->local_port[i]);
remote_sockaddr.u.sin6.sin6_family = AF_INET6;
remote_sockaddr.u.sin6.sin6_addr = info_ind->remote_ip[i].ipv6;
- remote_sockaddr.u.sin6.sin6_port = info_ind->remote_port[i];
+ remote_sockaddr.u.sin6.sin6_port = htons(info_ind->remote_port[i]);
break;
default:
continue;
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 99c92b7..8c79555 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -13,6 +13,7 @@
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/pcu/pcuif_proto.h>
+#include <osmocom/gprs/gprs_ns2.h>
#include "pcu_vty.h"
#include "gprs_rlcmac.h"
#include <pdch.h>
@@ -1088,10 +1089,13 @@ DEFUN(cfg_pcu_gb_dialect,
{
struct gprs_rlcmac_bts *bts = bts_main_data();
- if (!strcmp(argv[0], "ip-sns"))
+ if (!strcmp(argv[0], "ip-sns")) {
bts->gb_dialect_sns = true;
- else
+ gprs_ns2_vty_force_vc_mode(true, NS2_VC_MODE_ALIVE, "gb-dialect is ip-sns");
+ } else {
bts->gb_dialect_sns = false;
+ gprs_ns2_vty_force_vc_mode(false, 0, NULL);
+ }
return CMD_SUCCESS;
}
diff --git a/src/pcu_vty.h b/src/pcu_vty.h
index 2097561..00494d6 100644
--- a/src/pcu_vty.h
+++ b/src/pcu_vty.h
@@ -1,4 +1,5 @@
#ifndef _PCU_VTY_H
+
#define _PCU_VTY_H
#include <osmocom/gsm/protocol/gsm_04_08.h>