blob: f07ab526221a72970694dfccbf973efc18b06819 [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);
60
61int bssgp_tx_ul_ud(struct bssgp_bvc_ctx *bctx, uint32_t tlli,
62 const uint8_t *qos_profile, struct msgb *llc_pdu);
63
64int bssgp_rx_paging(struct bssgp_paging_info *pinfo,
65 struct msgb *msg);
66
Andreas Eversbergf44ed8c2012-09-23 06:05:20 +020067int bssgp_tx_fc_bvc(struct bssgp_bvc_ctx *bctx, uint8_t tag,
Harald Weltee92866b2012-09-10 08:56:04 +020068 uint32_t bucket_size, uint32_t bucket_leak_rate,
Jacob Erlbeck9385d1e2015-05-06 09:29:32 +020069 uint32_t bmax_default_ms, uint32_t r_default_ms,
Harald Weltee92866b2012-09-10 08:56:04 +020070 uint8_t *bucket_full_ratio, uint32_t *queue_delay_ms);
71
Andreas Eversbergf44ed8c2012-09-23 06:05:20 +020072int bssgp_tx_fc_ms(struct bssgp_bvc_ctx *bctx, uint32_t tlli, uint8_t tag,
Harald Weltee92866b2012-09-10 08:56:04 +020073 uint32_t ms_bucket_size, uint32_t bucket_leak_rate,
74 uint8_t *bucket_full_ratio);