Commit Graph

18 Commits

Author SHA1 Message Date
Pau Espin 4941403274 Move include osmocom/gprs -> osmocom/gb, deprecate osmocom/gprs/
libosmogb is an anomaly since it has its headers in osmocom/gprs
directory instead of osmocom/gb. This is really confusing for users.
Furthermore, libosmo-gprs is also using osmocom/gprs, which will create
even more confusion.

This patch moves all existing osmocom/gprs/ header files under
osmocom/gb/ directory (except the backward-compat ones which were
added pointing to the ones in osmocom/gsm/).
Next, new files are added in osmocom/gprs/ replacing the ones that used
to be tehre, with a pragma message announcing deprecating and asking
users to use the new path instead.
This allows keeping old applications working, while announcing
deprecation of the old osmocom/gprs/ patch and have all new development
happen under osmocom/gb/.

Change-Id: I6e826775552766e34e4c06fe2390084596dfc286
2023-02-20 12:21:30 +01:00
Oliver Smith 0b5c09b3f0 Fix typo endianess -> endianness
Rename contrib/struct_endianess.py to contrib/struct_endianness.py, and
fix the typo everywhere. This is in preparation to call the script in
CI on all repositories.

Related: OS#5884
Change-Id: Idc4af9098ba1de26243464c772d6ea8be330646a
2023-02-17 10:37:40 +01:00
Daniel Willmann 1f666e875d frame_relay, gprs_ns2_fr: Fix log messages, remove unused struct
Fix typo and remove any reference to GRE from gprs_ns2_fr.c.
GRE code is in gprs_ns2_frgre.c

Change-Id: I51c756f3c9d918552591bf87861cb4799721ac37
2021-11-11 16:50:01 +01:00
Harald Welte 069967be86 ns2: Dump frame relay state to VTY during "show ns"
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
2021-04-25 21:09:23 +02:00
Pau Espin 15b5acb332 Fix struct bitfields on big endian systems
Changes done by contrib/struct_endianess.py.

Change-Id: Ia9cb1ef2ba2bfff9ef713c7d1cf388931dae1c46
2021-02-08 17:23:25 +00:00
Harald Welte f3dc0f94c3 frame_relay; Fix Q.933 async STATUS at DLC creation
Fix the encoding of the asynchronous Q.933 STATUS message
we send at DLC creation time.

Change-Id: Id1460ffa6266be85f44579c447421eed12481b02
Closes: OS#5010
2021-02-05 11:10:48 +01:00
Harald Welte 8373c05a35 gb: frame_relay: Detect link outage on "last receive seq nr == 0"
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
2021-02-04 19:28:02 +01:00
Harald Welte cfe0ed63fa gb: frame_relay: Factor-out function to set link as dead
Change-Id: I624b6a1175cf7d59173dfff02d6197bb644b9072
2021-02-04 19:28:02 +01:00
Alexander Couzens ca3550a261 frame_relay: fix NULL pointer deref
Related: CID#215530
Change-Id: Ic58394ab44ee555a0c5dee2b07fa1054093fbcf0
2021-02-03 14:37:54 +01:00
Harald Welte d6cec24fa1 frame_relay: cosmetic: Unify log syntax when discarding Rx packets
Change-Id: I09d035e38b41be9d6ac5e16da7fb113286c77d29
2021-02-02 11:37:48 +00:00
Harald Welte 36c5e2b3e0 frame_relay: Discard received messages for DLC not yet active
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
2021-02-02 11:37:48 +00:00
Harald Welte 2cc1d4d7df frame_relay: Add status call-backs for link + DLC status changes
Change-Id: Iec19db4e48642c3fcb0aa11fa7787b8323fd0e5a
Related: Os#4999
2021-02-02 11:37:48 +00:00
Harald Welte 2319014f7e frame_relay: Send "Fuil Status" ENQUIRY after link recovers
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
2021-02-01 14:30:53 +00:00
Alexander Couzens b6b62cded0 frame_relay: link_alloc: move log message to the end
The link->name is still not set resulting in logging a (null)

Change-Id: I67cd4bce8238340e6ecb8d04a9a39c8b8d7d63e7
2020-12-23 06:32:29 +01:00
Alexander Couzens e249e36339 frame_relay: prevent null pointer exception when talloc fails
Change-Id: Ib39682ad0c7f30c97303b3d0bb6240fddd23ec0b
2020-12-23 06:32:29 +01:00
Harald Welte 29b77a61ff frame_relay: Fix null pointer dereference in DLC/PVC delete
Change-Id: I71de58f6ca15e2057f26d9c5502c8bc3e03e714f
Closes: CID#215530
2020-11-30 13:29:33 +00:00
Harald Welte 78ebc3fa31 frame_relay: Fix some spelling/language issues
Change-Id: I0ec34c0b452a46008a629f664c10dabd3f836d56
2020-11-25 17:39:06 +01:00
Alexander Couzens 841817ec52 ns2: add support for frame relay
Add support for frame relay over dahdi hdlc device.
It's supporting lmi by q933 and supports both
SGSN and BSS.

Change-Id: Id3b49f93d33c271f77cd9c9db03cde6b727a4d30
2020-11-24 03:53:22 +01:00