Move the BSSGP handling to libosmocore
Currently the BSSGP stack is cut into two halves. The SGSN side is implemented as a part of libosmocore the BSS side is implemented within the PCU (protocol) and libosmocore (tx functions, bctx allocation).
In libosmocore, incoming messages are just decoded, the protocol handling is done (mainly sending acknowledges or status messages), the corresponding bctx is updated, and further processing is passed to the upper layer via BSSGP primitives. Only the BVC RESET code does a bit more, since it automatically allocates bctx for unknown BVCIs.
The PCU contains the full protocol handling for the BSS side. Since only BVC RESET and STATUS may be sent in either direction, there is not much code duplication. But the BSS side implementation cannot be used for other projects that way (e.g. for intermediaries like the gbproxy).
The bssgp_rcvmsg() can already be used by the BSS side to process BSSGP messages, which only makes sense for BSSGP STATUS currently.
- Adapt the PCU functions to invoke BSSGP primaries instead of doing the PCU related action directly from within the rx functions
- Integrate the BSS side message dispatcher into libosmocore's BSSGP stack, the cases are already there
- Delegate the creation of BSSGP contexts (bctx) in bssgp_rx_bvc_reset to the higher layers by using (and inventing) a primary call or by modifying the semantics of the existing one (e.g. using the rc of bssgp_prim_cb to decide, whether to send ACK or STATUS)