blob: 2d960329a71e9bfe781d731052fa5700966c5414 [file] [log] [blame]
Ivan Kluchnikov8ee60512012-03-05 19:24:57 +04001/* gprs_bssgp_pcu.h
Ivan Kluchnikov5c2f9fb2012-02-05 02:27:17 +04002 *
Ivan Kluchnikov8ee60512012-03-05 19:24:57 +04003 * Copyright (C) 2012 Ivan Klyuchnikov
Ivan Kluchnikov5c2f9fb2012-02-05 02:27:17 +04004 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
Ivan Kluchnikov8ee60512012-03-05 19:24:57 +040019
20#ifndef GPRS_BSSGP_PCU_H
21#define GPRS_BSSGP_PCU_H
22
Ivan Kluchnikov5c2f9fb2012-02-05 02:27:17 +040023
24extern "C" {
25#include <osmocom/core/talloc.h>
26#include <osmocom/core/rate_ctr.h>
Ivan Kluchnikova9f1ff22012-05-24 22:25:06 +040027#include <osmocom/core/logging.h>
Harald Welted6790092012-06-18 12:21:03 +080028#include <osmocom/core/signal.h>
Ivan Kluchnikov5c2f9fb2012-02-05 02:27:17 +040029#include <osmocom/core/application.h>
Harald Welted6790092012-06-18 12:21:03 +080030#include <osmocom/gprs/gprs_ns.h>
31#include <osmocom/gprs/gprs_bssgp.h>
Andreas Eversberg4b39dd12012-09-23 05:03:56 +020032#include <osmocom/gprs/gprs_bssgp_bss.h>
Harald Welted6790092012-06-18 12:21:03 +080033#include <osmocom/gprs/gprs_msgb.h>
Ivan Kluchnikov5c2f9fb2012-02-05 02:27:17 +040034
Ivan Kluchnikov5c2f9fb2012-02-05 02:27:17 +040035struct bssgp_bvc_ctx *btsctx_alloc(uint16_t bvci, uint16_t nsei);
36}
Ivan Kluchnikova9f1ff22012-05-24 22:25:06 +040037#include <gprs_debug.h>
Ivan Kluchnikov5c2f9fb2012-02-05 02:27:17 +040038
Andreas Eversberg4b39dd12012-09-23 05:03:56 +020039#define QOS_PROFILE 4
Ivan Kluchnikov3fa42b22012-06-04 19:07:25 +040040#define BSSGP_HDR_LEN 53
Ivan Kluchnikov8ee60512012-03-05 19:24:57 +040041#define NS_HDR_LEN 4
Ivan Kluchnikovb172b1b2012-06-07 01:51:49 +040042#define IE_LLC_PDU 14
Ivan Kluchnikov5c2f9fb2012-02-05 02:27:17 +040043
Holger Hans Peter Freythere8d9a5f2013-07-28 19:11:20 +020044struct gprs_bssgp_pcu {
45 struct gprs_nsvc *nsvc;
46 struct bssgp_bvc_ctx *bctx;
47
48 struct gprs_rlcmac_bts *bts;
49
50 struct osmo_timer_list bvc_timer;
51
52 int nsvc_unblocked;
53
54 int bvc_sig_reset;
55 int bvc_reset;
56 int bvc_unblocked;
57 int exit_on_destroy;
58};
59
60struct gprs_bssgp_pcu *gprs_bssgp_create_and_connect(struct gprs_rlcmac_bts *bts,
61 uint16_t local_port,
Holger Hans Peter Freytherb67a8a32013-07-28 18:55:14 +020062 uint32_t sgsn_ip, uint16_t sgsn_port, uint16_t nsei,
63 uint16_t nsvci, uint16_t bvci, uint16_t mcc, uint16_t mnc,
64 uint16_t lac, uint16_t rac, uint16_t cell_id);
Andreas Eversbergbf5a0f62012-07-06 08:58:22 +020065
Holger Hans Peter Freythera30f4762013-07-11 16:13:38 +020066void gprs_bssgp_exit_on_destroy(void);
67void gprs_bssgp_destroy_or_exit(void);
Andreas Eversbergbf5a0f62012-07-06 08:58:22 +020068
Holger Hans Peter Freyther90692f92013-07-13 12:51:16 +020069struct bssgp_bvc_ctx *gprs_bssgp_pcu_current_bctx(void);
70
Ivan Kluchnikov8ee60512012-03-05 19:24:57 +040071#endif // GPRS_BSSGP_PCU_H