Age | Commit message (Collapse) | Author | Files | Lines |
|
find . -maxdepth 1 -iname "libosmo*so" | xargs -n1 -I\# sh -c "echo \#
&& nm \# | grep 'U talloc'"
tells us that all libs depend on talloc, but pkgconfig omits it for
codec and coding, which sometimes leads to linking issues with libtool
and
lld.
Change-Id: I75a4d39a0c3d53fc4c311e25e933a22832616cea
|
|
* Allow to set the reporting interval to 0 for manual reporting
* stats reset command to reset all statistics
* stats report command to manually trigger statistics reporting
Change-Id: I9febcb65650abfd538caedfbca77a787e66d517a
Related: SYS#4877
|
|
Change-Id: I80fc0ea8865ec4efdcd4c982e69d863275fd9919
Related: SYS#4877
|
|
Change-Id: If2f806d044cd0fb6929dac44ef8f8a15941ffe9b
Related: SYS#4877
|
|
Change-Id: Ib28ea88c8e8e9b33d70d58156d03af9a41e9e012
|
|
The talloc_asprintf() series includes an unconditional call to
talloc_set_name_const(), turning the entire long constructed string
into the name of the talloc object. That simply doesn't work when
creating kilobytes-sized VTY reference strings including linefeeds.
Let's add an explicit talloc_set_name_const() to prevent this.
Change-Id: Ibd77684b88cc3572047daa98c9a6b9119fba041b
Closes: OS#4668
|
|
Follows patch I353adc1aa72377f7d4b3336d2ff47791fb73d62c that was merged too
soon. Applying my code review in form of this fixup patch.
Change-Id: I979bca0c6aaa8fe4feddda922bd2e6c1cb49585b
|
|
Reverting due to being completely normal for some applications to submit
usning this channel type when decoding/parsing failed and hence not
being able to determine channel type.
This reverts Change-Id Ib4147a33a75c3cf425c30da8b0678c7fba8a371d
(commit 12f93be6073ed89055862baafbfe0e08e50ed17a.)
Change-Id: I6ebaa89cc3422df1d7fd2365a6176cb2902d1c67
|
|
gprs_ns_rcvmsg is already exported, but never declared.
Change-Id: I7edc5f4fb6e1fda059e35ea0988d0ef42208aa50
|
|
While processing an I-frame we may deliver its payload to L3. After
returning from L3 procesing, we run some additional code, assuming
the LAPD/DL state has not changed meanwhile.
However, if the application destroys the LAPD/DL meanwhile, our state
might be NULL again, and in this state we should not perform any further
action.
This is one of the cases where synchronous in-line dispatch across
various layers is hitting us. L3 should have an input queue, and only
start processing after all L2 work has completed and we're about to go
back to sleep in select().
Change-Id: I026b64503511002c13c0f4117648c366c48ecc62
Related: OS#1761
Closes: OS#4646
|
|
At some points, e.g. when allocating message buffers from the Tx
history, we used to allocate them exactly as large as the defined
headroom plus the user data. This means that the underlying PH layer
(E1 mostly) had no tailroom to add anything to the end of the message.
Especially for DAHDI this is a problem, as we need to make space for
two more bytes of frame check sequence (FCS).
So let's simply make sure we always have some extra space at the end
of such buffers.
Change-Id: Id362ce131157c7513d744b0248c7f78fb75c590c
Related: OS#4644
|
|
Change-Id: Ia19b870146334b4ab749f12dc87fb628c1cdcca9
|
|
We cannot just set sockaddr_in.sin_addr + sin_port, we also must
initializa sin_family. The reason this has worked so far is
because we probably always first received a NS packet from the
peer, rather than being the first one to send.
Change-Id: I6cefc2cd5516c7a4c01a2cc040afca454e59dd57
Related: OS#4629
|
|
If a BVC-RESET is sent from SGSN, there must not be a cell ID IE
included. See "Note 1" of TS 48.018 Section 10.4.12.
Change-Id: I11d4e70d510265b9c09dffccdab10b3f0816715a
|
|
The previous example showed a type == IMSI while setting a TMSI value.
Rather show how to encode IMSI digits.
Change-Id: I41af6bf0d61443465172123297b1228584d791d6
|
|
This function encodes a GSM 08.08 / 48.008 "Common ID" message.
Change-Id: I353adc1aa72377f7d4b3336d2ff47791fb73d62c
Related: OS#2969
|
|
This feature indicates if the given BTS supports paging coordination,
that is the transmission of CS paging (received on Abis) to be sent
via PACCH/PCU in PS domain fro MS with active TBF.
Change-Id: Ifb2e83eaf05dd36e5b203ed2de1a74864b039e38
Related: OS#2406
|
|
These TDMA constatns and modular arithmetic operations are used in
a number of osmo-* projects, so it makes sense to have them all
in a single header file, with minimalistic documentation.
Change-Id: Ic291fd3644f34964374227a191c7045d79d77e0d
|
|
This test knowingly calls deprecated functions -- allow that to squelch these
warnings:
warning: ‘gsm48_generate_lai’ is deprecated: Use gsm48_generate_lai2() instead, to not lose leading zeros in the MNC [-Wdeprecated-declarations]
warning: ‘gsm48_decode_lai’ is deprecated: Use gsm48_decode_lai2() instead, to not lose leading zeros in the MNC [-Wdeprecated-declarations]
Change-Id: Ifd618c1b9befa9c9ef0a338ab4aae2b0f796f4c2
|
|
Implement better API around 3GPP TS 24.008 Mobile Identity coding.
struct osmo_mobile_identity is a decoded representation of the raw Mobile
Identity, with a string representation as well as dedicated raw uint32_t TMSI.
The aim is to remove all uncertainty about decoded buffer sizes / data types.
I have patches ready for current osmo CNI programs, replacing the Mobile
Identity coding with this new API. Deprecate the old MI API.
osmo-bsc: I71c3b4c65dbfdfa51409e09d4868aea83225338a
osmo-msc: Ic3f969e739654c1e8c387aedeeba5cce07fe2307
osmo-sgsn: I4cacb10bac419633ca0c14f244f9903f7f517b49
Note that some GPRS and SGs related coding is done here in libosmocore and
hence currently remains using the old implementation (see previous version of
this patch: Ic3f969e739654c1e8c387aedeeba5cce07fe2307).
New API functions provide properly size-checking implementations of:
- decoding a raw MI from a bunch of MI octets;
- locating and decoding MI from a full 3GPP TS 24.008 Complete Layer 3 msgb;
- encoding to a buffer;
- encoding to the end of a msgb.
Other than the old gsm48_generate_mid(), omit a TLV tag and length from
encoding. Many callers manually stripped the tag and value after calling
gsm48_generate_mid(). The aim is to leave writing a TL to the caller entirely,
especially since some callers need to use a TvL, i.e. support a variable-size
length of 8 or 16 bit.
New validity checks so far not implemented anywhere else:
- stricter validation of number of digits of IMSI, IMEI, IMEI-SV MI.
- stricter on filler nibbles to be 0xf.
As a result, applications using osmo_mobile_identity will be stricter in
rejecting coding mistakes (some of which we currently have in our test suites,
and which we'll need to fix).
Rationale:
While implementing osmo-bsc's MSC pooling feature in osmo-bsc, this API will be
used to reduce the number of times a Mobile Identity is extracted from a raw
RSL message.
Extracting the Mobile Identity from messages has numerous duplicate
implementations across our code with various levels of specialization.
https://xkcd.com/927/
To name a few:
- libosmocore: gsm48_mi_to_string(), osmo_mi_name_buf()
- osmo-bsc: extract_sub()
- osmo-msc: mm_rx_loc_upd_req(), cm_serv_reuse_conn(), gsm48_rx_mm_serv_req(),
vlr_proc_acc_req()
We have existing functions to produce a human readable string from a Mobile
Identity, more or less awkward:
- gsm48_mi_to_string() decodes a TMSI as a decimal number. These days we use
hexadecimal TMSI everywhere.
- osmo_mi_name_buf() decodes the BCD digits from a raw MI every time, so we'd
need to pass around the raw message bytes. Also, osmo_mi_name_buf() has the
wrong signature, it should return a length like snprintf().
- osmo-bsc's extract_sub() first uses gsm48_mi_to_string() which encodes the
raw uint32_t TMSI to a string, and then calls strtoul() via
tmsi_from_string() to code those back to a raw uint32_t.
Each of the above implementations employ their own size overflow checks, each
invoke osmo_bcd2str() and implement their own TMSI osmo_load32be() handling.
Too much code dup, let's hope that each and every one is correct.
In osmo-bsc, I am now implementing MSC pooling, and need to extract NRI bits
from a TMSI Mobile Identity. Since none of the above functions are general
enough to be re-used, I found myself again copy-pasting Mobile Identity code:
locating the MI in a 24.008 message with proper size checks, decoding MI
octets.
This time I would like it to become a generally re-usable API.
This patch was first merged as Ic3f969e739654c1e8c387aedeeba5cce07fe2307 and
caused test fallout, because it re-implemented old API with the new stricter
decoding. In this patch version, old API remains 1:1 unchanged to avoid such
fallout. Applications will soon switch to the new osmo_mobile_identity API and
become stricter on MI coding when that happens, not implicitly by a new
libosmocore version.
Change-Id: If4f7be606e54cfa1c59084cf169785b1cbda5cf5
|
|
This reverts commit d1ceca9d48eb3d8b212f386a1ebb35d8fc612297, as it
introduces regressions in both osmo-msc and osmo-nitb which have been
causing failing builds for several days now.
Change-Id: I4bd958d0cd2ab4b0c4725e6d114f4404d725fcf7
|
|
Implement better API around 3GPP TS 24.008 Mobile Identity coding.
struct osmo_mobile_identity is a decoded representation of the raw Mobile
Identity, with a string representation as well as dedicated raw uint32_t TMSI.
The aim is to remove all uncertainty about decoded buffer sizes / data types.
I have patches ready for all osmo programs, completely replacing the Mobile
Identity coding with this new API. Hence deprecate the old MI API.
New API functions provide properly size-checking implementations of:
- decoding a raw MI from a bunch of MI octets;
- locating and decoding MI from a full 3GPP TS 24.008 Complete Layer 3 msgb;
- encoding to a buffer;
- encoding to the end of a msgb.
Other than the old gsm48_generate_mid(), omit a TLV tag and length from
encoding. Many callers manually stripped the tag and value after calling
gsm48_generate_mid(). The aim is to leave writing a TL to the caller entirely,
especially since some callers need to use a TvL, i.e. support a variable-size
length of 8 or 16 bit.
New validity checks so far not implemented anywhere else:
- stricter validation of number of digits of IMSI, IMEI, IMEI-SV MI.
- stricter on filler nibbles to be 0xf.
Rationale:
While implementing osmo-bsc's MSC pooling feature in osmo-bsc, this API will be
used to reduce the number of times a Mobile Identity is extracted from a raw
RSL message.
Extracting the Mobile Identity from messages has numerous duplicate
implementations across our code with various levels of specialization.
https://xkcd.com/927/
To name a few:
- libosmocore: gsm48_mi_to_string(), osmo_mi_name_buf()
- osmo-bsc: extract_sub()
- osmo-msc: mm_rx_loc_upd_req(), cm_serv_reuse_conn(), gsm48_rx_mm_serv_req(),
vlr_proc_acc_req()
We have existing functions to produce a human readable string from a Mobile
Identity, more or less awkward:
- gsm48_mi_to_string() decodes a TMSI as a decimal number. These days we use
hexadecimal TMSI everywhere.
- osmo_mi_name_buf() decodes the BCD digits from a raw MI every time, so we'd
need to pass around the raw message bytes. Also, osmo_mi_name_buf() has the
wrong signature, it should return a length like snprintf().
- osmo-bsc's extract_sub() first uses gsm48_mi_to_string() which encodes the
raw uint32_t TMSI to a string, and then calls strtoul() via
tmsi_from_string() to code those back to a raw uint32_t.
Each of the above implementations employ their own size overflow checks, each
invoke osmo_bcd2str() and implement their own TMSI osmo_load32be() handling.
Too much code dup, let's hope that each and every one is correct.
In osmo-bsc, I am now implementing MSC pooling, and need to extract NRI bits
from a TMSI Mobile Identity. Since none of the above functions are general
enough to be re-used, I found myself again copy-pasting Mobile Identity code:
locating the MI in a 24.008 message with proper size checks, decoding MI
octets.
This time I would like it to become a generally re-usable API.
Change-Id: Ic3f969e739654c1e8c387aedeeba5cce07fe2307
|
|
If start_nibble were passed negative, we'd end up accessing invalid memory.
Safeguard against that.
Change-Id: Ied3c1e02c3a01d868e08195cbd8dfa52d2c19ac3
|
|
So far, we have msgb_tl_put(), which allows putting the TL header of a TLV,
without the value part. Add the same for a variable-size length TvLV: put a TvL
header of a TvLV without the value part.
In a subsequent patch, osmo_mobile_identity will be introduced, which will
allow writing the encoded MI directly to the end of a msgb. For BSSGP_IE_IMSI,
which is a TvLV, it would hence be simplest to write only the TvL first.
Change-Id: I02cca5182fe42e40b63680a2fd470f03bcc11076
|
|
These utilities will be used by osmo-bsc to determine the Network Resource
Indicator seen in the TMSI, and (potentially) by osmo-msc to compose a TMSI
with a specific NRI, for osmo-bsc's load balancing between several MSCs.
Add utility functions to:
- extract an NRI value from a TMSI.
- overwrite the NRI value in a TMSI.
- limit an NRI in a (random) TMSI to a given list of ranges.
- add NRI value ranges to a list.
- remove them from a list.
- match NRI value (range) to a list.
- parse NRI values from string, for VTY.
- common VTY functionality of adding/removing NRI values from argv.
Add C tests for the above.
Why we need public API for NRI ranges: In osmo-bsc alone, we need the same NRI
API twice, 1: to manage/list NRI value ranges per-MSC, and 2: to manage/list
NULL-NRI values. If we also consider (potentially) adding NRI support to
osmo-msc, we need the same API twice again there. Hence it is useful to define
re-used API up here in libosmocore.
Related: OS#3682
Change-Id: Icb57a2dd9323c7ea11b34003eccc7e68a0247bf5
|
|
The call identifier in the ASSIGNMENT COMMAND is encoded in the wrong
endieness. 3GPP TS 48.008, section 3.2.2.105 specifies that the least
significant byte should be transmitted first, which means that the
endieness here is little endian. Lets make sure that the endieness is
correctly transmitted, regardless of the host byte order.
Change-Id: I6468e502f552f99ab54aec9d4b1c169fdc0adfb8
Related: OS#4582
|
|
Change-Id: I92c8a9752e88164eedffb9f9a081288458f6eadb
|
|
At the moment we print the pointer address to identify the log lines
belonging to a specific connection. Since pointer addresses are
difficult to work with, a human readable ID should be printed instead.
e.g. "This is LAPD instance for SAPI3 on bts0/trx1/ts5/lchan3"
Change-Id: Ie6742843fff809edffcac24c4dce4edf66bc71be
Closes: OS#1938
|
|
Change-Id: I2b10e1707b0976b685d1c14016481d5565888150
|
|
3GPP TS 48.016 is quite clear in that no NS-{RESET,BLOCK,UNBLOCK}
procedures shall be used over an IP based transport. They are only
for use in Frame Relay based transport.
However, as libosmogb was first developed against ip.access nanoBTS,
and their Gb implementation mandates those procedures, we
unconditionally implemented those procedures back then. Let's
give the user the option of disabling this behavior to become
more spec compliant (and interoperate with more other vendors out
there).
Change-Id: Ic4eba1b4dcbeac00f5879db295e0a9f1a50f71d8
|
|
This function may be useful in a case when most of the BTS models
do support some feature, but just a couple models do not. It's
much easier to unset that feature 2/10 times than set it 8/10
times individually for each BTS model.
Change-Id: Ib5fa27287be7f1ecf2f82249b1e8c848465cbac0
Related: I431c8ab9478cbc40179903edc21043623d805da1
|
|
If a feature index does not fit to the feature vector, this
function would return a negative number that would be casted
to true. This is wrong, we should return false instead.
Change-Id: Id1ad92e7654a806bb920ae9507c88a122e8d09f0
|
|
This implements a multiplexer and de-multiplexer for the ITU-T I.460
standard. The latter covers the transmission of sub-slots of 32/16/8k
inside 64k timeslots.
Change-Id: Id522f06e73b77332b437b7a27e4966872da70eda
|
|
Fix osmo_mi_name_buf() to snprintf() into the buf in *all* cases.
osmo_mi_name_c() is implemented via osmo_mi_name_buf(), which returns
compile-time string constants in special cases. That means that
osmo_mi_name_c() does return non-allocated strings in these special cases.
The caller of functions like osmo_mi_name_c() must always be able to rely on
getting a talloced string, or run a danger of deallocating const pointers.
Change-Id: I623959f01b72642bcdd18508097c5c405c59f6f1
|
|
Change-Id: Ibe722d38d28e5590a35e856dd15c2538e6ee0a3e
|
|
Change-Id: I81646ff8284061a60c208bd8f9233f66c3e410f8
|
|
Change-Id: I13f28041adcc1530e5125775c4533d8ac0a88169
|
|
Remove OpenSUSE bug report link, set version to @VERSION@, make it build with
CentOS 8 etc.
Related: OS#4550
Change-Id: I59255889740195ec811a947a7130ae0918ea4b4d
|
|
Related: osmo-bts Ic22ab71e520ab44429a93724250d349d16250801
Change-Id: Ib4147a33a75c3cf425c30da8b0678c7fba8a371d
|
|
Allow dumping the VTY XML reference (for generating manuals) to a normal FILE*
stream instead of a vty output buffer.
We currently generate the VTY reference by starting the client program,
connecting to the VTY telnet and dumping the reference. That is weirdly
convoluted, especially since there has to be a valid config file that
successfully starts up a minimal set of external links before the reference can
be generated. IMO we should have dumped the XML reference to stdout from the
start, and never to a VTY session.
With this patch, it is trivial to generate the XML VTY reference by a
commandline switch. The client program will set up the entire VTY, and
immediately after parsing the cmdline options but before parsing a config file,
just dumps the reference and doesn't even start establishing local ports. That
would allow generating the XML reference on the fly during the build process of
the manuals, without the need of a docker container or somesuch.
A first implementation of such a commandline switch is `osmo-bsc -X`, added in
I316efedb2c1652791434ecf14a1e261367cd2fb7
This patch jumps through a bit of a hoop to still allow dumping to a VTY buffer
without code dup, to still allow dumping the XML reference through telnet VTY,
until all our programs have implemented an -X switch (TM).
Change-Id: Ic74bbdb6dc5ea05f03c791cc70184861e39cd492
|
|
Also add a test for an actual CONFUSION message parsing.
Change-Id: If8afd2d096fb66c6c2f255a08fc1129de3d09cec
|
|
Copy the RPM spec file from:
https://build.opensuse.org/project/show/home:mnhauke:osmocom:nightly
Related: OS#4550
Change-Id: Ib329b719fbeaf4618d299fa20514c76fe704cb48
|
|
This is basically I16d5190b3cdc997c5609b52d41203f10264b017c.
Change-Id: Ife660f00d7a6d3b874ab2e59e34dca2109fa82d8
Related: OS#4546
|
|
This implementation is taken from OsmocomBB, in particular from:
target/firmware/layer1/rfch.c
Change return type to uint16_t, because neither ARFCN, nor MAI
can be negative. Add prefix 'gsm0502_' to the function's name.
Change-Id: I8aba1578cc9d1bd89d4f5d33a6e8fedc8bea789a
Related: OS#4546
|
|
gsm48_pag_resp and gsm48_service_request: omit comments in big endian part.
dtap_header: better segment the substruct.
gsm23041_msg_param_gsm: match up whitespace / comments.
Rationale: the script is a good way to avoid bugs from manually composing the
big endian parts (for example, it detected the missing endian.h include, fixed
in I593cc5e8272469b570559206bb02b6e79797340b). However, it becomes cumbersome
if it creates numerous edits in the source tree, which cause more time spent
for whoever wanted to rather save time with it. So let's keep the code tree
matching that struct's output.
Change-Id: I7432f5337d6589262c31f5186dfd0ac32221c467
|
|
Before this, the new dtap_header substruct construct would end up being split
up in a weird way:
struct dtap_header {
uint8_t type;
union {
uint8_t link_id; /* Backward compatibility */
struct {
uint8_t dlci_cc:2,
dlci_spare:3,
dlci_sapi:3; /* enum gsm0406_dlc_sapi */
};
};
uint8_t length;
} __attribute__((packed));
would previously become
struct dtap_header {
uint8_t type;
union {
uint8_t link_id; /* Backward compatibility */
struct {
#if OSMO_IS_LITTLE_ENDIAN
uint8_t dlci_cc:2,
dlci_spare:3,
dlci_sapi:3; /* enum gsm0406_dlc_sapi */
};
};
uint8_t length;
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
uint8_t dlci_sapi:3, dlci_spare:3, dlci_cc:2;
};
};
uint8_t length;
#endif
} __attribute__((packed));
now becomes
struct dtap_header {
uint8_t type;
union {
uint8_t link_id; /* Backward compatibility */
struct {
#if OSMO_IS_LITTLE_ENDIAN
uint8_t dlci_cc:2,
dlci_spare:3,
dlci_sapi:3; /* enum gsm0406_dlc_sapi */
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
uint8_t dlci_sapi:3, dlci_spare:3, dlci_cc:2;
#endif
};
};
uint8_t length;
} __attribute__((packed));
Change-Id: I3c4986ebd1e41aad8b279d6132b7e3b2539d7dc5
|
|
Change-Id: I593cc5e8272469b570559206bb02b6e79797340b
|
|
These functions implement re-ordering of bits as per TS 06.90 / 26.101
based on the already existing tables we've had in libosmocoding.
Change-Id: Ia4ac2aea2e96f9185f082a07ca64dfc5276efb46
|
|
As was pointed out by pespin, some compilers may not like the
lack of spaces around the format macro constants.
Change-Id: I4b6517989030c8e3f6a1bf16c43044e4e9137f40
|
|
notice.
In Change-Id Idf2b99e9ef014eba26e3d4f0f38c2714d3a0520a we accidentially removed this
symbol, let's re-introduce it.
Change-Id: I9fbcbcc6619ef0c63d3682fc86adc80045baab02
|