Passing "-p 12345" on the cmd line, fixes:
"""
File "/osmo-cbc/contrib/./cbc-apitool.py", line 20, in build_url
return "http://%s:%u%s%s" % (server_host, server_port, BASE_PATH, suffix)
TypeError: %u format: a real number is required, not str
"""
Change-Id: Ief688bb8c2a6cfa410608a6896ce3cb5df4eb48e
This will be needed when we add client support, since clients will
require the mgr structs to be available during VTY parsing.
Change-Id: I14e49d8d2e603925d7f06a7edb710c0eceb02ea3
This way it's clear and we have in one place all the related code that
neds to be run at a given time.t
Change-Id: I00fe755340664d4ca4a5cfdcae8d4cd33b2f40a1
This way we lock the type (proto) of each peer at creation time.
Otherwise, having the possibility of changing the protocol of the peer
makes all the code too complex and there's no good way to prevent the
protocol from being changed at any time creating unexpected issues.
If the user wants to change the protocol, she can do so by removing the
peer and re-adding it through the VTY with the desired protocol.
Change-Id: I47756dddd8f9b8450ba14c914614fd2391d5486e
The issue was not spotted until now because until recently
cbc_vty_go_parent was not called due to another bug.
Change-Id: I697597438d8c45f5956b12e2a6ea76413e945e5e
As the naming suggests, install_lib_element[_ve]() should be used
for commands registered by libraries. This API allows to enforce
some rules for command attribute letters and should not be used
by application specific commands.
Change-Id: I8c0c8ac66dfc4fc2b8bf9102fba0df2dd988e7c9
This way we end up with more "global" configs at the start of the file,
which are read/applied first, and later all the per-peer information,
which is a list of variable length.
Change-Id: I7623ea5874552e57764327e94a9c3a4de7b71d67
Delay allocating the structures until really needed.
First do checks agains the opened connection, and if an issue is
detected simply close the fd.
Next, fetch or allocate the related peer.
Finally, create the link from the fd.
This makes it easier to add early extra checks later when peers will
contain info on link_mode (client|server|disabled) later on.
Change-Id: Id4f83ec6b0b14e556b1caa9c80e7f68d062fec57
* link -> srv_link to avoid confusing with cbsp/sbcap links
* clients -> links, since it holds links, which in the future will be
both TCP/SCTP clients and servers.
Change-Id: I4717f49413af45b45059c1601a667f4161b4ca8a
Rename osmo_*_cbc -> cbc_*_mgr:
Now they only hold TCP/SCTP server related conns, but will also hold
TCP/SCTP client conns in the near future.
Rename osmo_cbc_*_client -> cbc_*_link:
The term "client" is confusing, since it doesn't exist in CBSP/SBcAP,
and will later support connecting to server at TCP/SCTP level.
Let's use "link" instead, similar to what's used in osmo-bsc which
already supports both TCP client and server modes.
Change-Id: Ia9d26dc1593c8ee08dce348fe9f5f4c9398ea2a5
Let's create missing header files and move stuff around to have a clear
view of who implements what.
Change-Id: Ib32091d716b33bca58e2d3acf8840b52824c0bd3
In sbcap_cbc_read_cb(), if sctp_recvmsg() fails and we end up calling
osmo_stream_srv_destroy(conn), then both conn and client will end up
being freed by sbcap_cbc_closed_cb(), so we cannot use them anymore
after calling osmo_stream_srv_destroy(conn).
Furthermore, since msg was allocated with "client" ctx as parent, it
would also be freed when "client" was freed.
Let's make the logic easier and alloc it under g_cbc, which is
guaranteed to always be kept there.
Change-Id: I201f44efa24a514e0087b6dcd01115b9b2b8e9db
Update skeleton files using newest asn1c with APER support [1],
commit eb4cd0c2a891a7dbfe90b4cb8cca545879b6d622.
This contains APER fixes for 32bit architectures.
[1] https://github.com/mouse07410/asn1c/tree/vlm_master/
Change-Id: I9ca556dec639223a8d37badb908fab254826192e
"""
osmo-cbc/src/cbc_vty.c:61:3: error: format not a string literal and no format arguments [-Werror=format-security]
61 | OSMO_STRBUF_PRINTF(sb, peer->remote_host[i]);
"""
Change-Id: I90e7bdbe9f01dae9269ae4850bc2d7391fee71ec
This patch makes use of the newly introduced sbcap library, and
introduces new code (and extends existing one) to handle all the aspects
of MME peers talking SBc-AP and its underlaying SCTP connection.
This commit doesn't aim to implement all the SBc-AP features, but to
implement a minimal subset of features already available for CBSP in
osmo-cbc, in order to have similar support level for both 2G and 4G
networks.
Related: OS#4945
Change-Id: Ib278bc1d1a74459814016fef7a8fe21cc29d46c9
This commit adds some minimum unit tests to validate encoding and
decoding of SBc-AP ASN.1 APER format is working properly.
Related: OS#4945
Change-Id: I5a26d008b7282da637c3781ae77435c6a69cf65d
This commit adds initial support to encode/decode SBc-AP messages in the
form of a library, under src/sbcap/ (includes in
include/osmocom/sbcap/).
asn1c is used to generate all suport code and structures for ASN.1 APER
encoding/decoding, based on asn files obtained from 3GPP TS 29.168 and
stored under src/sbcap/asn1/.
Currently, mainstream asn1c doesn't yet support ASN.1 APER
encoding/decoding, hence mouse07410 's fork is used [1]. Furthermore,
several encdoing/decoding bugs where found during the process and fixed,
which means asn1.c git >= 30219de2d3da888b4f1eea0dd79f2a505000401a must
be used to generate proper code.
A new "make -C src/ gen" target is added which can be used to regenerate
all C code from the available ASN.1 files in src/sbcap/asn1/*.asn (after
properly setting configure.ac ASN_* variables if needed).
[1] https://github.com/mouse07410/asn1c
Related: OS#4945
Change-Id: If76f8619a9b2d46af6d94b8ae49348b8514e53aa
This is later used in cbcmsg_to_cbsp(), but only set for type
'payload_decoded' in parse_payload_decoded().
Change-Id: I519cf300cd01e8c2728babeaa77b8486f47115be
perror() appends ":" immediatelly afterwards in order to append the
error string, so having a newline breaks the format.
Change-Id: I14874c2c86495c83030fa40c7060706e9dfe1968