This commit fixes crash when response is more than ~4096 chars.
Furthermore, we now allocate only the required memory, not 4096 for all
messages, which usually don't require it.
Test needs to be adapted since it assumed there was more available space
at the end of the msgb.
Related: OS#5169
Change-Id: I0b8f370f7b08736207f9efed13a0663b5e482824
gss->family (and gss->ip) was never set.
So IPv6 should have never worked.
Fixes: e769f5226b ("gprs_ns2_sns: rework IP-SNS initial remote")
Related: OS#5036
Change-Id: I4e39dc5c7f766a7040645ceb62afdf6a9cfad00f
Reduces the code as the conversion between address family (bind)
and ns2_sns_type is not needed anymore.
Related: OS#5036
Change-Id: I1bcdd43af34c926d4b88491d00669422c299bef7
Underlaying APIs (msgb_alloc) use a uint16_t as a type, which means
until now passing a value > 2^16 would succeed providing a msgb with
less space than requested.
Since those are static inline, there's no symbols used by apps, so we
should be safe enough changing the type to be uint16_t, since change
would only be applied at re-compile time.
Change-Id: I83c8222484e4856c68134a1a9d8cf96eb91af1b8
This feature provides the BSC with information on whether the BTS talks
the IPAC_PROTO_EXT_PCU osmocom extension over the underlying IPA
multiplex of the OML link.
Related: SYS#5303
Change-Id: Id62421f7f5540875ac877a187757f2cf0556bd02
This new extension protocol is used to forward Osmocom PCUIF messages
BSC<->BTS<->PCU.
It will be sent re-using the IPA multiplex of the OML link between
BSC and BTS. BTS is responsible for forwarding the message over the unix
socket to the PCU.
Related: SYS#5303
Change-Id: I68b04def49946b6915dbd4e476999f249751cd28
generic sha code from git://w1.fi/hostap.git commit
5ea93947ca67ba83529798b806a15b247cdb2e93 which also happens
to be the source of our milenage code.
Related: SYS#5324
Change-Id: Ibf2e49edada944d91ceba62bd0d6b6ce69261fcd
The IPv4/IPv6 elemens are the same for local and remote.
Refactor the entries into a struct to use function to manipulate
them with a single function.
Related: OS#5036
Change-Id: I05e053a9eb3328655502dfe2981c8f402104e292
Some combination of IPv4 and IPv6 result in incomplete
combination.
E.g. IPv6 binds, but only IPv4 endpoints and vice versa.
Related: OS#5036
Change-Id: I2fcf67bc2431ddac23c4ae23cebbb29771e573f1
Use the new stats API to set a meaningful name for its stats group too,
so that they are easily to identify when reported.
Example on VTY "show stats":
"""
NSVC Peer Statistics (0)('UDP-NSE01800-NSVC01800'):
ALIVE response time : 0 ms
NS Bind Statistics:
Transmit backlog length: 0 packets
"""
Example reporting to statsd:
"""
my-stats-reporter-prefix.ns.nsvc.UDP-NSE01800-NSVC01800.alive.delay:0|g
"""
Related: SYS#5456
Change-Id: I4c696c615ba3416f8524d0797ce06c0ecd3a18f2
This patch adds a new field "name" to the rate_ctr and osmo_stat_item_group
structs, together with an API to set it. This new field allows for easy
identification of specific group instances when several of them exists,
rather than using a sometimes random/increasing index value.
If set, this name (string) is used instead of the index by the stats
reporter.
The name, if set, is also printed during "show stats" VTY commands.
It's up to the user or application to set up unique or meaningful names
to fullfill one's needs.
WARNING: this commit breaks ABI and possibly creates unexpected behavior
when run with non-rebuilt apps which use the modified structs directly
to get the coutners, or if use the static inline API rate_ctr_inc2().
Existing users of these structs should migrate to use new APIs
introduced in follow-up commits instead of accessing the field directly.
Related: SYS#5456
Change-Id: I0dc510783dd9ae8436dae8005a7b3330e80d36f3
Ensure all nsvcs ids are unique as UDP ids might not be unique when
multiple NSVCs connect to the same remote endpoint (multiple binds).
Change the format of all ids to look similiar.
FR: NSE11-NSVC23-FR-fr0-DLCI13.
UDP: NSE11-NSVC-UDP-10.0.0.1:23000-192.168.1.1:24000
UDP: NSE11-NSVC23-UDP-10.0.0.1:23000-192.168.1.1:24000
UDP: NSE11-NSVC66-UDP-[fd01::1]:23000-[fd03::2]:24000
Change-Id: I618e263e73fcc64d4e46b57aa3a2cb2783837907
Applying and reverting this mask allows one to quickly convert
between VAMOS and non-VAMOS variants of Bm/Lm C-bits.
Change-Id: Ia0bd8695a3f12331b696fe69117189cdd48b584d
Related: SYS#4895, OS#4941, SYS#5315, OS#4940
Having this API and forcing apps to use it will allow easily adding new
members to the group structure without having so much impact in users of
this struct.
Related: SYS#5456
Change-Id: Iebbf401f11e36645f8964d389460918eb9e0910e
This is required to reset and close a card under software control
after opening it with osim_card_open()
Change-Id: Ie9ec66db4d54fdb1331f4ae05ca3ca4274912e9d
When modifying chan modes, I first thought rather always fail if there
is no equivalent mode.
That is true for gsm48_chan_mode_to_vamos(), but for a change to
non-VAMOS, rather return the unchanged mode for non-VAMOS modes, so that
gsm48_chan_mode_to_non_vamos(GSM_CMODE_SIGN) works without failure.
This makes more convenient checking, e.g. in osmo-bsc's lchan_fsm.c
making sure that a non-VAMOS lchan has a non-VAMOS chan_mode, for all
types of lchans.
Change-Id: Ibf20f04d167e0e0599012ff530bc17ba8c8ab562
When the bind to be removed is not the last entry, it would
remove the wrong SNS bind resulting in use-after-free memory.
Change-Id: I79062d404ebba9d5c8f7f209bebde146fa08c71f
This new API doesn't use host_config_set(), and allows passing a FILE*
from any source, not only a filesystem path.
Related: SYS#5369
Change-Id: I720ac04386261628c0798a1bfcaa91e2490a86c3
When we perform a non-blocking connect, the completion of the connect
will be signaled by marking the fd as WRITE-able. So we should
automatically set OSMO_FD_WRITE to make sure the user gets notified
on completion.
Change-Id: I22964c5d5da849abcd97a900bd86ab5b4ada05da
This reverts commit 43ad616e4b.
_enc_ functions are for some ies while the _encode_ and _decode_ are
for the full pdu. so the old name is correct.
Change-Id: Ib0b4a6fd7f8c96e4647a373541e3cccb324c6a11
The symbol was not in the list of exported symbols.
Take the chance that it was not used anywhere outside libosmocore to
rename it in order to follow similar naming as other existing APIs.
Change-Id: I534db7d8bc5ceb19a2a6866f07d5f5c70e456c5c
This has been changed based on feedback from Pau Espin in osmo-mgw,
and for consistency we also adjust it here. No backwards compat
needed as it was just introduced yesterday.
Change-Id: I88989dc17c8996609b895c43012f8cca98aa81dc
This could never possibly have worked. When iterating over the
different IEs to encode, we must of course use the tag of the current
iterator item, and not the hard-coded value of the second tag in the
list.
Change-Id: I148799c5bdb95f70118691c1150330ebac4fdf21
In 2018, I4723361e1094b358310541a7dc4c5c921c778a15 introuced a
check against an integer unterflow. However, the fheck got the
logic wrong, with the result of breaking the function completely:
It would always only detect the first tag within the IPA request
and then take the branch that assumes an integer underflow.
Change-Id: I344975d0bda565ff196a1c0c69305cd349b98a19
DSCP is a 6-bit value stored in the upper 8 bit of what was used to
be known as TOS. Let's use the newly introduced OSMO_SOCK_F_DSCP()
to prevent having to worry about this in higher level code.
Change-Id: I6b9848fd0752d99d3df5346313618d5847d64fb8
Related: OS#5136