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
The Signalling Field Element Coding list defined in 3.2.3 is used in
"Old BSS to New BSS Information" and "New BSS to old BSS Information"
IEs. However, the former IE (Old->New Info) defines 2 extra Field
Elements in 3.2.2.58 (3GPP TS 48.008 version 16.0.0 Release 16) not
present in 3.2.3.
Related: SYS#5337
Change-Id: I4db3f7974887e4c798a30c5b51a19472ceeee27d
e7dfeac8dc introduced a regression in the block/unblock check
as it was using the priv->initiate_block instead of priv->om_blocked.
The initiate_block tracks who is responsible to unblock the NSVC.
Fixes: e7dfeac8dc ("gprs_ns2_vty: print a response to vty `nsvc <nsvci> (block|unblock|reset)")
Change-Id: I516faea223e30b120a297faed10636daa554be8a
The library specific sub-systems are kind of special, because their
position in the 'osmo_log_info' may vary depending on the number of
application specific sub-systems. This is why their associated
constant values (like DLGLOBAL) are negative, and this is what
the LOGP() macro expects as the first argument.
Before this change, invoking 'logp' command with any library
specific logging sub-system would result in getting messages
printed with the fall-back DLGLOBAL sub-systems.
Change-Id: If86563e169fe1243adfa7b09c9d65d9f88c8a99e
This will be used by osmo-bts-omldummy to parse features strings from
the cmdline.
Note that osmo_bts_feature_name() already exists to return the longer
descriptive value_strings from osmo_bts_features_descs (_descs!).
Luckily that misses the plural 'features' in the name, so that I can
still add a properly named osmo_bts_features_name() function that only
returns the name, matching the common pattern used in osmocom code.
Related: SYS#4895
Change-Id: I699cd27512887d64d824be680303e70fff3677c1
The function osmo_bts_feature_name() is ill-named for two reasons:
- it returns descriptive text instead of just a string representation of
the name.
- The enum is named "osmo_bts_features", so the function name lacks the
"s" for "features".
Rationale: An upcoming patch adds a function to return just the name,
properly called osmo_bts_features_name(), so deprecate the weirdly named
one first.
Change-Id: I9dfdb5e81037b6000effbd340af4e5db0dcfd69c
This is a partial revert of b27b352e ("stats: Use a global index for
stat item values"). Now that osmo_stat_item_get_next correctly returns
how many values have been skipped, we can use the accurate asserts on
its return value again.
Fix the initial values of next_id_a,b (1 instead of 0), so we don't get
a skipped value on the first read. This is needed, because b27b352e
refactored osmo_stat_item_get_next to have the next id as parameter
instead of the last read one, and the initial value was not adjusted in
the tests.
Related: OS#5088
Change-Id: I9d4cda2487a62f52361c24058363dfa90e502c63