~ubuntu-branches/debian/sid/osmo-pcu/sid

« back to all changes in this revision

Viewing changes to src/gprs_bssgp_pcu.h

  • Committer: Package Import Robot
  • Author(s): Thorsten Alteholz
  • Date: 2017-12-12 19:07:49 UTC
  • Revision ID: package-import@ubuntu.com-20171212190749-h4lfqf29yw1bi6v5
Tags: upstream-0.4.0
ImportĀ upstreamĀ versionĀ 0.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* gprs_bssgp_pcu.h
 
2
 *
 
3
 * Copyright (C) 2012 Ivan Klyuchnikov
 
4
 * Copyright (C) 2013 by Holger Hans Peter Freyther
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (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 General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 */
 
20
 
 
21
#ifndef GPRS_BSSGP_PCU_H
 
22
#define GPRS_BSSGP_PCU_H
 
23
 
 
24
 
 
25
extern "C" {
 
26
#include <osmocom/core/talloc.h>
 
27
#include <osmocom/core/rate_ctr.h>
 
28
#include <osmocom/core/logging.h>
 
29
#include <osmocom/core/signal.h>
 
30
#include <osmocom/core/application.h>
 
31
#include <osmocom/gprs/gprs_ns.h>
 
32
#include <osmocom/gprs/gprs_bssgp.h>
 
33
#include <osmocom/gprs/gprs_bssgp_bss.h>
 
34
#include <osmocom/gprs/gprs_msgb.h>
 
35
 
 
36
struct bssgp_bvc_ctx *btsctx_alloc(uint16_t bvci, uint16_t nsei);
 
37
}
 
38
#include <gprs_debug.h>
 
39
 
 
40
#define QOS_PROFILE 4
 
41
#define BSSGP_HDR_LEN 53
 
42
#define NS_HDR_LEN 4
 
43
#define IE_LLC_PDU 14
 
44
 
 
45
struct gprs_rlcmac_bts;
 
46
 
 
47
struct gprs_bssgp_pcu {
 
48
        struct gprs_nsvc *nsvc;
 
49
        struct bssgp_bvc_ctx *bctx;
 
50
 
 
51
        struct gprs_rlcmac_bts *bts;
 
52
 
 
53
        struct osmo_timer_list bvc_timer;
 
54
 
 
55
        int nsvc_unblocked;
 
56
 
 
57
        int bvc_sig_reset;
 
58
        int bvc_reset;
 
59
        int bvc_unblocked;
 
60
 
 
61
        /* Flow control */
 
62
        struct timeval queue_delay_sum;
 
63
        unsigned queue_delay_count;
 
64
        uint8_t fc_tag;
 
65
        unsigned queue_frames_sent;
 
66
        unsigned queue_bytes_recv;
 
67
        unsigned queue_frames_recv;
 
68
 
 
69
        /** callbacks below */
 
70
 
 
71
        /* The BSSGP has been unblocked */
 
72
        void (*on_unblock_ack)(struct gprs_bssgp_pcu *pcu);
 
73
 
 
74
        /* When BSSGP data arrives. The msgb is not only for reference */
 
75
        void (*on_dl_unit_data)(struct gprs_bssgp_pcu *pcu, struct msgb *msg,
 
76
                                struct tlv_parsed *tp);
 
77
};
 
78
 
 
79
struct gprs_bssgp_pcu *gprs_bssgp_create_and_connect(struct gprs_rlcmac_bts *bts,
 
80
                uint16_t local_port,
 
81
                uint32_t sgsn_ip, uint16_t sgsn_port, uint16_t nsei,
 
82
                uint16_t nsvci, uint16_t bvci, uint16_t mcc, uint16_t mnc,
 
83
                uint16_t lac, uint16_t rac, uint16_t cell_id);
 
84
 
 
85
void gprs_bssgp_destroy(void);
 
86
int gprs_ns_reconnect(struct gprs_nsvc *nsvc);
 
87
 
 
88
struct bssgp_bvc_ctx *gprs_bssgp_pcu_current_bctx(void);
 
89
 
 
90
void gprs_bssgp_update_queue_delay(const struct timeval *tv_recv,
 
91
                const struct timeval *tv_now);
 
92
void gprs_bssgp_update_frames_sent();
 
93
void gprs_bssgp_update_bytes_received(unsigned bytes_recv, unsigned frames_recv);
 
94
 
 
95
#endif // GPRS_BSSGP_PCU_H