As suggested in code review, create sub-structs for cn and ran. The
following patches will fill them up with mscs, bscs etc.
Related: SYS#5560
Change-Id: I6a3cc0d837a3d89e7153c2296812df0863f3471f
The sccp_inst was only used to differentiate between CN / RAN. Instead
of passing that, pass an enum and add bsc_nat_print_addr_cn and _ran
defines to keep it short.
This is in preparation for refactoring struct bsc_nat as suggested in
code review.
Related: SYS#5560
Change-Id: I3c6046a6726c31bf137223c46c2c96b3898ad324
Let the BSCNAT directly reply to RESET sent from BSC with RESET ACK.
bssap_ran_handle_reset() is a bit empty right now but will be used in a
future patch to store the BSC.
Related: SYS#5560
Related: https://osmocom.org/projects/osmo-bscnat/wiki/AoIP_OsmoBSCNAT#RESET
Change-Id: I3223409e25c93b625d67634caf68efe9772e2558
Make it a bit shorter, it's clear that this refers to the local address
of the OsmoBSCNAT in CN/RAN.
Related: SYS#5560
Change-Id: I3083374d589487ed960507e7a431c45914afc5dd
Prepare for future patches where more will happen in the callback
function. Split it up into two functions, one for CN and one for RAN, so
we don't need to constantly think through both cases while
changing/trying to understand the function.
Related: SYS#5560
Change-Id: I8eb8f24ad33a59de8fbaf512547d389ee86c13dc
After implementing more functionallity (see follow-up patches), it
became clear that this macro is not so useful:
* Using the macro creates unnecessary overhead,
'LOG_SCCP(sccp_inst, peer_addr_in,' is much longer than 'LOGP('
* The RI and SSN are always the same, so it's not useful to print them
all the time, this is the generated prefix:
'(RI=SSN_PC,PC=0.23.3,SSN=BSSAP from CN)'
Related: SYS#5560
Change-Id: I49187d4e3d804c4786ee52eaebdd911e6c6cfa6c
Shorten them and don't use the LOG_SCCP macro anymore that will be
dropped in a follow-up patch. Change the level to DEBUG.
Related: SYS#5560
Change-Id: I85f65ad3c15a10958fbfe97aef00fc386e85ef63
Move the log message outside of the switch case to make it a bit
shorter. Use LOGP instead of LOG_SCCP, because the latter is about to
get removed in a follow-up patch.
Related: SYS#5560
Change-Id: I1f181ff38f86d83969da4e9d3da72dd9d69d298a
Categorize includes by:
* (library includes)
* Osmocom includes except for OsmoBSCNAT
* OsmoBSCNAT includes
Order the includes in each category alphabetically, and remove empty
lines between them. This allows me to keep them consistent, and with
empty lines removed between these categories it doesn't look
inconsistent if there is only one include from two categories in one
file, but multiple includes from the same category in another file.
While at it, also have one empty line after the license header in all
c, h files, and one after the includes.
Related: SYS#5560
Change-Id: I1a7b95ccb0c87fd53645c72f0c02449e8403043b
conn.ind happens before conn.conf, so use the same order in the switch
statement.
Related: SYS#5560
Change-Id: Ibdb5a9b092ab481f35cf5920f3635fdf4a9b85c2
Get ss7_inst once and store it inside bsc_nat_sccp_inst to avoid
multiple calls to osmo_ss7_instance_find().
Related: SYS#5560
Change-Id: I9a8b69fb3df17c85a67958fbca88948573d39694
This name seems more fitting, since the code mostly interacts with the
sccp addr and scu contained in the struct.
Related: SYS#5560
Change-Id: Id0f965811eff0eb7b387d5ae2eec2451d6d8e415
Fix the logic to not always return src->local_sccp_addr. What we need to
know is the peer's address.
Related: SYS#5560
Change-Id: I0055c0fafe672db5ce7a616d94c8964e8d58968f
Implement a simple version of forwarding Connection Request, Connection
Confirm, Data Form, Released SCCP messages. This is still assuming that
there is just one BSC, one MSC, the same connection ID is used in RAN
and CN. Future patches will add a mapping between RAN and CN sides and
allow multiple BSCs.
With this patch it is possible to perform a call between two MS in the
following network structure:
MS1 --.
BTS --- BSC --- BSCNAT --- MSC
MS2 --'
Related: SYS#5560
Change-Id: I3df79e4dfaa60f4fd098961ee57cda71e9773b82
Split this code into an extra function, as it will be used by other
message types in sccp_sap_up too (following patches).
Related: SYS#5560
Change-Id: I6bc59445d65f812ccd46eb33dd6cca6b34dd0867
Only in connection-less messages, the called party address is always the
address of the receiving peer. Prepare for connection-oriented messages
by renaming:
dest_called -> peer_addr_out
peer_addr -> peer_addr_in
Related: SYS#5560
Change-Id: Ib58a4e8eb8beca23cb9f11c46576f8b17bb66f3c
This is already done by the SCCP stack, as Harald explained it:
"Think of a TCP socket where you have already bound a socket and then
still do recvmsg to check if the destination address is what you expect."
Related: SYS#5560
Change-Id: Id9bfbf38a61ef66a4246f752ef487d8a09fea173
Add an initial implementation of sccp_sap_up, that assumes one BSC and
one MSC, and successfully forwards RESET and RESET ACK between both.
Related: SYS#5560
Depends: libosmo-sccp I0f38b0d038b0dd8cd355e7284e5b56d438811bd9
Change-Id: I4af398bb433341a98f818822e6c3af28b6d9dacd
Create the initial FSM that starts and stops two SS7 instances (one for
CN, one for RAN), and binds an sccp user to each.
Related: SYS#5560
Depends: libosmocore I81c64a7ae440304522c2179c212023a566ddced8
Change-Id: I7d52fa649c397582b18a1a7dcc40bb407f3b2c97