2011-06-27 09:25:35 +00:00
|
|
|
#ifndef OSMO_BTS_PAGING_H
|
|
|
|
#define OSMO_BTS_PAGING_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <osmocom/gsm/gsm_utils.h>
|
|
|
|
#include <osmocom/gsm/protocol/gsm_04_08.h>
|
|
|
|
|
|
|
|
struct paging_state;
|
2018-03-17 11:22:40 +00:00
|
|
|
struct gsm_bts;
|
2023-06-26 08:10:28 +00:00
|
|
|
struct asci_notification;
|
|
|
|
|
|
|
|
/* abstract representation of P1 rest octets; we only implement those parts we need for now */
|
|
|
|
struct p1_rest_octets {
|
|
|
|
struct {
|
|
|
|
bool present;
|
|
|
|
uint8_t nln;
|
|
|
|
uint8_t nln_status;
|
|
|
|
} nln_pch;
|
|
|
|
bool packet_page_ind[2];
|
|
|
|
bool r8_present;
|
|
|
|
struct {
|
|
|
|
bool prio_ul_access;
|
|
|
|
bool etws_present;
|
|
|
|
struct {
|
|
|
|
bool is_first;
|
|
|
|
uint8_t page_nr;
|
|
|
|
const uint8_t *page;
|
|
|
|
size_t page_bytes;
|
|
|
|
} etws;
|
|
|
|
} r8;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* abstract representation of P2 rest octets; we only implement those parts we need for now */
|
|
|
|
struct p2_rest_octets {
|
|
|
|
struct {
|
|
|
|
bool present;
|
|
|
|
uint8_t cn3;
|
|
|
|
} cneed;
|
|
|
|
struct {
|
|
|
|
bool present;
|
|
|
|
uint8_t nln;
|
|
|
|
uint8_t nln_status;
|
|
|
|
} nln_pch;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* abstract representation of P3 rest octets; we only implement those parts we need for now */
|
|
|
|
struct p3_rest_octets {
|
|
|
|
struct {
|
|
|
|
bool present;
|
|
|
|
uint8_t cn3;
|
|
|
|
uint8_t cn4;
|
|
|
|
} cneed;
|
|
|
|
struct {
|
|
|
|
bool present;
|
|
|
|
uint8_t nln;
|
|
|
|
uint8_t nln_status;
|
|
|
|
} nln_pch;
|
|
|
|
};
|
2011-06-27 09:25:35 +00:00
|
|
|
|
|
|
|
/* initialize paging code */
|
2018-03-17 11:22:40 +00:00
|
|
|
struct paging_state *paging_init(struct gsm_bts *bts,
|
2012-06-04 15:27:13 +00:00
|
|
|
unsigned int num_paging_max,
|
2011-06-27 09:25:35 +00:00
|
|
|
unsigned int paging_lifetime);
|
|
|
|
|
2012-11-13 04:20:47 +00:00
|
|
|
/* (re) configure paging code */
|
2012-12-18 23:00:42 +00:00
|
|
|
void paging_config(struct paging_state *ps,
|
2012-11-13 04:20:47 +00:00
|
|
|
unsigned int num_paging_max,
|
|
|
|
unsigned int paging_lifetime);
|
|
|
|
|
2011-06-27 21:51:02 +00:00
|
|
|
void paging_reset(struct paging_state *ps);
|
|
|
|
|
2013-01-03 15:44:28 +00:00
|
|
|
/* The max number of paging entries */
|
|
|
|
unsigned int paging_get_queue_max(struct paging_state *ps);
|
|
|
|
void paging_set_queue_max(struct paging_state *ps, unsigned int queue_max);
|
|
|
|
|
|
|
|
/* The lifetime of a paging entry */
|
|
|
|
unsigned int paging_get_lifetime(struct paging_state *ps);
|
|
|
|
void paging_set_lifetime(struct paging_state *ps, unsigned int lifetime);
|
|
|
|
|
2011-06-27 09:25:35 +00:00
|
|
|
/* update with new SYSTEM INFORMATION parameters */
|
|
|
|
int paging_si_update(struct paging_state *ps, struct gsm48_control_channel_descr *chan_desc);
|
|
|
|
|
|
|
|
/* Add an identity to the paging queue */
|
|
|
|
int paging_add_identity(struct paging_state *ps, uint8_t paging_group,
|
|
|
|
const uint8_t *identity_lv, uint8_t chan_needed);
|
|
|
|
|
2023-05-11 09:48:05 +00:00
|
|
|
/* Add a ready formatted MAC block message to the paging queue, this can be an IMMEDIATE ASSIGNMENT, or a
|
|
|
|
* PAGING COMMAND (from the PCU) */
|
2023-08-08 14:06:57 +00:00
|
|
|
int paging_add_macblock(struct paging_state *ps, uint32_t msg_id, const char *imsi, bool confirm, const uint8_t *macblock);
|
2012-07-08 16:55:45 +00:00
|
|
|
|
2023-06-26 08:10:28 +00:00
|
|
|
/* Paging rest octests */
|
|
|
|
void append_p1_rest_octets(struct bitvec *bv, const struct p1_rest_octets *p1ro,
|
|
|
|
const struct asci_notification *notif);
|
|
|
|
void append_p2_rest_octets(struct bitvec *bv, const struct p2_rest_octets *p2ro);
|
|
|
|
void append_p3_rest_octets(struct bitvec *bv, const struct p3_rest_octets *p3ro);
|
|
|
|
|
2011-06-27 09:25:35 +00:00
|
|
|
/* generate paging message for given gsm time */
|
2014-02-14 13:18:51 +00:00
|
|
|
int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *gt,
|
|
|
|
int *is_empty);
|
2011-06-27 09:25:35 +00:00
|
|
|
|
2011-12-01 08:09:18 +00:00
|
|
|
|
|
|
|
/* inspection methods below */
|
|
|
|
int paging_group_queue_empty(struct paging_state *ps, uint8_t group);
|
|
|
|
int paging_queue_length(struct paging_state *ps);
|
2012-06-04 15:27:13 +00:00
|
|
|
int paging_buffer_space(struct paging_state *ps);
|
2011-12-01 08:09:18 +00:00
|
|
|
|
2011-06-27 09:25:35 +00:00
|
|
|
#endif
|