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
This is a follow-up to I64fee56b04d0ecd128bf661699d5071817ea96ec,
due to code duplication there was another code path that manually set
the IP_TOS socekt option that I missed in the first patch.
Related: OS#5136
Change-Id: I4bb22d0f67984077706b694eb7e75327b41b6fcf
The api doc indicates the possibility to pass -1, and calling
osmo_tdef_get() actually casts the arg to a signed long. To end the
confusion, change default_timeout from unsigned long to long.
Change-Id: I51b9172603984839448346c9836e43c8c802fcf8
Every socket function that can be passed a 'flags' argument now
supports the following two additional macros that can be or-ed in
with the flags:
* OSMO_SOCK_F_DSCP(x) -- specify the IP DSCP of the socket
* OSMO_SOCK_F_PRIO(x) -- specify the priority of the socket
The existing osmo_sock_set_{dscp,priority}() functions are useful,
but you cannot call them in between the socket creation and the
connect() operation when using our socket helpers. This means that
the first packet sent will have the default DSCP/priority, and only
later packets would have the desired values.
When using the functionality introduced by this patch, we can ensure
that even the very first packet of e.g. a TCP or SCTP connect()
will have the correct DSCP/priority applied.
Change-Id: If22988735fe05e51226c6b091a5348dcf1208cdf
Related: SYS#5427
Common bits shared by various functions (currently setting
non-blocking) should not be copy+pasted around.
Change-Id: I95056940ddc26b65f63eedaeaab6882edaef6317
In some situations we want to set the SO_PRIORITY socket option
to determine the in-kernel priority of packets generated by this
socket.
Change-Id: I89abffcd125e6d073338a5c6437b9433220e1823
Related: SYS#5427
DSCP is a 6-bit value (0..63) stored in the upper 6 bits of what was
formerly known as TOS bits. We must
* make sure the user can only specify 0..63
* shift the value by two bits when using the IP_TOS socket option
We achieve the latter by using the recently-added osmo_sock_set_dscp()
helper.
Change-Id: I64fee56b04d0ecd128bf661699d5071817ea96ec
Closes: OS#5136
At least on Linux, sockets have a IP_TOS socket option that can be
configured to set the TOS. However, TOS (of RFC791) was replaced
by the DSCP (of RFC2474) in 1998.
As the DCSP bits are only the upper 6 bits of the TOS bits, let's
introduce a helper to get, mask and set the DSCP values in the TOS
bits.
Related: OS#5136, SYS#5427
Change-Id: Ia4ba389a5b7e3e9d5f17a742a900d6fd68c08e40
When doing a "show ns", let's also dump the state of the frame
relay network, with all its links and DLCs (if any).
Change-Id: I798af3e97dc014b6e0fcde86560a1809852f7510
Related: OS#4877
Defined in 48.018 10.5.2.82.
This will be used by Channel Mode Modify for VAMOS.
Related: SYS#4895 SYS#5315
Change-Id: I9bad6e7121af43dfa9706635e58279ce672a4e14
Also add functions to convert between VAMOS and non-VAMOS speech modes.
Related: SYS#4895 SYS#5315
Change-Id: Ie0ea592da5610ae70290106d004e549cf3212a89