summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom/bb/common/sap_interface.h
AgeCommit message (Collapse)AuthorFilesLines
2019-01-15layer23/sap_interface.c: reimplement (BT)SAP interfaceVadim Yanitskiy1-12/+17
The (BT)SAP (Bluetooth SIM Access Profile) is a part of Bluetooth specifications, that defines the protocol and procedures that shall be used to access a smart card (usually GSM SIM) via a Bluetooth link. The profile defines two roles: - Server - the side that has direct access to a smart card. It acts as a SIM card reader, which assists the Client in accessing and controlling the smart card. - Client - the side that accesses and controls the smart card inside the Server through the connection with Server. Typical examples of a Server are a simple SIM card holder or a portable phone in the car environment. A typical example of a Client is a car phone, which uses a subscription module in the Server for a connection to the cellular network. OsmocomBB implements the Client role providing abstract SAP interface API to the higher layers. Instead of Bluetooth, a UNIX socket is used to communicate with a Server. The previous implementation of (BT)SAP interface was incomplete and hard to maintain. This change (re)implements it almost from scratch on top of the Osmocom FSM framework. Besides that, the most significant changes are: - The implementation is separated into three parts: - sap_interface.{c|h} - public SAP interface API, - sap_proto.{c|h} - SAP protocol definition, - sap_fsm.{c|h} - SAP FSM implementation. - Both 'sap_message' and 'sap_param' structures follow the SAP message format definition according to 5.1 and 5.2. - The message parsing is done more carefully in order to prevent buffer overflow and NULL-pointer dereference. - Introduced public API for getting / adding message parameters, and checking the ResultCode. - Introduced public API for opening / closing a connection with the server, powering on / off and resetting the SIM card, sending ATR and APDU. - Introduced a call-back for handling the response message. - Card reader state is also a part of the public API. The new implementation was tested against softsim [1]. The only limitation is Server-initiated Release, that allows the Server to 'ask' a Client to release connection as soon as communication with the smart card is finished. This is not implemented (yet), and leads to immediate release. [1] https://git.osmocom.org/softsim/ Change-Id: I77bb108615bb2c94c441568f195b04e0a5421643
2019-01-07layer23/sap_interface.c: separate protocol definitionVadim Yanitskiy1-83/+0
Change-Id: Iad9b3d88b02cc7ec4cf64483bbc85e3a61c9ad10
2019-01-07layer23/sap_interface.c: avoid using 'osmo' prefixVadim Yanitskiy1-7/+7
The 'osmo' prefix is usually used by libosmo-* symbols. Change-Id: Id37d8553c2f2c20012fb1b729967b92a9a03f612
2019-01-07layer23/sap_interface.c: define missing enums and use themVadim Yanitskiy1-0/+31
Change-Id: I4ba5a8a42bf25d04b152ac3f1f0e4d7eac7f068f
2019-01-07layer23/sap_interface.c: prettify value_string definitionsVadim Yanitskiy1-2/+2
Change-Id: Ib3aa81986987027718e2a8b461afd28787bda4c2
2018-12-26layer23/sap_interface.c: remove redundant socket_path argumentVadim Yanitskiy1-1/+1
Change-Id: I408b3e1fa40e9b5daf88fa6ed5f3930b83dffe6f
2018-12-26layer23/sap_interface.c: drop unused osmosap_sapsocket()Vadim Yanitskiy1-1/+0
Change-Id: Ie3040c75bb61094b9b601aef9d699db603d292f4
2018-12-26layer23/include/sap_interface.h: use #pragma onceVadim Yanitskiy1-5/+1
Change-Id: I98e407c2b6604438d2495700cb62753ad55369ea
2016-01-18host/mobile: Improved SAP interface integrationЯницкий Ва дим1-0/+1
1) Now the SAP interface is selectable as SIM source using the 'sim sap' command in VTY. 2) SAP connection starts only if it is configured as SIM source. 3) Fixed sap_socket_path configuration r/w errors. Written-by: Яницкий Ва дим <axilirator@gmail.com> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-04-28host/mobile: Finish working support for the SAP interfaceSylvain Munaut1-1/+64
Patch mostly written by Nico Golde and some cleanup/testing by Domonkos Tomcsanyi Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-18[layer23] Added BTSAP socket interface to layer23Andreas.Eversberg1-0/+11