8 Commits
0.4.1 ... 0.4.2

Author SHA1 Message Date
Pau Espin Pedrol
311673c365 Bump version: 0.4.1.7-7fbd-dirty → 0.4.2
Change-Id: I49749d1d5809d18a7c0c81fb7316791fad81b5cc
2023-09-12 17:08:38 +02:00
Pau Espin Pedrol
7fbd6aa472 Catch and forbid configuring peers before configuring main protocol node
When the user enters each "peer" node, the related object is created if
not yet existing, and its updated config is applied (connect()) upon
exiting the node (cbc_peer_apply_cfg_chg()). When connect happens, it
needs to obtain the local IP address from the main protocol node
(cbsp|sbcap)", which means it must be configured beforehand, otherwise
the peers connect using the default values.

Hence, it makes no sense to configure peers if the main protocol
information has not yet been configured. The usual example configs as
well as the write-config VTY commands provide correct order of things.
Catch and forbid the user providing a config file where the peers are
configured before the main protocol nodes.

Related: OS#6154
Change-Id: I678f9e6715c85b1eb9116cc892f1a8299577c0c2
2023-08-29 17:26:56 +02:00
Oliver Smith
66221e60d6 systemd: depend on networking-online.target
Related: SYS#6400
Change-Id: I9c0cc0779f9ddb7520a565668b7cde07c6ad55d8
2023-05-26 14:10:44 +02:00
Pau Espin Pedrol
0422a10253 README.md: Document generation of SBcAP code from ASN.1 files
Change-Id: Id6edb2dcbd39ca101110f1ca57fcd67bf08c0ef0
2023-05-16 12:33:57 +02:00
Pau Espin Pedrol
292b2e895b sbcap: Update asn1c skeleton files
Update skeleton files using newest asn1c with APER support [1],
commit 08b293e8aa342d465d26805d1d66f3595b2ce261.

This contains among others, fix to automatically disable stack overflow checks [2]
when using ASan, in order to avoid failing during unit test run.

[1] https://github.com/mouse07410/asn1c/tree/vlm_master
[2] https://github.com/mouse07410/asn1c/pull/128

Related: OS#6025
Change-Id: I385d14d4be308b991a48ce1033087f07bd1f47ea
2023-05-15 17:34:45 +02:00
Oliver Smith
a7aca0333b debian: set compat level to 10
Related: OS#5958
Change-Id: Id0f168a7d3c2ae6869121397e65ca1d0cfea30d3
2023-04-25 16:48:21 +02:00
Vadim Yanitskiy
d04fe38e73 tests: use -no-install libtool flag to avoid ./lt-* scripts
This option should be used for any executables which are used only
for testing, or for generating other files and are consequently never
installed.  By specifying this option, we are telling Libtool that
the executable it links will only ever be executed from where it is
built in the build tree.  Libtool is usually able to considerably
speed up the link process for such executables.

Change-Id: I405b5e85113e9529b4491c7eeeec71afe25ef488
2023-03-11 04:34:45 +07:00
Vadim Yanitskiy
eb82cbc249 {src,tests/sbcap}/Makefile.am: reorder libraries in LDADD
... so that locally built libraries are listed first.
Otherwise the linker may pick system-installed libs instead.

Change-Id: I3396a95d221e81f3785a5883630d261f033aa10e
2023-03-09 17:11:37 +07:00
46 changed files with 229 additions and 109 deletions

View File

@@ -67,3 +67,30 @@ more details
The current patch queue for osmo-cbc can be seen at
https://gerrit.osmocom.org/#/q/project:osmo-cbc+status:open
Generating asn1c code
---------------------
Upstream master as1nc from [vlm](https://github.com/vlm/asn1c) [doesn't support
APER encoding](https://github.com/vlm/asn1c/issues/452). Nevertheless, the
upstream fork maintained by a big contributor
[mouse07410](https://github.com/mouse07410/asn1c) does support it, and it is
used in osmo-cbc to generate the SBc-AP code from ASN.1 files present in
src/sbcap/asn1/.
In order to regenerate the code, one shall adjust the ASN1C_SKELETON_PATH and
ASN1C_BIN_PATH in configure.ac to point to the built & installed asn1c from
mouse07410 (usually `vlm_master` branch). Last generated code was built using
commit hash 08b293e8aa342d465d26805d1d66f3595b2ce261.
Then, do the usual `autoreconf -fi && ./configure`, using a buildir != srcdir
(important, in order to avoid ending up with tempotary files in srcdir and
making it difficult to stash the relevant changes).
Finally, run `make -C src/ regen`, which will regenerate the files and copy over
the skeletons, with git possibily showing changes in the following paths:
- include/osmocom/sbcap/
- src/sbcap/gen/
- src/sbcap/skel/

View File

@@ -31,10 +31,10 @@ if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
fi
PKG_PROG_PKG_CONFIG([0.20])
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.8.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.8.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.8.0)
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.9.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.9.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.9.0)
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.4.0)
PKG_CHECK_MODULES(ULFIUS, libulfius)
PKG_CHECK_MODULES(JANSSON, jansson)
PKG_CHECK_MODULES(ORCANIA, liborcania)

View File

@@ -31,10 +31,10 @@ BuildRequires: pkgconfig >= 0.20
BuildRequires: systemd-rpm-macros
%endif
BuildRequires: pkgconfig(libsctp)
BuildRequires: pkgconfig(libosmocore) >= 1.8.0
BuildRequires: pkgconfig(libosmogsm) >= 1.8.0
BuildRequires: pkgconfig(libosmovty) >= 1.8.0
BuildRequires: pkgconfig(libosmo-netif) >= 1.3.0
BuildRequires: pkgconfig(libosmocore) >= 1.9.0
BuildRequires: pkgconfig(libosmogsm) >= 1.9.0
BuildRequires: pkgconfig(libosmovty) >= 1.9.0
BuildRequires: pkgconfig(libosmo-netif) >= 1.4.0
BuildRequires: pkgconfig(talloc)
BuildRequires: pkgconfig(libulfius)
%{?systemd_requires}

View File

@@ -1,5 +1,7 @@
[Unit]
Description=Osmocom CBC (Cell Broadcasting Centre)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple

17
debian/changelog vendored
View File

@@ -1,3 +1,20 @@
osmo-cbc (0.4.2) unstable; urgency=medium
[ Vadim Yanitskiy ]
* {src,tests/sbcap}/Makefile.am: reorder libraries in LDADD
* tests: use -no-install libtool flag to avoid ./lt-* scripts
[ Oliver Smith ]
* debian: set compat level to 10
* systemd: depend on networking-online.target
[ Pau Espin Pedrol ]
* sbcap: Update asn1c skeleton files
* README.md: Document generation of SBcAP code from ASN.1 files
* Catch and forbid configuring peers before configuring main protocol node
-- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 12 Sep 2023 17:08:37 +0200
osmo-cbc (0.4.1) unstable; urgency=medium
[ Vadim Yanitskiy ]

2
debian/compat vendored
View File

@@ -1 +1 @@
9
10

6
debian/control vendored
View File

@@ -2,7 +2,7 @@ Source: osmo-cbc
Section: net
Priority: extra
Maintainer: Osmocom team <openbsc@lists.osmocom.org>
Build-Depends: debhelper (>=9),
Build-Depends: debhelper (>= 10),
dh-autoreconf,
autotools-dev,
autoconf,
@@ -11,8 +11,8 @@ Build-Depends: debhelper (>=9),
pkg-config,
python3-minimal,
libtalloc-dev,
libosmocore-dev (>= 1.8.0),
libosmo-netif-dev (>= 1.3.0),
libosmocore-dev (>= 1.9.0),
libosmo-netif-dev (>= 1.4.0),
libulfius-dev,
libjansson-dev,
libsctp-dev,

View File

@@ -57,11 +57,13 @@ struct cbc {
struct {
char *local_host;
int local_port;
bool configured;
} cbsp;
struct {
char *local_host[CBC_MAX_LOC_ADDRS];
unsigned int num_local_host;
int local_port;
bool configured;
} sbcap;
struct {
char *local_host;

View File

@@ -29,12 +29,12 @@ typedef long SBcAP_Concurrent_Warning_Message_Indicator_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_SBcAP_Concurrent_Warning_Message_Indicator_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Concurrent_Warning_Message_Indicator;
extern const asn_INTEGER_specifics_t asn_SPC_Concurrent_Warning_Message_Indicator_specs_1;
asn_struct_free_f Concurrent_Warning_Message_Indicator_free;
asn_struct_print_f Concurrent_Warning_Message_Indicator_print;
asn_constr_check_f Concurrent_Warning_Message_Indicator_constraint;
per_type_decoder_f Concurrent_Warning_Message_Indicator_decode_aper;
per_type_encoder_f Concurrent_Warning_Message_Indicator_encode_aper;
extern const asn_INTEGER_specifics_t asn_SPC_SBcAP_Concurrent_Warning_Message_Indicator_specs_1;
asn_struct_free_f SBcAP_Concurrent_Warning_Message_Indicator_free;
asn_struct_print_f SBcAP_Concurrent_Warning_Message_Indicator_print;
asn_constr_check_f SBcAP_Concurrent_Warning_Message_Indicator_constraint;
per_type_decoder_f SBcAP_Concurrent_Warning_Message_Indicator_decode_aper;
per_type_encoder_f SBcAP_Concurrent_Warning_Message_Indicator_encode_aper;
#ifdef __cplusplus
}

View File

@@ -31,12 +31,12 @@ typedef long SBcAP_Criticality_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_SBcAP_Criticality_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Criticality;
extern const asn_INTEGER_specifics_t asn_SPC_Criticality_specs_1;
asn_struct_free_f Criticality_free;
asn_struct_print_f Criticality_print;
asn_constr_check_f Criticality_constraint;
per_type_decoder_f Criticality_decode_aper;
per_type_encoder_f Criticality_encode_aper;
extern const asn_INTEGER_specifics_t asn_SPC_SBcAP_Criticality_specs_1;
asn_struct_free_f SBcAP_Criticality_free;
asn_struct_print_f SBcAP_Criticality_print;
asn_constr_check_f SBcAP_Criticality_constraint;
per_type_decoder_f SBcAP_Criticality_decode_aper;
per_type_encoder_f SBcAP_Criticality_encode_aper;
#ifdef __cplusplus
}

View File

@@ -33,6 +33,8 @@ typedef struct SBcAP_Error_Indication {
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Error_Indication;
extern asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Error_Indication_specs_1;
extern asn_TYPE_member_t asn_MBR_SBcAP_Error_Indication_1[1];
#ifdef __cplusplus
}

View File

@@ -37,6 +37,8 @@ typedef struct SBcAP_PWS_Failure_Indication {
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_PWS_Failure_Indication;
extern asn_SEQUENCE_specifics_t asn_SPC_SBcAP_PWS_Failure_Indication_specs_1;
extern asn_TYPE_member_t asn_MBR_SBcAP_PWS_Failure_Indication_1[2];
#ifdef __cplusplus
}

View File

@@ -37,6 +37,8 @@ typedef struct SBcAP_PWS_Restart_Indication {
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_PWS_Restart_Indication;
extern asn_SEQUENCE_specifics_t asn_SPC_SBcAP_PWS_Restart_Indication_specs_1;
extern asn_TYPE_member_t asn_MBR_SBcAP_PWS_Restart_Indication_1[2];
#ifdef __cplusplus
}

View File

@@ -31,12 +31,12 @@ typedef long SBcAP_Presence_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_SBcAP_Presence_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Presence;
extern const asn_INTEGER_specifics_t asn_SPC_Presence_specs_1;
asn_struct_free_f Presence_free;
asn_struct_print_f Presence_print;
asn_constr_check_f Presence_constraint;
per_type_decoder_f Presence_decode_aper;
per_type_encoder_f Presence_encode_aper;
extern const asn_INTEGER_specifics_t asn_SPC_SBcAP_Presence_specs_1;
asn_struct_free_f SBcAP_Presence_free;
asn_struct_print_f SBcAP_Presence_print;
asn_constr_check_f SBcAP_Presence_constraint;
per_type_decoder_f SBcAP_Presence_decode_aper;
per_type_encoder_f SBcAP_Presence_encode_aper;
#ifdef __cplusplus
}

View File

@@ -29,12 +29,12 @@ typedef long SBcAP_RAT_Selector_5GS_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_SBcAP_RAT_Selector_5GS_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_RAT_Selector_5GS;
extern const asn_INTEGER_specifics_t asn_SPC_RAT_Selector_5GS_specs_1;
asn_struct_free_f RAT_Selector_5GS_free;
asn_struct_print_f RAT_Selector_5GS_print;
asn_constr_check_f RAT_Selector_5GS_constraint;
per_type_decoder_f RAT_Selector_5GS_decode_aper;
per_type_encoder_f RAT_Selector_5GS_encode_aper;
extern const asn_INTEGER_specifics_t asn_SPC_SBcAP_RAT_Selector_5GS_specs_1;
asn_struct_free_f SBcAP_RAT_Selector_5GS_free;
asn_struct_print_f SBcAP_RAT_Selector_5GS_print;
asn_constr_check_f SBcAP_RAT_Selector_5GS_constraint;
per_type_decoder_f SBcAP_RAT_Selector_5GS_decode_aper;
per_type_encoder_f SBcAP_RAT_Selector_5GS_encode_aper;
#ifdef __cplusplus
}

View File

@@ -29,12 +29,12 @@ typedef long SBcAP_Send_Stop_Warning_Indication_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_SBcAP_Send_Stop_Warning_Indication_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Send_Stop_Warning_Indication;
extern const asn_INTEGER_specifics_t asn_SPC_Send_Stop_Warning_Indication_specs_1;
asn_struct_free_f Send_Stop_Warning_Indication_free;
asn_struct_print_f Send_Stop_Warning_Indication_print;
asn_constr_check_f Send_Stop_Warning_Indication_constraint;
per_type_decoder_f Send_Stop_Warning_Indication_decode_aper;
per_type_encoder_f Send_Stop_Warning_Indication_encode_aper;
extern const asn_INTEGER_specifics_t asn_SPC_SBcAP_Send_Stop_Warning_Indication_specs_1;
asn_struct_free_f SBcAP_Send_Stop_Warning_Indication_free;
asn_struct_print_f SBcAP_Send_Stop_Warning_Indication_print;
asn_constr_check_f SBcAP_Send_Stop_Warning_Indication_constraint;
per_type_decoder_f SBcAP_Send_Stop_Warning_Indication_decode_aper;
per_type_encoder_f SBcAP_Send_Stop_Warning_Indication_encode_aper;
#ifdef __cplusplus
}

View File

@@ -29,12 +29,12 @@ typedef long SBcAP_Send_Write_Replace_Warning_Indication_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_SBcAP_Send_Write_Replace_Warning_Indication_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Send_Write_Replace_Warning_Indication;
extern const asn_INTEGER_specifics_t asn_SPC_Send_Write_Replace_Warning_Indication_specs_1;
asn_struct_free_f Send_Write_Replace_Warning_Indication_free;
asn_struct_print_f Send_Write_Replace_Warning_Indication_print;
asn_constr_check_f Send_Write_Replace_Warning_Indication_constraint;
per_type_decoder_f Send_Write_Replace_Warning_Indication_decode_aper;
per_type_encoder_f Send_Write_Replace_Warning_Indication_encode_aper;
extern const asn_INTEGER_specifics_t asn_SPC_SBcAP_Send_Write_Replace_Warning_Indication_specs_1;
asn_struct_free_f SBcAP_Send_Write_Replace_Warning_Indication_free;
asn_struct_print_f SBcAP_Send_Write_Replace_Warning_Indication_print;
asn_constr_check_f SBcAP_Send_Write_Replace_Warning_Indication_constraint;
per_type_decoder_f SBcAP_Send_Write_Replace_Warning_Indication_decode_aper;
per_type_encoder_f SBcAP_Send_Write_Replace_Warning_Indication_encode_aper;
#ifdef __cplusplus
}

View File

@@ -29,12 +29,12 @@ typedef long SBcAP_Stop_All_Indicator_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_SBcAP_Stop_All_Indicator_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Stop_All_Indicator;
extern const asn_INTEGER_specifics_t asn_SPC_Stop_All_Indicator_specs_1;
asn_struct_free_f Stop_All_Indicator_free;
asn_struct_print_f Stop_All_Indicator_print;
asn_constr_check_f Stop_All_Indicator_constraint;
per_type_decoder_f Stop_All_Indicator_decode_aper;
per_type_encoder_f Stop_All_Indicator_encode_aper;
extern const asn_INTEGER_specifics_t asn_SPC_SBcAP_Stop_All_Indicator_specs_1;
asn_struct_free_f SBcAP_Stop_All_Indicator_free;
asn_struct_print_f SBcAP_Stop_All_Indicator_print;
asn_constr_check_f SBcAP_Stop_All_Indicator_constraint;
per_type_decoder_f SBcAP_Stop_All_Indicator_decode_aper;
per_type_encoder_f SBcAP_Stop_All_Indicator_encode_aper;
#ifdef __cplusplus
}

View File

@@ -37,6 +37,8 @@ typedef struct SBcAP_Stop_Warning_Indication {
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Stop_Warning_Indication;
extern asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Stop_Warning_Indication_specs_1;
extern asn_TYPE_member_t asn_MBR_SBcAP_Stop_Warning_Indication_1[2];
#ifdef __cplusplus
}

View File

@@ -37,6 +37,8 @@ typedef struct SBcAP_Stop_Warning_Request {
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Stop_Warning_Request;
extern asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Stop_Warning_Request_specs_1;
extern asn_TYPE_member_t asn_MBR_SBcAP_Stop_Warning_Request_1[2];
#ifdef __cplusplus
}

View File

@@ -37,6 +37,8 @@ typedef struct SBcAP_Stop_Warning_Response {
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Stop_Warning_Response;
extern asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Stop_Warning_Response_specs_1;
extern asn_TYPE_member_t asn_MBR_SBcAP_Stop_Warning_Response_1[2];
#ifdef __cplusplus
}

View File

@@ -32,12 +32,12 @@ typedef long SBcAP_TriggeringMessage_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_SBcAP_TriggeringMessage_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_TriggeringMessage;
extern const asn_INTEGER_specifics_t asn_SPC_TriggeringMessage_specs_1;
asn_struct_free_f TriggeringMessage_free;
asn_struct_print_f TriggeringMessage_print;
asn_constr_check_f TriggeringMessage_constraint;
per_type_decoder_f TriggeringMessage_decode_aper;
per_type_encoder_f TriggeringMessage_encode_aper;
extern const asn_INTEGER_specifics_t asn_SPC_SBcAP_TriggeringMessage_specs_1;
asn_struct_free_f SBcAP_TriggeringMessage_free;
asn_struct_print_f SBcAP_TriggeringMessage_print;
asn_constr_check_f SBcAP_TriggeringMessage_constraint;
per_type_decoder_f SBcAP_TriggeringMessage_decode_aper;
per_type_encoder_f SBcAP_TriggeringMessage_encode_aper;
#ifdef __cplusplus
}

View File

@@ -33,12 +33,12 @@ typedef long SBcAP_TypeOfError_t;
/* Implementation */
extern asn_per_constraints_t asn_PER_type_SBcAP_TypeOfError_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_TypeOfError;
extern const asn_INTEGER_specifics_t asn_SPC_TypeOfError_specs_1;
asn_struct_free_f TypeOfError_free;
asn_struct_print_f TypeOfError_print;
asn_constr_check_f TypeOfError_constraint;
per_type_decoder_f TypeOfError_decode_aper;
per_type_encoder_f TypeOfError_encode_aper;
extern const asn_INTEGER_specifics_t asn_SPC_SBcAP_TypeOfError_specs_1;
asn_struct_free_f SBcAP_TypeOfError_free;
asn_struct_print_f SBcAP_TypeOfError_print;
asn_constr_check_f SBcAP_TypeOfError_constraint;
per_type_decoder_f SBcAP_TypeOfError_decode_aper;
per_type_encoder_f SBcAP_TypeOfError_encode_aper;
#ifdef __cplusplus
}

View File

@@ -37,6 +37,8 @@ typedef struct SBcAP_Write_Replace_Warning_Indication {
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Write_Replace_Warning_Indication;
extern asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Write_Replace_Warning_Indication_specs_1;
extern asn_TYPE_member_t asn_MBR_SBcAP_Write_Replace_Warning_Indication_1[2];
#ifdef __cplusplus
}

View File

@@ -37,6 +37,8 @@ typedef struct SBcAP_Write_Replace_Warning_Request {
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Write_Replace_Warning_Request;
extern asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Write_Replace_Warning_Request_specs_1;
extern asn_TYPE_member_t asn_MBR_SBcAP_Write_Replace_Warning_Request_1[2];
#ifdef __cplusplus
}

View File

@@ -37,6 +37,8 @@ typedef struct SBcAP_Write_Replace_Warning_Response {
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_SBcAP_Write_Replace_Warning_Response;
extern asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Write_Replace_Warning_Response_specs_1;
extern asn_TYPE_member_t asn_MBR_SBcAP_Write_Replace_Warning_Response_1[2];
#ifdef __cplusplus
}

View File

@@ -30,10 +30,17 @@ osmo_cbc_SOURCES = \
smscb_peer_fsm.c \
$(NULL)
osmo_cbc_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) \
$(LIBOSMONETIF_LIBS) \
$(ULFIUS_LIBS) $(JANSSON_LIBS) $(ORCANIA_LIBS) $(LIBSCTP_LIBS) \
sbcap/libosmo-sbcap.la
osmo_cbc_LDADD = \
sbcap/libosmo-sbcap.la \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOVTY_LIBS) \
$(LIBOSMONETIF_LIBS) \
$(ULFIUS_LIBS) \
$(JANSSON_LIBS) \
$(ORCANIA_LIBS) \
$(LIBSCTP_LIBS) \
$(NULL)
regen:
$(MAKE) -C sbcap regen

View File

@@ -108,12 +108,16 @@ static const struct log_info log_info = {
static int cbc_vty_go_parent(struct vty *vty)
{
switch (vty->node) {
case CBSP_NODE:
g_cbc->config.cbsp.configured = true;
break;
case SBcAP_NODE:
/* If no local addr set, add a default one: */
if (g_cbc->config.sbcap.num_local_host == 0) {
g_cbc->config.sbcap.local_host[0] = talloc_strdup(g_cbc, "127.0.0.1");
g_cbc->config.sbcap.num_local_host = 1;
}
g_cbc->config.sbcap.configured = true;
vty->node = CONFIG_NODE;
vty->index = NULL;
break;

View File

@@ -576,6 +576,26 @@ DEFUN(cfg_cbc_peer, cfg_cbc_peer_cmd,
enum cbc_peer_protocol proto;
proto = get_string_value(cbc_peer_proto_name_vty, argv[0]);
switch (proto) {
case CBC_PEER_PROTO_CBSP:
if (!g_cbc->config.cbsp.configured) {
vty_out(vty, "%% Node '%s' must be configured before configuring node 'peer'!%s",
argv[0], VTY_NEWLINE);
return CMD_WARNING;
}
break;
case CBC_PEER_PROTO_SBcAP:
if (!g_cbc->config.sbcap.configured) {
vty_out(vty, "%% Node '%s' must be configured before configuring node 'peer'!%s",
argv[0], VTY_NEWLINE);
return CMD_WARNING;
}
break;
case CBC_PEER_PROTO_SABP:
default:
return CMD_WARNING;
}
peer = cbc_peer_by_name(argv[1]);
if (!peer)
peer = cbc_peer_create(argv[1], proto);

View File

@@ -374,7 +374,7 @@ noinst_LTLIBRARIES=libosmo-asn1-sbcap.la
libosmo_asn1_sbcap_la_SOURCES=$(ASN_MODULE_SRC)
libosmo_asn1_sbcap_la_LIBADD=$(ASN1C_LDADD)
sbcap_LIBVERSION=0:0:0
sbcap_LIBVERSION=1:0:1
lib_LTLIBRARIES = libosmo-sbcap.la
libosmo_sbcap_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(sbcap_LIBVERSION) -no-undefined
libosmo_sbcap_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) \

View File

@@ -7,7 +7,7 @@
#include <osmocom/sbcap/SBcAP_Error-Indication.h>
static asn_TYPE_member_t asn_MBR_SBcAP_Error_Indication_1[] = {
asn_TYPE_member_t asn_MBR_SBcAP_Error_Indication_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SBcAP_Error_Indication, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
@@ -32,7 +32,7 @@ static const ber_tlv_tag_t asn_DEF_SBcAP_Error_Indication_tags_1[] = {
static const asn_TYPE_tag2member_t asn_MAP_SBcAP_Error_Indication_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
};
static asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Error_Indication_specs_1 = {
asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Error_Indication_specs_1 = {
sizeof(struct SBcAP_Error_Indication),
offsetof(struct SBcAP_Error_Indication, _asn_ctx),
asn_MAP_SBcAP_Error_Indication_tag2el_1,

View File

@@ -7,7 +7,7 @@
#include <osmocom/sbcap/SBcAP_PWS-Failure-Indication.h>
static asn_TYPE_member_t asn_MBR_SBcAP_PWS_Failure_Indication_1[] = {
asn_TYPE_member_t asn_MBR_SBcAP_PWS_Failure_Indication_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SBcAP_PWS_Failure_Indication, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
@@ -51,7 +51,7 @@ static const asn_TYPE_tag2member_t asn_MAP_SBcAP_PWS_Failure_Indication_tag2el_1
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* protocolIEs */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* protocolExtensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_SBcAP_PWS_Failure_Indication_specs_1 = {
asn_SEQUENCE_specifics_t asn_SPC_SBcAP_PWS_Failure_Indication_specs_1 = {
sizeof(struct SBcAP_PWS_Failure_Indication),
offsetof(struct SBcAP_PWS_Failure_Indication, _asn_ctx),
asn_MAP_SBcAP_PWS_Failure_Indication_tag2el_1,

View File

@@ -7,7 +7,7 @@
#include <osmocom/sbcap/SBcAP_PWS-Restart-Indication.h>
static asn_TYPE_member_t asn_MBR_SBcAP_PWS_Restart_Indication_1[] = {
asn_TYPE_member_t asn_MBR_SBcAP_PWS_Restart_Indication_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SBcAP_PWS_Restart_Indication, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
@@ -51,7 +51,7 @@ static const asn_TYPE_tag2member_t asn_MAP_SBcAP_PWS_Restart_Indication_tag2el_1
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* protocolIEs */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* protocolExtensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_SBcAP_PWS_Restart_Indication_specs_1 = {
asn_SEQUENCE_specifics_t asn_SPC_SBcAP_PWS_Restart_Indication_specs_1 = {
sizeof(struct SBcAP_PWS_Restart_Indication),
offsetof(struct SBcAP_PWS_Restart_Indication, _asn_ctx),
asn_MAP_SBcAP_PWS_Restart_Indication_tag2el_1,

View File

@@ -7,7 +7,7 @@
#include <osmocom/sbcap/SBcAP_Stop-Warning-Indication.h>
static asn_TYPE_member_t asn_MBR_SBcAP_Stop_Warning_Indication_1[] = {
asn_TYPE_member_t asn_MBR_SBcAP_Stop_Warning_Indication_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SBcAP_Stop_Warning_Indication, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
@@ -51,7 +51,7 @@ static const asn_TYPE_tag2member_t asn_MAP_SBcAP_Stop_Warning_Indication_tag2el_
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* protocolIEs */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* protocolExtensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Stop_Warning_Indication_specs_1 = {
asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Stop_Warning_Indication_specs_1 = {
sizeof(struct SBcAP_Stop_Warning_Indication),
offsetof(struct SBcAP_Stop_Warning_Indication, _asn_ctx),
asn_MAP_SBcAP_Stop_Warning_Indication_tag2el_1,

View File

@@ -7,7 +7,7 @@
#include <osmocom/sbcap/SBcAP_Stop-Warning-Request.h>
static asn_TYPE_member_t asn_MBR_SBcAP_Stop_Warning_Request_1[] = {
asn_TYPE_member_t asn_MBR_SBcAP_Stop_Warning_Request_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SBcAP_Stop_Warning_Request, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
@@ -51,7 +51,7 @@ static const asn_TYPE_tag2member_t asn_MAP_SBcAP_Stop_Warning_Request_tag2el_1[]
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* protocolIEs */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* protocolExtensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Stop_Warning_Request_specs_1 = {
asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Stop_Warning_Request_specs_1 = {
sizeof(struct SBcAP_Stop_Warning_Request),
offsetof(struct SBcAP_Stop_Warning_Request, _asn_ctx),
asn_MAP_SBcAP_Stop_Warning_Request_tag2el_1,

View File

@@ -7,7 +7,7 @@
#include <osmocom/sbcap/SBcAP_Stop-Warning-Response.h>
static asn_TYPE_member_t asn_MBR_SBcAP_Stop_Warning_Response_1[] = {
asn_TYPE_member_t asn_MBR_SBcAP_Stop_Warning_Response_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SBcAP_Stop_Warning_Response, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
@@ -51,7 +51,7 @@ static const asn_TYPE_tag2member_t asn_MAP_SBcAP_Stop_Warning_Response_tag2el_1[
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* protocolIEs */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* protocolExtensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Stop_Warning_Response_specs_1 = {
asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Stop_Warning_Response_specs_1 = {
sizeof(struct SBcAP_Stop_Warning_Response),
offsetof(struct SBcAP_Stop_Warning_Response, _asn_ctx),
asn_MAP_SBcAP_Stop_Warning_Response_tag2el_1,

View File

@@ -7,7 +7,7 @@
#include <osmocom/sbcap/SBcAP_Write-Replace-Warning-Indication.h>
static asn_TYPE_member_t asn_MBR_SBcAP_Write_Replace_Warning_Indication_1[] = {
asn_TYPE_member_t asn_MBR_SBcAP_Write_Replace_Warning_Indication_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SBcAP_Write_Replace_Warning_Indication, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
@@ -51,7 +51,7 @@ static const asn_TYPE_tag2member_t asn_MAP_SBcAP_Write_Replace_Warning_Indicatio
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* protocolIEs */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* protocolExtensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Write_Replace_Warning_Indication_specs_1 = {
asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Write_Replace_Warning_Indication_specs_1 = {
sizeof(struct SBcAP_Write_Replace_Warning_Indication),
offsetof(struct SBcAP_Write_Replace_Warning_Indication, _asn_ctx),
asn_MAP_SBcAP_Write_Replace_Warning_Indication_tag2el_1,

View File

@@ -7,7 +7,7 @@
#include <osmocom/sbcap/SBcAP_Write-Replace-Warning-Request.h>
static asn_TYPE_member_t asn_MBR_SBcAP_Write_Replace_Warning_Request_1[] = {
asn_TYPE_member_t asn_MBR_SBcAP_Write_Replace_Warning_Request_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SBcAP_Write_Replace_Warning_Request, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
@@ -51,7 +51,7 @@ static const asn_TYPE_tag2member_t asn_MAP_SBcAP_Write_Replace_Warning_Request_t
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* protocolIEs */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* protocolExtensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Write_Replace_Warning_Request_specs_1 = {
asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Write_Replace_Warning_Request_specs_1 = {
sizeof(struct SBcAP_Write_Replace_Warning_Request),
offsetof(struct SBcAP_Write_Replace_Warning_Request, _asn_ctx),
asn_MAP_SBcAP_Write_Replace_Warning_Request_tag2el_1,

View File

@@ -7,7 +7,7 @@
#include <osmocom/sbcap/SBcAP_Write-Replace-Warning-Response.h>
static asn_TYPE_member_t asn_MBR_SBcAP_Write_Replace_Warning_Response_1[] = {
asn_TYPE_member_t asn_MBR_SBcAP_Write_Replace_Warning_Response_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct SBcAP_Write_Replace_Warning_Response, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
@@ -51,7 +51,7 @@ static const asn_TYPE_tag2member_t asn_MAP_SBcAP_Write_Replace_Warning_Response_
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* protocolIEs */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* protocolExtensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Write_Replace_Warning_Response_specs_1 = {
asn_SEQUENCE_specifics_t asn_SPC_SBcAP_Write_Replace_Warning_Response_specs_1 = {
sizeof(struct SBcAP_Write_Replace_Warning_Response),
offsetof(struct SBcAP_Write_Replace_Warning_Response, _asn_ctx),
asn_MAP_SBcAP_Write_Replace_Warning_Response_tag2el_1,

View File

@@ -432,7 +432,7 @@ asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
case ATS_BASIC_JER:
case ATS_JER:
if(td->op->jer_encoder) {
er = jer_encode(td, sptr, callback, callback_key);
if(er.encoded == -1) {

View File

@@ -53,8 +53,8 @@ CHOICE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
if(specs->ext_start == -1)
ASN__DECODE_FAILED;
if (ct && ct->upper_bound >= ct->lower_bound) {
value = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound + 1);
if(specs && specs->tag2el_count > specs->ext_start) {
value = aper_get_nsnnwn(pd, specs->tag2el_count - specs->ext_start); /* extension elements range */
if(value < 0) ASN__DECODE_STARVED;
value += specs->ext_start;
if((unsigned)value >= td->elements_count)

View File

@@ -124,6 +124,8 @@ SEQUENCE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
for(edx = 0; edx < td->elements_count; edx++) {
asn_TYPE_member_t *elm = &td->elements[edx];
const void *memb_ptr;
asn_constr_check_f *constr;
int ret;
if(elm->flags & ATF_POINTER) {
memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
@@ -139,14 +141,12 @@ SEQUENCE_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
}
if(elm->encoding_constraints.general_constraints) {
int ret = elm->encoding_constraints.general_constraints(elm->type, memb_ptr,
ctfailcb, app_key);
if(ret) return ret;
} else {
return elm->type->encoding_constraints.general_constraints(elm->type,
memb_ptr, ctfailcb, app_key);
}
constr = elm->encoding_constraints.general_constraints;
if(!constr)
constr = elm->type->encoding_constraints.general_constraints;
ret = constr(elm->type, memb_ptr, ctfailcb, app_key);
if(ret) return ret;
}
return 0;

View File

@@ -61,7 +61,7 @@ enum asn_transfer_syntax {
*/
ATS_BASIC_XER,
ATS_CANONICAL_XER,
ATS_BASIC_JER,
ATS_JER,
};
/*

View File

@@ -137,8 +137,25 @@ asn__format_to_callback(
/*
* Check stack against overflow, if limit is set.
*/
/* Since GCC 13, AddressSanitizer started defaulting to
* ASAN_OPTIONS="detect_stack_use_after_return=1", which makes this check
* fail due to apparently jumping stack pointers.
* Hence, disable this check if building with ASan, as documented in:
* GCC: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
* Clang: https://clang.llvm.org/docs/AddressSanitizer.html#conditional-compilation-with-has-feature-address-sanitizer
*/
#if defined(__SANITIZE_ADDRESS__)
#define ASN__SANITIZE_ENABLED 1
#elif defined(__has_feature)
#if __has_feature(address_sanitizer)
#define ASN__SANITIZE_ENABLED 1
#endif
#endif
#define ASN__DEFAULT_STACK_MAX (30000)
#ifdef ASN_DISABLE_STACK_OVERFLOW_CHECK
#if defined(ASN__SANITIZE_ENABLED) || defined(ASN_DISABLE_STACK_OVERFLOW_CHECK)
static int CC_NOTUSED
ASN__STACK_OVERFLOW_CHECK(const asn_codec_ctx_t *ctx) {
(void)ctx;

View File

@@ -13,15 +13,20 @@ extern "C" {
struct asn_TYPE_descriptor_s; /* Forward declaration */
/* Flags used by the jer_encode() and (*jer_type_encoder_f), defined below */
/* Flags used by the jer_encode() and (*jer_type_encoder_f), defined below
*
* This isn't actually used, it might be used in the future to support
* both normal JSON and prettified JSON output or removed.
* It came from XER
*/
enum jer_encoder_flags_e {
/* Mode of encoding */
JER_F_BASIC = 0x01, /* BASIC-JER (pretty-printing) */
JER_F = 0x01, /* JER (pretty-printing) */
};
/*
* The JER encoder of any type. May be invoked by the application.
* Produces CANONICAL-JER and BASIC-JER depending on the (jer_flags).
* Produces JER output.
*/
asn_enc_rval_t jer_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
const void *struct_ptr, /* Structure to be encoded */
@@ -30,7 +35,7 @@ asn_enc_rval_t jer_encode(const struct asn_TYPE_descriptor_s *type_descriptor,
);
/*
* The variant of the above function which dumps the BASIC-JER (JER_F_BASIC)
* The variant of the above function which dumps the JER
* output into the chosen file pointer.
* RETURN VALUES:
* 0: The structure is printed.
@@ -42,9 +47,9 @@ int jer_fprint(FILE *stream, const struct asn_TYPE_descriptor_s *td,
/*
* A helper function that uses JER encoding/decoding to verify that:
* - Both structures encode into the same BASIC JER.
* - Both structures encode into the same JER.
* - Both resulting JER byte streams can be decoded back.
* - Both decoded structures encode into the same BASIC JER (round-trip).
* - Both decoded structures encode into the same JER (round-trip).
* All of this verifies equivalence between structures and a round-trip.
* ARGUMENTS:
* (opt_debug_stream) - If specified, prints ongoing details.

View File

@@ -19,6 +19,7 @@ AM_CFLAGS = \
AM_LDFLAGS = \
$(COVERAGE_LDFLAGS) \
-no-install \
$(NULL)
EXTRA_DIST = \
@@ -34,6 +35,7 @@ sbcap_test_SOURCES = \
$(NULL)
sbcap_test_LDADD = \
$(top_builddir)/src/sbcap/libosmo-sbcap.la \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOVTY_LIBS) \
@@ -42,5 +44,4 @@ sbcap_test_LDADD = \
$(JANSSON_LIBS) \
$(ORCANIA_LIBS) \
$(LIBSCTP_LIBS) \
$(top_builddir)/src/sbcap/libosmo-sbcap.la \
$(NULL)