Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 1 | /* (C) 2017 by Sysmocom s.f.m.c. GmbH |
| 2 | * All Rights Reserved |
| 3 | * |
| 4 | * Author: Philipp Maier |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU Affero General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU Affero General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Affero General Public License |
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #pragma once |
| 22 | |
Neels Hofmeyr | 9084396 | 2017-09-04 15:04:35 +0200 | [diff] [blame] | 23 | #include <osmocom/msc/a_reset.h> |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 24 | |
| 25 | /* A struct to keep a context information about the BSCs we are associated with */ |
| 26 | struct bsc_context { |
| 27 | struct llist_head list; |
| 28 | |
| 29 | /* Holds a copy of the sccp address of the BSC, |
| 30 | * this address will become known as soon as |
| 31 | * a remote BSC tries to make a connection or |
| 32 | * sends a RESET request via UNIDATA */ |
| 33 | struct osmo_sccp_addr bsc_addr; |
| 34 | |
| 35 | /* Holds a copy of the our local MSC address, |
| 36 | * this will be the sccp-address that is associated |
| 37 | * with the A interface */ |
| 38 | struct osmo_sccp_addr msc_addr; |
| 39 | |
| 40 | /* A pointer to the reset handler FSM, the |
| 41 | * state machine is allocated when the BSC |
| 42 | * is registerd. */ |
| 43 | struct a_reset_ctx *reset; |
| 44 | |
| 45 | /* A pointer to the sccp_user that is associated |
| 46 | * with the A interface. We need this information |
| 47 | * to send the resets and to send paging requests */ |
| 48 | struct osmo_sccp_user *sccp_user; |
| 49 | }; |
| 50 | |
| 51 | /* Initalize A interface connection between to MSC and BSC */ |
| 52 | int a_init(struct osmo_sccp_instance *sccp, struct gsm_network *network); |
| 53 | |
Philipp Maier | 4502f5f | 2017-09-07 11:39:58 +0200 | [diff] [blame^] | 54 | /* Send DTAP message via A-interface, take ownership of msg */ |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 55 | int a_iface_tx_dtap(struct msgb *msg); |
| 56 | |
| 57 | /* Send Cipher mode command via A-interface */ |
| 58 | int a_iface_tx_cipher_mode(const struct gsm_subscriber_connection *conn, |
| 59 | int cipher, const const uint8_t *key, int len, int include_imeisv); |
| 60 | |
| 61 | /* Page a subscriber via A-interface */ |
| 62 | int a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac); |
| 63 | |
| 64 | /* Send assignment request via A-interface */ |
| 65 | int a_iface_tx_assignment(const struct gsm_trans *trans); |
| 66 | |
| 67 | /* Send clear command via A-interface */ |
| 68 | int a_iface_tx_clear_cmd(struct gsm_subscriber_connection *conn); |
| 69 | |
| 70 | /* Clear all subscriber connections on a specified BSC |
| 71 | * (Helper function for a_iface_bssap.c) */ |
| 72 | void a_clear_all(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *bsc_addr); |
| 73 | |
| 74 | /* Delete info of a closed connection from the active connection list |
| 75 | * (Helper function for a_iface_bssap.c) */ |
| 76 | void a_delete_bsc_con(uint32_t conn_id); |