Move it above the place where the bit is set, since the bit represents
whether Extension Information is available, not whether R99 is
available.
Change-Id: Ice592acc50a24efd7fe4cf1a91f1d48fd74f38d8
In prepration to introduce more commands e.g. ip-sns-bind rename the ip-sns-remote
Related: SYS#5354
Change-Id: Ida979f3b9daa5f7280a629441e4006a7635653b0
The SNS must know when all NS-VC have failed. Further more
there might be a corner case when the SNS configuration succeeds but
no NS-VC comes up afterwards.
Related: OS#5355
Change-Id: Ie72da9adeefe0c2850d49a9208b2d0a4556f9101
When writing to the AF_PACKET socket, we have to distinguish the
pseudo-errors like -ENOBUFS (where we do want to add to the backlog)
from real errors like -ENETDOWN, -EMSGSIZE, ... where we don't want
to add the failed packet to the backlog.
Change-Id: Ibbb6805da0f118466c4c91e458e62b63b84cb794
This patch improves the behavior of the newly-added backlog in
situations where the interface goes up/down.
* don't add new packets to the backlog while if_running == false
* flush the backlog on both ifup and ifdown events
Change-Id: Ib35d099526544fe2cff64566fd56147a906adab9
There's not really any point in storing multiple LMI messages,
and then transmitting them in inverse order, as the existing code
does. Instead, we shall store only the last (failed) LMI message
and try to transmit that at highest priority, before any NS messages
in the actual queue.
Change-Id: I5407a76a34d7e687966fe1a915febf3a87256593
Reading a log line like this:
<0026> gprs_ns2_vc_fsm.c:808 GPRS-NS2-VC(FR-hdlcnet1-DLCI16-NSE02001-NSVC00001)[0x6120000024a0]{UNBLOCKED}: Received Event RESET
is very ambiguous. Does it mean we received a NS-RESET message? Does it
mean the FSM was instructed to send a NS-RESET? ...
Let's make sure the human-readable names give a very clear indication
of what exactly is happening.
Change-Id: I8b7615b3eca04212831163ff0ea4aea35069cd0e
Fix the encoding of the asynchronous Q.933 STATUS message
we send at DLC creation time.
Change-Id: Id1460ffa6266be85f44579c447421eed12481b02
Closes: OS#5010
this is a bit of a hack. Q.933 explicitly forbids either side from ever
sending a sequence number of '0'. Values start from '1' and are modulo 256,
but '0' is always skipped. So if the peer is sending us a "last received
sequence number of '0' it means it has not yet received any packets from us,
which in turn can only mean that it has just been restarted. Let's treat
this as "service affecting condition" and notify upper layers. This helps
particularly in recovering from rapidly re-starting peers, where the Q.933
nor NS have time to actually detect the connection was lost.
Change-Id: I960a7b17f2550cb49a7b9d72ed87cd271bb64122
Related: OS#4974
Comparing struct gprs_ra_id using memcmp can be error prone, so lets add
a compare function to compare two struct gprs_ra_id values reliably.
Change-Id: I4d7558c04d9d01761516526086be5104bb2eeada
Related: SYS#5103
Given that all the distributions we support are shipping systemd
anyway, this will not really introduce any additional runtime package
dependencies.
Change-Id: Ib3af918cd4cc8d0ca6d228a0f2c8338534374d46
This adds a --enable-systemtap configure option, which will then
add static tracepoints to the generated libosmocore binary.
At this point, only two tracepoints are supported: log_start
and log_done. They can be used to trace the amount of time
a libosmocore-using application spends in potentiall blocking calls to
log to stderr or to files.
Related: OS#4311
Change-Id: I7e1ab664241deb524c9582cbd1bec31af46c747e
All bind function should work in the same way.
Also fixing a null pointer assignment if no **result is giving.
Change-Id: Idd0c2190d2af39804c18c4786a997079db9a4330
ST_ALIVE isn't quite clear. This state means this NS-VC is still dead.
ST_ALIVE is used for NS-VC with vc_mode ALIVE (e.g. UDP NS-VC). It's
the first state when the remote hasn't yet answered or when
the NS-VC lost ALIVEs.
Related: OS#4958
Change-Id: I0b29e8ce6444546d90bde68b1f957f1013238784
There's no point in sending NS-RESET (or any other) messages to the
underlying FR layer if the FR DLC has not been marked as
available/active yet.
Change-Id: Id4e7565ba166ca1d12f8800c643d9f2bc4d66873
Closes: OS#4999
There are use cases in which the NS-VC FSM should go back to
unconfigured _without_ being re-started immediately. Let's permit
the caller to do that.
Change-Id: I31fe695a83d38ea1f10f5444e840633d7fa68442
If we receive messages for a DLC which has not yet reported as being
available by Q.933 LMI, drop the incoming message. Otherwise we would
dispatch it to the user, and the user wants to respond - but then
we reject the transmission due to the inactive DLC.
Change-Id: Ia4a045fdf165b526f429f4617e0fdc76036480bd
Related: OS#4999
Using 'uint8_t' for the length argument is definitely a bad idea.
Because of this, packing more than 255 septets would not work as
expected. Deprecate the old function and use 'size_t' instead.
Change-Id: Ib1aac538afeb0a5c76a1df472d555139a496e12e
As can be seen, this unit test reveals problems with encoding
of more than 250 septets using gsm_7bit_encode_n(). The problem
is that some API functions use type 'uint8_t' for the length, so
we basically suffer from integer overflows.
Change-Id: I723300578d5ab0c7b94cf49c14d962b2dbf47740
If we are the 'user' side of FR and a link has just recovered,
we should ensure the next STATUS is for "full status". This way
we learn about the present DLCs as quickly as possible, saving up
to 10 seconds of further delay in link recovery.
Related: OS#4999
Change-Id: I6f905a18a7d130a3c02b4a3e7a2a2dc24afc0ea1
Remove "(const struct osim_card_sw)" infront of OSIM_CARD_SW_LAST, so
debian 8's gcc 4.9.2 doesn't fail anymore with the following error each
time the macro is used:
card_fs_sim.c:105:1: error: initializer element is not constant
I verified with docker that there aren't any other build errors with gcc
4.9.2.
Fixes: OS#4991
Change-Id: I9d3abbf9812dc09201eff0e9f7542cddedb6848b
Log the NS-STATUS primitives from within the library, so we don't have
to keep related code in each and every application.
Change-Id: I368883acfc8ea76529befcd429bf8f2445a60a94
ENOSPC is used with non-volatile (disk) storage, while ENOMEM is
customarily used for RAM allocation failures.
Change-Id: Ia4c16d8278dc30c7cc69169b18428cda5272738d
Avoid code duplication between three different drivers by sharing
the "core" of the bind initialization in a new, shared ns2_bind_alloc().
Change-Id: I535fc68e94fcd695de827dd922706adc1c5a2cb7
The counters had all been lost in the ns -> ns2 configuration,
let's try to implement some more of them: LOST_ALIVE, BLOCKED,
LOST_RESET.
Change-Id: I75d8637bd142722fdf9a162a2369aa9cdc980a57