summaryrefslogtreecommitdiffstats
path: root/src/input
Commit message (Collapse)AuthorAgeFilesLines
* hsl: close socket if we destroy the signalling linkPablo Neira Ayuso2011-07-081-0/+14
| | | | | As we do in ipaccess driver, the socket is not useful anymore if the BSC/BTS decides to close the signalling link.
* hsl: BTS supportPablo Neira Ayuso2011-07-083-39/+138
| | | | | | This patch adds the BTS support for the hsl driver. It includes two examples under the tests/ directory.
* ipaccess: add bugtrag for the RSL link becomes up casePablo Neira Ayuso2011-07-081-0/+9
| | | | | | | | | The RSL signal link becomes up for the ipaccess driver is tricky. If the BSC forgets to use the E1 line used by OML for the RSL link, we run into trouble. This patch adds a bugtrap so people don't forget to appropriately handle this case.
* hsl: remove unused hsl_setup functionPablo Neira Ayuso2011-07-071-6/+0Star
| | | | This function lives in openBSC not here.
* e1_input: add new refcounting scheme to avoid leaking E1 linesPablo Neira Ayuso2011-07-071-22/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch 's/e1inp_line_get/e1inp_line_find/g' since we need this function name for the new refcounting scheme. Basically, I have added a new function to clone lines that is used by the ipaccess driver: struct e1inp_line *e1inp_line_clone(void *ctx, struct e1inp_line *line); And two functions to bump and decrement the refcount: void e1inp_line_get(struct e1inp_line *line); void e1inp_line_put(struct e1inp_line *line); This is useful to avoid leaking virtual E1 lines in the ipaccess case, since we have two sockets for OML and RSL respectively, we have to release the line *once* both sockets have been closed. Without this patch, there are cases in which we don't know if it's time to release the virtual E1 line. This patch also includes a fix to avoid crashing if we open a connection with OML/RSL port without sending any ID_RESP message (in that case, we have no chance to set the signal link). I tested these situations with netcat.
* ipaccess: close connection if we receive bad messages from BTSPablo Neira Ayuso2011-07-071-29/+55
| | | | | If we receive bad messages from the BTS, we close the connection. I think this is a more robust behaviour.
* ipaccess: skip further processing for ping, pong and id_req messagesPablo Neira Ayuso2011-07-071-5/+10
|
* ipaccess: release virtual E1 line for closed connectionPablo Neira Ayuso2011-07-071-0/+3
| | | | | We fix a leak in the ipaccess_drop(...) path where we were missing the release of the cloned E1 line for this OML/RSL links
* ipaccess: don't forget to release temporary RSL socketPablo Neira Ayuso2011-07-071-1/+5
| | | | | We have to release the temporary RSL in case that the socket is closed and we have no chance to attach it to the OML link.
* ipaccess: fix write path for OML/RSL message from BSC -> BTSPablo Neira Ayuso2011-07-051-3/+1Star
| | | | | | | | | This patch fixes the write path for OML/RSL messages. I broke this while trying to support the delivery of IPA CCM messages using this path, which is not useful since they are directly delivered by means of the file descriptor. This patch fixes the corruption of messages leaving the BSC.
* src: use signal infrastructure that will be available in libosmocorePablo Neira Ayuso2011-07-051-1/+1
| | | | | This is still not in mainline yet, it's in a separate patch that I expect to send to Harald soon.
* logging: use new harald's logging infrastructure in libosmocorePablo Neira Ayuso2011-07-056-6/+0Star
| | | | | I can send patches to improve it later, better not to waste much time at it by now so port libosmo-abis upon it.
* ipaccess: fix ID_RESP parsing in BSC modePablo Neira Ayuso2011-07-051-6/+3Star
|
* ipaccess: remove any reference to deprecated msg->trxPablo Neira Ayuso2011-07-051-2/+0Star
| | | | We plan to use msg->dst instead.
* e1_input: change prototype of ->sign_link(...)Pablo Neira Ayuso2011-07-052-3/+3
| | | | | This patch removes the struct e1inp_sign_link parameter since this is already available in the msgb->dst field of the message.
* e1_input: change prototype of close hook in e1inp_driverPablo Neira Ayuso2011-07-051-1/+3
| | | | | This patch changes `close' so we can make the e1inp_event inside this hook.
* include: export lapd.h since openBSC needs itPablo Neira Ayuso2011-07-052-2/+2
| | | | More specifically, the unfinished ericsson rbs2000 BTS.
* dahdi: fix driver compilationPablo Neira Ayuso2011-07-021-18/+8Star
| | | | | | Now dahdi driver compiles file. We force the compilation of this driver, I prefer to avoid condition compilation options that tend add problems IMO.
* input: close socket if no signal link was createdPablo Neira Ayuso2011-07-022-16/+44
| | | | | | | | | If the ->sign_link_up callback does not returns (or if it's NULL) a valid new signal link, we inmediately close the socket. If no signal link is set, there is nothing we can do with this socket, so keeping it open is useless otherwise.
* ipaccess: put the ID_GET logic for the BTS mode into the driverPablo Neira Ayuso2011-07-021-5/+126
| | | | | This patch moves the ID_GET logic from the example file to the ipaccess driver in BTS mode.
* major updates in e1_input callback ops and IPA infrastructuresPablo Neira Ayuso2011-06-304-97/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is a major update of the callback infrastructure, now the e1input_ops looks like the following: struct e1inp_sign_link * (*sign_link_up)(void *unit_info, struct e1inp_line *line, enum e1inp_sign_type type); void (*sign_link_down)(struct e1inp_line *line); int (*sign_link)(struct msgb *msg, struct e1inp_sign_link *link); The sign_link_up and sign_link_down will be used by the A-bis over IP input drivers. The sign_link_up callback is used if we receive a ID_RESP message, in that case, we have to set up the sign link for the corresponding new OML/RSL signal link. The pointer to unit_info provides a data structure that contains the BTS device details if we run as BSC, and the requested device information from the BSC if we run as BTS. The sign_link_up callback must return the new sign_link created. The sign_link_down callback is invoked if the line does down, which means that the counterpart has closed the socket. The sign_link callback is used to handle all RSL/OML messages. I have also added the following callback to the e1inp_driver: + void (*close)(struct e1inp_ts *ts); Which is invoked if you call e1inp_sign_link_destroy(). This callback is used to close the socket that is linked to that timeslot. This is useful for A-bis over IP drivers since sockets are closed if the OML/RSL signalling link is destroyed. As you can notice, I have also added all the ID_RESP parsing into libosmo-abis for both ipaccess and hsl drivers. This patch also contains a rework of the ipa_client_link whose integration with the e1_input infrastructure was broken (the transmission path was broken). This patch also contains more develop examples that act as BSC and BTS for the ipaccess driver. Sorry, I know it would be better to split all these changes into logical pieces but many of them are tightly related. This is under heavy development stage, it's anyway hard to track changes until this becomes more stable.
* ipaccess: use E1INP_SIGN_OML instead of hardcoded 1Pablo Neira Ayuso2011-06-271-1/+1
| | | | This patch is a minor cleanup.
* ipaccess: fix RSL link establishmentPablo Neira Ayuso2011-06-271-0/+5
| | | | | This patch fixes the RSL link establishment which made openBSC port over libosmo-abis crash.
* ipaccess: fix write path for OML socketPablo Neira Ayuso2011-06-261-5/+1Star
| | | | | | We have to use e1i_ts->driver.ipaccess.fd file descriptor to fix the write path. Otherwise, openBSC never delivers replies to OML messages.
* ipaccess: add msg->trx to reduce the size of the openbsc-port patchPablo Neira Ayuso2011-06-261-0/+2
| | | | | | This is a temporary change to keep the openbsc port over libosmo-abis smaller. We'll remove it at some point once we fully transition to the new msg->dst routing attribute.
* e1_input: remove unused function ipaccess_connect()Pablo Neira Ayuso2011-06-251-39/+0Star
| | | | This function should live in openbsc instead.
* e1_input: minor API changes to adapt it to openbscPablo Neira Ayuso2011-06-254-31/+31
| | | | | While working on the openbsc over libosmo-abis port, I noticed several API changes that we need to perform for better adaptation.
* ipa: add ipa_*_send() to transmit messagesPablo Neira Ayuso2011-06-231-0/+15
| | | | | | | | This patch adds ipa_*_send() functions to transmit messages using the new A-bis over IP infrastructure. This patch completes the transmission path support for the A-bis over IP infrastructure.
* ipa: add ipa_server_peer infrastructurePablo Neira Ayuso2011-06-231-0/+99
| | | | | This patch adds the ipa_server_peer abstraction which provide helpers for the accept path of ipa_server_link.
* ipa: extend ipa_*link_create() to take one generic data pointerPablo Neira Ayuso2011-06-233-7/+12
| | | | | With this patch we can attach generic data to some IPA link. This will be useful for the IPA proxy support.
* ipaccess: remove dead code from ipaccess adriverPablo Neira Ayuso2011-06-211-21/+0Star
| | | | This patch removes some dead code in the ipaccess driver
* ipa: add ipa_server_link abstractionPablo Neira Ayuso2011-06-212-61/+116
| | | | | | | | This patch adds the ipa_server_link which allows to create IPA servers. I have also changed the ipaccess driver to use it. Still missing the port of HSL driver.
* ipa: rename `struct ipa_link' by `struct ipa_client_link'Pablo Neira Ayuso2011-06-213-23/+23
| | | | | And IPA_LINK_STATE_* by IPA_CLIENT_LINK_STATE_* to prepare the addition of the ipa_server_link abstraction.
* ipaccess: initial works to get BTS mode workingPablo Neira Ayuso2011-06-213-8/+71
| | | | | | | | | | | | | | This patch adds the initial support to get BTS mode working with the ipaccess driver. Now, the driver handles IPA ping, pong and id_ack messages internally in BTS modes, and it passes the signalling messages to the client application by invoking the callback line operations. Moreover, with this patch, each IPA link object always has one E1 line object associated. Still HSL BTS-mode remains unimplemented.
* ipaccess: create RSL socket in BTS modePablo Neira Ayuso2011-06-211-5/+25
| | | | | | | | With this patch, we create the RSL socket in BTS mode. This patch also fixes a crash if the RSL socket goes down before we have set the RSL line via OML with the existing code.
* input: use generic ipa_msg_recv() instead of ipaccess_read_msg()Pablo Neira Ayuso2011-06-212-59/+4Star
| | | | | | | | We use the new generic function to receive messages, instead of ipaccess_read_msg. It's a mere renaming, but it's the first step before the rework that will happen soon to avoid calling read() twice.
* hsl: add support for BTS-modePablo Neira Ayuso2011-06-213-6/+30
| | | | This patch adds support for BTS-mode for the hsl input driver.
* e1input: add address as parameter to e1inp_line_update(...)Pablo Neira Ayuso2011-06-215-22/+22
| | | | | This patch adds a new parameter to e1inp_line_update that allows to specific the address for A-bis over IP BSC/BTS.
* input: ipaccess: add preliminary BTS-side for A-bis over IPPablo Neira Ayuso2011-06-143-4/+260
| | | | | | | | | | | | This patch adds the BTS-side for the ip.access driver for A-bis over IP communications. This patch adds one example under test/ so you can test the existing BSC and BTS sides over ip.access. Still incomplete, it requires to allow to register some callback in the BTS side to perform some action once we receive some message. This will come in next updates.
* include: remove internal definition that are now in libosmocorePablo Neira Ayuso2011-06-094-7/+4Star
| | | | | Still in one separate patch for libosmocore, but they may become part of mainline soon.
* hsl: use include/abis/ipaccess.hPablo Neira Ayuso2011-06-071-1/+1
| | | | instead of deprecated include/gsm/protocol/ipaccess.h
* e1input: rework generic (virtual and real) E1 line operationsPablo Neira Ayuso2011-06-074-13/+135
| | | | | | | | | | | | | | | | | | | | | | struct e1inp_line_ops { int (*sign_link_up)(struct msgb *msg, struct e1inp_line *line); int (*sign_link)(struct msgb *msg, struct e1inp_sign_link *link); int (*error)(struct msgb *msg, int error); }; The description of the operations is the following: * sign_link_up is invoked if the signalling link becomes up. In A-bis over IP, we have to wait until the other peer identifies itself as a BTS/BSC device, then this function is invoked. This function is not used by ISDN drivers, the signalling link can be set up just after the line is created. * sign_link is called if we receive OML/RSL message. This function is used both by ISDN and A-bis over IP drivers. * error is called if we receive a malformed message. It is used both by ISDN and A-bis over IP drivers.
* src: add libosmo_abis_init(void *ctx) to set the talloc contextPablo Neira Ayuso2011-06-072-5/+9
| | | | | This function is called during initialization, so we can set what's the talloc context for the application and the library.
* src: use include/osmocom/abis instead of include/osmocom/gsm/abisPablo Neira Ayuso2011-06-075-25/+4Star
| | | | | | Harald prefers short paths. This patch also remove commented includes in several files.
* src: use new socket API in libosmocorePablo Neira Ayuso2011-06-072-6/+39
| | | | | get rid of internal copy of openbsc/libcommon/socket.c, we now use the new socket API available in libosmocore.
* initial commit of libosmo-abisPablo Neira Ayuso2011-06-056-0/+2561
still many things to get fixed