libosmogb
1.6.0.113-b17c
Osmocom Gb library
|
Go to the documentation of this file.
12 #define LOGNSE(nse, lvl, fmt, args ...) \
13 LOGP(DLNS, lvl, "NSE(%05u) " fmt, (nse)->nsei, ## args)
15 #define LOGBIND(bind, lvl, fmt, args ...) \
16 LOGP(DLNS, lvl, "BIND(%s) " fmt, (bind)->name, ## args)
18 #define LOGNSVC_SS(ss, nsvc, lvl, fmt, args ...) \
20 if ((nsvc)->nsvci_is_valid) { \
21 LOGP(ss, lvl, "NSE(%05u)-NSVC(%05u) " fmt, \
22 (nsvc)->nse->nsei, (nsvc)->nsvci, ## args); \
24 LOGP(ss, lvl, "NSE(%05u)-NSVC(none) " fmt, \
25 (nsvc)->nse->nsei, ## args); \
29 #define LOGNSVC(nsvc, lvl, fmt, args ...) \
30 LOGNSVC_SS(DLNS, nsvc, lvl, fmt, ## args)
32 #define LOG_NS_SIGNAL(nsvc, direction, pdu_type, lvl, fmt, args ...) \
33 LOGNSVC_SS(DLNSSIGNAL, nsvc, lvl, "%s %s" fmt, direction, get_value_string(gprs_ns_pdu_strings, pdu_type), ## args)
35 #define LOG_NS_DATA(nsvc, direction, pdu_type, lvl, fmt, args ...) \
36 LOGNSVC_SS(DLNSDATA, nsvc, lvl, "%s %s" fmt, direction, get_value_string(gprs_ns_pdu_strings, pdu_type), ## args)
38 #define LOG_NS_RX_SIGNAL(nsvc, pdu_type) LOG_NS_SIGNAL(nsvc, "Rx", pdu_type, LOGL_INFO, "\n")
39 #define LOG_NS_TX_SIGNAL(nsvc, pdu_type) LOG_NS_SIGNAL(nsvc, "Tx", pdu_type, LOGL_INFO, "\n")
41 #define RATE_CTR_INC_NS(nsvc, ctr) \
43 struct gprs_ns2_vc *_nsvc = (nsvc); \
44 rate_ctr_inc(rate_ctr_group_get_ctr(_nsvc->ctrg, ctr)); \
45 rate_ctr_inc(rate_ctr_group_get_ctr(_nsvc->nse->ctrg, ctr)); \
48 #define RATE_CTR_ADD_NS(nsvc, ctr, val) \
50 struct gprs_ns2_vc *_nsvc = (nsvc); \
51 rate_ctr_add(rate_ctr_group_get_ctr(_nsvc->ctrg, ctr), val); \
52 rate_ctr_add(rate_ctr_group_get_ctr(_nsvc->nse->ctrg, ctr), val); \
63 #define NS_TIMERS_COUNT 11
64 #define NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries|tsns-prov|tsns-size-retries|tsns-config-retries|tsns-procedures-retries)"
65 #define NS_TIMERS_HELP \
66 "(un)blocking Timer (Tns-block) timeout\n" \
67 "(un)blocking Timer (Tns-block) number of retries\n" \
68 "Reset Timer (Tns-reset) timeout\n" \
69 "Reset Timer (Tns-reset) number of retries\n" \
70 "Test Timer (Tns-test) timeout\n" \
71 "Alive Timer (Tns-alive) timeout\n" \
72 "Alive Timer (Tns-alive) number of retries\n" \
73 "SNS Provision Timer (Tsns-prov) timeout\n" \
74 "SNS Size number of retries\n" \
75 "SNS Config number of retries\n" \
76 "SNS Procedures number of retries\n" \
79 #define NS_ALLOC_SIZE 3072
80 #define NS_ALLOC_HEADROOM 20
139 #define NSE_S_BLOCKED 0x0001
140 #define NSE_S_ALIVE 0x0002
141 #define NSE_S_RESET 0x0004
143 #define NS_DESC_B(st) ((st) & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED")
144 #define NS_DESC_A(st) ((st) & NSE_S_ALIVE ? "ALIVE" : "DEAD")
145 #define NS_DESC_R(st) ((st) & NSE_S_RESET ? "RESET" : "UNRESET")
312 struct vty *
vty,
bool stats);
354 struct msgb **reject,
392 unsigned int num_ip4_elems,
394 unsigned int num_ip6_elems);
397 unsigned int num_ip4_elems,
399 unsigned int num_ip6_elems);
402 int ip4_ep_nr,
int ip6_ep_nr);
408 unsigned int num_ip4_elems,
410 unsigned int num_ip6_elems);
414 unsigned int num_ip4_elems,
416 unsigned int num_ip6_elems);
420 unsigned int num_ip4_elems,
422 unsigned int num_ip6_elems);
438 uint16_t
bvci, uint8_t sducontrol,
442 uint16_t
bvci,
struct msgb *orig_msg, uint16_t *nsvci);
464 const char *
id,
bool initiate);
struct osmo_routing_area_id rai
char * gprs_ns_ll_str_c(const void *ctx, const struct gprs_nsvc *nsvc)
Definition: gprs_ns.c:1554
#define NS_DESC_A(st)
Definition: gprs_ns.h:49
@ BSSGP_IE_PACKET_FLOW_TIMER
Definition: gsm_08_18.h:159
Definition: gprs_bssgp.h:64
uint8_t data_weight
Definition: gsm_08_16.h:3
uint32_t retry_us
Definition: gprs_ns2_fr.c:110
static struct gprs_ns2_vc * ns2_load_sharing_signal(struct gprs_ns2_nse *nse)
Definition: gprs_ns2.c:339
int ns2_vc_unblock(struct gprs_ns2_vc *nsvc)
Unblock a NS-VC.
Definition: gprs_ns2_vc_fsm.c:846
char * nsvc
Definition: gprs_ns2.h:130
uint8_t sig_weight
Definition: gsm_08_16.h:2
@ BSSGP_IE_BUCKET_FULL_RATIO
Definition: gsm_08_18.h:162
static int gprs_ns_rx_block(struct gprs_nsvc *nsvc, struct msgb *msg)
Definition: gprs_ns.c:1444
@ BSSGP_PDUT_PS_HO_REQUEST_NACK
Definition: gsm_08_18.h:77
@ BSSGP_CAUSE_DTM_HO_NO_CS_RES
Definition: gsm_08_18.h:317
@ BSSGP_PDUT_OVERLOAD
Definition: gsm_08_18.h:61
int osmo_gettimeofday(struct timeval *tv, struct timezone *tz)
char * bssgp_rim_ri_name_buf(char *buf, size_t buf_len, const struct bssgp_rim_routing_info *ri)
Encode a RIM Routing information into a human readable string.
Definition: gprs_bssgp_rim.c:155
static const struct rate_ctr_desc nsvc_ctr_description[]
Definition: gprs_ns.c:143
@ BSSGP_IE_RIM_APP_IDENTITY
Definition: gsm_08_18.h:177
@ NS2_SNS_EV_REQ_SELECT_ENDPOINT
Select a SNS endpoint from the list.
Definition: gprs_ns2_internal.h:332
struct priv_bind::@26 backlog
int(* osmo_prim_cb)(struct osmo_prim_hdr *oph, void *ctx)
@ NS_CAUSE_INVAL_WEIGH
Definition: gsm_08_16.h:99
Definition: gprs_bssgp_rim.c:404
int gprs_ns_tx_unblock(struct gprs_nsvc *nsvc)
Transmit a NS-UNBLOCK on a given NS-VC.
Definition: gprs_ns.c:692
@ BSSGP_IE_SON_TRANSFER_APP_ID
Definition: gsm_08_18.h:232
ns2_cs
Osmocom NS2 VC create status.
Definition: gprs_ns2_internal.h:113
@ GPRS_NS_CS_CREATED
A NSVC object has been created.
Definition: gprs_ns.h:66
struct gprs_ns2_vc * gprs_ns2_fr_connect2(struct gprs_ns2_vc_bind *bind, uint16_t nsei, uint16_t nsvci, uint16_t dlci)
Create, connect and activate a new FR-based NS-VC.
Definition: gprs_ns2_fr.c:1005
@ NSVC_TIMER_TNS_RESET
Definition: gprs_ns.h:117
@ BSSGP_IE_DTM_HO_COMMAND
Definition: gsm_08_18.h:221
static void free_vc(struct gprs_ns2_vc *nsvc)
Definition: gprs_ns2_fr.c:120
@ NS_CTR_PKTS_IN
Definition: gprs_ns.c:129
static const uint8_t mod_bss_pfc_ies[]
Definition: gprs_bssgp_util.c:226
bool ip_sns_role_sgsn
are we implementing the SGSN role?
Definition: gprs_ns2_internal.h:216
struct gprs_ns2_vc * gprs_ns2_nsvc_by_sockaddr_nse(struct gprs_ns2_nse *nse, const struct osmo_sockaddr *sockaddr)
Find NS-VC for given socket address.
Definition: gprs_ns2.c:1245
static int handle_rx_gre_ipv4(struct osmo_fd *bfd, struct msgb *msg, struct iphdr *iph, struct gre_hdr *greh)
Definition: gprs_ns2_frgre.c:224
struct osmo_fsm_inst * bss_sns_fi
Definition: gprs_ns.h:110
int bssgp_dec_ran_inf_app_cont_nacc(struct bssgp_ran_inf_app_cont_nacc *cont, const uint8_t *buf, size_t len)
Decode a RAN Information Application Container (3GPP TS 48.018, section 11.3.63.2....
Definition: gprs_bssgp_rim.c:254
int bssgp_tx_simple_bvci(uint8_t pdu_type, uint16_t nsei, uint16_t bvci, uint16_t ns_bvci)
Definition: gprs_bssgp_util.c:536
Definition: gprs_bssgp_rim.h:224
uint16_t bvci
Definition: gprs_msgb.h:16
@ NS_TOUT_TSNS_PROV
Definition: gprs_ns2_internal.h:90
const struct osmo_stat_item_desc nsbind_stat_description[]
Definition: gprs_ns2.c:209
@ NS2_SNS_EV_RX_DELETE
Definition: gprs_ns2_internal.h:339
#define OSMO_SOCK_F_CONNECT
struct rate_ctr_group * ctrg
Definition: gprs_ns2_internal.h:264
static uint16_t tlvp_val16be(const struct tlv_parsed *tp, int pos)
@ BSSGP_IE_MLAT_TIMER
Definition: gsm_08_18.h:258
int gprs_ns2_sns_del_bind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:2675
@ BSSGP_CAUSE_INVAL_CSG_CELL
Definition: gsm_08_18.h:323
#define LOGNSVC(nsvc, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:29
@ BSSGP_PDUT_STATUS
Definition: gsm_08_18.h:60
uint16_t gprs_ns2_fr_nsvc_dlci(const struct gprs_ns2_vc *nsvc)
Return the dlci of the nsvc.
Definition: gprs_ns2_fr.c:1062
struct msgb * gprs_ns_msgb_alloc(void)
Definition: gprs_ns.c:206
@ BSSGP_IE_LLC_FRAMES_DISCARDED
Definition: gsm_08_18.h:133
@ BSSGP_PDUT_PERFORM_LOC_RESP
Definition: gsm_08_18.h:83
struct gprs_ns2_vc * gprs_ns2_ip_connect_inactive(struct gprs_ns2_vc_bind *bind, const struct osmo_sockaddr *remote, struct gprs_ns2_nse *nse, uint16_t nsvci)
Create, and connect an inactive, new IP-based NS-VC.
Definition: gprs_ns2.c:1178
@ BSSGP_IE_UNCONF_SEND_STATE_VAR
Definition: gsm_08_18.h:238
static struct msgb * read_nsip_msg(struct osmo_fd *bfd, int *error, struct sockaddr_in *saddr)
Definition: gprs_ns.c:1960
@ BSSGP_IE_LCS_CAPABILITY
Definition: gsm_08_18.h:175
void gprs_ns2_free_nse(struct gprs_ns2_nse *nse)
Destroy given NS Entity.
Definition: gprs_ns2.c:903
@ BSSGP_PDUT_SGSN_INVOKE_TRACE
Definition: gsm_08_18.h:59
@ NS2_CS_CREATED
A NSVC object has been created.
Definition: gprs_ns2_internal.h:114
int ns2_tx_unblock_ack(struct gprs_ns2_vc *nsvc)
Transmit a NS-UNBLOCK-ACK on a given NS-VC.
Definition: gprs_ns2_message.c:366
@ BSSGP_CAUSE_UNKN_DST
Definition: gsm_08_18.h:290
static struct msgb * msgb_alloc_headroom(uint16_t size, uint16_t headroom, const char *name)
@ BSSGP_CAUSE_INV_MAND_INF
Definition: gsm_08_18.h:281
@ BSSGP_PDUT_SUSPEND
Definition: gsm_08_18.h:32
@ NS_IE_NSEI
Definition: gsm_08_16.h:70
struct llist_head list
llist entry for gprs_ns2_inst
Definition: gprs_ns2_internal.h:180
uint16_t remote_port
Definition: gprs_ns.h:98
int osmo_sockaddr_cmp(const struct osmo_sockaddr *a, const struct osmo_sockaddr *b)
#define IPPROTO_GRE
Definition: gprs_ns2_frgre.c:56
size_t err_pdu_len
Definition: gprs_bssgp_rim.h:212
uint16_t dlci
Definition: gprs_ns2_fr.c:116
int ns2_tx_sns_ack(struct gprs_ns2_vc *nsvc, uint8_t trans_id, uint8_t *cause, const struct gprs_ns_ie_ip4_elem *ip4_elems, unsigned int num_ip4_elems, const struct gprs_ns_ie_ip6_elem *ip6_elems, unsigned int num_ip6_elems)
Encode + Transmit a SNS-ACK as per Section 9.3.1.
Definition: gprs_ns2_message.c:619
@ BSSGP_IE_PFC_TO_BE_SETUP_LIST
Definition: gsm_08_18.h:203
@ BSSGP_CAUSE_ABQP_NOT_SUPP
Definition: gsm_08_18.h:279
@ BSSGP_CAUSE_MISSING_COND_IE
Definition: gsm_08_18.h:283
static const struct tlv_definition ns_att_tlvdef1
Definition: gprs_ns2.c:102
struct gprs_ns2_vc_bind * gprs_ns2_bind_by_name(struct gprs_ns2_inst *nsi, const char *name)
Search for a bind with a unique name.
Definition: gprs_ns2.c:1535
@ BSSGP_CAUSE_UNEXP_COND_IE
Definition: gsm_08_18.h:284
bool freed
recursive anchor
Definition: gprs_ns2_internal.h:222
static void log_set_bvc_filter(struct log_target *target, struct bssgp_bvc_ctx *bctx)
Definition: gprs_bssgp_vty.c:47
static const uint8_t flush_ll_ack_ies[]
Definition: gprs_bssgp_util.c:203
@ NS_IE_PDU
Definition: gsm_08_16.h:68
int osmo_fr_tx_dlc(struct msgb *msg)
Definition: frame_relay.c:834
const char * osmo_rai_name(const struct gprs_ra_id *rai)
static int nsip_fd_cb(struct osmo_fd *bfd, unsigned int what)
Definition: gprs_ns.c:2030
@ BSSGP_IE_LIST_OF_SETUP_PFC
Definition: gsm_08_18.h:204
struct osmo_prim_hdr oph
Definition: gprs_bssgp.h:65
struct gprs_ns2_vc * gprs_ns2_ip_connect(struct gprs_ns2_vc_bind *bind, const struct osmo_sockaddr *remote, struct gprs_ns2_nse *nse, uint16_t nsvci)
Create, connect and activate a new IP-based NS-VC.
Definition: gprs_ns2.c:1203
#define GRE_PTYPE_KAR
Definition: gprs_ns2_frgre.c:53
static int ns2_find_vc_by_dlci(struct gprs_ns2_vc_bind *bind, uint16_t dlci, struct gprs_ns2_vc **result)
Definition: gprs_ns2_frgre.c:406
struct llist_head list
list of NS-VCs within NS Instance
Definition: gprs_ns.h:124
void * priv
can be used by the bind/driver of the virtual circuit.
Definition: gprs_ns2_internal.h:258
struct timespec ts_alive_change
when the NSE became alive or dead
Definition: gprs_ns2_internal.h:225
@ BSSGP_IE_RIM_REQ_APP_CONTAINER
Definition: gsm_08_18.h:179
static const uint8_t ps_ho_required_ies[]
Definition: gprs_bssgp_util.c:235
int ns2_count_transfer_cap(struct gprs_ns2_nse *nse, uint16_t bvci)
calculate the transfer capabilities for a nse
Definition: gprs_ns2.c:1608
An instance of the NS protocol stack.
Definition: gprs_ns2_internal.h:148
@ BSSGP_CAUSE_MS_BACK_OLD_CHAN
Definition: gsm_08_18.h:305
int ns2_sns_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp)
main entry point for receiving SNS messages from the network.
Definition: gprs_ns2_sns.c:2310
void osmo_stat_item_group_set_name(struct osmo_stat_item_group *statg, const char *name)
@ BSSGP_IE_ALIGNMENT
Definition: gsm_08_18.h:118
#define GRE_PTYPE_IPv6
Definition: gprs_ns2_frgre.c:52
#define RATE_CTR_INC_NS(nsvc, ctr)
Definition: gprs_ns2_internal.h:41
const char * get_value_string(const struct value_string *vs, uint32_t val)
static void nsvc_start_timer(struct gprs_nsvc *nsvc, enum nsvc_timer_mode mode)
Definition: gprs_ns.c:743
@ BSSGP_PDUT_BVC_BLOCK
Definition: gsm_08_18.h:44
void rate_ctr_add(struct rate_ctr *ctr, int inc)
struct osmo_stat_item_group * statg
Definition: gprs_ns2_internal.h:319
@ BSSGP_IE_RA_CAP_UPD_CAUSE
Definition: gsm_08_18.h:144
int gprs_ns_tx_alive_ack(struct gprs_nsvc *nsvc)
Transmit a NS-ALIVE-ACK on a given NS-VC.
Definition: gprs_ns.c:721
#define osmo_fsm_inst_term(fi, cause, data)
static const uint8_t rad_sts_ies[]
Definition: gprs_bssgp_util.c:190
@ BSSGP_IE_SCI
Definition: gsm_08_18.h:240
@ BSSGP_RIM_ROUTING_INFO_UTRAN
Definition: gprs_bssgp_rim.h:34
char * osmo_plmn_name_buf(char *buf, size_t buf_len, const struct osmo_plmn_id *plmn)
@ BSSGP_IE_EUTRAN_IRAT_HO_INFO
Definition: gsm_08_18.h:228
#define LOG_NS_DATA(nsvc, direction, pdu_type, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:35
@ NS_TOUT_TNS_BLOCK_RETRIES
Definition: gprs_ns2_internal.h:84
static size_t len(const char *str)
@ BSSGP_IE_RELIABLE_IRAT_HO_INFO
Definition: gsm_08_18.h:231
@ BSSGP_CAUSE_DTM_HO_PS_ALLOC_FAIL
Definition: gsm_08_18.h:318
int osmo_sock_init_osa_ofd(struct osmo_fd *ofd, int type, int proto, const struct osmo_sockaddr *local, const struct osmo_sockaddr *remote, unsigned int flags)
uint8_t pdu_type
NS PDU type.
Definition: gsm_08_16.h:0
struct bssgp_flow_control * fc
Definition: gprs_bssgp.h:122
@ NS_CAUSE_PROTO_ERR_UNSPEC
Definition: gsm_08_16.h:92
@ BSSGP_CAUSE_MS_UNDER_PS_HO
Definition: gsm_08_18.h:296
@ GPRS_NS2_AFF_CAUSE_SNS_CONFIGURED
Definition: gprs_ns2.h:84
#define NSE_S_BLOCKED
Definition: gprs_ns.h:44
static struct cmd_node bssgp_node
Definition: gprs_bssgp_vty.c:59
struct osmo_prim_hdr oph
Definition: gprs_ns2.h:110
void * priv
Definition: gprs_ns2_internal.h:327
@ BSSGP_IE_RI_REQ_RIM_CONTAINER
Definition: gsm_08_18.h:187
struct gprs_ns2_vc_driver vc_driver_fr
Definition: gprs_ns2_fr.c:89
@ BSSGP_PDUT_SUSPEND_NACK
Definition: gsm_08_18.h:34
static const char * bssgp_rim_routing_info_discr_str(enum bssgp_rim_routing_info_discr val)
Obtain a human-readable string for NACC Cause code.
Definition: gprs_bssgp_rim.h:41
@ BSSGP_IE_CONTAINER_ID
Definition: gsm_08_18.h:210
@ BSSGP_CAUSE_PS_HO_TARG_NA
Definition: gsm_08_18.h:314
@ BSSGP_IE_CSG_ID
Definition: gsm_08_18.h:233
@ NS2_SNS_EV_RX_CONFIG
Definition: gprs_ns2_internal.h:335
void(* dump_vty)(const struct gprs_ns2_vc_bind *bind, struct vty *vty, bool stats)
allow to show information for the vty
Definition: gprs_ns2_internal.h:311
#define LIBGB_MSGB_CB(__msgb)
Definition: gprs_msgb.h:21
@ GPRS_NS2_PRIM_STATUS
Definition: gprs_ns2.h:55
void rate_ctr_group_free(struct rate_ctr_group *grp)
#define NS_ALLOC_HEADROOM
Definition: gprs_ns.h:31
uint16_t bssgp_parse_cell_id(struct gprs_ra_id *raid, const uint8_t *buf)
Definition: gprs_bssgp.c:349
struct gprs_ns2_nse * gprs_ns2_create_nse(struct gprs_ns2_inst *nsi, uint16_t nsei, enum gprs_ns2_ll linklayer, enum gprs_ns2_dialect dialect)
Create a NS Entity within given NS instance.
Definition: gprs_ns2.c:886
@ BSSGP_CAUSE_UNKN_RIM_AI
Definition: gsm_08_18.h:291
static const struct tlv_definition ns_att_tlvdef2
Definition: gprs_ns2.c:120
static struct priv_vc * fr_alloc_vc(struct gprs_ns2_vc_bind *bind, struct gprs_ns2_vc *nsvc, uint16_t dlci)
Definition: gprs_ns2_fr.c:191
struct tlv_parsed * tp
Definition: gprs_bssgp.h:71
@ GPRS_NS2_LL_FR_GRE
NS/FR/GRE/IP.
Definition: gprs_ns2.h:48
#define DEBUGP(ss, fmt, args...)
int dscp
Definition: gprs_ns2_frgre.c:114
@ BSSGP_IE_RIM_PROTOCOL_VERSION
Definition: gsm_08_18.h:185
#define PTM
Definition: gprs_bssgp_util.c:259
#define RATE_CTR_ADD_NS(nsvc, ctr, val)
Definition: gprs_ns2_internal.h:48
static struct gprs_nsvc * gprs_active_nsvc_by_nsei(struct gprs_ns_inst *nsi, uint16_t nsei, uint16_t bvci)
Determine active NS-VC for given NSEI + BVCI.
Definition: gprs_ns.c:267
#define TVLV_HDR_MAXLEN
Definition: gprs_bssgp_rim.c:35
static const uint8_t ps_ho_compl_ack_ies[]
Definition: gprs_bssgp_util.c:247
struct bssgp_rim_routing_info::@5::@8 utran
@ PRIM_BSSGP_RIM_PDU_TRANSFER
Definition: gprs_bssgp.h:61
@ S_NS_REPLACED
Definition: gprs_ns.h:237
ns_pdu_type
NS PDU Type (TS 08.16, Section 10.3.7, Table 14)
Definition: gsm_08_16.h:42
struct gprs_ns_inst * nsi
pointer to NS Instance
Definition: gprs_ns.h:126
static void osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap, unsigned int primitive, enum osmo_prim_operation operation, struct msgb *msg)
static unsigned char * msgb_put(struct msgb *msgb, unsigned int len)
static const uint8_t pag_cs_ies[]
Definition: gprs_bssgp_util.c:187
void osmo_stat_item_group_free(struct osmo_stat_item_group *grp)
@ NS_TOUT_TNS_ALIVE
Definition: gprs_ns.h:39
@ BSSGP_IE_BVC_MEASUREMENT
Definition: gsm_08_18.h:124
static struct gprs_ns2_vc * ns2_load_sharing_modulo(struct gprs_ns2_nse *nse, uint16_t bvci, uint32_t load_selector)
Definition: gprs_ns2.c:372
#define OSMO_SOCK_F_DSCP(x)
int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def, const uint8_t *buf, int buf_len, uint8_t lv_tag, uint8_t lv_tag2)
@ NS_TOUT_TNS_TEST
Definition: gprs_ns2_internal.h:87
@ BSSGP_IE_POSITIONING_DATA
Definition: gsm_08_18.h:171
@ NS_PDUT_BLOCK
Definition: gsm_08_16.h:46
struct osmo_timer_list timer
Definition: gprs_ns.h:134
@ NS_IE_VCI
Definition: gsm_08_16.h:67
void gprs_ns_destroy(struct gprs_ns_inst *nsi)
Destroy an entire NS instance.
Definition: gprs_ns.c:1948
struct tlv_definition tvlv_att_def
@ GPRS_NS_CS_SKIPPED
Skipped message.
Definition: gprs_ns.h:69
struct msgb * bssgp_msgb_alloc(void)
Definition: gprs_bssgp_util.c:494
static int gprs_ns_rx_status(struct gprs_nsvc *nsvc, struct msgb *msg)
Definition: gprs_ns.c:1142
void * cb_data
callback data
Definition: gprs_ns2_internal.h:153
@ BSSGP_IE_IRAT_MEAS_CFG_E_EARFCN
Definition: gsm_08_18.h:245
int bssgp_tx_status(uint8_t cause, uint16_t *bvci, struct msgb *orig_msg)
Definition: gprs_bssgp_util.c:555
uint8_t data[0]
variable-length payload
Definition: gsm_08_16.h:1
struct llist_head nsvc
llist head to hold all nsvc
Definition: gprs_ns2_internal.h:183
int gprs_sns_bss_fsm_start(struct gprs_ns_inst *nsi)
Definition: gprs_ns_sns.c:680
void osmo_identifier_sanitize_buf(char *str, const char *sep_chars, char replace_with)
@ BSSGP_IE_SGSN_GROUP_ID
Definition: gsm_08_18.h:255
static const uint8_t rinfo_ack_ies[]
Definition: gprs_bssgp_util.c:251
uint8_t sns_data_weight
the IP-SNS data weight when doing dynamic configuration
Definition: gprs_ns2_internal.h:317
bool accept_ipaccess
Definition: gprs_ns2_internal.h:292
int(* send_vc)(struct gprs_ns2_vc *nsvc, struct msgb *msg)
send a msg over a VC
Definition: gprs_ns2_internal.h:305
static int reject_status_msg(struct msgb *orig_msg, struct tlv_parsed *tp, struct msgb **reject, enum ns_cause cause)
Create a status message to be sent over a new connection.
Definition: gprs_ns2.c:712
static void ns_osmo_signal_dispatch_mismatch(struct gprs_nsvc *nsvc, struct msgb *msg, uint8_t pdu_type, uint8_t ie_type)
Definition: gprs_ns.c:374
static int nsvc_timer_elapsed_ms(struct gprs_nsvc *nsvc)
Definition: gprs_ns.c:761
void ns2_free_nsvcs(struct gprs_ns2_nse *nse)
Definition: gprs_ns2.c:668
unsigned int nsvci_is_valid
Definition: gprs_ns.h:141
@ NS_PDUT_ALIVE_ACK
Definition: gsm_08_16.h:52
int gprs_ns_tx_block(struct gprs_nsvc *nsvc, uint8_t cause)
Transmit a NS-BLOCK on a given NS-VC.
Definition: gprs_ns.c:627
@ NSVC_TIMER_TNS_TEST
Definition: gprs_ns2_internal.h:98
#define ns_set_remote_state(ns_, st_)
Definition: gprs_ns.c:93
#define TLVP_PRES_LEN(tp, tag, min_len)
Definition: gprs_ns2_fr.c:114
struct gprs_nsvc * gprs_ns_nsip_connect_sns(struct gprs_ns_inst *nsi, struct sockaddr_in *dest, uint16_t nsei, uint16_t nsvci)
Establish a NS connection (from the BSS) to the SGSN using SNS auto-configuration.
Definition: gprs_ns.c:2170
int osmo_fd_register(struct osmo_fd *fd)
uint8_t num_si
Definition: gprs_bssgp_rim.h:90
const char * bssgp_rim_ri_name(const struct bssgp_rim_routing_info *ri)
Encode a RIM Routing information into a human readable string.
Definition: gprs_bssgp_rim.c:206
@ GPRS_NS2_AFF_CAUSE_RECOVERY
Definition: gprs_ns2.h:82
uint8_t pdu_type
NS PDU type.
Definition: gsm_08_16.h:18
@ NS_CAUSE_INVAL_NR_NS_VC
Definition: gsm_08_16.h:98
enum ns2_cs ns2_create_vc(struct gprs_ns2_vc_bind *bind, struct msgb *msg, const struct osmo_sockaddr *remote, const char *logname, struct msgb **reject, struct gprs_ns2_vc **success)
Create a new NS-VC based on a [received] message.
Definition: gprs_ns2.c:1005
uint16_t bvci
Definition: gprs_bssgp.h:69
static const char * osmo_fr_role_str(enum osmo_fr_role role)
Definition: frame_relay.h:50
void rate_ctr_group_set_name(struct rate_ctr_group *grp, const char *name)
uint8_t sig_counter
signalling packet counter for the load sharing function
Definition: gprs_ns2_internal.h:252
gprs_ns2_ll
Osmocom NS link layer types.
Definition: gprs_ns2.h:44
@ BSSGP_IE_SUB_PID4RAT_FREQ_PRIO
Definition: gsm_08_18.h:229
int(* cb)(struct osmo_fd *fd, unsigned int what)
@ BSSGP_IE_RI_RIM_CONTAINER
Definition: gsm_08_18.h:188
static const uint8_t ps_ho_required_ack_ies[]
Definition: gprs_bssgp_util.c:237
int ns2_tx_sns_add(struct gprs_ns2_vc *nsvc, uint8_t trans_id, const struct gprs_ns_ie_ip4_elem *ip4_elems, unsigned int num_ip4_elems, const struct gprs_ns_ie_ip6_elem *ip6_elems, unsigned int num_ip6_elems)
Encode + Transmit a SNS-ADD as per Section 9.3.2.
Definition: gprs_ns2_message.c:564
void ns2_nse_notify_unblocked(struct gprs_ns2_vc *nsvc, bool unblocked)
Notify a nse about the change of a NS-VC.
Definition: gprs_ns2.c:1392
bool use_reset_block_unblock
IPA compatibility: NS-RESET/BLOCK/UNBLOCK even on IP-SNS.
Definition: gprs_ns.h:101
@ BSSGP_CAUSE_CELL_TRAF_CONG
Definition: gsm_08_18.h:273
struct gprs_ns_inst * gprs_ns_instantiate(gprs_ns_cb_t *cb, void *ctx)
Create a new GPRS NS instance.
Definition: gprs_ns.c:1884
static const uint8_t inv_trc_ies[]
Definition: gprs_bssgp_util.c:219
struct bssgp_rim_pdu_ind pdu_ind
Definition: gprs_bssgp_rim.c:407
static const uint8_t ps_ho_cancel_ies[]
Definition: gprs_bssgp_util.c:246
int ns2_tx_alive_ack(struct gprs_ns2_vc *nsvc)
Transmit a NS-ALIVE-ACK on a given NS-VC.
Definition: gprs_ns2_message.c:390
struct osmo_gprs_ns2_prim::@20::@23 status
@ BSSGP_IE_EXT_FEATURE_BITMAP
Definition: gsm_08_18.h:205
#define BIT_DURATION_NS
Definition: gprs_ns2_fr.c:84
@ BSSGP_CAUSE_CAPA_GREATER_0KPBS
Definition: gsm_08_18.h:270
@ BSSGP_NACC_CAUSE_SIPSI_SET_ERR
Definition: gprs_bssgp_rim.h:106
enum gprs_ns_ll ll
which link-layer are we based on?
Definition: gprs_ns.h:147
@ BSSGP_IE_INTER_RAT_HO_INFO
Definition: gsm_08_18.h:215
@ BSSGP_IE_RIM_SEQ_NR
Definition: gsm_08_18.h:178
static const uint8_t rinfo_req_ies[]
Definition: gprs_bssgp_util.c:250
@ BSSGP_NACC_CAUSE_UNSPEC
Definition: gprs_bssgp_rim.h:101
@ BSSGP_IE_ROUTEING_AREA
Definition: gsm_08_18.h:145
void ns2_prim_status_ind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc *nsvc, uint16_t bvci, enum gprs_ns2_affecting_cause cause)
Send a STATUS.ind primitive to the specified NS instance user.
Definition: gprs_ns2.c:551
const char * gprs_ns2_fr_bind_netif(struct gprs_ns2_vc_bind *bind)
Return the network interface of the bind.
Definition: gprs_ns2_fr.c:919
struct osmo_stat_item_group * statg
Definition: gprs_ns2_internal.h:265
@ BSSGP_IE_SI_PSI_CONTAINER
Definition: gsm_08_18.h:218
@ GPRS_NS2_AFF_CAUSE_VC_FAILURE
Definition: gprs_ns2.h:79
uint32_t queue_depth
current length of queue (msgs)
Definition: gprs_bssgp.h:95
int osmo_clock_gettime(clockid_t clk_id, struct timespec *tp)
static int gprs_ns_rx_unitdata(struct gprs_nsvc *nsvc, struct msgb *msg)
Definition: gprs_ns.c:1123
@ SNS_PDUT_CHANGE_WEIGHT
Definition: gsm_08_16.h:56
static const uint8_t unblock_ack_ies[]
Definition: gprs_bssgp_util.c:215
void osmo_stat_item_inc(struct osmo_stat_item *item, int32_t value)
bool accept_sns
Definition: gprs_ns2_internal.h:293
void gprs_nsvc_delete(struct gprs_nsvc *nsvc)
Delete given NS-VC.
Definition: gprs_ns.c:353
#define llist_for_each_entry_safe(pos, n, head, member)
struct osmo_fr_link * link
Definition: gprs_ns2_fr.c:96
struct gprs_ns_inst * bssgp_nsi
Definition: gprs_bssgp_util.c:37
static const uint8_t fc_bvc_ies[]
Definition: gprs_bssgp_util.c:206
uint32_t max_queue_depth
how many packets to queue (mgs)
Definition: gprs_bssgp.h:94
int bssgp_rx_rim(struct msgb *msg, struct tlv_parsed *tp, uint16_t bvci)
Definition: gprs_bssgp_rim.c:1183
@ BSSGP_PDUT_MS_REGISTR_ENQ
Definition: gsm_08_18.h:41
#define BSSGP_RIM_SI_LEN
Definition: gprs_bssgp_rim.h:83
static int gprs_ns_tx_simple(struct gprs_nsvc *nsvc, uint8_t pdu_type)
Definition: gprs_ns.c:516
int ns2_tx_block_ack(struct gprs_ns2_vc *nsvc, uint16_t *nsvci)
Transmit a NS-BLOCK-ACK on a given NS-VC.
Definition: gprs_ns2_message.c:253
static void ns_set_state_with_log(struct gprs_nsvc *nsvc, uint32_t state, bool is_remote, const char *file, unsigned line)
Definition: gprs_ns.c:218
@ BSSGP_IE_TRACE_REFERENC
Definition: gsm_08_18.h:151
@ BSSGP_IE_SERVICE_UTRAN_CCO
Definition: gsm_08_18.h:163
static const struct rate_ctr_group_desc nsvc_ctrg_desc
Definition: gprs_ns.c:158
uint8_t prot_ver
Definition: gprs_bssgp_rim.c:408
uint8_t prot_ver
Definition: gprs_bssgp_rim.h:207
@ BSSGP_IE_CS_INDICATION
Definition: gsm_08_18.h:222
struct gprs_ns2_inst * nsi
entry back to ns2_inst
Definition: gprs_ns2_internal.h:177
@ BSSGP_PDUT_BVC_BLOCK_ACK
Definition: gsm_08_18.h:45
@ BSSGP_CAUSE_DTM_HO_INVAL_CS_IND
Definition: gsm_08_18.h:320
@ BSSGP_PDUT_UL_UNITDATA
Definition: gsm_08_18.h:20
const struct value_string bssgp_nacc_cause_strs[]
Definition: gprs_bssgp_rim.c:344
static uint8_t * msgb_v_put(struct msgb *msg, uint8_t val)
@ BSSGP_PDUT_PS_HO_REQUIRED
Definition: gsm_08_18.h:72
#define NS_DESC_B(st)
Definition: gprs_ns.h:48
struct osmo_fsm_inst * ns2_vc_fsm_alloc(struct gprs_ns2_vc *nsvc, const char *id, bool initiate)
gprs_ns2_vc_fsm_alloc
Definition: gprs_ns2_vc_fsm.c:792
struct gprs_ns_inst::@14 nsip
NS-over-IP specific bits.
void osmo_fd_setup(struct osmo_fd *ofd, int fd, unsigned int when, int(*cb)(struct osmo_fd *fd, unsigned int what), void *data, unsigned int priv_nr)
@ BSSGP_PDUT_PS_HO_REQUEST_ACK
Definition: gsm_08_18.h:76
struct llist_head nse
linked lists of all NSVC in this instance
Definition: gprs_ns2_internal.h:159
int ns2_tx_sns_config(struct gprs_ns2_vc *nsvc, bool end_flag, const struct gprs_ns_ie_ip4_elem *ip4_elems, unsigned int num_ip4_elems, const struct gprs_ns_ie_ip6_elem *ip6_elems, unsigned int num_ip6_elems)
Encode + Transmit a SNS-CONFIG as per Section 9.3.4.
Definition: gprs_ns2_message.c:681
@ NS_CTR_BLOCKED
Definition: gprs_ns.c:133
static const uint8_t crt_bss_pfc_nack_ies[]
Definition: gprs_bssgp_util.c:225
uint16_t mtu
MTU of a NS PDU.
Definition: gprs_ns2_internal.h:213
@ BSSGP_IE_MS_BUCKET_SIZE
Definition: gsm_08_18.h:136
@ BSSGP_IE_MBMS_SESSION_DURATION
Definition: gsm_08_18.h:194
uint16_t nsei
Identifiers of a BTS, equal to 'struct bssgp_bts_ctx'.
Definition: gprs_msgb.h:15
struct llist_head bssgp_bvc_ctxts
@ BSSGP_IE_LLC_PDU
Definition: gsm_08_18.h:132
#define LOG_NS_RX_SIGNAL(nsvc, pdu_type)
Definition: gprs_ns2_internal.h:38
@ BSSGP_CAUSE_PROTO_ERR_UNSPEC
Definition: gsm_08_18.h:287
int gprs_ns2_find_vc_by_dlci(struct gprs_ns2_vc_bind *bind, uint16_t dlci, struct gprs_ns2_vc **result)
Definition: gprs_ns2_fr.c:217
enum gprs_ns2_ll ll
which link-layer are we based on?
Definition: gprs_ns2_internal.h:199
@ NS2_SNS_EV_REQ_ADD_BIND
add a new local bind to this NSE
Definition: gprs_ns2_internal.h:345
@ NS_CAUSE_INVAL_NR_IPv6_EP
Definition: gsm_08_16.h:97
@ NS_CTR_LOST_ALIVE
Definition: gprs_ns.c:139
static uint8_t * msgb_tv16_put(struct msgb *msg, uint8_t tag, uint16_t val)
void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf)
@ BSSGP_IE_NSEI
Definition: gsm_08_18.h:164
void osmo_fd_unregister(struct osmo_fd *fd)
const char * osmo_sockaddr_to_str(const struct osmo_sockaddr *sockaddr)
int bssgp_enc_ran_inf_app_err_rim_cont(uint8_t *buf, size_t len, const struct bssgp_ran_inf_app_err_rim_cont *cont)
Encode a RAN Information Application Error RIM Container (3GPP TS 48.018, table 11....
Definition: gprs_bssgp_rim.c:918
@ BSSGP_PDUT_DL_UNITDATA
Definition: gsm_08_18.h:19
@ NS_TOUT_TSNS_PROCEDURES_RETRIES
Definition: gprs_ns2_internal.h:93
static void fr_backlog_timer_cb(void *data)
Definition: gprs_ns2_fr.c:410
union osmo_gprs_ns2_prim::@20 u
struct bssgp_rim_routing_info::@5::@9 eutran
@ GPRS_NS_EVT_UNIT_DATA
Definition: gprs_ns.h:61
int gprs_ns_process_msg(struct gprs_ns_inst *nsi, struct msgb *msg, struct gprs_nsvc **nsvc)
Process NS message independently from underlying transport layer.
Definition: gprs_ns.c:1725
@ BSSGP_IE_CHAN_NEEDED
Definition: gsm_08_18.h:127
void * cb_data
Definition: frame_relay.h:104
Definition: gprs_bssgp_rim.h:75
@ BSSGP_IE_REDIRECTION_COMPLETED
Definition: gsm_08_18.h:237
@ NS_CAUSE_MISSING_ESSENT_IE
Definition: gsm_08_16.h:94
struct log_target * osmo_log_vty2tgt(struct vty *vty)
char ip[INET6_ADDRSTRLEN]
static const uint8_t dl_mb_ud_ies[]
Definition: gprs_bssgp_util.c:184
@ BSSGP_IE_CAUSE
Definition: gsm_08_18.h:125
static uint8_t * dub_tlvp_header(uint8_t *buf, uint8_t iei, uint16_t len)
Definition: gprs_bssgp_rim.c:520
Structure repesenting a NSE.
Definition: gprs_ns2_internal.h:173
#define INIT_LLIST_HEAD(ptr)
void vty_out_rate_ctr_group(struct vty *vty, const char *prefix, struct rate_ctr_group *ctrg)
uint16_t gprs_ns2_fr_nsvc_dlci(const struct gprs_ns2_vc *nsvc)
Return the dlci of the nsvc.
Definition: gprs_ns2_fr.c:1062
@ BSSGP_IE_LOCATION_AREA
Definition: gsm_08_18.h:134
@ BSSGP_IE_REDIRECTION_INDICATION
Definition: gsm_08_18.h:236
@ NS_TOUT_TSNS_CONFIG_RETRIES
Definition: gprs_ns2_internal.h:92
int ns2_vc_reset(struct gprs_ns2_vc *nsvc)
Reset a NS-VC.
Definition: gprs_ns2_vc_fsm.c:858
struct llist_head list
list of NS-VCs within NSE
Definition: gprs_ns2_internal.h:231
@ BSSGP_IE_ACTIVE_PFC_LIST
Definition: gsm_08_18.h:219
@ BSSGP_PDUT_RAN_INFO_ERROR
Definition: gsm_08_18.h:91
int bssgp_enc_ran_inf_err_rim_cont(uint8_t *buf, size_t len, const struct bssgp_ran_inf_err_rim_cont *cont)
Encode a RAN Information Error RIM Container (3GPP TS 48.018, table 11.3.62a.4.b).
Definition: gprs_bssgp_rim.c:845
static const uint8_t ps_ho_compl_ies[]
Definition: gprs_bssgp_util.c:245
int gprs_ns_cb_t(enum gprs_ns_evt event, struct gprs_nsvc *nsvc, struct msgb *msg, uint16_t bvci)
Osmocom GPRS callback function type.
Definition: gprs_ns.h:75
static int fr_netif_ofd_cb(struct osmo_fd *bfd, uint32_t what)
Definition: gprs_ns2_fr.c:240
size_t son_trans_app_id_len
Definition: gprs_bssgp_rim.h:197
static struct priv_vc * frgre_alloc_vc(struct gprs_ns2_vc_bind *bind, struct gprs_ns2_vc *nsvc, struct osmo_sockaddr *remote, uint16_t dlci)
Definition: gprs_ns2_frgre.c:150
@ BSSGP_IE_NAS_CONT_FOR_PS_HO
Definition: gsm_08_18.h:202
@ NS_TOUT_TNS_RESET
Definition: gprs_ns.h:36
@ BSSGP_IE_RRLP_APDU
Definition: gsm_08_18.h:165
int bssgp_dec_ran_inf_err_rim_cont(struct bssgp_ran_inf_err_rim_cont *cont, const uint8_t *buf, size_t len)
Decode a RAN Information Error RIM Container (3GPP TS 48.018, table 11.3.62a.4.b).
Definition: gprs_bssgp_rim.c:800
nsvc_timer_mode
Definition: gprs_ns.h:113
int gprs_ns_sendmsg(struct gprs_ns_inst *nsi, struct msgb *msg)
High-level function for transmitting a NS-UNITDATA messsage.
Definition: gprs_ns.c:1081
@ BSSGP_IE_TIME_TO_MBMS_DATA_XFR
Definition: gsm_08_18.h:213
static int frgre_fd_cb(struct osmo_fd *bfd, unsigned int what)
Definition: gprs_ns2_frgre.c:520
static int handle_nsfrgre_write(struct osmo_fd *bfd)
Definition: gprs_ns2_frgre.c:476
@ BSSGP_IE_TRACE_TYPE
Definition: gsm_08_18.h:152
static const uint8_t llc_disc_ies[]
Definition: gprs_bssgp_util.c:204
int gprs_ns_tx_status(struct gprs_nsvc *nsvc, uint8_t cause, uint16_t bvci, struct msgb *orig_msg)
Transmit a NS-STATUS on a given NSVC.
Definition: gprs_ns.c:573
#define container_of(ptr, type, member)
@ BSSGP_NACC_CAUSE_SIPSI_TYPE_ERR
Definition: gprs_bssgp_rim.h:104
uint16_t ptype
Definition: gprs_ns2_frgre.c:61
static const uint8_t dl_bss_pfc_ies[]
Definition: gprs_bssgp_util.c:220
void * filter_data[LOG_MAX_FILTERS+1]
static const uint8_t resume_nack_ies[]
Definition: gprs_bssgp_util.c:196
@ BSSGP_IE_OMC_ID
Definition: gsm_08_18.h:138
#define timersub(a, b, result)
@ BSSGP_CAUSE_BVCI_BLOCKED
Definition: gsm_08_18.h:276
static const struct tlv_definition ns_att_tlvdef
Definition: gprs_ns.c:109
int nsvc_count
count all active NSVCs
Definition: gprs_ns2_internal.h:186
#define ns_mark_alive(ns_)
Definition: gprs_ns.c:96
static void free_vc(struct gprs_ns2_vc *nsvc)
Definition: gprs_ns2_frgre.c:122
@ BSSGP_IE_MBMS_SESSION_INFO
Definition: gsm_08_18.h:198
struct gprs_ns2_vc * ns2_ip_bind_connect(struct gprs_ns2_vc_bind *bind, struct gprs_ns2_nse *nse, const struct osmo_sockaddr *remote)
Create new NS-VC to a given remote address.
Definition: gprs_ns2_udp.c:384
ns_stat
Definition: gprs_ns.c:166
uint32_t bucket_leak_rate
leak rate of the bucket (octets/sec)
Definition: gprs_bssgp.h:88
@ BSSGP_CAUSE_TRASIT_NET_FAIL
Definition: gsm_08_18.h:269
struct gprs_nsvc::@16::@19 frgre
@ BSSGP_PDUT_PAGING_CS
Definition: gsm_08_18.h:28
@ NS_TOUT_TNS_ALIVE_RETRIES
Definition: gprs_ns.h:40
const struct value_string gprs_ns2_lltype_strs[]
Definition: gprs_ns2.c:240
int bssgp_dec_ran_inf_req_app_cont_nacc(struct bssgp_ran_inf_req_app_cont_nacc *cont, const uint8_t *buf, size_t len)
Decode a RAN Information Request Application Container for NACC (3GPP TS 48.018, section 11....
Definition: gprs_bssgp_rim.c:216
@ NS2_SNS_EV_RX_SIZE_ACK
Definition: gprs_ns2_internal.h:334
@ BSSGP_IE_PAGE_MODE
Definition: gsm_08_18.h:209
static const struct value_string bssgp_pdu_strings[]
Definition: gprs_bssgp_util.c:104
gprs_ns2_affecting_cause
Osmocom NS primitives according to 48.016 5.2.2.6 Service primitives.
Definition: gprs_ns2.h:78
DEFUN(cfg_bssgp, cfg_bssgp_cmd, "bssgp", "Configure the GPRS BSS Gateway Protocol")
Definition: gprs_bssgp_vty.c:72
@ BSSGP_PDUT_PS_HO_COMPLETE
Definition: gsm_08_18.h:78
static int dec_rim_cont_common(struct bssgp_ran_inf_x_cont *cont, struct tlv_parsed *tp)
Definition: gprs_bssgp_rim.c:411
@ GPRS_NS2_LL_FR
NS/FR.
Definition: gprs_ns2.h:47
@ BSSGP_IE_ENB_ID
Definition: gsm_08_18.h:227
bssgp_ran_inf_app_id
Definition: gprs_bssgp_rim.h:128
uint16_t local_port
Definition: gprs_ns.h:96
@ BSSGP_PDUT_PTM_UNITDATA
Definition: gsm_08_18.h:23
static uint8_t * enc_rim_cont_common(uint8_t *buf, size_t len, const struct bssgp_ran_inf_x_cont *cont)
Definition: gprs_bssgp_rim.c:436
@ NS2_CS_ERROR
Failed to process message.
Definition: gprs_ns2_internal.h:118
char * osmo_sockaddr_to_str_buf(char *buf, size_t buf_len, const struct osmo_sockaddr *sockaddr)
const struct osmo_tlv_prot_def osmo_pdef_bssgp
Definition: gprs_bssgp_util.c:261
int bssgp_dec_ran_inf_app_err_rim_cont(struct bssgp_ran_inf_app_err_rim_cont *cont, const uint8_t *buf, size_t len)
Decode a RAN Information Application Error RIM Container (3GPP TS 48.018, table 11....
Definition: gprs_bssgp_rim.c:878
@ NS_CTR_INV_NSEI
Definition: gprs_ns.c:138
#define ns_mark_unblocked(ns_)
Definition: gprs_ns.c:95
@ BSSGP_CAUSE_PS_HO_TARG_NOT_SUPP
Definition: gsm_08_18.h:315
static const uint8_t ra_cap_ies[]
Definition: gprs_bssgp_util.c:183
@ NS_CAUSE_INVAL_NR_IPv4_EP
Definition: gsm_08_16.h:96
const char * name
unique name
Definition: gprs_ns2_internal.h:281
@ BSSGP_CAUSE_DTM_HO_T24_EXPIRY
Definition: gsm_08_18.h:319
ns2_bind_stat
Definition: gprs_ns2_internal.h:108
struct rate_ctr_group * ctrg
Definition: gprs_ns.h:143
@ BSSGP_CAUSE_NOT_ALL_PFC
Definition: gsm_08_18.h:308
void gprs_ns2_free(struct gprs_ns2_inst *nsi)
Destroy a NS Instance (including all its NSEs, binds, ...).
Definition: gprs_ns2.c:1459
@ BSSGP_IE_GANSS_LOCATION_TYPE
Definition: gsm_08_18.h:224
uint16_t msgb_length(const struct msgb *msg)
static const uint8_t reset_ack_ies[]
Definition: gprs_bssgp_util.c:217
@ BSSGP_RAN_INF_APP_ID_MBMS
Definition: gprs_bssgp_rim.h:131
uint16_t cell_id
Cell ID of the remote BTS.
Definition: gprs_bssgp.h:111
int bssgp_tx_rim(const struct bssgp_ran_information_pdu *pdu, uint16_t nsei)
Send RIM RAN INFORMATION REQUEST via BSSGP (3GPP TS 48.018, section 10.6.1).
Definition: gprs_bssgp_rim.c:1155
uint16_t mtu
MTU of a NS PDU on this bind.
Definition: gprs_ns2_internal.h:299
@ BSSGP_IE_SBSS_TO_TBSS_TR_CONT
Definition: gsm_08_18.h:200
int bssgp_dec_app_err_cont_nacc(struct bssgp_app_err_cont_nacc *cont, const uint8_t *buf, size_t len)
Decode a Application Error Container for NACC (3GPP TS 48.018, section 11.3.64.1).
Definition: gprs_bssgp_rim.c:358
@ BSSGP_IE_MOBILE_ID
Definition: gsm_08_18.h:135
int ns2_tx_sns_config_ack(struct gprs_ns2_vc *nsvc, uint8_t *cause)
Encode + Transmit a SNS-CONFIG-ACK as per Section 9.3.5.
Definition: gprs_ns2_message.c:737
Definition: frame_relay.h:67
static void llist_del(struct llist_head *entry)
@ BSSGP_IE_DRX_PARAMS
Definition: gsm_08_18.h:128
uint8_t pdu_type
BSSGP PDU type.
Definition: gsm_08_18.h:112
An instance of the NS protocol stack.
Definition: gprs_ns.h:79
@ BSSGP_IE_REQUESTED_GPS_AST_DATA
Definition: gsm_08_18.h:168
uint16_t nsei
Definition: gprs_bssgp.h:116
@ BSSGP_RIM_ROUTING_INFO_GERAN
Definition: gprs_bssgp_rim.h:33
static uint32_t tlvp_val32be(const struct tlv_parsed *tp, int pos)
@ NS_CTR_DEAD
Definition: gprs_ns.c:134
void install_lib_element_ve(struct cmd_element *cmd)
@ GPRS_NS2_VC_MODE_BLOCKRESET
The VC will use RESET/BLOCK/UNBLOCK to start the connection and do ALIVE/ACK.
Definition: gprs_ns2.h:29
@ BSSGP_CAUSE_COND_IE_ERR
Definition: gsm_08_18.h:285
const struct value_string bssgp_ran_inf_app_id_strs[]
Definition: gprs_bssgp_rim.c:459
void ns2_sns_write_vty(struct vty *vty, const struct gprs_ns2_nse *nse)
write IP-SNS to a vty
Definition: gprs_ns2_sns.c:2437
#define CHECK_TX_RC(rc, nsvc)
Definition: gprs_ns.c:193
int ns2_vc_is_alive(struct gprs_ns2_vc *nsvc)
static const uint8_t reset_ies[]
Definition: gprs_bssgp_util.c:216
ns2_vc_stat
Definition: gprs_ns2_internal.h:104
static const uint8_t resume_ies[]
Definition: gprs_bssgp_util.c:194
@ BSSGP_PDUT_POSITION_RESPONSE
Definition: gsm_08_18.h:86
enum osmo_prim_operation operation
void osmo_stat_item_set(struct osmo_stat_item *item, int32_t value)
#define llist_first_entry(ptr, type, member)
@ BSSGP_PDUT_BVC_RESET_ACK
Definition: gsm_08_18.h:47
@ NS_IE_MAX_NR_NSVC
Definition: gsm_08_16.h:74
@ BSSGP_IE_TA_REQ
Definition: gsm_08_18.h:262
static const uint8_t pag_ps_ies[]
Definition: gprs_bssgp_util.c:186
@ NS_PDUT_ALIVE
Definition: gsm_08_16.h:51
@ NS_CAUSE_EQUIP_FAIL
Definition: gsm_08_16.h:86
@ GPRS_NS2_DIALECT_STATIC_ALIVE
Definition: gprs_ns2.h:37
const char * gprs_ns_ll_str(const struct gprs_nsvc *nsvc)
Definition: gprs_ns.c:1548
static int gprs_ns_tx_reset_ack(struct gprs_nsvc *nsvc)
Definition: gprs_ns.c:837
@ BSSGP_IE_FLUSH_ACTION
Definition: gsm_08_18.h:130
@ BSSGP_CAUSE_TIME_CRIT_RELOC
Definition: gsm_08_18.h:313
uint8_t data[0]
variable-length payload
Definition: gsm_08_16.h:19
uint32_t remote_ip
Definition: gprs_ns.h:97
@ BSSGP_CAUSE_PFC_CREATED
Definition: gsm_08_18.h:294
struct msgb * ns2_msgb_alloc(void)
Allocate a message buffer for use with the NS2 stack.
Definition: gprs_ns2.c:695
void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid)
@ S_NS_RESET
Definition: gprs_ns.h:233
int log_set_context(uint8_t ctx_nr, void *value)
@ NS_TOUT_TNS_RESET_RETRIES
Definition: gprs_ns2_internal.h:86
static void gprs_ns_timer_cb(void *data)
Definition: gprs_ns.c:770
@ BSSGP_IE_REDIRECT_ATTEMPT_FLAG
Definition: gsm_08_18.h:235
@ BSSGP_CAUSE_PFC_QUEUE
Definition: gsm_08_18.h:293
@ BSSGP_CAUSE_SEM_INCORR_PDU
Definition: gsm_08_18.h:280
@ NS2_SNS_EV_RX_CHANGE_WEIGHT
Definition: gprs_ns2_internal.h:340
int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto, const char *host, uint16_t port, unsigned int flags)
struct msgb * lmi_msg
Definition: gprs_ns2_fr.c:104
struct osmo_fsm_inst * bss_sns_fi
Definition: gprs_ns2_internal.h:204
static void rate_ctr_group_upd_idx(struct rate_ctr_group *grp, unsigned int idx)
struct gprs_nsvc * gprs_nsvc_by_nsei(struct gprs_ns_inst *nsi, uint16_t nsei)
Lookup struct gprs_nsvc based on NSEI.
Definition: gprs_ns.c:254
static unsigned char * msgb_push(struct msgb *msgb, unsigned int len)
@ BSSGP_CAUSE_PFC_CREATE_FAIL
Definition: gsm_08_18.h:277
@ BSSGP_PDUT_CREATE_BSS_PFC_ACK
Definition: gsm_08_18.h:65
static int gprs_ns_rx_reset_ack(struct gprs_nsvc **nsvc, struct msgb *msg)
Definition: gprs_ns.c:1321
struct timespec ts_alive_change
when the NSVC became alive or dead
Definition: gprs_ns2_internal.h:275
@ BSSGP_CAUSE_UNKNOWN_BVCI
Definition: gsm_08_18.h:272
int gprs_nsvc_reset(struct gprs_nsvc *nsvc, uint8_t cause)
Initiate a RESET procedure.
Definition: gprs_ns.c:2105
bssgp_prim
Definition: gprs_bssgp.h:45
void install_node(struct cmd_node *node, int(*func)(struct vty *))
@ NS2_CS_REJECTED
Rejected and answered message.
Definition: gprs_ns2_internal.h:116
@ BSSGP_IE_MLAT_TA
Definition: gsm_08_18.h:259
static void rate_ctr_inc(struct rate_ctr *ctr)
@ NS2_SNS_EV_RX_ADD
Definition: gprs_ns2_internal.h:338
@ GPRS_NS2_VC_MODE_ALIVE
The VC will only use ALIVE/ACK (no RESET/BLOCK/UNBLOCK), which is for Gb-IP interface compliant to 3G...
Definition: gprs_ns2.h:32
@ GPRS_NS2_PRIM_UNIT_DATA
Definition: gprs_ns2.h:53
@ BSSGP_CAUSE_OML_INTERV
Definition: gsm_08_18.h:275
@ BSSGP_IE_LSA_INFORMATION
Definition: gsm_08_18.h:157
int bssgp_dec_ran_inf_ack_rim_cont(struct bssgp_ran_inf_ack_rim_cont *cont, const uint8_t *buf, size_t len)
Decode a RAN Information ACK RIM Container (3GPP TS 48.018, table 11.3.62a.3.b).
Definition: gprs_bssgp_rim.c:733
uint32_t state
Definition: gprs_bssgp.h:118
#define REP_CELL_ID_LEN
Definition: gprs_bssgp_rim.c:43
static void enqueue_at_head(struct gprs_ns2_vc_bind *bind, struct msgb *msg)
Definition: gprs_ns2_fr.c:341
#define GRE_PTYPE_FR
Definition: gprs_ns2_frgre.c:50
Section 10.3.2c List of IP4 Elements.
Definition: gsm_08_16.h:24
@ NS_PDUT_RESET
Definition: gsm_08_16.h:44
int ns2_nse_set_dialect(struct gprs_ns2_nse *nse, enum gprs_ns2_dialect dialect)
Definition: gprs_ns2.c:847
uint16_t bvci
Definition: gprs_ns2.h:113
struct gprs_ns2_vc * ns2_load_sharing_first(struct gprs_ns2_nse *nse)
Definition: gprs_ns2.c:438
int gprs_ns_tx_sns_config(struct gprs_nsvc *nsvc, bool end_flag, const struct gprs_ns_ie_ip4_elem *ip4_elems, unsigned int num_ip4_elems)
Encode + Transmit a SNS-CONFIG as per Section 9.3.4.
Definition: gprs_ns.c:920
int bssgp_create_cell_id(uint8_t *buf, const struct gprs_ra_id *raid, uint16_t cid)
Definition: gprs_bssgp.c:357
@ GPRS_NS2_AFF_CAUSE_MTU_CHANGE
Definition: gprs_ns2.h:87
int gprs_ns2_sns_add_bind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:2644
@ NS_CAUSE_OM_INTERVENTION
Definition: gsm_08_16.h:85
static int ns2_tlv_parse(struct tlv_parsed *dec, const uint8_t *buf, int buf_len, uint8_t lv_tag, uint8_t lv_tag2)
Definition: gprs_ns2.c:935
gprs_ns_ll
Osmocom NS link layer types.
Definition: gprs_ns.h:53
static const uint8_t ms_reg_enq_ies[]
Definition: gprs_bssgp_util.c:200
@ GPRS_NS2_PRIM_CONGESTION
Definition: gprs_ns2.h:54
Definition: gprs_ns2_frgre.c:59
@ BSSGP_PDUT_MBMS_START_RESP
Definition: gsm_08_18.h:95
void gprs_ns_set_log_ss(int ss)
Definition: gprs_ns.c:2203
struct msgb * bssgp_msgb_alloc(void)
Definition: gprs_bssgp_util.c:494
static const uint8_t d_pag_ps_ies[]
Definition: gprs_bssgp_util.c:197
#define DL
Definition: gprs_bssgp_util.c:255
struct gprs_ns2_vc * gprs_ns2_nsvc_by_nsvci(struct gprs_ns2_inst *nsi, uint16_t nsvci)
Resolve a NS-VC Entity based on its NS-VCI.
Definition: gprs_ns2.c:786
@ BSSGP_NACC_CAUSE_RPRT_CELL_MISSMTCH
Definition: gprs_bssgp_rim.h:103
@ BSSGP_PDUT_PERFORM_LOC_REQ
Definition: gsm_08_18.h:82
bool persistent
true if this NSE was created by VTY or pcu socket)
Definition: gprs_ns2_internal.h:189
@ NS_CAUSE_TRANSIT_FAIL
Definition: gsm_08_16.h:84
static const uint8_t flush_ll_ies[]
Definition: gprs_bssgp_util.c:202
struct gprs_ns2_vc * ns2_vc_alloc(struct gprs_ns2_vc_bind *bind, struct gprs_ns2_nse *nse, bool initiater, enum gprs_ns2_vc_mode vc_mode, const char *id)
Allocate a NS-VC within the given bind + NSE.
Definition: gprs_ns2.c:590
static struct msgb * read_nsfrgre_msg(struct osmo_fd *bfd, int *error, struct osmo_sockaddr *saddr, uint16_t *dlci, const struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_frgre.c:276
@ BSSGP_PDUT_PS_HO_REQUIRED_ACK
Definition: gsm_08_18.h:73
struct llist_head blist
list of NS-VCs within bind, bind is the owner!
Definition: gprs_ns2_internal.h:234
@ GPRS_NS2_DIALECT_STATIC_RESETBLOCK
Definition: gprs_ns2.h:38
#define osmo_fsm_inst_dispatch(fi, event, data)
@ BSSGP_PDUT_RA_CAPABILITY
Definition: gsm_08_18.h:21
@ BSSGP_IE_LCS_CAUSE
Definition: gsm_08_18.h:174
@ BSSGP_PDUT_MBMS_UPDATE_REQ
Definition: gsm_08_18.h:98
#define OSMO_STRLCPY_ARRAY(array, src)
static const uint8_t ms_reg_enq_res_ies[]
Definition: gprs_bssgp_util.c:201
const struct value_string gprs_ns_signal_ns_names[]
Definition: gprs_ns.c:182
@ BSSGP_CAUSE_CS
Definition: gsm_08_18.h:309
uint8_t sns_sig_weight
the IP-SNS signalling weight when doing dynamic configuration
Definition: gprs_ns2_internal.h:315
Definition: gprs_ns2.h:109
@ BSSGP_PDUT_MODIFY_BSS_PFC_ACK
Definition: gsm_08_18.h:68
@ BSSGP_IE_LCS_QOS
Definition: gsm_08_18.h:166
uint16_t nsei
Identifiers of a BTS, equal to 'struct bssgp_bts_ctx'.
Definition: gprs_msgb.h:7
int ns2_tx_status(struct gprs_ns2_vc *nsvc, uint8_t cause, uint16_t bvci, struct msgb *orig_msg, uint16_t *nsvci)
Transmit a NS-STATUS on a given NS-VC.
Definition: gprs_ns2_message.c:437
@ BSSGP_CAUSE_DIR_RETRY
Definition: gsm_08_18.h:312
@ NS_CTR_BYTES_OUT_DROP
Definition: gprs_ns2_internal.h:127
@ BSSGP_IE_LCS_CLIENT_TYPE
Definition: gsm_08_18.h:167
@ BSSGP_PDUT_LLC_DISCARD
Definition: gsm_08_18.h:56
@ NS2_SNS_EV_RX_CONFIG_END
SNS-CONFIG with end flag received.
Definition: gprs_ns2_internal.h:336
uint16_t nsei
Definition: gprs_ns2.h:112
static int gprs_nsvc_replace_if_found(uint16_t nsvci, struct gprs_nsvc **nsvc, struct gprs_nsvc **old_nsvc)
Definition: gprs_ns.c:1177
static enum ns2_cs ns2_create_vc_sns(struct gprs_ns2_vc_bind *bind, const struct osmo_sockaddr *remote, struct gprs_ns2_vc **success, uint16_t nsei)
Definition: gprs_ns2.c:947
struct gprs_ns2_nse * gprs_ns2_create_nse2(struct gprs_ns2_inst *nsi, uint16_t nsei, enum gprs_ns2_ll linklayer, enum gprs_ns2_dialect dialect, bool ip_sns_role_sgsn)
Create a NS Entity within given NS instance.
Definition: gprs_ns2.c:806
int ns2_tx_block(struct gprs_ns2_vc *nsvc, uint8_t cause, uint16_t *nsvci)
Transmit a NS-BLOCK on a given NS-VC.
Definition: gprs_ns2_message.c:216
int ns2_bind_alloc(struct gprs_ns2_inst *nsi, const char *name, struct gprs_ns2_vc_bind **result)
common allocation + low-level initialization of a bind.
Definition: gprs_ns2.c:1652
@ BSSGP_IE_FLOW_CTRL_GRANULARITY
Definition: gsm_08_18.h:226
static const uint8_t mod_bss_pfc_ack_ies[]
Definition: gprs_bssgp_util.c:228
const char * name
Definition: gprs_ns2_internal.h:326
void msgb_free(struct msgb *m)
const struct value_string gprs_ns2_cause_strs[]
Definition: gprs_ns2.c:140
struct priv_bind __attribute__
#define msgb_nsei(__x)
Definition: gprs_msgb.h:23
@ BSSGP_PDUT_FLUSH_LL_ACK
Definition: gsm_08_18.h:55
@ BSSGP_RAN_INF_APP_ID_NACC
Definition: gprs_bssgp_rim.h:129
static const struct osmo_stat_item_group_desc nsbind_statg_desc
Definition: gprs_ns2.c:213
void ns2_nse_update_mtu(struct gprs_ns2_nse *nse)
Definition: gprs_ns2.c:1578
Definition: gsm_08_18.h:364
static const uint8_t suspend_ies[]
Definition: gprs_bssgp_util.c:191
@ BSSGP_IE_PS_HO_COMMAND
Definition: gsm_08_18.h:216
struct osmo_gprs_ns2_prim::@20::@21 unitdata
@ BSSGP_IE_SRC_TO_TGT_TR_CONT
Definition: gsm_08_18.h:206
static int gprs_ns_rx_reset(struct gprs_nsvc **nsvc, struct msgb *msg)
Definition: gprs_ns.c:1212
@ BSSGP_PDUT_RA_CAPA_UPDATE_ACK
Definition: gsm_08_18.h:30
gprs_bssgp_cause
Cause coding (Section 11.3.8 / Table 11.10)
Definition: gsm_08_18.h:266
uint16_t nsvci
end-to-end significance
Definition: gprs_ns.h:129
struct gprs_ns2_vc * gprs_ns2_fr_connect(struct gprs_ns2_vc_bind *bind, struct gprs_ns2_nse *nse, uint16_t nsvci, uint16_t dlci)
Create, connect and activate a new FR-based NS-VC.
Definition: gprs_ns2_fr.c:962
@ BSSGP_IE_PDU_IN_ERROR
Definition: gsm_08_18.h:139
int bssgp_dec_ran_inf_rim_cont(struct bssgp_ran_inf_rim_cont *cont, const uint8_t *buf, size_t len)
Decode a RAN Information RIM Container (3GPP TS 48.018, table 11.3.62a.2.b).
Definition: gprs_bssgp_rim.c:595
@ BSSGP_IE_DECIPHERING_KEYS
Definition: gsm_08_18.h:172
@ BSSGP_PDUT_FLOW_CONTROL_MS_ACK
Definition: gsm_08_18.h:53
void osmo_fd_close(struct osmo_fd *fd)
static const uint8_t ps_ho_required_nack_ies[]
Definition: gprs_bssgp_util.c:238
@ BSSGP_PDUT_BVC_UNBLOCK
Definition: gsm_08_18.h:48
static const char * gprs_ns2_cause_str(enum ns_cause val)
Obtain a human-readable string for NS primitives.
Definition: gprs_ns2.h:106
@ BSSGP_IE_VELOCITY_DATA
Definition: gsm_08_18.h:220
struct gprs_ns2_vc_bind * ns2_ip_get_bind_by_index(struct gprs_ns2_inst *nsi, struct osmo_sockaddr *remote, int index)
Definition: gprs_ns2_udp.c:580
static const uint8_t block_ies[]
Definition: gprs_bssgp_util.c:212
@ NS_TOUT_TNS_BLOCK_RETRIES
Definition: gprs_ns.h:35
@ NS_TOUT_TNS_RESET
Definition: gprs_ns2_internal.h:85
struct gprs_ns2_vc_driver vc_driver_frgre
Definition: gprs_ns2_frgre.c:105
Structure representing a single NS-VC.
Definition: gprs_ns2_internal.h:229
@ NS_TOUT_TNS_BLOCK
Definition: gprs_ns2_internal.h:83
@ BSSGP_IE_APP_ERROR_CONTAINER
Definition: gsm_08_18.h:186
@ BSSGP_NACC_CAUSE_SIPSI_LEN_ERR
Definition: gprs_bssgp_rim.h:105
@ BSSGP_IE_PRIO_CLASS_IND
Definition: gsm_08_18.h:243
static void dump_bvc(struct vty *vty, struct bssgp_bvc_ctx *bvc, int stats)
Definition: gprs_bssgp_vty.c:80
void gprs_ns2_free_binds(struct gprs_ns2_inst *nsi)
Definition: gprs_ns2.c:1519
@ BSSGP_IE_RI_APP_ERROR_RIM_CONT
Definition: gsm_08_18.h:189
const uint8_t * son_trans_app_id
Definition: gprs_bssgp_rim.h:196
Definition: gprs_bssgp_rim.h:189
@ NS_CAUSE_BVCI_UNKNOWN
Definition: gsm_08_16.h:89
struct gprs_ns2_nse * nse
pointer to NS Instance
Definition: gprs_ns2_internal.h:237
int bssgp_enc_ran_inf_req_rim_cont(uint8_t *buf, size_t len, const struct bssgp_ran_inf_req_rim_cont *cont)
Encode a RAN Information Request RIM Container (3GPP TS 48.018, table 11.3.62a.1.b).
Definition: gprs_bssgp_rim.c:544
@ BSSGP_RAN_INF_APP_ID_UTRA_SI
Definition: gprs_bssgp_rim.h:133
Definition: gprs_bssgp_rim.h:143
void osmo_fr_link_free(struct osmo_fr_link *link)
Definition: frame_relay.c:955
static const uint8_t suspend_nack_ies[]
Definition: gprs_bssgp_util.c:193
@ NS2_SNS_EV_REQ_NSVC_ALIVE
a NS-VC became alive
Definition: gprs_ns2_internal.h:344
void ns2_sns_update_weights(struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:2711
int bssgp_enc_app_err_cont_nacc(uint8_t *buf, size_t len, const struct bssgp_app_err_cont_nacc *cont)
Encode Application Error Container for NACC (3GPP TS 48.018, section 11.3.64.1).
Definition: gprs_bssgp_rim.c:382
ns_timeout
Definition: gprs_ns.h:33
@ BSSGP_PDUT_DL_MMBS_UNITDATA
Definition: gsm_08_18.h:24
@ BSSGP_IE_IRAT_MEASUREMENT_CONF
Definition: gsm_08_18.h:239
@ BSSGP_IE_PS_HO_INDICATIONS
Definition: gsm_08_18.h:217
@ BSSGP_IE_LSA_ID_LIST
Definition: gsm_08_18.h:156
static void dump_bssgp(struct vty *vty, int stats)
Definition: gprs_bssgp_vty.c:101
#define NSE_S_ALIVE
Definition: gprs_ns.h:45
int ns2_tx_sns_del(struct gprs_ns2_vc *nsvc, uint8_t trans_id, const struct gprs_ns_ie_ip4_elem *ip4_elems, unsigned int num_ip4_elems, const struct gprs_ns_ie_ip6_elem *ip6_elems, unsigned int num_ip6_elems)
Encode + Transmit a SNS-DEL as per Section 9.3.6.
Definition: gprs_ns2_message.c:600
uint8_t pdu_type
Definition: gprs_ns.h:249
@ BSSGP_IE_RIM_PDU_INDICATIONS
Definition: gsm_08_18.h:181
#define NS_ALLOC_SIZE
Definition: gprs_ns.h:30
static int fr_netif_write_one(struct gprs_ns2_vc_bind *bind, struct msgb *msg)
Definition: gprs_ns2_fr.c:291
int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
@ BSSGP_CAUSE_DL_QUALITY
Definition: gsm_08_18.h:299
static void ns_osmo_signal_dispatch_replaced(struct gprs_nsvc *nsvc, struct gprs_nsvc *old_nsvc)
Definition: gprs_ns.c:388
@ BSSGP_RAN_INF_APP_ID_SI3
Definition: gprs_bssgp_rim.h:130
@ NS_CAUSE_UNKN_IP_ADDR
Definition: gsm_08_16.h:101
@ BSSGP_CAUSE_DTM_HO_MSC_ERR
Definition: gsm_08_18.h:322
int gprs_ns_tx_sns_size(struct gprs_nsvc *nsvc, bool reset_flag, uint16_t max_nr_nsvc, uint16_t *ip4_ep_nr, uint16_t *ip6_ep_nr)
Encode + transmit a SNS-SIZE as per Section 9.3.7.
Definition: gprs_ns.c:1000
@ BSSGP_IE_SUSPEND_REF_NR
Definition: gsm_08_18.h:147
#define LMI_Q933A_DLCI
Definition: gprs_ns2_fr.c:357
void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds)
const uint8_t * son_trans_app_id
Definition: gprs_bssgp_rim.h:216
@ NS_CTR_PKTS_OUT_DROP
Definition: gprs_ns2_internal.h:124
static const uint8_t fc_pfc_ack_ies[]
Definition: gprs_bssgp_util.c:233
struct rate_ctr_group * ctrg
Definition: gprs_bssgp.h:120
void ns2_vty_dump_nsvc(struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats)
Definition: gprs_ns2_vty.c:1875
static const char * osmo_fsm_inst_state_name(struct osmo_fsm_inst *fi)
@ BSSGP_CAUSE_DTM_HO_T23_EXPIRY
Definition: gsm_08_18.h:321
Definition: gprs_bssgp.h:107
uint8_t data_weight
signaling weight.
Definition: gprs_ns.h:162
@ BSSGP_CAUSE_TRAFFIC
Definition: gsm_08_18.h:303
void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data)
int bssgp_parse_rim_ri(struct bssgp_rim_routing_info *ri, const uint8_t *buf, unsigned int len)
Parse a RIM Routing information IE (3GPP TS 48.018, chapter 11.3.70).
Definition: gprs_bssgp_rim.c:56
@ BSSGP_PDUT_RAN_INFO
Definition: gsm_08_18.h:88
static void osmo_stat_item_group_udp_idx(struct osmo_stat_item_group *grp, unsigned int idx)
#define NS2_LL_MAX_STR
Definition: gprs_ns2.c:304
@ S_NS_ALIVE_EXP
Definition: gprs_ns.h:236
struct osmo_location_area_id lac
static void enqueue_at_tail(struct gprs_ns2_vc_bind *bind, struct msgb *msg)
Definition: gprs_ns2_fr.c:349
char * gprs_nsvc_state_append(char *s, struct gprs_nsvc *nsvc)
Append the nsvc state to a talloc string.
Definition: gprs_ns.c:2216
@ NS2_CS_FOUND
A NSVC object has been found.
Definition: gprs_ns2_internal.h:115
@ BSSGP_PDUT_DUMMY_PAGING_PS_RESP
Definition: gsm_08_18.h:40
static void dump_vty(const struct gprs_ns2_vc_bind *bind, struct vty *vty, bool stats)
Definition: gprs_ns2_fr.c:133
int dscp
Definition: gprs_ns.h:99
@ NS2_SNS_EV_REQ_FREE_NSVCS
free all NS-VCs
Definition: gprs_ns2_internal.h:343
int gprs_ns2_is_fr_bind(struct gprs_ns2_vc_bind *bind)
determine if given bind is for FR-GRE encapsulation.
Definition: gprs_ns2_fr.c:327
@ BSSGP_PDUT_RAN_INFO_ACK
Definition: gsm_08_18.h:90
@ BSSGP_IE_RIM_ROUTING_INFO
Definition: gsm_08_18.h:184
@ S_NS_BLOCK
Definition: gprs_ns.h:234
@ BSSGP_PDUT_DOWNLOAD_BSS_PFC
Definition: gsm_08_18.h:63
enum osmo_fr_role role
Definition: frame_relay.h:71
struct gprs_nsvc * gprs_ns_nsip_connect(struct gprs_ns_inst *nsi, struct sockaddr_in *dest, uint16_t nsei, uint16_t nsvci)
Establish a NS connection (from the BSS) to the SGSN.
Definition: gprs_ns.c:2139
#define BVCI_SIGNALLING
Fixed BVCI definitions (Section 5.4.1)
Definition: gsm_08_18.h:10
static int set_ifupdown(const char *netif, bool up)
Definition: gprs_ns2_fr.c:679
const uint8_t * err_pdu
Definition: gprs_bssgp_rim.h:211
#define NS_DESC_R(st)
Definition: gprs_ns.h:50
struct osmo_fsm_inst * fi
Definition: gprs_ns2_internal.h:269
void osmo_stat_item_dec(struct osmo_stat_item *item, int32_t value)
@ NS_TOUT_TSNS_PROV
Definition: gprs_ns.h:41
static const uint8_t status_ies[]
Definition: gprs_bssgp_util.c:218
Structure representing a single NS-VC.
Definition: gprs_ns.h:122
static int handle_rx_gre_ipv6(struct osmo_fd *bfd, struct msgb *msg, struct ip6_hdr *ip6hdr, struct gre_hdr *greh)
Definition: gprs_ns2_frgre.c:166
struct rate_ctr_group * ctrg
NSE-wide statistics.
Definition: gprs_ns2_internal.h:219
Common header of GPRS NS.
Definition: gsm_08_16.h:17
@ NS2_SNS_EV_RX_ACK
Rx of SNS-ACK (response to ADD/DELETE/CHG_WEIGHT.
Definition: gprs_ns2_internal.h:341
@ BSSGP_PDUT_FLOW_CONTROL_BVC_ACK
Definition: gsm_08_18.h:51
@ BSSGP_PDUT_DELETE_BSS_PFC
Definition: gsm_08_18.h:69
struct rate_ctr_group * rate_ctr_group_alloc(void *ctx, const struct rate_ctr_group_desc *desc, unsigned int idx)
#define LOGNSE(nse, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:12
int bssgp_tx_status(uint8_t cause, uint16_t *bvci, struct msgb *orig_msg)
Definition: gprs_bssgp_util.c:555
@ GPRS_NS2_ENDPOINT_CONFIRM_CHANGE
Definition: gprs_ns2.h:100
@ BSSGP_IE_TLLI
Definition: gsm_08_18.h:149
@ BSSGP_PDUT_RAN_INFO_APP_ERROR
Definition: gsm_08_18.h:92
int alive_retries
Definition: gprs_ns.h:137
@ BSSGP_IE_GGSN_PGW_LOCATION
Definition: gsm_08_18.h:241
const struct osmo_tlv_prot_def osmo_pdef_bssgp
Definition: gprs_bssgp_util.c:261
Structure repesenting a bind instance.
Definition: gprs_ns2_internal.h:279
static int config_write_bssgp(struct vty *vty)
Definition: gprs_bssgp_vty.c:65
struct bssgp_ran_information_pdu rim_pdu
Definition: gprs_bssgp.h:79
@ BSSGP_PDUT_RESUME_ACK
Definition: gsm_08_18.h:36
int bssgp_parse_rim_pdu(struct bssgp_ran_information_pdu *pdu, const struct msgb *msg)
Parse a given message buffer into a rim-pdu struct.
Definition: gprs_bssgp_rim.c:958
int(* gprs_ns2_foreach_nsvc_cb)(struct gprs_ns2_vc *nsvc, void *ctx)
a callback to iterate over all NSVC
Definition: gprs_ns2.h:153
int bssgp_vty_init(void)
Definition: gprs_bssgp_vty.c:206
static const struct osmo_stat_item_desc nsvc_stat_description[]
Definition: gprs_ns.c:170
@ BSSGP_IE_ADDITIONAL_PTMSI
Definition: gsm_08_18.h:256
int ns2_vc_force_unconfigured(struct gprs_ns2_vc *nsvc)
Reset a NS-VC FSM.
Definition: gprs_ns2_vc_fsm.c:826
@ BSSGP_PDUT_PAGING_PS
Definition: gsm_08_18.h:27
@ GPRS_NS_CS_FOUND
A NSVC object has been found.
Definition: gprs_ns.h:67
@ NS_CTR_UNBLOCKED
Definition: gprs_ns2_internal.h:129
@ NS_IE_BVCI
Definition: gsm_08_16.h:69
struct gprs_nsvc * old_nsvc
Definition: gprs_ns.h:247
struct msgb * msg
Definition: gprs_ns.h:251
uint32_t bucket_counter
number of tokens in the bucket
Definition: gprs_bssgp.h:90
int transfer_capability
transfer capability in mbit
Definition: gprs_ns2_internal.h:296
@ BSSGP_PDUT_RESUME
Definition: gsm_08_18.h:35
const char * osmo_hexdump_buf(char *out_buf, size_t out_buf_size, const unsigned char *buf, int len, const char *delim, bool delim_after_last)
struct osmo_fr_dlc * osmo_fr_dlc_alloc(struct osmo_fr_link *link, uint16_t dlci)
Definition: frame_relay.c:974
static int fr_vc_sendmsg(struct gprs_ns2_vc *nsvc, struct msgb *msg)
Definition: gprs_ns2_fr.c:333
@ BSSGP_IE_BTS_RX_ACCURACY_LVL
Definition: gsm_08_18.h:261
static void free_bind(struct gprs_ns2_vc_bind *bind)
clean up all private driver state.
Definition: gprs_ns2_fr.c:156
@ BSSGP_IE_MS_SYNC_ACCURACY
Definition: gsm_08_18.h:260
struct rate_ctr * rate_ctr_group_get_ctr(struct rate_ctr_group *grp, unsigned int idx)
@ NS_IE_CAUSE
Definition: gsm_08_16.h:66
@ BSSGP_PDUT_PS_HO_CANCEL
Definition: gsm_08_18.h:79
struct osmo_sockaddr remote
Definition: gprs_ns2_fr.c:115
unsigned char * bssgp_cell_id
Cell Identifier.
Definition: gprs_msgb.h:12
static bool gprs_sns_fsm_registered
Definition: gprs_ns.c:1878
@ GPRS_NS2_ENDPOINT_REQUEST_CHANGE
Definition: gprs_ns2.h:99
@ SNS_PDUT_ADD
Definition: gsm_08_16.h:55
#define TLVP_PRESENT(x, y)
int gprs_ns_nsip_listen(struct gprs_ns_inst *nsi)
Create a listening socket for GPRS NS/UDP/IP.
Definition: gprs_ns.c:2050
void(* free_bind)(struct gprs_ns2_vc_bind *driver)
Definition: gprs_ns2_internal.h:328
@ BSSGP_PDUT_RAN_INFO_REQ
Definition: gsm_08_18.h:89
@ NS_PDUT_RESET_ACK
Definition: gsm_08_16.h:45
bool freed
recursive anchor
Definition: gprs_ns2_internal.h:322
@ BSSGP_IE_TRIGGER_ID
Definition: gsm_08_18.h:154
#define msgb_bssgp_len(__x)
Definition: gprs_msgb.h:27
void gprs_ns_ll_copy(struct gprs_nsvc *nsvc, struct gprs_nsvc *other)
Definition: gprs_ns.c:1562
static const struct rate_ctr_group_desc nse_ctrg_desc
Definition: gprs_ns2.c:180
static const uint8_t ps_ho_request_ies[]
Definition: gprs_bssgp_util.c:239
@ BSSGP_IE_RRLP_FLAGS
Definition: gsm_08_18.h:176
@ NS_IE_IP_ADDR
Definition: gsm_08_16.h:78
ns2_timeout
Definition: gprs_ns2_internal.h:82
@ BSSGP_CAUSE_UL_QUALITY
Definition: gsm_08_18.h:297
if(vty->type==VTY_SHELL_SERV)
enum bssgp_nacc_cause nacc_cause
Definition: gprs_bssgp_rim.h:117
struct gprs_nsvc * gprs_nsvc_by_rem_addr(struct gprs_ns_inst *nsi, const struct sockaddr_in *sin)
Lookup NS-VC based on specified remote peer socket addr.
Definition: gprs_ns.c:291
uint16_t flags
Definition: gprs_ns2_frgre.c:60
static int handle_nsip_write(struct osmo_fd *bfd)
Definition: gprs_ns.c:2009
enum osmo_fr_role gprs_ns2_fr_bind_role(struct gprs_ns2_vc_bind *bind)
Return the frame relay role of a bind.
Definition: gprs_ns2_fr.c:904
uint32_t sum_data_weight
sum of all the data weight of alive NS-VCs
Definition: gprs_ns2_internal.h:207
@ BSSGP_PDUT_SUSPEND_ACK
Definition: gsm_08_18.h:33
enum bssgp_ran_inf_app_id app_id
Definition: gprs_bssgp_rim.c:405
#define log_tgt_mutex_lock()
Definition: frame_relay.h:54
gprs_ns_cb_t * cb
callback to the user for incoming UNIT DATA IND
Definition: gprs_ns.h:81
@ BSSGP_IE_PRIORITY
Definition: gsm_08_18.h:141
@ NS_TOUT_TNS_TEST
Definition: gprs_ns.h:38
struct gprs_ns2_inst * nsi
a pointer back to the nsi
Definition: gprs_ns2_internal.h:289
@ BSSGP_PDUT_FLOW_CONTROL_PFC
Definition: gsm_08_18.h:57
int bssgp_enc_ran_inf_app_cont_nacc(uint8_t *buf, size_t len, const struct bssgp_ran_inf_app_cont_nacc *cont)
Encode a RAN Information Application Container (3GPP TS 48.018, section 11.3.63.2....
Definition: gprs_bssgp_rim.c:305
int gprs_ns_tx_sns_ack(struct gprs_nsvc *nsvc, uint8_t trans_id, uint8_t *cause, const struct gprs_ns_ie_ip4_elem *ip4_elems, unsigned int num_ip4_elems)
Encode + Transmit a SNS-ACK as per Section 9.3.1.
Definition: gprs_ns.c:875
@ BSSGP_IE_MBMS_RESPONSE
Definition: gsm_08_18.h:196
@ BSSGP_IE_GLOBAL_CN_ID
Definition: gsm_08_18.h:183
@ S_NS_MISMATCH
Definition: gprs_ns.h:238
the data structure stored in msgb->cb for libgb apps
Definition: gprs_msgb.h:7
static const uint8_t resume_ack_ies[]
Definition: gprs_bssgp_util.c:195
union osmo_sockaddr::@22 u
int gprs_ns_tx_alive(struct gprs_nsvc *nsvc)
Transmit a NS-ALIVE on a given NS-VC.
Definition: gprs_ns.c:708
static const uint8_t rinfo_ies[]
Definition: gprs_bssgp_util.c:249
@ NSVC_TIMER_TNS_TEST
Definition: gprs_ns.h:115
struct llist_head gprs_nsvcs
linked lists of all NSVC in this instance
Definition: gprs_ns.h:84
struct llist_head list
Definition: gprs_ns2_fr.c:106
const struct value_string gprs_ns_pdu_strings[]
Definition: gprs_ns.c:398
@ NS_PDUT_BLOCK_ACK
Definition: gsm_08_16.h:47
uint32_t bucket_size_max
maximum size of the bucket (octets)
Definition: gprs_bssgp.h:87
@ NS_TOUT_TNS_ALIVE_RETRIES
Definition: gprs_ns2_internal.h:89
static unsigned int msgb_l2len(const struct msgb *msgb)
static const struct value_string timer_mode_strs[]
Definition: gprs_ns.c:736
int ns2_vc_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp)
entry point for messages from the driver/VL
Definition: gprs_ns2_vc_fsm.c:868
@ BSSGP_IE_TMSI
Definition: gsm_08_18.h:150
@ BSSGP_IE_TBSS_TO_SBSS_TR_CONT
Definition: gsm_08_18.h:201
@ BSSGP_PDUT_PS_HO_REQUEST
Definition: gsm_08_18.h:75
void osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data)
void * priv
driver private structure
Definition: gprs_ns2_internal.h:287
@ BSSGP_PDUT_MBMS_STOP_RESP
Definition: gsm_08_18.h:97
@ BSSGP_CAUSE_PDU_INCOMP_FEAT
Definition: gsm_08_18.h:288
@ BSSGP_IE_GANSS_POSITIONING_DATA
Definition: gsm_08_18.h:225
enum gprs_ns2_vc_mode ns2_dialect_to_vc_mode(enum gprs_ns2_dialect dialect)
Definition: gprs_ns2.c:1547
@ S_NS_UNBLOCK
Definition: gprs_ns.h:235
const struct value_string bssgp_rim_routing_info_discr_strs[]
Definition: gprs_bssgp_rim.c:45
int grps_ns_frgre_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg)
int fr_tx_cb(void *data, struct msgb *msg)
Definition: gprs_ns2_fr.c:447
@ GPRS_NS2_DIALECT_IPACCESS
Definition: gprs_ns2.h:39
int ns2_ip_count_bind(struct gprs_ns2_inst *nsi, struct osmo_sockaddr *remote)
Count UDP binds compatible with remote.
Definition: gprs_ns2_udp.c:558
@ GPRS_NS2_DIALECT_SNS
Definition: gprs_ns2.h:40
unsigned char * bssgph
Definition: gprs_msgb.h:8
@ BSSGP_IE_LOCATION_TYPE
Definition: gsm_08_18.h:169
int bssgp_enc_ran_inf_req_app_cont_nacc(uint8_t *buf, size_t len, const struct bssgp_ran_inf_req_app_cont_nacc *cont)
Encode a RAN Information Request Application Container for NACC (3GPP TS 48.018, section 11....
Definition: gprs_bssgp_rim.c:235
@ BSSGP_CAUSE_PROC_OVERLOAD
Definition: gsm_08_18.h:267
@ NS2_BIND_STAT_BACKLOG_LEN
Definition: gprs_ns2_internal.h:109
int ns2_sns_add_sns_default_binds(struct gprs_ns2_nse *nse)
Definition: gprs_ns2_vty.c:1622
char * gprs_ns2_ll_str_c(const void *ctx, struct gprs_ns2_vc *nsvc)
string-format a given NS-VC to a dynamically allocated string.
Definition: gprs_ns2.c:319
@ BSSGP_PDUT_MBMS_UPDATE_RESP
Definition: gsm_08_18.h:99
@ GPRS_NS2_AFF_CAUSE_VC_RECOVERY
Definition: gprs_ns2.h:80
uint8_t data[0]
optional/conditional IEs as TLVs
Definition: gsm_08_18.h:113
void gprs_ns_ll_clear(struct gprs_nsvc *nsvc)
Definition: gprs_ns.c:1578
@ GPRS_NS_CS_REJECTED
Rejected and answered message.
Definition: gprs_ns.h:68
struct gprs_nsvc * gprs_nsvc_create2(struct gprs_ns_inst *nsi, uint16_t nsvci, uint8_t sig_weight, uint8_t data_weight)
Create a new NS-VC (Virtual Circuit) within given instance.
Definition: gprs_ns.c:311
@ BSSGP_IE_RQD_GANNS_AST_DATA
Definition: gsm_08_18.h:223
void gprs_ns2_start_alive_all_nsvcs(struct gprs_ns2_nse *nse)
Start the NS-ALIVE FSM in all NS-VCs of given NSE.
Definition: gprs_ns2.c:1472
@ GPRS_NS2_AFF_CAUSE_SNS_NO_ENDPOINTS
Definition: gprs_ns2.h:86
struct gprs_ns2_vc_driver * driver
Definition: gprs_ns2_internal.h:290
static const struct osmo_stat_item_group_desc nsvc_statg_desc
Definition: gprs_ns.c:174
Definition: gprs_bssgp_rim.h:165
struct osmo_cell_global_id_ps reprt_cell
Definition: gprs_bssgp_rim.h:88
struct msgb * bssgp_msgb_copy(const struct msgb *msg, const char *name)
Definition: gprs_bssgp_util.c:505
static const uint8_t crt_bss_pfc_ies[]
Definition: gprs_bssgp_util.c:221
static int handle_nsip_read(struct osmo_fd *bfd)
Definition: gprs_ns.c:1992
@ BSSGP_IE_TRANSACTION_ID
Definition: gsm_08_18.h:153
@ NS_PDUT_UNITDATA
Definition: gsm_08_16.h:43
static int setup_device(const char *netif, const struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_fr.c:710
static const struct value_string ns_cause_str[]
Definition: gprs_ns.c:423
static int nsip_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg)
Definition: gprs_ns.c:2015
osmo_fr_role
Definition: frame_relay.h:38
#define SIG
Definition: gprs_bssgp_util.c:257
struct gprs_ra_id ra_id
parsed RA ID of the remote BTS
Definition: gprs_bssgp.h:110
@ NS_TOUT_TSNS_SIZE_RETRIES
Definition: gprs_ns2_internal.h:91
void gprs_ns2_free_nses(struct gprs_ns2_inst *nsi)
Definition: gprs_ns2.c:924
@ NS_IE_RESET_FLAG
Definition: gsm_08_16.h:77
BSSGP flow control (SGSN side) According to Section 8.2.
Definition: gprs_bssgp.h:86
@ BSSGP_IE_BMAX_DEFAULT_MS
Definition: gsm_08_18.h:119
@ BSSGP_IE_LOCATION_ESTIMATE
Definition: gsm_08_18.h:170
int ifindex
Definition: gprs_ns2_fr.c:97
const char * group_name_prefix
enum gprs_ns2_ll ll
which link-layer are we based on?
Definition: gprs_ns2_internal.h:302
struct gprs_ns2_vc_bind * gprs_ns2_fr_bind_by_netif(struct gprs_ns2_inst *nsi, const char *netif)
Find NS bind for a given network interface.
Definition: gprs_ns2_fr.c:935
@ BSSGP_IE_EMLPP_PRIO
Definition: gsm_08_18.h:129
#define llist_for_each_entry(pos, head, member)
@ BSSGP_PDUT_MBMS_START_REQ
Definition: gsm_08_18.h:94
int bssgp_create_rim_ri(uint8_t *buf, const struct bssgp_rim_routing_info *ri)
Encode a RIM Routing information IE (3GPP TS 48.018, chapter 11.3.70).
Definition: gprs_bssgp_rim.c:103
@ BSSGP_NACC_CAUSE_SYNTAX_ERR
Definition: gprs_bssgp_rim.h:102
static const uint8_t ra_cap_upd_ies[]
Definition: gprs_bssgp_util.c:188
@ _NSVC_TIMER_NR
Definition: gprs_ns.h:118
static const uint8_t del_bss_pfc_ies[]
Definition: gprs_bssgp_util.c:230
int osmo_sock_init2_ofd(struct osmo_fd *ofd, int family, int type, int proto, const char *local_host, uint16_t local_port, const char *remote_host, uint16_t remote_port, unsigned int flags)
@ NS2_SNS_EV_REQ_NO_NSVC
no more NS-VC remaining (all dead)
Definition: gprs_ns2_internal.h:342
@ BSSGP_IE_MS_RADIO_ACCESS_CAP
Definition: gsm_08_18.h:137
void gprs_ns2_free_nsvc(struct gprs_ns2_vc *nsvc)
Destroy/release given NS-VC.
Definition: gprs_ns2.c:641
@ BSSGP_IE_IMEI
Definition: gsm_08_18.h:212
uint16_t bvci
Definition: gprs_msgb.h:8
@ BSSGP_IE_PAGING_ATTEMPT_INFO
Definition: gsm_08_18.h:249
@ NS_CTR_REPLACED
Definition: gprs_ns.c:135
int ns2_validate(struct gprs_ns2_vc *nsvc, uint8_t pdu_type, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
Definition: gprs_ns2_message.c:139
@ BSSGP_PDUT_BVC_RESET
Definition: gsm_08_18.h:46
@ BSSGP_PDUT_FLOW_CONTROL_PFC_ACK
Definition: gsm_08_18.h:58
@ NS_TOUT_TNS_BLOCK
Definition: gprs_ns.h:34
static const uint8_t overload_ies[]
Definition: gprs_bssgp_util.c:248
struct osmo_mnl * osmo_mnl_init(void *ctx, int bus, unsigned int groups, mnl_cb_t mnl_cb, void *priv)
@ BSSGP_PDUT_PS_HO_COMPLETE_ACK
Definition: gsm_08_18.h:80
const char * gprs_ns2_ll_str(struct gprs_ns2_vc *nsvc)
string-format a given NS-VC to a thread-local static buffer.
Definition: gprs_ns2.c:309
@ NSVC_TIMER_TNS_RESET
Definition: gprs_ns2_internal.h:100
@ BSSGP_CAUSE_PUESBINE
Definition: gsm_08_18.h:316
int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg, struct sockaddr_in *saddr, enum gprs_ns_ll ll)
Receive incoming NS message from underlying transport layer.
Definition: gprs_ns.c:1496
@ BSSGP_IE_PFC_FLOW_CTRL_PARAMS
Definition: gsm_08_18.h:182
static void llist_add(struct llist_head *_new, struct llist_head *head)
const char * bssgp_pdu_str(enum bssgp_pdu_type pdu)
Definition: gprs_bssgp_util.c:489
@ BSSGP_PDUT_CREATE_BSS_PFC
Definition: gsm_08_18.h:64
const char * bssgp_cause_str(enum gprs_bssgp_cause cause)
Definition: gprs_bssgp_util.c:484
static const uint8_t block_ack_ies[]
Definition: gprs_bssgp_util.c:213
@ BSSGP_PDUT_PERFORM_LOC_ABORT
Definition: gsm_08_18.h:84
char * gprs_ns_ll_str_buf(char *buf, size_t buf_len, const struct gprs_nsvc *nsvc)
Definition: gprs_ns.c:1527
@ BSSGP_IE_OLD_RA_ID
Definition: gsm_08_18.h:251
int bssgp_enc_ran_inf_rim_cont(uint8_t *buf, size_t len, const struct bssgp_ran_inf_rim_cont *cont)
Encode a RAN Information RIM Container (3GPP TS 48.018, table 11.3.62a.2.b).
Definition: gprs_bssgp_rim.c:662
@ BSSGP_IE_COVERAGE_CLASS
Definition: gsm_08_18.h:248
Definition: gprs_bssgp_rim.h:204
int ns2_vc_block(struct gprs_ns2_vc *nsvc)
Block a NS-VC.
Definition: gprs_ns2_vc_fsm.c:834
@ SNS_PDUT_CONFIG
Definition: gsm_08_16.h:57
struct bssgp_bvc_ctx * btsctx_by_bvci_nsei(uint16_t bvci, uint16_t nsei)
Definition: gprs_bssgp.c:192
@ BSSGP_PDUT_BVC_UNBLOCK_ACK
Definition: gsm_08_18.h:49
struct msgb * msgb_copy(const struct msgb *msg, const char *name)
static const struct rate_ctr_desc ns_ctr_description[]
Definition: gprs_ns2.c:162
@ NS_IE_IPv4_EP_NR
Definition: gsm_08_16.h:75
struct gprs_nsvc * nsvc
Definition: gprs_ns.h:246
#define FRAME_RELAY_SDU
Definition: frame_relay.h:46
#define PTP
Definition: gprs_bssgp_util.c:258
#define ns_mark_blocked(ns_)
Definition: gprs_ns.c:94
static bool nsvc_is_not_used(const struct gprs_nsvc *nsvc)
Definition: gprs_ns.c:198
static bool ns_is_sns(uint8_t pdu_type)
Definition: gprs_ns.c:454
struct gprs_nsvc::@16::@18 ip
static const uint8_t del_bss_pfc_req_ies[]
Definition: gprs_bssgp_util.c:234
gprs_ns2_dialect
Definition: gprs_ns2.h:35
@ BSSGP_IE_SELECTED_PLMN_ID
Definition: gsm_08_18.h:242
const char * gprs_ns2_fr_bind_netif(struct gprs_ns2_vc_bind *bind)
Return the network interface of the bind.
Definition: gprs_ns2_fr.c:919
const char * msgb_hexdump(const struct msgb *msg)
static void ns_osmo_signal_dispatch(struct gprs_nsvc *nsvc, unsigned int signal, uint8_t cause)
Definition: gprs_ns.c:363
static struct gprs_ns2_vc * ns2_load_sharing(struct gprs_ns2_nse *nse, uint16_t bvci, uint32_t link_selector)
Definition: gprs_ns2.c:456
char * gprs_ns2_ll_str_buf(char *buf, size_t buf_len, struct gprs_ns2_vc *nsvc)
string-format a given NS-VC into a user-supplied buffer.
Definition: gprs_ns2.c:252
@ BSSGP_PDUT_DUMMY_PAGING_PS
Definition: gsm_08_18.h:39
@ _NSVC_TIMER_NR
Definition: gprs_ns2_internal.h:101
void gprs_ns2_free_nsvcs(struct gprs_ns2_nse *nse)
Destroy/release all NS-VC of given NSE.
Definition: gprs_ns2.c:682
int ns2_tx_sns_size_ack(struct gprs_ns2_vc *nsvc, uint8_t *cause)
Encode + Transmit a SNS-SIZE-ACK as per Section 9.3.8.
Definition: gprs_ns2_message.c:831
@ BSSGP_PDUT_MS_REGISTR_ENQ_RESP
Definition: gsm_08_18.h:42
void gprs_start_alive_all_nsvcs(struct gprs_ns_inst *nsi)
Definition: gprs_ns.c:2241
@ BSSGP_PDUT_FLOW_CONTROL_MS
Definition: gsm_08_18.h:52
@ NS_CTR_BYTES_IN
Definition: gprs_ns.c:131
size_t son_trans_app_id_len
Definition: gprs_bssgp_rim.h:217
uint16_t timeout[NS_TIMERS_COUNT]
Definition: gprs_ns.h:90
static struct gprs_ns2_vc * ns2_load_sharing_weight_modulo(struct gprs_ns2_nse *nse, uint16_t bvci, uint32_t load_selector)
Definition: gprs_ns2.c:411
const char * gprs_ns2_nsvc_state_name(struct gprs_ns2_vc *nsvc)
Return the current state name of a given NS-VC to a thread-local static buffer.
Definition: gprs_ns2.c:330
const uint8_t * si[127]
Definition: gprs_bssgp_rim.h:93
int gprs_ns_tx_sns_size_ack(struct gprs_nsvc *nsvc, uint8_t *cause)
Encode + Transmit a SNS-SIZE-ACK as per Section 9.3.8.
Definition: gprs_ns.c:1040
ns_cause
NS Cause (TS 08.16, Section 10.3.2, Table 13)
Definition: gsm_08_16.h:83
@ BSSGP_IE_MBMS_STOP_CAUSE
Definition: gsm_08_18.h:199
@ GPRS_NS2_AFF_CAUSE_FAILURE
Definition: gprs_ns2.h:81
static const uint8_t fc_ms_ack_ies[]
Definition: gprs_bssgp_util.c:211
@ BSSGP_PDUT_FLUSH_LL
Definition: gsm_08_18.h:54
uint32_t bind_rate_ctr_idx
Definition: gprs_ns2_internal.h:165
@ BSSGP_IE_T_UNTIL_NEXT_PAGING
Definition: gsm_08_18.h:247
int ns2_tx_alive(struct gprs_ns2_vc *nsvc)
Transmit a NS-ALIVE on a given NS-VC.
Definition: gprs_ns2_message.c:379
const char * gprs_ns_cause_str(enum ns_cause cause)
Obtain a human-readable string for NS cause value.
Definition: gprs_ns.c:446
static enum ns_timeout timer_mode_tout[_NSVC_TIMER_NR]
Definition: gprs_ns.c:730
int gprs_ns2_nse_foreach_nsvc(struct gprs_ns2_nse *nse, gprs_ns2_foreach_nsvc_cb cb, void *cb_data)
Iterate over all nsvc of a NS Entity and call the callback.
Definition: gprs_ns2.c:1271
int gprs_ns_vc_create(struct gprs_ns_inst *nsi, struct msgb *msg, struct gprs_nsvc *fallback_nsvc, struct gprs_nsvc **new_nsvc)
Create/get NS-VC independently from underlying transport layer.
Definition: gprs_ns.c:1609
static int frgre_sendmsg(struct gprs_ns2_vc_bind *bind, struct msgb *msg, struct osmo_sockaddr *dest)
Definition: gprs_ns2_frgre.c:482
static const uint8_t unblock_ies[]
Definition: gprs_bssgp_util.c:214
static void llist_add_tail(struct llist_head *_new, struct llist_head *head)
bool freed
recursive anchor
Definition: gprs_ns2_internal.h:272
struct osmo_fr_dlc * dlc
Definition: gprs_ns2_fr.c:117
@ NSVC_TIMER_TNS_ALIVE
Definition: gprs_ns.h:116
enum osmo_sub_auth_type type
@ BSSGP_IE_BVC_BUCKET_SIZE
Definition: gsm_08_18.h:123
int bssgp_dec_ran_inf_req_rim_cont(struct bssgp_ran_inf_req_rim_cont *cont, const uint8_t *buf, size_t len)
Decode a RAN Information Request RIM Container (3GPP TS 48.018, table 11.3.62a.1.b).
Definition: gprs_bssgp_rim.c:472
@ BSSGP_PDUT_FLOW_CONTROL_BVC
Definition: gsm_08_18.h:50
static const uint8_t crt_bss_pfc_ack_ies[]
Definition: gprs_bssgp_util.c:223
char netif[IFNAMSIZ]
Definition: gprs_ns2_fr.c:95
int gprs_ns_rx_sns(struct gprs_ns_inst *nsi, struct msgb *msg, struct tlv_parsed *tp)
Definition: gprs_ns_sns.c:686
@ BSSGP_IE_RADIO_CAUSE
Definition: gsm_08_18.h:143
@ SNS_PDUT_ACK
Definition: gsm_08_16.h:54
@ BSSGP_PDUT_CREATE_BSS_PFC_NACK
Definition: gsm_08_18.h:66
bool alive
true if this NSE has at least one alive VC
Definition: gprs_ns2_internal.h:196
@ GPRS_NS2_LL_UDP
NS/UDP/IP.
Definition: gprs_ns2.h:46
uint8_t sig_weight
signalling weight.
Definition: gprs_ns2_internal.h:249
#define NSE_S_RESET
Definition: gprs_ns.h:46
@ BSSGP_CAUSE_UL_STRENGTH
Definition: gsm_08_18.h:298
@ BSSGP_IE_UE_USAGE_TYPE
Definition: gsm_08_18.h:257
enum gprs_ns2_congestion_cause cause
Definition: gprs_ns2.h:126
@ BSSGP_CAUSE_DL_STRENGTH
Definition: gsm_08_18.h:300
int ns2_tx_unblock(struct gprs_ns2_vc *nsvc)
Transmit a NS-UNBLOCK on a given NS-VC.
Definition: gprs_ns2_message.c:352
static int gprs_ns_tx_block_ack(struct gprs_nsvc *nsvc)
Transmit a NS-BLOCK-ACK on a given NS-VC.
Definition: gprs_ns.c:662
@ NS_IE_TRANS_ID
Definition: gsm_08_16.h:79
@ BSSGP_IE_BUCKET_LEAK_RATE
Definition: gsm_08_18.h:121
@ BSSGP_IE_RAN_INFO_APP_CONTAINER
Definition: gsm_08_18.h:180
@ NS_TOUT_TNS_RESET_RETRIES
Definition: gprs_ns.h:37
@ NS_PDUT_UNBLOCK
Definition: gsm_08_16.h:48
static const uint8_t rinfo_err_ies[]
Definition: gprs_bssgp_util.c:252
@ NSVC_TIMER_TNS_ALIVE
Definition: gprs_ns2_internal.h:99
const char * group_name_prefix
uint16_t nsvci
uniquely identifies NS-VC if VC contains nsvci
Definition: gprs_ns2_internal.h:246
@ BSSGP_CAUSE_REQ_ALG_NOT_SUPP
Definition: gsm_08_18.h:310
int gprs_ns2_is_frgre_bind(struct gprs_ns2_vc_bind *bind)
determine if given bind is for FR-GRE encapsulation.
Definition: gprs_ns2_frgre.c:533
static const uint8_t fc_pfc_ies[]
Definition: gprs_bssgp_util.c:232
void gprs_ns2_free_bind(struct gprs_ns2_vc_bind *bind)
Destroy a given bind.
Definition: gprs_ns2.c:1490
void(* status_cb)(struct osmo_fr_dlc *dlc, void *cb_data, bool active)
Definition: frame_relay.h:129
@ BSSGP_IE_NC_ID
Definition: gsm_08_18.h:208
int osmo_timer_pending(const struct osmo_timer_list *timer)
Definition: gprs_ns2_internal.h:325
enum bssgp_rim_routing_info_discr discr
Definition: gprs_bssgp_rim.h:46
void osmo_timer_del(struct osmo_timer_list *timer)
static uint8_t * msgb_tvlv_put(struct msgb *msg, uint8_t tag, uint16_t len, const uint8_t *val)
int gprs_sns_init(void)
Definition: gprs_ns_sns.c:736
int osmo_sockaddr_str_from_sockaddr(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_storage *src)
uint32_t remote_state
Definition: gprs_ns.h:132
enum gprs_ns2_dialect dialect
which dialect does this NSE speaks?
Definition: gprs_ns2_internal.h:202
#define LOGPSRC(ss, level, caller_file, caller_line, fmt, args...)
struct sockaddr_storage sas
@ NS_PDUT_STATUS
Definition: gsm_08_16.h:50
@ BSSGP_IE_MBMS_SA_ID_LIST
Definition: gsm_08_18.h:195
struct osmo_stat_item_group * statg
Definition: gprs_ns.h:144
@ NS_IE_IPv6_LIST
Definition: gsm_08_16.h:73
@ BSSGP_CAUSE_T14_EXPIRY
Definition: gsm_08_18.h:307
uint8_t prot_ver
Definition: gprs_bssgp_rim.h:192
@ GPRS_NS_LL_UDP
NS/UDP/IP.
Definition: gprs_ns.h:54
void install_lib_element(int ntype, struct cmd_element *cmd)
size_t err_app_cont_len
Definition: gprs_bssgp_rim.h:121
int gprs_ns2_recv_prim(struct gprs_ns2_inst *nsi, struct osmo_prim_hdr *oph)
Receive a primitive from the NS User (Gb).
Definition: gprs_ns2.c:486
int ns2_tx_unit_data(struct gprs_ns2_vc *nsvc, uint16_t bvci, uint8_t sducontrol, struct msgb *msg)
Transmit NS-UNITDATA on a given NS-VC.
Definition: gprs_ns2_message.c:404
uint32_t nsvc_rate_ctr_idx
workaround for rate counter until rate counter accepts char str as index
Definition: gprs_ns2_internal.h:164
bool first
true if this NSE wasn't yet alive at all.
Definition: gprs_ns2_internal.h:193
@ BSSGP_CAUSE_T12_EXPIRY
Definition: gsm_08_18.h:295
struct llist_head list
list entry in nsi
Definition: gprs_ns2_internal.h:283
#define TVLV_HDR_LEN
Definition: gprs_bssgp_rim.c:39
@ BSSGP_IE_CELL_ID
Definition: gsm_08_18.h:126
Section 10.3.2d List of IP6 Elements.
Definition: gsm_08_16.h:32
int osmo_tlv_prot_parse(const struct osmo_tlv_prot_def *pdef, struct tlv_parsed *dec, unsigned int dec_multiples, uint8_t msg_type, const uint8_t *buf, unsigned int buf_len, uint8_t lv_tag, uint8_t lv_tag2, int log_subsys, const char *log_pfx)
void * bssgp_ns_send_data
Definition: gprs_bssgp.c:51
bssgp_bvc_send bssgp_ns_send
Definition: gprs_bssgp.c:50
@ NS_CTR_BYTES_OUT
Definition: gprs_ns.c:132
@ BSSGP_IE_MBMS_SESSION_REP_NR
Definition: gsm_08_18.h:214
struct osmo_timer_list timer
Definition: gprs_ns2_fr.c:108
void ns2_sns_dump_vty(struct vty *vty, const char *prefix, const struct gprs_ns2_nse *nse, bool stats)
Dump the IP-SNS state to a vty.
Definition: gprs_ns2_sns.c:2399
#define UL
Definition: gprs_bssgp_util.c:256
static void add_bind_array(struct gprs_ns2_vc_bind **array, struct gprs_ns2_vc_bind *bind, int size)
Definition: gprs_ns2.c:1561
write Write running configuration to or terminal n Write configuration to the file(same as write file)\n") ALIAS(config_write_file
@ NS_CAUSE_UNKN_IP_EP
Definition: gsm_08_16.h:100
uint32_t sum_sig_weight
sum of all the signalling weight of alive NS-VCs
Definition: gprs_ns2_internal.h:210
static void free_bind(struct gprs_ns2_vc_bind *bind)
clean up all private driver state.
Definition: gprs_ns2_frgre.c:135
@ BSSGP_IE_TGT_TO_SRC_TR_CONT
Definition: gsm_08_18.h:207
#define BSSGP_RIM_PSI_LEN
Definition: gprs_bssgp_rim.h:84
int bssgp_tx_bvc_reset(struct bssgp_bvc_ctx *bctx, uint16_t bvci, uint8_t cause)
Definition: gprs_bssgp_bss.c:300
#define BSSGP_RIM_ROUTING_INFO_MAXLEN
Definition: gprs_bssgp_rim.h:67
@ NS_CTR_LOST_RESET
Definition: gprs_ns.c:140
uint8_t * msgb_data(const struct msgb *msg)
@ BSSGP_CAUSE_SGSN_CONG
Definition: gsm_08_18.h:274
bssgp_pdu_type
BSSGP PDU types (Section 11.3.26 / Table 11.27)
Definition: gsm_08_18.h:17
#define LOGBIND(bind, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:15
#define log_tgt_mutex_unlock()
static const uint8_t rinfo_aerr_ies[]
Definition: gprs_bssgp_util.c:253
struct osmo_stat_item_group * osmo_stat_item_group_alloc(void *ctx, const struct osmo_stat_item_group_desc *group_desc, unsigned int idx)
int gsm0808_decode_cell_id_u(union gsm0808_cell_id_u *out, enum CELL_IDENT discr, const uint8_t *buf, unsigned int len)
@ BSSGP_IE_TMGI
Definition: gsm_08_18.h:192
@ BSSGP_PDUT_UL_MMBS_UNITDATA
Definition: gsm_08_18.h:25
struct llist_head nsvc
list of all VC
Definition: gprs_ns2_internal.h:285
uint8_t data_weight
data weight.
Definition: gprs_ns2_internal.h:255
void gprs_nsvc_start_test(struct gprs_nsvc *nsvc)
Start the ALIVE timer procedure in all NS-VCs part of this NS Instance.
Definition: gprs_ns.c:2231
bool if_running
Definition: gprs_ns2_fr.c:98
@ BSSGP_IE_EDRX_PARAMETERS
Definition: gsm_08_18.h:246
@ BSSGP_IE_IMSI
Definition: gsm_08_18.h:131
static const uint8_t ra_cap_upd_ack_ies[]
Definition: gprs_bssgp_util.c:189
unsigned int remote_end_is_sgsn
Definition: gprs_ns.h:139
int ns2_tx_sns_change_weight(struct gprs_ns2_vc *nsvc, uint8_t trans_id, const struct gprs_ns_ie_ip4_elem *ip4_elems, unsigned int num_ip4_elems, const struct gprs_ns_ie_ip6_elem *ip6_elems, unsigned int num_ip6_elems)
Encode + Transmit a SNS-CHANGE-WEIGHT as per Section 9.3.3.
Definition: gprs_ns2_message.c:582
static const uint8_t fc_ms_ies[]
Definition: gprs_bssgp_util.c:209
static const uint8_t ps_ho_request_nack_ies[]
Definition: gprs_bssgp_util.c:244
Definition: gprs_ns.h:245
#define LOGP(ss, level, fmt, args...)
static const char * gprs_ns2_aff_cause_prim_str(enum gprs_ns2_affecting_cause val)
Obtain a human-readable string for NS affecting cause in primitives.
Definition: gprs_ns2.h:93
@ BSSGP_IE_QOS_PROFILE
Definition: gsm_08_18.h:142
@ NS_CAUSE_UNKN_IP_TEST_FAILED
Definition: gsm_08_16.h:102
@ SNS_PDUT_CONFIG_ACK
Definition: gsm_08_16.h:58
@ BSSGP_IE_SOURCE_CELL_ID
Definition: gsm_08_18.h:244
#define BSSGP_PDUT_RA_CAPA_UDPATE
Definition: gsm_08_18.h:14
#define msgb_bvci(__x)
Definition: gprs_msgb.h:24
struct msgb * msgb_alloc(uint16_t size, const char *name)
static int llist_empty(const struct llist_head *head)
@ BSSGP_IE_R_DEFAULT_MS
Definition: gsm_08_18.h:146
static int backlog_enqueue_or_free(struct gprs_ns2_vc_bind *bind, struct msgb *msg)
Definition: gprs_ns2_fr.c:360
uint32_t tlli
Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx'.
Definition: gprs_msgb.h:19
static const uint8_t suspend_ack_ies[]
Definition: gprs_bssgp_util.c:192
@ BSSGP_IE_PACKET_FLOW_ID
Definition: gsm_08_18.h:158
#define ERR_IF_NSVC_USES_SNS(nsvc, reason)
Definition: gprs_ns.c:99
static const uint8_t del_bss_pfc_ack_ies[]
Definition: gprs_bssgp_util.c:231
static const char * gprs_ns2_lltype_str(enum gprs_ns2_ll val)
Obtain a human-readable string for NS link-layer type.
Definition: gprs_ns2.h:66
union osmo_bssgp_prim::@0 u
struct gprs_ns2_vc * gprs_ns2_nsvc_by_sockaddr_bind(struct gprs_ns2_vc_bind *bind, const struct osmo_sockaddr *saddr)
Find a NS-VC by its remote socket address.
Definition: gprs_ns2_udp.c:123
@ BSSGP_IE_REQ4IRAT_HO_INFO
Definition: gsm_08_18.h:230
static int open_socket(int ifindex, const struct gprs_ns2_vc_bind *nsbind)
Definition: gprs_ns2_fr.c:489
struct timeval timer_started
Definition: gprs_ns.h:136
@ NS_CAUSE_NSVC_UNKNOWN
Definition: gsm_08_16.h:88
@ NS_CAUSE_SEM_INCORR_PDU
Definition: gsm_08_16.h:90
static const uint8_t d_pag_ps_resp_ies[]
Definition: gprs_bssgp_util.c:198
@ BSSGP_RAN_INF_APP_ID_SON
Definition: gprs_bssgp_rim.h:132
@ BSSGP_IE_MME_QUERY
Definition: gsm_08_18.h:254
@ BSSGP_IE_ATTACH_IND
Definition: gsm_08_18.h:252
int ns2_vc_is_unblocked(struct gprs_ns2_vc *nsvc)
is the given NS-VC unblocked?
Definition: gprs_ns2_vc_fsm.c:985
struct gprs_nsvc * unknown_nsvc
a NSVC object that's needed to deal with packets for unknown NSVC
Definition: gprs_ns.h:88
#define NS_TIMERS_COUNT
Definition: gprs_ns2_internal.h:63
struct osmo_stat_item * osmo_stat_item_group_get_item(struct osmo_stat_item_group *grp, unsigned int idx)
static void fr_dlci_status_cb(struct osmo_fr_dlc *dlc, void *cb_data, bool active)
Definition: gprs_ns2_fr.c:180
#define BSSGP_STR
Definition: gprs_bssgp_vty.c:134
@ BSSGP_IE_NUM_OCT_AFF
Definition: gsm_08_18.h:155
@ NS_CTR_NSEI_CHG
Definition: gprs_ns.c:136
@ BSSGP_IE_BSS_AREA_ID
Definition: gsm_08_18.h:120
@ BSSGP_PDUT_RESUME_NACK
Definition: gsm_08_18.h:37
void * cb_data
Definition: frame_relay.h:130
gprs_ns2_vc_mode
Definition: gprs_ns2.h:25
BSSGP normal header.
Definition: gsm_08_18.h:111
uint16_t dlci
Definition: gprs_ns2_frgre.c:113
@ BSSGP_IE_RI_ERROR_RIM_COINTAINER
Definition: gsm_08_18.h:191
int gprs_ns2_fr_bind(struct gprs_ns2_inst *nsi, const char *name, const char *netif, struct osmo_fr_network *fr_network, enum osmo_fr_role fr_role, struct gprs_ns2_vc_bind **result)
Create a new bind for NS over FR.
Definition: gprs_ns2_fr.c:797
unsigned char * llch
Definition: gprs_msgb.h:9
struct osmo_fd ofd
Definition: gprs_ns2_fr.c:102
struct osmo_fr_link * osmo_fr_link_alloc(struct osmo_fr_network *net, enum osmo_fr_role role, const char *name)
Definition: frame_relay.c:927
uint32_t state
uniquely identifies NS-VC at SGSN
Definition: gprs_ns.h:131
@ NS2_SNS_EV_REQ_CHANGE_WEIGHT
a bind changed its weight
Definition: gprs_ns2_internal.h:347
struct bssgp_rim_routing_info::@5::@7 geran
@ BSSGP_IE_MBMS_RA_LIST
Definition: gsm_08_18.h:197
@ BSSGP_IE_EXCEPTION_REPORT_FLAG
Definition: gsm_08_18.h:250
int ns2_tx_sns_size(struct gprs_ns2_vc *nsvc, bool reset_flag, uint16_t max_nr_nsvc, int ip4_ep_nr, int ip6_ep_nr)
Encode + transmit a SNS-SIZE as per Section 9.3.7.
Definition: gprs_ns2_message.c:783
void ns2_nse_notify_alive(struct gprs_ns2_vc *nsvc, bool alive)
ns2_sns_event
Definition: gprs_ns2_internal.h:331
struct osmo_fsm_inst * ns2_sns_sgsn_fsm_alloc(struct gprs_ns2_nse *nse, const char *id)
Allocate an IP-SNS FSM for the SGSN side.
Definition: gprs_ns2_sns.c:3072
@ BSSGP_IE_TAC
Definition: gsm_08_18.h:234
osmo_prim_cb cb
callback to the user for incoming UNIT DATA IND
Definition: gprs_ns2_internal.h:150
uint32_t local_ip
Definition: gprs_ns.h:95
#define MSG_DEF(name, mand_ies, flags)
@ BSSGP_IE_AGG_BSS_QOS_PROFILE
Definition: gsm_08_18.h:160
uint32_t seq_num
Definition: gprs_bssgp_rim.c:406
uint8_t sig_weight
signalling weight.
Definition: gprs_ns.h:160
int gprs_ns_tx_reset(struct gprs_nsvc *nsvc, uint8_t cause)
Transmit a NS-RESET on a given NSVC.
Definition: gprs_ns.c:538
@ NS_CAUSE_NSVC_BLOCKED
Definition: gsm_08_16.h:87
@ BSSGP_PDUT_MBMS_STOP_REQ
Definition: gsm_08_18.h:96
@ BSSGP_IE_BVCI
Definition: gsm_08_18.h:122
void ns2_nse_data_sum(struct gprs_ns2_nse *nse)
Definition: gprs_ns2.c:1371
@ SNS_PDUT_DELETE
Definition: gsm_08_16.h:59
struct gprs_ns2_vc * gprs_ns2_ip_connect2(struct gprs_ns2_vc_bind *bind, const struct osmo_sockaddr *remote, uint16_t nsei, uint16_t nsvci, enum gprs_ns2_dialect dialect)
Create, connect and activate a new IP-based NS-VC.
Definition: gprs_ns2.c:1224
enum nsvc_timer_mode timer_mode
Definition: gprs_ns.h:135
@ NS2_CS_SKIPPED
Skipped message.
Definition: gprs_ns2_internal.h:117
@ BSSGP_CAUSE_T13_EXPIRY
Definition: gsm_08_18.h:306
@ BSSGP_PDUT_PS_HO_REQUIRED_NACK
Definition: gsm_08_18.h:74
@ BSSGP_CAUSE_RELOC_FAIL
Definition: gsm_08_18.h:311
@ NS2_SNS_EV_RX_SIZE
Definition: gprs_ns2_internal.h:333
@ BSSGP_IE_PLMN_ID
Definition: gsm_08_18.h:253
Definition: gprs_ns2_fr.c:94
bool nsvci_is_valid
Definition: gprs_ns2_internal.h:260
static int gprs_ns_tx(struct gprs_nsvc *nsvc, struct msgb *msg)
Definition: gprs_ns.c:471
@ BSSGP_IE_LCS_PRIORITY
Definition: gsm_08_18.h:173
@ NS2_SNS_EV_REQ_DELETE_BIND
remove a local bind from this NSE
Definition: gprs_ns2_internal.h:346
bool persistent
true if this NS was created by VTY or pcu socket)
Definition: gprs_ns2_internal.h:243
static int frgre_vc_sendmsg(struct gprs_ns2_vc *nsvc, struct msgb *msg)
Definition: gprs_ns2_frgre.c:497
struct msgb * msgb_dequeue(struct llist_head *queue)
int gprs_ns_tx_sns_config_ack(struct gprs_nsvc *nsvc, uint8_t *cause)
Encode + Transmit a SNS-CONFIG-ACK as per Section 9.3.5.
Definition: gprs_ns.c:961
@ BSSGP_CAUSE_MISSING_MAND_IE
Definition: gsm_08_18.h:282
uint16_t gprs_ns2_nse_nsei(struct gprs_ns2_nse *nse)
Return the NSEI.
Definition: gprs_ns2.c:896
@ BSSGP_PDUT_MODIFY_BSS_PFC
Definition: gsm_08_18.h:67
@ BSSGP_CAUSE_REQ_INFO_NOT_AVAIL
Definition: gsm_08_18.h:289
int gprs_ns_frgre_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg)
Definition: gprs_ns_frgre.c:282
@ NS_PDUT_UNBLOCK_ACK
Definition: gsm_08_16.h:49
Definition: gprs_bssgp_rim.h:87
@ BSSGP_PDUT_RADIO_STATUS
Definition: gsm_08_18.h:31
int ns2_tx_reset_ack(struct gprs_ns2_vc *nsvc)
Transmit a NS-RESET-ACK on a given NS-VC.
Definition: gprs_ns2_message.c:318
int(* rx_cb)(void *cb_data, struct msgb *msg)
Definition: frame_relay.h:127
struct msgb * bssgp_encode_rim_pdu(const struct bssgp_ran_information_pdu *pdu)
Encode a given rim-pdu struct into a message buffer.
Definition: gprs_bssgp_rim.c:1062
static const uint8_t ul_ud_ies[]
Definition: gprs_bssgp_util.c:182
int gprs_ns2_is_ip_bind(struct gprs_ns2_vc_bind *bind)
Is the given bind an IP bind?
Definition: gprs_ns2_udp.c:504
@ NS_CTR_PKTS_OUT
Definition: gprs_ns.c:130
static int devname2ifindex(const char *ifname)
Definition: gprs_ns2_fr.c:468
struct osmo_fsm_inst * ns2_sns_bss_fsm_alloc(struct gprs_ns2_nse *nse, const char *id)
Allocate an IP-SNS FSM for the BSS side.
Definition: gprs_ns2_sns.c:2275
#define msgb_bssgph(__x)
Definition: gprs_msgb.h:26
struct gprs_ns2_inst * gprs_ns2_instantiate(void *ctx, osmo_prim_cb cb, void *cb_data)
Create a new GPRS NS instance.
Definition: gprs_ns2.c:1429
bool sns_only
should this NS-VC only be used for SNS-SIZE and SNS-CONFIG?
Definition: gprs_ns2_internal.h:262
static const struct value_string bssgp_cause_strings[]
Definition: gprs_bssgp_util.c:43
uint16_t bvci
Definition: gprs_bssgp.h:115
struct osmo_sockaddr addr
Definition: gprs_ns2_frgre.c:112
struct osmo_fd fd
Definition: gprs_ns2_frgre.c:111
@ BSSGP_IE_RI_ACK_RIM_CONTAINER
Definition: gsm_08_18.h:190
const struct osmo_sockaddr * gprs_ns2_ip_bind_sockaddr(struct gprs_ns2_vc_bind *bind)
Return the locally bound socket address of the bind.
Definition: gprs_ns2_udp.c:494
Definition: frame_relay.h:108
@ NS2_SNS_EV_RX_CONFIG_ACK
Definition: gprs_ns2_internal.h:337
@ GPRS_NS2_AFF_CAUSE_SNS_FAILURE
Definition: gprs_ns2.h:85
struct gprs_ns2_vc_bind * bind
pointer to NS VL bind.
Definition: gprs_ns2_internal.h:240
@ BSSGP_PDUT_DELETE_BSS_PFC_ACK
Definition: gsm_08_18.h:70
uint16_t nsei
Definition: gprs_bssgp.h:68
@ NS_IE_IPv6_EP_NR
Definition: gsm_08_16.h:76
static const uint8_t fc_bvc_ack_ies[]
Definition: gprs_bssgp_util.c:208
@ SNS_PDUT_SIZE_ACK
Definition: gsm_08_16.h:61
struct gprs_ns2_nse * gprs_ns2_nse_by_nsei(struct gprs_ns2_inst *nsi, uint16_t nsei)
Resolve a NS Entity based on its NSEI.
Definition: gprs_ns2.c:770
void ns2_sns_replace_nsvc(struct gprs_ns2_vc *nsvc)
called when a nsvc is beeing freed or the nsvc became dead
Definition: gprs_ns2_sns.c:297
const struct value_string gprs_ns2_prim_strs[]
Definition: gprs_ns2.c:233
int ns2_vc_fsm_start(struct gprs_ns2_vc *nsvc)
Start a NS-VC FSM.
Definition: gprs_ns2_vc_fsm.c:815
uint16_t nsei
Definition: gprs_ns.h:128
struct osmo_cell_global_id_ps reprt_cell
Definition: gprs_bssgp_rim.h:76
enum gprs_ns2_vc_mode mode
Definition: gprs_ns2_internal.h:267
@ BSSGP_IE_PDU_LIFETIME
Definition: gsm_08_18.h:140
@ BSSGP_CAUSE_BETTER_CELL
Definition: gsm_08_18.h:302
int bssgp_enc_ran_inf_ack_rim_cont(uint8_t *buf, size_t len, const struct bssgp_ran_inf_ack_rim_cont *cont)
Encode a RAN Information ACK RIM Container (3GPP TS 48.018, table 11.3.62a.3.b).
Definition: gprs_bssgp_rim.c:771
#define LOGPC(ss, level, fmt, args...)
ns_ctr
Definition: gprs_ns.c:128
struct osmo_fsm_inst * gprs_sns_bss_fsm_alloc(void *ctx, struct gprs_nsvc *nsvc, const char *id)
Definition: gprs_ns_sns.c:630
int(* tx_cb)(void *data, struct msgb *msg)
Definition: frame_relay.h:101
int ns2_recv_vc(struct gprs_ns2_vc *nsvc, struct msgb *msg)
Bottom-side entry-point for received NS PDU from the driver/bind.
Definition: gprs_ns2.c:1290
@ BSSGP_RIM_ROUTING_INFO_EUTRAN
Definition: gprs_bssgp_rim.h:35
@ BSSGP_CAUSE_INVAL_CONT_UI
Definition: gsm_08_18.h:292
@ BSSGP_IE_MBMS_SESSION_ID
Definition: gsm_08_18.h:193
@ BSSGP_CAUSE_PDU_INCOMP_STATE
Definition: gsm_08_18.h:286
static const uint8_t ps_ho_request_ack_ies[]
Definition: gprs_bssgp_util.c:242
BSSGP RIM Routing information, see also 3GPP TS 48.018, section 11.3.70.
Definition: gprs_bssgp_rim.h:45
int DNS
Definition: common_vty.c:66
static uint8_t * tvlv_put(uint8_t *buf, uint8_t tag, uint16_t len, const uint8_t *val)
const struct osmo_sockaddr * gprs_ns2_ip_vc_remote(const struct gprs_ns2_vc *nsvc)
Return the socket address of the remote peer of a NS-VC.
Definition: gprs_ns2_udp.c:446
@ BSSGP_PDUT_DELETE_BSS_PFC_REQ
Definition: gsm_08_18.h:71
@ GPRS_NS_LL_FR_GRE
NS/FR/GRE/IP.
Definition: gprs_ns.h:56
@ BSSGP_IE_TAG
Definition: gsm_08_18.h:148
void(* free_vc)(struct gprs_ns2_vc *nsvc)
free the vc priv data
Definition: gprs_ns2_internal.h:308
Definition: gprs_bssgp_rim.h:116
static const uint8_t ul_mb_ud_ies[]
Definition: gprs_bssgp_util.c:185
struct llist_head binding
linked lists of all NSVC binds (e.g.
Definition: gprs_ns2_internal.h:156
@ GPRS_NS2_DIALECT_UNDEF
Definition: gprs_ns2.h:36
struct osmo_mnl * linkmon_mnl
libmnl netlink socket for link state monitoring
Definition: gprs_ns2_internal.h:168
uint8_t cause
Definition: gprs_ns.h:248
@ BSSGP_CAUSE_PFC_PREEMPTED
Definition: gsm_08_18.h:278
@ BSSGP_CAUSE_EQUIP_FAIL
Definition: gsm_08_18.h:268
@ NS_STAT_ALIVE_DELAY
Definition: gprs_ns.c:167
int ns2_tx_reset(struct gprs_ns2_vc *nsvc, uint8_t cause)
Transmit a NS-RESET on a given NS-VC.
Definition: gprs_ns2_message.c:287
@ BSSGP_PDUT_POSITION_COMMAND
Definition: gsm_08_18.h:85
vty_out(vty, "!%s", VTY_NEWLINE)
const char * osmo_sock_get_name2(int fd)
const struct osmo_fd * fd
uint16_t nsei
Definition: gprs_ns2_internal.h:174
@ BSSGP_CAUSE_MS_RADIO_LOSS
Definition: gsm_08_18.h:304
@ NS_CAUSE_PDU_INCOMP_PSTATE
Definition: gsm_08_16.h:91
@ NS_IE_IPv4_LIST
Definition: gsm_08_16.h:72
@ S_SNS_CONFIGURED
Definition: gprs_ns.h:239
struct gprs_nsvc * gprs_nsvc_by_nsvci(struct gprs_ns_inst *nsi, uint16_t nsvci)
Lookup struct gprs_nsvc based on NSVCI.
Definition: gprs_ns.c:239
uint32_t seq_num
Definition: gprs_bssgp_rim.h:191
static uint8_t * msgb_tv_put(struct msgb *msg, uint8_t tag, uint8_t val)
#define ns_set_state(ns_, st_)
Definition: gprs_ns.c:92
void gprs_ns_close(struct gprs_ns_inst *nsi)
Definition: gprs_ns.c:1924
static const uint8_t dl_ud_ies[]
Definition: gprs_bssgp_util.c:181
void ns2_sns_notify_alive(struct gprs_ns2_nse *nse, struct gprs_ns2_vc *nsvc, bool alive)
Definition: gprs_ns2_sns.c:2587
#define GRE_PTYPE_IPv4
Definition: gprs_ns2_frgre.c:51
@ SNS_PDUT_SIZE
Definition: gsm_08_16.h:60
uint8_t cause
Definition: gprs_bssgp_rim.h:206
@ BSSGP_CAUSE_DISTANCE
Definition: gsm_08_18.h:301
@ BSSGP_PDUT_PAGING_PS_REJECT
Definition: gsm_08_18.h:38
enum bssgp_ran_inf_app_id app_id
Definition: gprs_bssgp_rim.h:190
CELL_IDENT_WHOLE_GLOBAL_PS
int osmo_fr_rx(struct msgb *msg)
Definition: frame_relay.c:769
uint16_t timeout[NS_TIMERS_COUNT]
Definition: gprs_ns2_internal.h:161
const uint8_t * err_app_cont
Definition: gprs_bssgp_rim.h:120
@ BSSGP_IE_FEATURE_BITMAP
Definition: gsm_08_18.h:161
@ NS_CAUSE_INVAL_ESSENT_IE
Definition: gsm_08_16.h:93
struct osmo_fd fd
Definition: gprs_ns.h:94
@ NS_STAT_ALIVE_DELAY
Definition: gprs_ns2_internal.h:105
int gprs_ns2_frgre_bind(struct gprs_ns2_inst *nsi, const char *name, const struct osmo_sockaddr *local, int dscp, struct gprs_ns2_vc_bind **result)
Create a new bind for NS over FR-GRE.
Definition: gprs_ns2_frgre.c:544
static const uint8_t d_pag_ps_rej_ies[]
Definition: gprs_bssgp_util.c:199
uint8_t ie_type
Definition: gprs_ns.h:250
const char * bssgp_pdu_str(enum bssgp_pdu_type pdu)
Definition: gprs_bssgp_util.c:489
enum bssgp_ran_inf_app_id app_id
Definition: gprs_bssgp_rim.h:205
#define BVC_S_BLOCKED
Definition: gprs_bssgp.h:104
bool type_psi
Definition: gprs_bssgp_rim.h:89
struct gprs_ns2_vc * gprs_ns2_fr_nsvc_by_dlci(struct gprs_ns2_vc_bind *bind, uint16_t dlci)
Return the nsvc by dlci.
Definition: gprs_ns2_fr.c:1041
const struct value_string gprs_ns2_aff_cause_prim_strs[]
Definition: gprs_ns2.c:221
static int handle_nsfrgre_read(struct osmo_fd *bfd)
Definition: gprs_ns2_frgre.c:427
@ NS_CTR_INV_VCI
Definition: gprs_ns.c:137
static int fr_dlci_rx_cb(void *cb_data, struct msgb *msg)
Definition: gprs_ns2_fr.c:281
char * osmo_cgi_ps_name_buf(char *buf, size_t buf_len, const struct osmo_cell_global_id_ps *cgi_ps)
@ BSSGP_CAUSE_UNKNOWN_MS
Definition: gsm_08_18.h:271
@ BSSGP_IE_GLOBAL_TFI
Definition: gsm_08_18.h:211
@ NS_TOUT_TNS_ALIVE
Definition: gprs_ns2_internal.h:88