Philipp Maier | e190e03 | 2018-12-07 12:31:08 +0100 | [diff] [blame] | 1 | /*! \file gsm23003.h */ |
| 2 | |
| 3 | /* (C) 2018 by sysmocom s.f.m.c. GmbH |
| 4 | * All Rights Reserved |
| 5 | * |
| 6 | * Author: Harald Welte, Philipp Maier |
| 7 | * |
| 8 | * SPDX-License-Identifier: GPL-2.0+ |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; either version 2 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
Philipp Maier | e190e03 | 2018-12-07 12:31:08 +0100 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #pragma once |
| 23 | |
| 24 | #include <osmocom/core/msgb.h> |
| 25 | #include <osmocom/gsm/gsm23003.h> |
| 26 | #include <osmocom/gsm/protocol/gsm_29_118.h> |
| 27 | #include <osmocom/gsm/protocol/gsm_04_08.h> |
| 28 | |
| 29 | /*! 3GPP TS 3GPP TS 29.018 8.14 SGsAP-PAGING-REQUEST. */ |
| 30 | struct gsm29118_paging_req { |
| 31 | char imsi[GSM48_MI_SIZE]; |
| 32 | char vlr_name[SGS_VLR_NAME_MAXLEN + 1]; |
| 33 | uint8_t serv_ind; |
| 34 | |
| 35 | bool lai_present; |
| 36 | struct osmo_location_area_id lai; |
| 37 | }; |
| 38 | |
| 39 | /*! 3GPP TS 3GPP TS 29.018 8.15 SGsAP-RESET-ACK and 8.16 SGsAP-RESET-INDICATION. */ |
| 40 | struct gsm29118_reset_msg { |
| 41 | bool vlr_name_present; |
| 42 | char vlr_name[SGS_VLR_NAME_MAXLEN + 1]; |
| 43 | bool mme_name_present; |
| 44 | char mme_name[SGS_MME_NAME_LEN + 1]; |
| 45 | }; |
| 46 | |
| 47 | struct msgb *gsm29118_msgb_alloc(void); |
| 48 | struct msgb *gsm29118_create_alert_req(const char *imsi); |
| 49 | struct msgb *gsm29118_create_dl_ud(const char *imsi, struct msgb *nas_msg); |
| 50 | struct msgb *gsm29118_create_eps_det_ack(const char *imsi); |
| 51 | struct msgb *gsm29118_create_imsi_det_ack(const char *imsi); |
| 52 | struct msgb *gsm29118_create_lu_ack(const char *imsi, const struct osmo_location_area_id *lai, const uint8_t *new_id, |
| 53 | unsigned int new_id_len); |
| 54 | struct msgb *gsm29118_create_lu_rej(const char *imsi, uint8_t rej_cause, const struct osmo_location_area_id *lai); |
| 55 | struct msgb *gsm29118_create_mm_info_req(const char *imsi, const uint8_t *mm_info, uint8_t mm_info_len); |
| 56 | struct msgb *gsm29118_create_paging_req(struct gsm29118_paging_req *params); |
| 57 | struct msgb *gsm29118_create_reset_ack(struct gsm29118_reset_msg *params); |
| 58 | struct msgb *gsm29118_create_reset_ind(struct gsm29118_reset_msg *params); |
| 59 | struct msgb *gsm29118_create_status(const char *imsi, enum sgsap_sgs_cause cause, const struct msgb *err_msg); |
| 60 | struct msgb *gsm29118_create_release_req(const char *imsi, const uint8_t sgs_cause); |
| 61 | struct msgb *gsm29118_create_service_abort_req(const char *imsi); |