blob: ab62b66960117f6d6e82ee98bb6509e581b71b4e [file] [log] [blame]
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02001/*! \file gprs_bssgp_bss.h
2 * GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */
3/*
4 * (C) 2009-2012 by Harald Welte <laforge@gnumonks.org>
Harald Welte30fabdf2012-09-10 08:54:35 +02005 *
6 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
Harald Welte7fa89c22014-10-26 20:33:09 +01009 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
Harald Welte30fabdf2012-09-10 08:54:35 +020011 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Harald Welte7fa89c22014-10-26 20:33:09 +010016 * GNU General Public License for more details.
Harald Welte30fabdf2012-09-10 08:54:35 +020017 *
Harald Welte7fa89c22014-10-26 20:33:09 +010018 * You should have received a copy of the GNU General Public License
Harald Welte30fabdf2012-09-10 08:54:35 +020019 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
Neels Hofmeyr17518fe2017-06-20 04:35:06 +020023#pragma once
24
25#include <osmocom/core/msgb.h>
26#include <osmocom/gprs/gprs_bssgp.h>
Harald Welte30fabdf2012-09-10 08:54:35 +020027
28uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli);
Maxf1ad60e2018-01-05 14:19:33 +010029uint8_t *bssgp_msgb_ra_put(struct msgb *msg, const struct gprs_ra_id *ra_id);
Max8b8938f2017-06-29 19:48:29 +020030int bssgp_tx_bvc_ptp_reset(uint16_t nsei, enum gprs_bssgp_cause cause);
Harald Welte30fabdf2012-09-10 08:54:35 +020031int bssgp_tx_suspend(uint16_t nsei, uint32_t tlli,
32 const struct gprs_ra_id *ra_id);
33
34int bssgp_tx_resume(uint16_t nsei, uint32_t tlli,
35 const struct gprs_ra_id *ra_id, uint8_t suspend_ref);
36
37int bssgp_tx_ra_capa_upd(struct bssgp_bvc_ctx *bctx, uint32_t tlli, uint8_t tag);
38
39int bssgp_tx_radio_status_tlli(struct bssgp_bvc_ctx *bctx, uint8_t cause,
40 uint32_t tlli);
41
42int bssgp_tx_radio_status_tmsi(struct bssgp_bvc_ctx *bctx, uint8_t cause,
43 uint32_t tmsi);
44
45int bssgp_tx_radio_status_imsi(struct bssgp_bvc_ctx *bctx, uint8_t cause,
46 const char *imsi);
47
48int bssgp_tx_flush_ll_ack(struct bssgp_bvc_ctx *bctx, uint32_t tlli,
49 uint8_t action, uint16_t bvci_new,
50 uint32_t num_octets);
51
52int bssgp_tx_llc_discarded(struct bssgp_bvc_ctx *bctx, uint32_t tlli,
53 uint8_t num_frames, uint32_t num_octets);
54
55int bssgp_tx_bvc_block(struct bssgp_bvc_ctx *bctx, uint8_t cause);
56
57int bssgp_tx_bvc_unblock(struct bssgp_bvc_ctx *bctx);
58
59int bssgp_tx_bvc_reset(struct bssgp_bvc_ctx *bctx, uint16_t bvci, uint8_t cause);
Harald Welte2d3465f2020-06-26 15:13:19 +020060int bssgp_tx_bvc_reset2(struct bssgp_bvc_ctx *bctx, uint16_t bvci, uint8_t cause, bool add_cell_id);
Harald Welte30fabdf2012-09-10 08:54:35 +020061
62int bssgp_tx_ul_ud(struct bssgp_bvc_ctx *bctx, uint32_t tlli,
63 const uint8_t *qos_profile, struct msgb *llc_pdu);
64
65int bssgp_rx_paging(struct bssgp_paging_info *pinfo,
66 struct msgb *msg);
67
Andreas Eversbergf44ed8c2012-09-23 06:05:20 +020068int bssgp_tx_fc_bvc(struct bssgp_bvc_ctx *bctx, uint8_t tag,
Harald Weltee92866b2012-09-10 08:56:04 +020069 uint32_t bucket_size, uint32_t bucket_leak_rate,
Jacob Erlbeck9385d1e2015-05-06 09:29:32 +020070 uint32_t bmax_default_ms, uint32_t r_default_ms,
Harald Weltee92866b2012-09-10 08:56:04 +020071 uint8_t *bucket_full_ratio, uint32_t *queue_delay_ms);
72
Andreas Eversbergf44ed8c2012-09-23 06:05:20 +020073int bssgp_tx_fc_ms(struct bssgp_bvc_ctx *bctx, uint32_t tlli, uint8_t tag,
Harald Weltee92866b2012-09-10 08:56:04 +020074 uint32_t ms_bucket_size, uint32_t bucket_leak_rate,
75 uint8_t *bucket_full_ratio);