libosmogb
1.9.2
Osmocom Gb library
|
#include <stdint.h>
Go to the source code of this file.
|
enum | bssp_ptp_bvc_fsm_state {
BSSGP_BVCFSM_S_NULL,
BSSGP_BVCFSM_S_BLOCKED,
BSSGP_BVCFSM_S_WAIT_RESET_ACK,
BSSGP_BVCFSM_S_UNBLOCKED
} |
|
enum | bssgp_ptp_bvc_fsm_event {
BSSGP_BVCFSM_E_RX_BLOCK,
BSSGP_BVCFSM_E_RX_BLOCK_ACK,
BSSGP_BVCFSM_E_RX_UNBLOCK,
BSSGP_BVCFSM_E_RX_UNBLOCK_ACK,
BSSGP_BVCFSM_E_RX_RESET,
BSSGP_BVCFSM_E_RX_RESET_ACK,
BSSGP_BVCFSM_E_RX_FC_BVC,
BSSGP_BVCFSM_E_RX_FC_BVC_ACK,
BSSGP_BVCFSM_E_REQ_BLOCK,
BSSGP_BVCFSM_E_REQ_UNBLOCK,
BSSGP_BVCFSM_E_REQ_RESET,
BSSGP_BVCFSM_E_REQ_FC_BVC
} |
|
|
struct osmo_fsm_inst * | bssgp_bvc_fsm_alloc_sig_bss (void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint32_t features) |
| Allocate a SIGNALING-BVC FSM for the BSS role (facing a remote SGSN). More...
|
|
struct osmo_fsm_inst * | bssgp_bvc_fsm_alloc_ptp_bss (void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint16_t bvci, const struct gprs_ra_id *ra_id, uint16_t cell_id) |
| Allocate a PTP-BVC FSM for the BSS role (facing a remote SGSN). More...
|
|
struct osmo_fsm_inst * | bssgp_bvc_fsm_alloc_sig_sgsn (void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint32_t features) |
| Allocate a SIGNALING-BVC FSM for the SGSN role (facing a remote BSS). More...
|
|
struct osmo_fsm_inst * | bssgp_bvc_fsm_alloc_ptp_sgsn (void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint16_t bvci) |
| Allocate a PTP-BVC FSM for the SGSN role (facing a remote BSS). More...
|
|
void | bssgp_bvc_fsm_set_ops (struct osmo_fsm_inst *fi, const struct bssgp_bvc_fsm_ops *ops, void *ops_priv) |
| Set the 'operations' callbacks + private data. More...
|
|
bool | bssgp_bvc_fsm_is_unblocked (struct osmo_fsm_inst *fi) |
| Return if the given BVC FSM is in UNBLOCKED state. More...
|
|
uint8_t | bssgp_bvc_fsm_get_block_cause (struct osmo_fsm_inst *fi) |
| Determine the cause value why given BVC FSM is blocked. More...
|
|
uint32_t | bssgp_bvc_fsm_get_features_advertised (struct osmo_fsm_inst *fi) |
| Return the advertised features / extended features. More...
|
|
uint32_t | bssgp_bvc_fsm_get_features_received (struct osmo_fsm_inst *fi) |
| Return the received features / extended features. More...
|
|
uint32_t | bssgp_bvc_fsm_get_features_negotiated (struct osmo_fsm_inst *fi) |
| Return the negotiated features / extended features. More...
|
|
void | bssgp_bvc_fsm_set_max_pdu_len (struct osmo_fsm_inst *fi, uint16_t max_pdu_len) |
| Set the maximum size of a BSSGP PDU. More...
|
|
uint16_t | bssgp_bvc_fsm_get_max_pdu_len (const struct osmo_fsm_inst *fi) |
| Return the maximum size of a BSSGP PDU ! On the NS layer this corresponds to the size of an NS SDU in NS-UNITDATA (3GPP TS 48.016 Ch. More...
|
|
◆ bssgp_ptp_bvc_fsm_event
Enumerator |
---|
BSSGP_BVCFSM_E_RX_BLOCK | |
BSSGP_BVCFSM_E_RX_BLOCK_ACK | |
BSSGP_BVCFSM_E_RX_UNBLOCK | |
BSSGP_BVCFSM_E_RX_UNBLOCK_ACK | |
BSSGP_BVCFSM_E_RX_RESET | |
BSSGP_BVCFSM_E_RX_RESET_ACK | |
BSSGP_BVCFSM_E_RX_FC_BVC | |
BSSGP_BVCFSM_E_RX_FC_BVC_ACK | |
BSSGP_BVCFSM_E_REQ_BLOCK | |
BSSGP_BVCFSM_E_REQ_UNBLOCK | |
BSSGP_BVCFSM_E_REQ_RESET | |
BSSGP_BVCFSM_E_REQ_FC_BVC | |
◆ bssp_ptp_bvc_fsm_state
Enumerator |
---|
BSSGP_BVCFSM_S_NULL | |
BSSGP_BVCFSM_S_BLOCKED | |
BSSGP_BVCFSM_S_WAIT_RESET_ACK | |
BSSGP_BVCFSM_S_UNBLOCKED | |
◆ bssgp_bvc_fsm_alloc_ptp_bss()
Allocate a PTP-BVC FSM for the BSS role (facing a remote SGSN).
- Parameters
-
[in] | ctx | talloc context from which to allocate |
[in] | nsi | NS Instance on which this BVC operates |
[in] | nsei | NS Entity Identifier on which this BVC operates |
[in] | bvci | BVCI of this FSM |
[in] | ra_id | Routing Area Identity of the cell (reported to SGSN) |
[in] | cell_id | Cell Identifier of the cell (reported to SGSN) |
- Returns
- newly-allocated FSM Instance; NULL in case of error
References _bvc_fsm_alloc(), bvci, bvc_fsm_priv::cell_id, nsei, bvc_fsm_priv::nsi, OSMO_ASSERT, osmo_fsm_inst::priv, and bvc_fsm_priv::ra_id.
◆ bssgp_bvc_fsm_alloc_ptp_sgsn()
Allocate a PTP-BVC FSM for the SGSN role (facing a remote BSS).
- Parameters
-
[in] | ctx | talloc context from which to allocate |
[in] | nsi | NS Instance on which this BVC operates |
[in] | nsei | NS Entity Identifier on which this BVC operates |
[in] | bvci | BVCI of this FSM |
- Returns
- newly-allocated FSM Instance; NULL in case of error
References _bvc_fsm_alloc(), bvci, nsei, and OSMO_ASSERT.
◆ bssgp_bvc_fsm_alloc_sig_bss()
Allocate a SIGNALING-BVC FSM for the BSS role (facing a remote SGSN).
- Parameters
-
[in] | ctx | talloc context from which to allocate |
[in] | nsi | NS Instance on which this BVC operates |
[in] | nsei | NS Entity Identifier on which this BVC operates |
[in] | features | Feature [byte 0] and Extended Feature [byte 1] bitmap |
- Returns
- newly-allocated FSM Instance; NULL in case of error
References _bvc_fsm_alloc(), bvc_fsm_priv::advertised, bvc_fsm_priv::features, nsei, and osmo_fsm_inst::priv.
◆ bssgp_bvc_fsm_alloc_sig_sgsn()
Allocate a SIGNALING-BVC FSM for the SGSN role (facing a remote BSS).
- Parameters
-
[in] | ctx | talloc context from which to allocate |
[in] | nsi | NS Instance on which this BVC operates |
[in] | nsei | NS Entity Identifier on which this BVC operates |
[in] | features | Feature [byte 0] and Extended Feature [byte 1] bitmap |
- Returns
- newly-allocated FSM Instance; NULL in case of error
References _bvc_fsm_alloc(), bvc_fsm_priv::advertised, bvc_fsm_priv::features, nsei, and osmo_fsm_inst::priv.
◆ bssgp_bvc_fsm_get_block_cause()
uint8_t bssgp_bvc_fsm_get_block_cause |
( |
struct osmo_fsm_inst * |
fi | ) |
|
◆ bssgp_bvc_fsm_get_features_advertised()
uint32_t bssgp_bvc_fsm_get_features_advertised |
( |
struct osmo_fsm_inst * |
fi | ) |
|
◆ bssgp_bvc_fsm_get_features_negotiated()
uint32_t bssgp_bvc_fsm_get_features_negotiated |
( |
struct osmo_fsm_inst * |
fi | ) |
|
◆ bssgp_bvc_fsm_get_features_received()
uint32_t bssgp_bvc_fsm_get_features_received |
( |
struct osmo_fsm_inst * |
fi | ) |
|
◆ bssgp_bvc_fsm_get_max_pdu_len()
uint16_t bssgp_bvc_fsm_get_max_pdu_len |
( |
const struct osmo_fsm_inst * |
fi | ) |
|
◆ bssgp_bvc_fsm_is_unblocked()
◆ bssgp_bvc_fsm_set_max_pdu_len()
void bssgp_bvc_fsm_set_max_pdu_len |
( |
struct osmo_fsm_inst * |
fi, |
|
|
uint16_t |
max_pdu_len |
|
) |
| |
◆ bssgp_bvc_fsm_set_ops()
#define NS_DESC_A(st)
Definition: gprs_ns.h:49
static int ns2_sns_copy_local_endpoints(struct ns2_sns_state *gss)
Definition: gprs_ns2_sns.c:854
uint8_t data_weight
Definition: gsm_08_16.h:5
@ GPRS_NS2_EV_REQ_OM_BLOCK
Definition: gprs_ns2_vc_fsm.c:117
int ns2_vc_unblock(struct gprs_ns2_vc *nsvc)
Unblock a NS-VC.
Definition: gprs_ns2_vc_fsm.c:844
uint8_t sig_weight
Definition: gsm_08_16.h:4
static struct osmo_fsm ns2_vc_fsm
Definition: gprs_ns2_vc_fsm.c:761
static void ns2_sns_st_configured_add(struct osmo_fsm_inst *fi, struct ns2_sns_state *gss, struct tlv_parsed *tp)
Definition: gprs_ns2_sns.c:1201
struct gprs_ns2_vc_priv::@26 alive
Definition: gprs_ns2_vc_fsm.c:52
struct gprs_ns2_vc_bind * gprs_ns2_ip_bind_by_sockaddr(struct gprs_ns2_inst *nsi, const struct osmo_sockaddr *sockaddr)
Find NS bind for a given socket address.
Definition: gprs_ns2_udp.c:250
struct llist_head links
Definition: frame_relay.h:55
static int config_write_ns_bind(struct vty *vty)
Definition: gprs_ns2_vty.c:575
@ NS2_SNS_EV_REQ_SELECT_ENDPOINT
Select a SNS endpoint from the list.
Definition: gprs_ns2_internal.h:337
enum ns2_timeout mode
Definition: gprs_ns2_vc_fsm.c:67
static const struct value_string gprs_ns_timer_strs[]
Definition: gprs_ns2_vty.c:94
@ FR_ROLE_USER_EQUIPMENT
Definition: frame_relay.h:39
@ NS_CAUSE_INVAL_WEIGH
Definition: gsm_08_16.h:99
int gprs_ns_tx_unblock(struct gprs_nsvc *nsvc)
Transmit a NS-UNBLOCK on a given NS-VC.
Definition: gprs_ns.c:691
struct ns2_sns_elems local
Definition: gprs_ns2_sns.c:169
static void _config_write_ns_nse(struct vty *vty, struct gprs_ns2_nse *nse)
Definition: gprs_ns2_vty.c:536
static int ip6_weight_sum(const struct ns2_sns_elems *elems, bool data_weight)
Definition: gprs_ns2_sns.c:233
@ SNS_PROC_ADD
Definition: gprs_ns2_sns.c:100
static struct sns_endpoint * ns2_get_sns_endpoint(struct ns2_sns_state *state, const struct osmo_sockaddr *saddr)
Definition: gprs_ns2_sns.c:2455
bool ip_sns_role_sgsn
are we implementing the SGSN role?
Definition: gprs_ns2_internal.h:218
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 nsip_vc_sendmsg(struct gprs_ns2_vc *nsvc, struct msgb *msg)
send the msg and free it afterwards.
Definition: gprs_ns2_udp.c:159
struct osmo_fsm_inst * bss_sns_fi
Definition: gprs_ns.h:110
@ NS2_SNS_EV_RX_DELETE
Definition: gprs_ns2_internal.h:344
@ GPRS_NS2_EV_RX_UNBLOCK_ACK
Definition: gprs_ns2_vc_fsm.c:106
static void ns2_sns_st_sgsn_unconfigured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:2768
struct rate_ctr_group * ctrg
Definition: gprs_ns2_internal.h:266
static uint16_t tlvp_val16be(const struct tlv_parsed *tp, int pos)
int gprs_ns2_sns_del_bind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:2675
static int remove_bind_elem(struct ns2_sns_state *gss, struct ns2_sns_elems *elems, struct ns2_sns_bind *sbind)
Definition: gprs_ns2_sns.c:603
#define LOGNSVC(nsvc, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:30
static void log_set_nsvc_filter(struct log_target *target, struct gprs_ns2_vc *nsvc)
Definition: gprs_ns2_vty.c:2191
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
void gprs_ns2_free_nse(struct gprs_ns2_nse *nse)
Destroy given NS Entity.
Definition: gprs_ns2.c:903
@ NS2_CS_CREATED
A NSVC object has been created.
Definition: gprs_ns2_internal.h:117
static void ns2_nsvc_create_ip4(struct osmo_fsm_inst *fi, struct gprs_ns2_nse *nse, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns2_sns.c:378
void osmo_iofd_free(struct osmo_io_fd *iofd)
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:352
@ GPRS_SNS_ST_CONFIGURED
Definition: gprs_ns_sns.c:275
struct ns2_sns_procedure * current_procedure
Definition: gprs_ns2_sns.c:184
Definition: gprs_ns2_sns.c:130
#define ip46_weight_sum_sig(elems)
Definition: gprs_ns2_sns.c:255
@ NS_IE_NSEI
Definition: gsm_08_16.h:70
static void handle_nsip_sendto(struct osmo_io_fd *iofd, int res, struct msgb *msg, const struct osmo_sockaddr *daddr)
Definition: gprs_ns2_udp.c:225
int ns2_tx_alive(struct gprs_ns2_vc *nsvc)
Transmit a NS-ALIVE on a given NS-VC.
Definition: gprs_ns2_message.c:365
int osmo_sockaddr_cmp(const struct osmo_sockaddr *a, const struct osmo_sockaddr *b)
struct osmo_io_fd * osmo_iofd_setup(const void *ctx, int fd, const char *name, enum osmo_io_fd_mode mode, const struct osmo_io_ops *ioops, void *data)
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:605
int osmo_sock_init_osa(uint16_t type, uint8_t proto, const struct osmo_sockaddr *local, const struct osmo_sockaddr *remote, unsigned int flags)
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:1537
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:423
Definition: gprs_ns2_vty.c:78
@ NS_IE_PDU
Definition: gsm_08_16.h:68
int gprs_ns2_vty_init(struct gprs_ns2_inst *nsi)
Definition: gprs_ns2_vty.c:2306
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
void * priv
can be used by the bind/driver of the virtual circuit.
Definition: gprs_ns2_internal.h:260
int _osmo_fsm_inst_dispatch(struct osmo_fsm_inst *fi, uint32_t event, void *data, const char *file, int line)
static void config_write_nsvc(struct vty *vty, const struct gprs_ns2_vc *nsvc)
Definition: gprs_ns2_vty.c:485
struct timespec ts_alive_change
when the NSE became alive or dead
Definition: gprs_ns2_internal.h:227
const struct value_string vty_ll_names[]
Definition: gprs_ns2_vty.c:115
uint8_t data_weight
Definition: gsm_08_16.h:36
struct llist_head list
Definition: gprs_ns2_vty.c:89
An instance of the NS protocol stack.
Definition: gprs_ns2_internal.h:151
int osmo_iofd_register(struct osmo_io_fd *iofd, int fd)
static void ns2_add_procedure(struct ns2_sns_state *gss, struct ns2_sns_bind *sbind, enum sns_procedure procedure_type)
Definition: gprs_ns2_sns.c:1890
unsigned int persistent
Definition: gprs_ns.h:140
#define RATE_CTR_INC_NS(nsvc, ctr)
Definition: gprs_ns2_internal.h:42
const char * get_value_string(const struct value_string *vs, uint32_t val)
static void ns2_sns_st_configured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:1437
void osmo_fr_network_dump_vty(struct vty *vty, const struct osmo_fr_network *net)
Definition: frame_relay.c:1041
struct osmo_stat_item_group * statg
Definition: gprs_ns2_internal.h:324
#define ip4_weight_sum_sig(elems)
Definition: gprs_ns2_sns.c:230
#define osmo_fsm_inst_term(fi, cause, data)
static void gprs_sns_st_unconfigured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns_sns.c:301
@ GPRS_NS2_EV_RX_UNITDATA
Definition: gprs_ns2_vc_fsm.c:113
#define LOG_NS_DATA(nsvc, direction, pdu_type, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:36
static void ns2_vc_fsm_clean(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
Definition: gprs_ns2_vc_fsm.c:753
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:552
struct gprs_ns2_vc_driver vc_driver_ip
Definition: gprs_ns2_udp.c:44
void vty_out_fsm_inst2(struct vty *vty, const char *prefix, struct osmo_fsm_inst *fsmi)
struct llist_head list
Definition: gprs_ns2_vty.c:79
static void ns2_sns_st_local_procedure(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:1591
enum sns_procedure procedure
Definition: gprs_ns2_sns.c:124
static int add_ip6_elem(struct ns2_sns_state *gss, struct ns2_sns_elems *elems, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:551
@ GPRS_SNS_ST_UNCONFIGURED
Definition: gprs_ns_sns.c:271
uint8_t pdu_type
NS PDU type.
Definition: gsm_08_16.h:2
@ GPRS_SNS_ST_CONFIG_SGSN
SNS-CONFIG procedure (SGSN->BSS) ongoing.
Definition: gprs_ns_sns.c:274
bool block_no_nsvc_events
Definition: gprs_ns2_sns.c:154
@ NS_CAUSE_PROTO_ERR_UNSPEC
Definition: gsm_08_16.h:92
static void ns2_sns_st_bss_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:999
void osmo_timer_add(struct osmo_timer_list *timer)
@ GPRS_NS2_AFF_CAUSE_SNS_CONFIGURED
Definition: gprs_ns2.h:84
void gprs_ns2_ip_bind_set_sns_weight(struct gprs_ns2_vc_bind *bind, uint8_t signalling, uint8_t data)
set the signalling and data weight for this bind
Definition: gprs_ns2_udp.c:591
int gprs_ns2_vty_init_reduced(struct gprs_ns2_inst *nsi)
initialized a reduced vty interface which excludes the configuration nodes besides timeouts.
Definition: gprs_ns2_vty.c:2271
#define DLCI_STR
Definition: gprs_ns2_vty.c:58
@ GPRS_SNS_ST_UNCONFIGURED
Definition: gprs_ns2_sns.c:66
@ NS2_SNS_EV_RX_CONFIG
Definition: gprs_ns2_internal.h:340
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:316
@ GPRS_NS2_LL_FR_GRE
NS/FR/GRE/IP.
Definition: gprs_ns2.h:48
static int vty_nse_remove_vbind(struct vty_nse *vnse, struct vty_bind *vbind)
Definition: gprs_ns2_vty.c:212
int dscp
Definition: gprs_ns2_frgre.c:114
struct gprs_ns2_vc * gprs_ns2_nsvc_by_sockaddr_bind(struct gprs_ns2_vc_bind *bind, const struct osmo_sockaddr *rem_addr)
Find a NS-VC by its remote socket address.
Definition: gprs_ns2_udp.c:125
#define RATE_CTR_ADD_NS(nsvc, ctr, val)
Definition: gprs_ns2_internal.h:49
struct ns2_sns_elems local_procedure
Definition: gprs_ns2_sns.c:172
int gprs_sns_init(void)
Definition: gprs_ns_sns.c:736
struct gprs_ns_inst * nsi
pointer to NS Instance
Definition: gprs_ns.h:126
ns_pdu_type
NS PDU Type (TS 08.16, Section 10.3.7, Table 14)
Definition: gsm_08_16.h:42
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)
int gprs_ns2_sns_del_endpoint(struct gprs_ns2_nse *nse, const struct osmo_sockaddr *saddr)
gprs_ns2_sns_del_endpoint
Definition: gprs_ns2_sns.c:2513
@ NS_TOUT_TNS_ALIVE
Definition: gprs_ns.h:39
#define OSMO_SOCK_F_DSCP(x)
unsigned int num_ip4
Definition: gprs_ns2_sns.c:132
@ NS_PDUT_BLOCK
Definition: gsm_08_16.h:46
int ns2_vc_fsm_start(struct gprs_ns2_vc *nsvc)
Start a NS-VC FSM.
Definition: gprs_ns2_vc_fsm.c:813
@ GPRS_SNS_EV_CONFIG_ACK
Definition: gprs_ns_sns.c:282
static int remove_remote_ip4_elem(struct gprs_sns_state *gss, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:150
static int ns_vc_tx(struct gprs_ns2_vc *nsvc, struct msgb *msg)
Definition: gprs_ns2_message.c:172
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:723
@ NS_IE_VCI
Definition: gsm_08_16.h:67
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:586
uint8_t data[0]
variable-length payload
Definition: gsm_08_16.h:3
void gprs_sns_dump_vty(struct vty *vty, const struct gprs_ns_inst *nsi, bool stats)
Definition: gprs_ns_sns.c:753
static struct gprs_ns_inst * vty_nsi
Definition: gprs_ns_vty.c:51
struct llist_head nsvc
llist head to hold all nsvc
Definition: gprs_ns2_internal.h:185
void osmo_identifier_sanitize_buf(char *str, const char *sep_chars, char replace_with)
static void ns2_st_blocked(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:360
enum ns2_sns_role role
Definition: gprs_ns2_sns.c:142
static struct gprs_ns2_inst * ns_inst_from_fi(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_vc_fsm.c:142
uint8_t sns_data_weight
the IP-SNS data weight when doing dynamic configuration
Definition: gprs_ns2_internal.h:322
bool accept_ipaccess
Definition: gprs_ns2_internal.h:297
int(* send_vc)(struct gprs_ns2_vc *nsvc, struct msgb *msg)
send a msg over a VC
Definition: gprs_ns2_internal.h:310
void ns2_free_nsvcs(struct gprs_ns2_nse *nse)
Definition: gprs_ns2.c:668
#define NSE_CMD_STR
Definition: gprs_ns_vty.c:280
static void dump_ns_entities(struct vty *vty, const struct gprs_ns2_inst *nsi, bool stats, bool persistent_only)
Definition: gprs_ns2_vty.c:1970
@ 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:626
struct gprs_ns_inst::@15 frgre
NS-over-FR-over-GRE-over-IP specific bits.
#define TLVP_PRES_LEN(tp, tag, min_len)
static void dump_nse(struct vty *vty, const struct gprs_ns2_nse *nse, bool stats, bool persistent_only)
Definition: gprs_ns2_vty.c:1928
Definition: gprs_ns2_fr.c:112
@ GPRS_NS2_EV_RX_BLOCK
Definition: gprs_ns2_vc_fsm.c:107
int gprs_ns_frgre_listen(struct gprs_ns_inst *nsi)
Definition: gprs_ns_frgre.c:326
#define ERR_IF_NSVC_USES_SNS(nsvc, reason)
Definition: gprs_ns2_message.c:42
static void log_set_nse_filter(struct log_target *target, struct gprs_ns2_nse *nse)
Definition: gprs_ns2_vty.c:2179
int osmo_sock_set_priority(int fd, int prio)
@ NS_CAUSE_INVAL_NR_NS_VC
Definition: gsm_08_16.h:98
uint8_t pdu_type
NS PDU type.
Definition: gsm_08_16.h:18
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
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:866
gprs_ns2_ll
Osmocom NS link layer types.
Definition: gprs_ns2.h:44
int(* cb)(struct osmo_fd *fd, unsigned int what)
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:550
struct llist_head sns_endpoints
Definition: gprs_ns2_sns.c:145
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
static int remove_ip4_elem(struct ns2_sns_state *gss, struct ns2_sns_elems *elems, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns2_sns.c:516
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:769
static void alive_timeout_handler(void *data)
Definition: gprs_ns2_vc_fsm.c:218
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:376
@ SNS_PROC_NONE
used as invalid/idle value
Definition: gprs_ns2_sns.c:99
@ GPRS_SNS_EV_CHANGE_WEIGHT
Definition: gprs_ns_sns.c:285
enum gprs_ns_ll ll
which link-layer are we based on?
Definition: gprs_ns.h:147
@ GPRS_SNS_ST_SGSN_WAIT_CONFIG
Definition: gprs_ns2_sns.c:71
static int handle_rx_gre_ipv4(struct osmo_fd *bfd, struct msgb *msg, struct iphdr *iph, struct gre_hdr *greh)
Definition: gprs_ns_frgre.c:95
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
struct osmo_stat_item_group * statg
Definition: gprs_ns2_internal.h:267
static struct llist_head binds
Definition: gprs_ns2_vty.c:62
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:273
int osmo_clock_gettime(clockid_t clk_id, struct timespec *tp)
@ SNS_PDUT_CHANGE_WEIGHT
Definition: gsm_08_16.h:56
struct osmo_fsm_inst * osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv, int log_level, const char *id)
static void ns2_st_unconfigured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:263
int _osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state, unsigned long timeout_secs, int T, const char *file, int line)
static void ns2_st_blocked_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_vc_fsm.c:336
bool accept_sns
Definition: gprs_ns2_internal.h:298
void gprs_nsvc_delete(struct gprs_nsvc *nsvc)
Delete given NS-VC.
Definition: gprs_ns.c:353
Definition: gprs_ns2_vty.c:88
#define llist_for_each_entry_safe(pos, n, head, member)
static void vty_dump_sns_ip4(struct vty *vty, const char *prefix, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns2_sns.c:2377
bool accept_sns
Definition: gprs_ns2_vty.c:73
static int ns2_validate_reset(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
Definition: gprs_ns2_message.c:49
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
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:239
static void ns2_clear_elems(struct ns2_sns_elems *elems)
Definition: gprs_ns2_sns.c:334
#define CMD_ERR_NOTHING_TODO
static int update_ip4_elem(struct ns2_sns_state *gss, struct ns2_sns_elems *elems, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns2_sns.c:533
static const struct value_string ns2_vc_event_names[]
Definition: gprs_ns2_vc_fsm.c:122
int get_string_value(const struct value_string *vs, const char *str)
static struct cmd_node ns_node
Definition: gprs_ns2_vty.c:248
void osmo_iofd_set_alloc_info(struct osmo_io_fd *iofd, unsigned int size, unsigned int headroom)
struct in6_addr ip_addr
Definition: gsm_08_16.h:33
struct gprs_ns2_inst * nsi
entry back to ns2_inst
Definition: gprs_ns2_internal.h:179
static uint8_t * msgb_v_put(struct msgb *msg, uint8_t val)
static struct gprs_nsvc * nsvc_by_ip4_elem(struct gprs_ns_inst *nsi, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:74
#define NS_DESC_B(st)
Definition: gprs_ns.h:48
struct gprs_ns_inst::@14 nsip
NS-over-IP specific bits.
struct llist_head nse
linked lists of all NSVC in this instance
Definition: gprs_ns2_internal.h:162
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:667
@ NS_CTR_BLOCKED
Definition: gprs_ns.c:133
const char * get_value_string_or_null(const struct value_string *vs, uint32_t val)
enum gprs_ns2_ll ll
which link-layer are we based on?
Definition: gprs_ns2_internal.h:201
int ns2_tx_unblock(struct gprs_ns2_vc *nsvc)
Transmit a NS-UNBLOCK on a given NS-VC.
Definition: gprs_ns2_message.c:338
@ NS2_SNS_EV_REQ_ADD_BIND
add a new local bind to this NSE
Definition: gprs_ns2_internal.h:350
@ SNS_PROC_DEL
Definition: gprs_ns2_sns.c:101
@ NS_CAUSE_INVAL_NR_IPv6_EP
Definition: gsm_08_16.h:97
@ NS_CTR_LOST_ALIVE
Definition: gprs_ns.c:139
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:667
static uint8_t * msgb_tv16_put(struct msgb *msg, uint8_t tag, uint16_t val)
bool initiate_reset
Definition: gprs_ns2_vc_fsm.c:60
static void ns2_recv_unitdata(struct osmo_fsm_inst *fi, struct msgb *msg)
Definition: gprs_ns2_vc_fsm.c:596
@ NS_TOUT_TSNS_PROCEDURES_RETRIES
Definition: gprs_ns2_internal.h:96
Definition: gprs_ns2_vty.c:66
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:876
@ NS_CAUSE_MISSING_ESSENT_IE
Definition: gsm_08_16.h:94
int gprs_ns2_is_ip_bind(struct gprs_ns2_vc_bind *bind)
Is the given bind an IP bind?
Definition: gprs_ns2_udp.c:476
static void ns2_sns_st_bss_config_sgsn_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:1147
static void ns2_vc_create_ip(struct osmo_fsm_inst *fi, struct gprs_ns2_nse *nse, const struct osmo_sockaddr *remote, uint8_t sig_weight, uint8_t data_weight)
Definition: gprs_ns2_sns.c:353
gprs_ns2_vc_state
Definition: gprs_ns2_vc_fsm.c:90
struct log_target * osmo_log_vty2tgt(struct vty *vty)
static void ns2_clear_sgsn(struct ns2_sns_state *gss, struct gprs_ns2_vc *size_nsvc)
Definition: gprs_ns2_sns.c:2743
char ip[INET6_ADDRSTRLEN]
static struct gprs_ns2_vc * nsvc_by_ip4_elem(struct gprs_ns2_nse *nse, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns2_sns.c:257
Structure repesenting a NSE.
Definition: gprs_ns2_internal.h:175
#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:976
static void ns2_st_unconfigured_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_vc_fsm.c:255
int gprs_ns2_sns_add_endpoint(struct gprs_ns2_nse *nse, const struct osmo_sockaddr *saddr)
gprs_ns2_sns_add_endpoint
Definition: gprs_ns2_sns.c:2473
static int ns2_validate_status(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
Definition: gprs_ns2_message.c:90
@ NS_TOUT_TSNS_CONFIG_RETRIES
Definition: gprs_ns2_internal.h:95
uint16_t next_nsvci
Definition: gprs_ns_sns.c:47
struct gprs_ns2_vc * nsvc
Definition: gprs_ns2_vc_fsm.c:53
struct gprs_ns2_vc_bind * gprs_ns2_ip_bind_by_sockaddr(struct gprs_ns2_inst *nsi, const struct osmo_sockaddr *sockaddr)
Find NS bind for a given socket address.
Definition: gprs_ns2_udp.c:250
int ns2_vc_reset(struct gprs_ns2_vc *nsvc)
Reset a NS-VC.
Definition: gprs_ns2_vc_fsm.c:856
struct ns2_sns_bind * initial_bind
Definition: gprs_ns2_sns.c:149
uint16_t nsei
Definition: gprs_ns2_vty.c:80
static const struct value_string gprs_sns_event_names[]
Definition: gprs_ns2_sns.c:76
static void dump_vty(const struct gprs_ns2_vc_bind *bind, struct vty *vty, bool stats)
Definition: gprs_ns2_udp.c:90
static int ns_sns_configured_timeout(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_sns.c:1087
@ NS_TOUT_TNS_RESET
Definition: gprs_ns.h:36
static void ns2_sns_st_configured_delete(struct osmo_fsm_inst *fi, struct ns2_sns_state *gss, struct tlv_parsed *tp)
Definition: gprs_ns2_sns.c:1267
#define GRE_PTYPE_IPv4
Definition: gprs_ns_frgre.c:46
int gprs_ns2_sns_count(struct gprs_ns2_nse *nse)
gprs_ns2_sns_count
Definition: gprs_ns2_sns.c:2566
uint16_t ptype
Definition: gprs_ns2_frgre.c:61
void * filter_data[LOG_MAX_FILTERS+1]
static int ns2_tx_sns_procedure(struct gprs_ns2_vc *nsvc, enum ns_pdu_type pdu, 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/SNS-CHANGE-WEIGHT as per Section 9.3.2/9.3.3.
Definition: gprs_ns2_message.c:490
ns2_sns_role
Definition: gprs_ns2_sns.c:59
static int ns2_sns_count_num_local_ep(struct osmo_fsm_inst *fi, int ip_proto)
Definition: gprs_ns2_sns.c:829
struct llist_head procedures
Definition: gprs_ns2_sns.c:183
static __attribute__((constructor))
Definition: gprs_ns2_sns.c:3102
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:356
static int do_sns_delete(struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:211
void gprs_ns2_ip_bind_set_sns_weight(struct gprs_ns2_vc_bind *bind, uint8_t signalling, uint8_t data)
set the signalling and data weight for this bind
Definition: gprs_ns2_udp.c:591
static void dump_ns_bind(struct vty *vty, const struct gprs_ns2_inst *nsi, bool stats)
Definition: gprs_ns2_vty.c:1960
struct gprs_nsvc::@16::@19 frgre
@ GPRS_SNS_ST_BSS_SIZE
SNS-SIZE procedure ongoing.
Definition: gprs_ns2_sns.c:67
@ NS_TOUT_TNS_ALIVE_RETRIES
Definition: gprs_ns.h:40
@ GPRS_NS2_ST_RESET
Definition: gprs_ns2_vc_fsm.c:92
@ NS2_SNS_EV_RX_SIZE_ACK
Definition: gprs_ns2_internal.h:339
static struct gprs_ns_ie_ip6_elem * ns2_get_sbind_ip6_entry(struct ns2_sns_state *gss, struct ns2_sns_bind *sbind, struct ns2_sns_elems *endpoints)
Definition: gprs_ns2_sns.c:1838
static uint8_t tlvp_val8(const struct tlv_parsed *tp, uint8_t tag, uint8_t default_val)
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:304
static void ns2_st_alive(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:465
size_t num_max_nsvcs
Definition: gprs_ns2_sns.c:179
@ GPRS_SNS_ST_SGSN_WAIT_CONFIG_ACK
Definition: gprs_ns2_sns.c:72
@ GPRS_NS2_LL_FR
NS/FR.
Definition: gprs_ns2.h:47
uint16_t udp_port
Definition: gsm_08_16.h:34
static int ns2_sns_add_elements(struct ns2_sns_state *gss, struct ns2_sns_bind *sbind, struct ns2_sns_elems *elems)
Definition: gprs_ns2_sns.c:1972
uint16_t local_port
Definition: gprs_ns.h:96
static void ns2_sns_st_all_action_sgsn(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:2947
union osmo_sockaddr::@28 u
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:550
@ NS2_CS_ERROR
Failed to process message.
Definition: gprs_ns2_internal.h:121
static void ns2_sns_st_bss_unconfigured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:796
int N
Definition: gprs_ns2_sns.c:164
static struct cmd_node ns_bind_node
Definition: gprs_ns2_vty.c:618
@ NS_CAUSE_INVAL_NR_IPv4_EP
Definition: gsm_08_16.h:96
const char * name
unique name
Definition: gprs_ns2_internal.h:286
static void ns2_clear_procedures(struct ns2_sns_state *gss)
Definition: gprs_ns2_sns.c:343
char * osmo_sockaddr_to_str_buf(char *buf, size_t buf_len, const struct osmo_sockaddr *sockaddr)
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
struct rate_ctr_group * ctrg
Definition: gprs_ns.h:143
uint16_t msgb_length(const struct msgb *msg)
uint16_t mtu
MTU of a NS PDU on this bind.
Definition: gprs_ns2_internal.h:304
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:723
static void llist_del(struct llist_head *entry)
bool gprs_ns2_ip_vc_equal(const struct gprs_ns2_vc *nsvc, const struct osmo_sockaddr *local, const struct osmo_sockaddr *remote, uint16_t nsvci)
Compare the NS-VC with the given parameter.
Definition: gprs_ns2_udp.c:436
An instance of the NS protocol stack.
Definition: gprs_ns.h:79
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:817
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
Definition: gprs_ns_sns.c:27
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 NS_DEFAULT_TXQUEUE_MAX_LENGTH
Definition: gprs_ns2_internal.h:83
static void ns2_sns_st_bss_config_bss_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:1060
static void config_write_vbind(struct vty *vty, struct vty_bind *vbind)
Definition: gprs_ns2_vty.c:433
void osmo_stat_item_set(struct osmo_stat_item *item, int32_t value)
#define llist_first_entry(ptr, type, member)
@ NS_IE_MAX_NR_NSVC
Definition: gsm_08_16.h:74
@ 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:1546
static uint16_t TVLV_GROSS_LEN(uint16_t len)
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:466
uint8_t data[0]
variable-length payload
Definition: gsm_08_16.h:19
struct msgb * ns2_msgb_alloc(void)
Allocate a message buffer for use with the NS2 stack.
Definition: gprs_ns2.c:695
void ns2_sns_update_weights(struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:2711
const struct osmo_sockaddr * gprs_ns2_nse_sns_remote(struct gprs_ns2_nse *nse)
Return the initial SNS remote socket address.
Definition: gprs_ns2_sns.c:285
int log_set_context(uint8_t ctx_nr, void *value)
size_t num_max_ip4_remote
Definition: gprs_ns2_sns.c:180
@ GPRS_NS2_EV_RX_BLOCK_FOREIGN
Definition: gprs_ns2_vc_fsm.c:119
bool accept_unitdata
Definition: gprs_ns2_vc_fsm.c:62
static int ns2_validate_reset_ack(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
Definition: gprs_ns2_message.c:60
@ NS2_SNS_EV_RX_CHANGE_WEIGHT
Definition: gprs_ns2_internal.h:345
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 osmo_fsm_inst * bss_sns_fi
Definition: gprs_ns2_internal.h:206
static int ip46_weight_sum(const struct ns2_sns_elems *elems, bool data_weight)
Definition: gprs_ns2_sns.c:249
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)
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:418
struct timespec ts_alive_change
when the NSVC became alive or dead
Definition: gprs_ns2_internal.h:280
int gprs_nsvc_reset(struct gprs_nsvc *nsvc, uint8_t cause)
Initiate a RESET procedure.
Definition: gprs_ns.c:2103
void install_node(struct cmd_node *node, int(*func)(struct vty *))
@ NS2_CS_REJECTED
Rejected and answered message.
Definition: gprs_ns2_internal.h:119
static void rate_ctr_inc(struct rate_ctr *ctr)
@ 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
@ NS2_SNS_EV_RX_ADD
Definition: gprs_ns2_internal.h:343
@ GPRS_NS2_PRIM_UNIT_DATA
Definition: gprs_ns2.h:53
const struct value_string vty_fr_role_names[]
Definition: gprs_ns2_vty.c:109
@ GPRS_NS2_ST_RECOVERING
Definition: gprs_ns2_vc_fsm.c:96
static int ns2_sns_bss_valid_configuration(struct ns2_sns_state *gss)
Definition: gprs_ns2_sns.c:2156
static int ns2_validate_block_ack(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
Definition: gprs_ns2_message.c:80
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:390
Section 10.3.2c List of IP4 Elements.
Definition: gsm_08_16.h:24
@ NS_PDUT_RESET
Definition: gsm_08_16.h:44
DEFUN_HIDDEN(show_ns, show_ns_cmd, "show ns", SHOW_STR SHOW_NS_STR)
Definition: gprs_ns2_vty.c:1981
int ns2_nse_set_dialect(struct gprs_ns2_nse *nse, enum gprs_ns2_dialect dialect)
Definition: gprs_ns2.c:847
static int config_write_ns(struct vty *vty)
Definition: gprs_ns2_vty.c:586
static void ns2_sns_st_sgsn_wait_config_ack_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:2816
static void gprs_sns_st_config_bss_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns_sns.c:364
#define NS_TIMERS
Definition: gprs_ns.h:18
struct gprs_ns2_vc * sns_nsvc
Definition: gprs_ns2_sns.c:162
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:918
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
gprs_ns_ll
Osmocom NS link layer types.
Definition: gprs_ns.h:53
Definition: gprs_ns2_frgre.c:59
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
static int config_write_ns_nse(struct vty *vty)
Definition: gprs_ns2_vty.c:561
bool persistent
true if this NSE was created by VTY or pcu socket)
Definition: gprs_ns2_internal.h:191
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
@ GPRS_NS2_DIALECT_STATIC_RESETBLOCK
Definition: gprs_ns2.h:38
#define osmo_fsm_inst_dispatch(fi, event, data)
int ns2_vc_force_unconfigured(struct gprs_ns2_vc *nsvc)
Reset a NS-VC FSM.
Definition: gprs_ns2_vc_fsm.c:824
static struct priv_vc * ns2_driver_alloc_vc(struct gprs_ns2_vc_bind *bind, struct gprs_ns2_vc *nsvc, const struct osmo_sockaddr *remote)
Definition: gprs_ns2_udp.c:170
@ SNS_PROC_CHANGE_WEIGHT
Definition: gprs_ns2_sns.c:102
struct osmo_fr_network * osmo_fr_network_alloc(void *ctx)
Definition: frame_relay.c:898
uint8_t sns_sig_weight
the IP-SNS signalling weight when doing dynamic configuration
Definition: gprs_ns2_internal.h:320
Definition: gprs_ns2.h:109
uint16_t nsei
Identifiers of a BTS, equal to 'struct bssgp_bts_ctx'.
Definition: gprs_msgb.h:9
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:423
@ GPRS_SNS_ST_CONFIG_BSS
SNS-CONFIG procedure (BSS->SGSN) ongoing.
Definition: gprs_ns_sns.c:273
@ GPRS_SNS_ST_CONFIGURED
Definition: gprs_ns2_sns.c:70
@ NS_CTR_BYTES_OUT_DROP
Definition: gprs_ns2_internal.h:130
static void gprs_sns_st_configured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns_sns.c:434
@ NS2_SNS_EV_RX_CONFIG_END
SNS-CONFIG with end flag received.
Definition: gprs_ns2_internal.h:341
static int create_missing_nsvcs(struct osmo_fsm_inst *fi)
Definition: gprs_ns_sns.c:108
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 local_sgsn_role)
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:202
int gprs_ns2_ip_bind_set_priority(struct gprs_ns2_vc_bind *bind, uint8_t priority)
Set the socket priority of the given bind.
Definition: gprs_ns2_udp.c:507
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:1654
uint8_t ip_sns_data_weight
Definition: gprs_ns2_vty.c:75
const char * name
Definition: gprs_ns2_internal.h:331
void msgb_free(struct msgb *m)
@ GPRS_NS2_EV_RX_ALIVE_ACK
Definition: gprs_ns2_vc_fsm.c:110
#define msgb_nsei(__x)
Definition: gprs_msgb.h:23
@ GPRS_NS2_ST_BLOCKED
Definition: gprs_ns2_vc_fsm.c:93
void vty_out_fsm_inst(struct vty *vty, struct osmo_fsm_inst *fsmi)
static void dump_nse(struct vty *vty, const struct gprs_nsvc *nsvc, bool stats, bool persistent_only)
Definition: gprs_ns_vty.c:170
@ GPRS_NS2_EV_RX_UNBLOCK
Definition: gprs_ns2_vc_fsm.c:105
uint16_t nsvci
end-to-end significance
Definition: gprs_ns.h:129
static struct gprs_ns2_inst * vty_nsi
Definition: gprs_ns2_vty.c:60
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:818
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:530
struct llist_head binds
Definition: gprs_ns2_vty.c:84
static const char * gprs_ns2_cause_str(enum ns_cause val)
Obtain a human-readable string for NS primitives.
Definition: gprs_ns2.h:106
@ GPRS_NS2_EV_REQ_OM_RESET
Definition: gprs_ns2_vc_fsm.c:116
static void ns2_sns_st_all_action_bss(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:2199
@ NS_TOUT_TNS_BLOCK_RETRIES
Definition: gprs_ns.h:35
Structure representing a single NS-VC.
Definition: gprs_ns2_internal.h:231
uint8_t change_weight_state
Definition: gprs_ns2_sns.c:113
static int ns2_vc_fsm_timer_cb(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_vc_fsm.c:543
@ NS_CAUSE_BVCI_UNKNOWN
Definition: gsm_08_16.h:89
unsigned int num_ip4_remote
Definition: gprs_ns_sns.c:42
struct gprs_ns2_nse * nse
pointer to NS Instance
Definition: gprs_ns2_internal.h:239
@ GPRS_NS2_EV_REQ_OM_UNBLOCK
Definition: gprs_ns2_vc_fsm.c:118
static struct vty_bind * vty_bind_by_name(const char *name)
Definition: gprs_ns2_vty.c:122
int ns2_vc_reset(struct gprs_ns2_vc *nsvc)
Reset a NS-VC.
Definition: gprs_ns2_vc_fsm.c:856
@ GPRS_SNS_ROLE_SGSN
Definition: gprs_ns2_sns.c:61
@ NS2_SNS_EV_REQ_NSVC_ALIVE
a NS-VC became alive
Definition: gprs_ns2_internal.h:349
void ns2_sns_update_weights(struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:2711
static int remove_ip6_elem(struct ns2_sns_state *gss, struct ns2_sns_elems *elems, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:570
#define LOGPFSMLSRC(fi, level, caller_file, caller_line, fmt, args...)
struct timespec timer_started
Definition: gprs_ns2_vc_fsm.c:69
static int handle_nsfrgre_read(struct osmo_fd *bfd)
Definition: gprs_ns_frgre.c:249
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:586
@ GPRS_NS2_LL_UNDEF
undefined, used by vty
Definition: gprs_ns2.h:45
#define NS_ALLOC_SIZE
Definition: gprs_ns.h:30
int gprs_ns_frgre_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg)
Definition: gprs_ns_frgre.c:282
bool reselection_running
Definition: gprs_ns2_sns.c:151
@ NS_CAUSE_UNKN_IP_ADDR
Definition: gsm_08_16.h:101
struct osmo_sockaddr saddr
Definition: gprs_ns2_sns.c:107
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:703
int gprs_ns2_ip_bind_set_dscp(struct gprs_ns2_vc_bind *bind, int dscp)
Set the DSCP (TOS) bit value of the given bind.
Definition: gprs_ns2_udp.c:482
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:998
void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds)
@ NS_CTR_PKTS_OUT_DROP
Definition: gprs_ns2_internal.h:127
void ns2_vty_dump_nsvc(struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats)
Definition: gprs_ns2_vty.c:1900
static const char * osmo_fsm_inst_state_name(struct osmo_fsm_inst *fi)
uint8_t data_weight
signaling weight.
Definition: gprs_ns.h:162
#define sns_failed(fi, reason)
Definition: gprs_ns2_sns.c:195
void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data)
static void stop_test_procedure(struct gprs_ns2_vc_priv *priv)
Definition: gprs_ns2_vc_fsm.c:182
@ GPRS_SNS_EV_SIZE_ACK
Definition: gprs_ns_sns.c:279
int ns2_vc_unblock(struct gprs_ns2_vc *nsvc)
Unblock a NS-VC.
Definition: gprs_ns2_vc_fsm.c:844
#define ip4_weight_sum_data(elems)
Definition: gprs_ns2_sns.c:229
int osmo_iofd_sendto_msgb(struct osmo_io_fd *iofd, struct msgb *msg, int sendto_flags, const struct osmo_sockaddr *dest)
@ NS2_CS_FOUND
A NSVC object has been found.
Definition: gprs_ns2_internal.h:118
@ GPRS_NS2_EV_REQ_START
Definition: gprs_ns2_vc_fsm.c:100
#define ip6_weight_sum_data(elems)
Definition: gprs_ns2_sns.c:246
uint16_t data_weight
Definition: gprs_ns2_sns.c:120
void(* sendto_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg, const struct osmo_sockaddr *daddr)
static void ns2_st_reset_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_vc_fsm.c:294
uint8_t priority
Definition: gprs_ns2_udp.c:53
Definition: gprs_ns2_sns.c:105
static void ns2_st_reset(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:309
int dscp
Definition: gprs_ns.h:99
static void handle_nsip_recvfrom(struct osmo_io_fd *iofd, int error, struct msgb *msg, const struct osmo_sockaddr *saddr)
Definition: gprs_ns2_udp.c:182
@ NS2_SNS_EV_REQ_FREE_NSVCS
free all NS-VCs
Definition: gprs_ns2_internal.h:348
int gprs_ns2_sns_add_endpoint(struct gprs_ns2_nse *nse, const struct osmo_sockaddr *saddr)
gprs_ns2_sns_add_endpoint
Definition: gprs_ns2_sns.c:2473
static void log_set_nsvc_filter(struct log_target *target, struct gprs_nsvc *nsvc)
Definition: gprs_ns_vty.c:67
bool om_blocked
if blocked by O&M/vty
Definition: gprs_ns2_internal.h:277
static void start_test_procedure(struct osmo_fsm_inst *fi, bool start_tx_alive)
Definition: gprs_ns2_vc_fsm.c:150
bool initiator
Definition: gprs_ns2_vc_fsm.c:58
struct osmo_fsm_inst * fi
Definition: gprs_ns2_internal.h:271
gprs_sns_event
Definition: gprs_ns_sns.c:276
@ NS_TOUT_TSNS_PROV
Definition: gprs_ns.h:41
static struct vty_bind * vty_bind_alloc(const char *name)
Definition: gprs_ns2_vty.c:132
static void vty_bind_free(struct vty_bind *vbind)
Definition: gprs_ns2_vty.c:150
struct vty_bind * vbind
Definition: gprs_ns2_vty.c:90
Structure representing a single NS-VC.
Definition: gprs_ns.h:122
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:346
static void gprs_sns_st_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns_sns.c:334
static void ns2_sns_st_configured_change(struct osmo_fsm_inst *fi, struct ns2_sns_state *gss, struct tlv_parsed *tp)
Definition: gprs_ns2_sns.c:1389
uint8_t priority
Definition: gprs_ns2_vty.c:71
#define LOGNSE(nse, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:13
static const struct value_string gprs_sns_event_names[]
Definition: gprs_ns_sns.c:288
Structure repesenting a bind instance.
Definition: gprs_ns2_internal.h:284
static int create_missing_nsvcs(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_sns.c:420
static void _sns_failed(struct osmo_fsm_inst *fi, const char *reason, const char *file, int line)
Definition: gprs_ns2_sns.c:197
static struct gprs_ns2_nse * nse_inst_from_fi(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_sns.c:188
int ns2_vc_force_unconfigured(struct gprs_ns2_vc *nsvc)
Reset a NS-VC FSM.
Definition: gprs_ns2_vc_fsm.c:824
static void ns2_sns_st_bss_config_bss(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:1036
@ NS_CTR_UNBLOCKED
Definition: gprs_ns2_internal.h:132
@ NS_IE_BVCI
Definition: gsm_08_16.h:69
struct gprs_ns_inst * nsi
Definition: gprs_ns_sns.c:28
void gprs_sns_dump_vty(struct vty *vty, const struct gprs_ns_inst *nsi, bool stats)
Definition: gprs_ns_sns.c:753
int transfer_capability
transfer capability in mbit
Definition: gprs_ns2_internal.h:301
static int vty_nse_add_vbind(struct vty_nse *vnse, struct vty_bind *vbind)
Definition: gprs_ns2_vty.c:191
@ GPRS_SNS_ROLE_BSS
Definition: gprs_ns2_sns.c:60
static struct cmd_node ns_nse_node
Definition: gprs_ns2_vty.c:952
static void create_nsvc_for_new_sbind(struct ns2_sns_state *gss, struct ns2_sns_bind *sbind)
Definition: gprs_ns2_sns.c:1532
static int handle_nsfrgre_write(struct osmo_fd *bfd)
Definition: gprs_ns_frgre.c:276
unsigned int num_ip6
Definition: gprs_ns2_sns.c:134
@ GPRS_SNS_EV_DELETE
Definition: gprs_ns_sns.c:284
gprs_ns2_vc_event
Definition: gprs_ns2_vc_fsm.c:99
struct rate_ctr * rate_ctr_group_get_ctr(struct rate_ctr_group *grp, unsigned int idx)
uint16_t sig_weight
Definition: gprs_ns2_sns.c:119
@ NS_IE_CAUSE
Definition: gsm_08_16.h:66
struct osmo_sockaddr remote
Definition: gprs_ns2_fr.c:113
static struct cmd_node ns_node
Definition: gprs_ns_vty.c:79
@ GPRS_SNS_EV_CONFIG
Definition: gprs_ns_sns.c:280
bool osmo_identifier_valid(const char *str)
@ 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_rx_sns(struct gprs_ns_inst *nsi, struct msgb *msg, struct tlv_parsed *tp)
Definition: gprs_ns_sns.c:686
static void ns2_vc_fsm_allstate_action(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:630
@ NS_PDUT_RESET_ACK
Definition: gsm_08_16.h:45
@ GPRS_SNS_ST_SIZE
SNS-SIZE procedure ongoing.
Definition: gprs_ns_sns.c:272
static void ns2_sns_st_sgsn_unconfigured_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:2761
@ NS_IE_IP_ADDR
Definition: gsm_08_16.h:78
struct gprs_ns2_nse * nse
Definition: gprs_ns2_sns.c:138
OSMO_IO_FD_MODE_RECVFROM_SENDTO
ns2_timeout
Definition: gprs_ns2_internal.h:85
struct llist_head list
Definition: gprs_ns2_vty.c:67
if(vty->type==VTY_SHELL_SERV)
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 nsvc_force_unconf_cb(struct gprs_ns2_vc *nsvc, void *ctx)
Definition: gprs_ns2_vty.c:2063
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
static void gprs_sns_st_config_bss(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns_sns.c:343
static struct osmo_fsm gprs_ns2_sns_sgsn_fsm
Definition: gprs_ns2_sns.c:3050
uint8_t sig_weight
Definition: gsm_08_16.h:35
#define ip4_weight_sum_data(x, y)
Definition: gprs_ns_sns.c:71
static const struct osmo_fsm_state gprs_sns_bss_states[]
Definition: gprs_ns_sns.c:557
#define log_tgt_mutex_lock()
Definition: frame_relay.h:54
@ NS_TOUT_TNS_TEST
Definition: gprs_ns.h:38
#define NSVCI_STR
Definition: gprs_ns2_vty.c:57
static int ns2_sns_fsm_sgsn_timer_cb(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_sns.c:2914
struct llist_head list
Definition: gprs_ns2_sns.c:106
struct gprs_ns2_inst * nsi
a pointer back to the nsi
Definition: gprs_ns2_internal.h:294
DEFUN(cfg_ns, cfg_ns_cmd, "ns", "Configure the GPRS Network Service")
Definition: gprs_ns_vty.c:162
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:873
void ns2_ip_set_txqueue_max_length(struct gprs_ns2_vc_bind *bind, unsigned int max_length)
Definition: gprs_ns2_udp.c:578
bool running
Definition: gprs_ns2_sns.c:127
struct llist_head gprs_nsvcs
linked lists of all NSVC in this instance
Definition: gprs_ns.h:84
const struct value_string gprs_ns_pdu_strings[]
Definition: gprs_ns.c:397
@ NS_PDUT_BLOCK_ACK
Definition: gsm_08_16.h:47
static unsigned int msgb_l2len(const struct msgb *msgb)
static int ns_nse_nsvc_udp_cmds(struct vty *vty, const char *bind_name, const char *remote_char, uint16_t port, uint16_t sig_weight, uint16_t data_weight)
Definition: gprs_ns2_vty.c:1132
struct gprs_ns_ie_ip4_elem * ip4
Definition: gprs_ns2_sns.c:131
@ GPRS_SNS_EV_START
Definition: gprs_ns_sns.c:277
static void ns2_nsvc_create_ip6(struct osmo_fsm_inst *fi, struct gprs_ns2_nse *nse, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:391
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:292
enum gprs_ns2_vc_mode ns2_dialect_to_vc_mode(enum gprs_ns2_dialect dialect)
Definition: gprs_ns2.c:1549
struct gprs_ns2_vc * gprs_ns2_nsvc_by_sockaddr_bind(struct gprs_ns2_vc_bind *bind, const struct osmo_sockaddr *rem_addr)
Find a NS-VC by its remote socket address.
Definition: gprs_ns2_udp.c:125
@ GPRS_SNS_ST_LOCAL_PROCEDURE
in process of a ADD/DEL/CHANGE procedure towards SGSN (BSS->SGSN)
Definition: gprs_ns2_sns.c:73
@ GPRS_NS2_DIALECT_IPACCESS
Definition: gprs_ns2.h:39
#define TLVP_VAL_MINLEN(_tp, tag, min_len)
@ GPRS_NS2_DIALECT_SNS
Definition: gprs_ns2.h:40
#define osmo_fsm_inst_state_chg(fi, new_state, timeout_secs, T)
static void gprs_sns_st_config_sgsn(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns_sns.c:371
int vty_out_uptime(struct vty *vty, const struct timespec *starttime)
@ GPRS_NS2_AFF_CAUSE_VC_RECOVERY
Definition: gprs_ns2.h:80
uint16_t udp_port
Definition: gsm_08_16.h:26
gprs_sns_bss_state
Definition: gprs_ns2_sns.c:65
@ GPRS_SNS_ST_BSS_CONFIG_BSS
SNS-CONFIG procedure (BSS->SGSN) ongoing.
Definition: gprs_ns2_sns.c:68
static void ns2_st_unblocked_on_enter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_vc_fsm.c:421
static const struct osmo_fsm_state ns2_sns_bss_states[]
Definition: gprs_ns2_sns.c:1704
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
uint32_t ip_addr
Definition: gsm_08_16.h:2
static struct osmo_fr_network * vty_fr_network
Definition: gprs_ns2_vty.c:61
bool alive
Definition: gprs_ns2_sns.c:166
@ GPRS_NS2_AFF_CAUSE_SNS_NO_ENDPOINTS
Definition: gprs_ns2.h:86
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:1474
size_t num_max_ip4_remote
Definition: gprs_ns_sns.c:38
struct gprs_ns2_vc_driver * driver
Definition: gprs_ns2_internal.h:295
static struct gprs_ns_inst * ns_inst_from_fi(struct osmo_fsm_inst *fi)
Definition: gprs_ns_sns.c:50
int gprs_sns_bss_fsm_start(struct gprs_ns_inst *nsi)
Definition: gprs_ns_sns.c:680
int osmo_sock_local_ip(char *local_ip, const char *remote_ip)
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:352
static unsigned int llist_count(const struct llist_head *head)
@ NS_PDUT_UNITDATA
Definition: gsm_08_16.h:43
osmo_fr_role
Definition: frame_relay.h:38
int osmo_sockaddr_str_from_str(struct osmo_sockaddr_str *sockaddr_str, const char *ip, uint16_t port)
static void vty_dump_sns_ip6(struct vty *vty, const char *prefix, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:2384
@ NS_TOUT_TSNS_SIZE_RETRIES
Definition: gprs_ns2_internal.h:94
@ NS_IE_RESET_FLAG
Definition: gsm_08_16.h:77
static int do_sns_delete(struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:688
enum gprs_ns2_ll ll
which link-layer are we based on?
Definition: gprs_ns2_internal.h:307
#define S(x)
Definition: gprs_ns2_sns.c:57
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:568
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:605
static int config_write_ns(struct vty *vty)
Definition: gprs_ns_vty.c:85
#define llist_for_each_entry(pos, head, member)
static struct msgb * read_nsfrgre_msg(struct osmo_fd *bfd, int *error, struct sockaddr_in *saddr)
Definition: gprs_ns_frgre.c:147
struct osmo_fsm_inst * ns2_vc_fsm_alloc(struct gprs_ns2_vc *nsvc, const char *id, bool initiator)
gprs_ns2_vc_fsm_alloc
Definition: gprs_ns2_vc_fsm.c:790
static void free_vc(struct gprs_ns2_vc *nsvc)
Definition: gprs_ns2_udp.c:77
@ NS2_SNS_EV_REQ_NO_NSVC
no more NS-VC remaining (all dead)
Definition: gprs_ns2_internal.h:347
static struct osmo_fsm gprs_sns_bss_fsm
Definition: gprs_ns_sns.c:617
#define SHOW_NS_STR
Definition: gprs_ns2_vty.c:56
void gprs_ns2_free_nsvc(struct gprs_ns2_vc *nsvc)
Destroy/release given NS-VC.
Definition: gprs_ns2.c:641
uint16_t bvci
Definition: gprs_msgb.h:10
static const struct osmo_fsm_state ns2_sns_sgsn_states[]
Definition: gprs_ns2_sns.c:2856
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
@ NS_TOUT_TNS_BLOCK
Definition: gprs_ns.h:34
static void ns2_st_alive_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_vc_fsm.c:474
int gprs_ns2_ip_bind(struct gprs_ns2_inst *nsi, const char *name, const struct osmo_sockaddr *local, int dscp, struct gprs_ns2_vc_bind **result)
Bind to an IPv4/IPv6 address.
Definition: gprs_ns2_udp.c:277
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
#define ip4_weight_sum_sig(x, y)
Definition: gprs_ns_sns.c:72
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:1494
@ GPRS_NS2_EV_RX_RESET
Definition: gprs_ns2_vc_fsm.c:103
int gprs_ns2_sns_add_bind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:2644
struct llist_head list
Definition: gprs_ns2_sns.c:117
#define ip6_weight_sum_sig(elems)
Definition: gprs_ns2_sns.c:247
int ns2_vc_block(struct gprs_ns2_vc *nsvc)
Block a NS-VC.
Definition: gprs_ns2_vc_fsm.c:832
@ SNS_PDUT_CONFIG
Definition: gsm_08_16.h:57
@ FR_ROLE_NETWORK_EQUIPMENT
Definition: frame_relay.h:40
@ NS_IE_IPv4_EP_NR
Definition: gsm_08_16.h:75
static void ns2_sns_choose_next_bind(struct ns2_sns_state *gss)
Definition: gprs_ns2_sns.c:989
static void dump_bind(struct vty *vty, const struct gprs_ns2_vc_bind *bind, bool stats)
Definition: gprs_ns2_vty.c:1950
static struct vty_nse * vty_nse_by_nsei(uint16_t nsei)
Definition: gprs_ns2_vty.c:159
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:202
struct gprs_nsvc::@16::@18 ip
int gprs_ns2_ip_bind(struct gprs_ns2_inst *nsi, const char *name, const struct osmo_sockaddr *local, int dscp, struct gprs_ns2_vc_bind **result)
Bind to an IPv4/IPv6 address.
Definition: gprs_ns2_udp.c:277
#define llist_first_entry_or_null(ptr, type, member)
int gprs_ns2_ip_bind_set_dscp(struct gprs_ns2_vc_bind *bind, int dscp)
Set the DSCP (TOS) bit value of the given bind.
Definition: gprs_ns2_udp.c:482
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:833
@ GPRS_NS2_EV_RX_RESET_ACK
Definition: gprs_ns2_vc_fsm.c:104
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:817
void gprs_start_alive_all_nsvcs(struct gprs_ns_inst *nsi)
Definition: gprs_ns.c:2239
static void free_bind(struct gprs_ns2_vc_bind *bind)
clean up all private driver state.
Definition: gprs_ns2_udp.c:61
uint16_t timeout[NS_TIMERS_COUNT]
Definition: gprs_ns.h:90
int gprs_ns_vty_init(struct gprs_ns_inst *nsi)
Definition: gprs_ns_vty.c:635
static int add_remote_ip4_elem(struct gprs_sns_state *gss, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:137
static void dump_ns(struct vty *vty, const struct gprs_ns_inst *nsi, bool stats, bool persistent_only)
Definition: gprs_ns_vty.c:200
const char * gprs_ns_cause_str(enum ns_cause cause)
Obtain a human-readable string for NS cause value.
Definition: gprs_ns.c:445
int ns2_tx_alive(struct gprs_ns2_vc *nsvc)
Transmit a NS-ALIVE on a given NS-VC.
Definition: gprs_ns2_message.c:365
static int do_sns_add(struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:731
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
static void ns2_sns_st_all_action(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:2004
static void llist_add_tail(struct llist_head *_new, struct llist_head *head)
static void ns2_sns_compute_local_ep_from_binds(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_sns.c:884
int osmo_sock_set_dscp(int fd, uint8_t dscp)
static __attribute__((constructor))
Definition: gprs_ns2_vc_fsm.c:989
uint8_t ip_sns_sig_weight
Definition: gprs_ns2_vty.c:74
static int ns2_update_weight_entry(struct ns2_sns_state *gss, struct ns2_sns_bind *sbind, struct ns2_sns_elems *endpoints)
Definition: gprs_ns2_sns.c:1863
@ SNS_PDUT_ACK
Definition: gsm_08_16.h:54
bool alive
true if this NSE has at least one alive VC
Definition: gprs_ns2_internal.h:198
@ GPRS_NS2_LL_UDP
NS/UDP/IP.
Definition: gprs_ns2.h:46
uint8_t data_weight
Definition: gsm_08_16.h:28
uint8_t sig_weight
signalling weight.
Definition: gprs_ns2_internal.h:251
struct gprs_ns_ie_ip4_elem * ip4_remote
Definition: gprs_ns_sns.c:41
int ns2_tx_unblock(struct gprs_ns2_vc *nsvc)
Transmit a NS-UNBLOCK on a given NS-VC.
Definition: gprs_ns2_message.c:338
@ NS_IE_TRANS_ID
Definition: gsm_08_16.h:79
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
@ NS_TOUT_TNS_RESET_RETRIES
Definition: gprs_ns.h:37
@ NS_PDUT_UNBLOCK
Definition: gsm_08_16.h:48
#define LOG_NS_TX_SIGNAL(nsvc, pdu_type)
Definition: gprs_ns2_internal.h:40
uint16_t nsvci
uniquely identifies NS-VC if VC contains nsvci
Definition: gprs_ns2_internal.h:248
@ GPRS_NS2_EV_REQ_FORCE_UNCONFIGURED
Definition: gprs_ns2_vc_fsm.c:115
void gprs_ns2_free_bind(struct gprs_ns2_vc_bind *bind)
Destroy a given bind.
Definition: gprs_ns2.c:1492
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
bool initiate_block
Definition: gprs_ns2_vc_fsm.c:59
int osmo_timer_pending(const struct osmo_timer_list *timer)
Definition: gprs_ns2_internal.h:330
void osmo_timer_del(struct osmo_timer_list *timer)
static struct gprs_nsvc * gprs_nsvc_create_ip4(struct gprs_ns_inst *nsi, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:84
int osmo_fsm_register(struct osmo_fsm *fsm)
static uint8_t * msgb_tvlv_put(struct msgb *msg, uint8_t tag, uint16_t len, const uint8_t *val)
Definition: gprs_ns2_sns.c:137
@ GPRS_NS2_EV_RX_BLOCK_ACK
Definition: gprs_ns2_vc_fsm.c:108
int osmo_sockaddr_str_from_sockaddr(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_storage *src)
#define llist_entry(ptr, type, member)
Definition: gprs_ns2_sns.c:110
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:204
struct sockaddr_storage sas
@ NS_PDUT_STATUS
Definition: gsm_08_16.h:50
struct osmo_stat_item_group * statg
Definition: gprs_ns.h:144
const struct osmo_sockaddr * gprs_ns2_ip_vc_local(const struct gprs_ns2_vc *nsvc)
Return the socket address of the local peer of a NS-VC.
Definition: gprs_ns2_udp.c:404
struct gprs_ns_ie_ip6_elem ip6
Definition: gprs_ns2_sns.c:123
@ NS_IE_IPv6_LIST
Definition: gsm_08_16.h:73
#define GRE_PTYPE_KAR
Definition: gprs_ns_frgre.c:47
@ GPRS_NS_LL_UDP
NS/UDP/IP.
Definition: gprs_ns.h:54
#define LOGPFSML(fi, level, fmt, args...)
void install_lib_element(int ntype, struct cmd_element *cmd)
static int update_ip6_elem(struct ns2_sns_state *gss, struct ns2_sns_elems *elems, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:587
struct ns2_sns_bind * sbind
Definition: gprs_ns2_sns.c:118
enum gprs_ns2_ll ll
Definition: gprs_ns2_vty.c:69
@ GPRS_NS2_ST_UNCONFIGURED
Definition: gprs_ns2_vc_fsm.c:91
void ns2_ip_set_txqueue_max_length(struct gprs_ns2_vc_bind *bind, unsigned int max_length)
Definition: gprs_ns2_udp.c:578
Section 10.3.2d List of IP6 Elements.
Definition: gsm_08_16.h:32
struct gprs_nsvc * nsvc_hack
Definition: gprs_ns_sns.c:29
size_t num_ip4_local
Definition: gprs_ns_sns.c:33
static struct osmo_fsm gprs_ns2_sns_bss_fsm
Definition: gprs_ns2_sns.c:2253
@ NS_CTR_BYTES_OUT
Definition: gprs_ns.c:132
static int nsfrgre_fd_cb(struct osmo_fd *bfd, unsigned int what)
Definition: gprs_ns_frgre.c:314
int gprs_ns2_sns_count(struct gprs_ns2_nse *nse)
gprs_ns2_sns_count
Definition: gprs_ns2_sns.c:2566
static int update_remote_ip4_elem(struct gprs_sns_state *gss, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:166
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
write Write running configuration to or terminal n Write configuration to the file(same as write file)\n") ALIAS(config_write_file
#define NS_TIMERS_HELP
Definition: gprs_ns.h:19
struct gprs_ns_ie_ip4_elem * ip4_local
Definition: gprs_ns_sns.c:32
@ 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:212
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
@ GPRS_SNS_ST_BSS_CONFIG_SGSN
SNS-CONFIG procedure (SGSN->BSS) ongoing.
Definition: gprs_ns2_sns.c:69
@ NS_CTR_LOST_RESET
Definition: gprs_ns.c:140
static struct gprs_ns_ie_ip4_elem * ns2_get_sbind_ip4_entry(struct ns2_sns_state *gss, struct ns2_sns_bind *sbind, struct ns2_sns_elems *endpoints)
Definition: gprs_ns2_sns.c:1814
uint8_t * msgb_data(const struct msgb *msg)
static struct llist_head ip_sns_default_binds
Definition: gprs_ns2_vty.c:64
static const struct value_string gprs_ns_timer_strs[]
Definition: gprs_ns_vty.c:55
sns_procedure
Definition: gprs_ns2_sns.c:98
struct llist_head list
Definition: gprs_ns2_sns.c:111
#define S(x)
Definition: gprs_ns2_vc_fsm.c:50
struct gprs_ns_ie_ip4_elem ip4
Definition: gprs_ns2_sns.c:122
#define GRE_PTYPE_FR
Definition: gprs_ns_frgre.c:45
#define LOGBIND(bind, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:16
#define log_tgt_mutex_unlock()
int gprs_ns2_ip_bind_set_priority(struct gprs_ns2_vc_bind *bind, uint8_t priority)
Set the socket priority of the given bind.
Definition: gprs_ns2_udp.c:507
#define IPPROTO_GRE
Definition: gprs_ns_frgre.c:50
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:955
struct llist_head nsvc
list of all VC
Definition: gprs_ns2_internal.h:290
uint8_t data_weight
data weight.
Definition: gprs_ns2_internal.h:257
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:2229
int family
Definition: gprs_ns2_sns.c:141
static struct vty_nse * vty_nse_alloc(uint16_t nsei)
Definition: gprs_ns2_vty.c:169
unsigned int remote_end_is_sgsn
Definition: gprs_ns.h:139
struct osmo_timer_list timer
Definition: gprs_ns2_vc_fsm.c:66
@ GPRS_NS2_EV_RX_ALIVE
Definition: gprs_ns2_vc_fsm.c:109
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:568
Definition: gprs_ns.h:245
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:239
#define LOGP(ss, level, fmt, args...)
int N
Definition: gprs_ns2_vc_fsm.c:55
@ SNS_PDUT_CONFIG_ACK
Definition: gsm_08_16.h:58
@ NS_CAUSE_UNKN_IP_TEST_FAILED
Definition: gsm_08_16.h:102
static int add_ip4_elem(struct ns2_sns_state *gss, struct ns2_sns_elems *elems, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns2_sns.c:498
static void vty_dump_sns_ip4(struct vty *vty, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:746
struct msgb * msgb_alloc(uint16_t size, const char *name)
static int llist_empty(const struct llist_head *head)
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:849
#define ip46_weight_sum_data(elems)
Definition: gprs_ns2_sns.c:254
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
#define S(x)
Definition: gprs_ns_sns.c:25
static struct llist_head nses
Definition: gprs_ns2_vty.c:63
@ NS_CAUSE_NSVC_UNKNOWN
Definition: gsm_08_16.h:88
@ NS_CAUSE_SEM_INCORR_PDU
Definition: gsm_08_16.h:90
@ GPRS_NS2_EV_RX_STATUS
Definition: gprs_ns2_vc_fsm.c:111
int ns2_vc_is_unblocked(struct gprs_ns2_vc *nsvc)
is the given NS-VC unblocked?
Definition: gprs_ns2_vc_fsm.c:983
struct gprs_nsvc * unknown_nsvc
a NSVC object that's needed to deal with packets for unknown NSVC
Definition: gprs_ns.h:88
struct osmo_stat_item * osmo_stat_item_group_get_item(struct osmo_stat_item_group *grp, unsigned int idx)
@ GPRS_SNS_EV_CONFIG_END
SNS-CONFIG with end flag received.
Definition: gprs_ns_sns.c:281
static void ns2_st_unblocked(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:443
gprs_ns2_vc_mode
Definition: gprs_ns2.h:25
int ns2_sns_add_sns_default_binds(struct gprs_ns2_nse *nse)
Definition: gprs_ns2_vty.c:1626
static void ns2_sns_st_configured_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:1458
bool accept_ipaccess
Definition: gprs_ns2_vty.c:72
uint32_t state
uniquely identifies NS-VC at SGSN
Definition: gprs_ns.h:131
static void gprs_sns_st_configured_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns_sns.c:551
@ NS2_SNS_EV_REQ_CHANGE_WEIGHT
a bind changed its weight
Definition: gprs_ns2_internal.h:352
int osmo_sockaddr_local_ip(struct osmo_sockaddr *local_ip, const struct osmo_sockaddr *remote_ip)
#define GPRS_SNS_FLAG_KEEP_SELECT_ENDPOINT_ORDER
Definition: gprs_ns2_sns.c:96
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:769
const char * name
Definition: gprs_ns2_vty.c:68
@ GPRS_SNS_EV_SIZE
Definition: gprs_ns_sns.c:278
static void ns2_sns_st_local_procedure_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:1486
uint32_t local_ip
Definition: gprs_ns.h:95
static void ns2_sns_st_sgsn_wait_config(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:2776
uint8_t trans_id
Definition: gprs_ns2_sns.c:185
struct gprs_ns2_vc_bind * bind
Definition: gprs_ns2_sns.c:112
uint8_t sig_weight
signalling weight.
Definition: gprs_ns.h:160
@ NS_CAUSE_NSVC_BLOCKED
Definition: gsm_08_16.h:87
struct osmo_fsm_inst * gprs_sns_bss_fsm_alloc(void *ctx, struct gprs_nsvc *nsvc, const char *id)
Definition: gprs_ns_sns.c:630
@ SNS_PDUT_DELETE
Definition: gsm_08_16.h:59
static int nsip_sendmsg(struct gprs_ns2_vc_bind *bind, struct msgb *msg, const struct osmo_sockaddr *dest)
Definition: gprs_ns2_udp.c:146
@ NS2_CS_SKIPPED
Skipped message.
Definition: gprs_ns2_internal.h:120
static int do_sns_change_weight(struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:182
static int ns2_sns_fsm_bss_timer_cb(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_sns.c:1771
@ NS2_SNS_EV_RX_SIZE
Definition: gprs_ns2_internal.h:338
bool nsvci_is_valid
Definition: gprs_ns2_internal.h:262
Definition: gprs_ns2_fr.c:91
@ NS2_SNS_EV_REQ_DELETE_BIND
remove a local bind from this NSE
Definition: gprs_ns2_internal.h:351
bool persistent
true if this NS was created by VTY or pcu socket)
Definition: gprs_ns2_internal.h:245
unsigned int enabled
Definition: gprs_ns.h:107
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:959
#define ENCAPS_STR
Definition: gprs_ns_vty.c:471
uint8_t sig_weight
Definition: gsm_08_16.h:27
void * osmo_iofd_get_data(const struct osmo_io_fd *iofd)
@ NS_PDUT_UNBLOCK_ACK
Definition: gsm_08_16.h:49
uint32_t ip_addr
Definition: gsm_08_16.h:25
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:304
static void ns2_sns_st_bss_size(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:803
struct gprs_ns_ie_ip6_elem * ip6
Definition: gprs_ns2_sns.c:133
int gprs_ns2_is_ip_bind(struct gprs_ns2_vc_bind *bind)
Is the given bind an IP bind?
Definition: gprs_ns2_udp.c:476
@ NS_CTR_PKTS_OUT
Definition: gprs_ns.c:130
int vty_out_newline(struct vty *)
struct gre_hdr __attribute__((packed))
DEFUN(cfg_ns, cfg_ns_cmd, "ns", "Configure the GPRS Network Service")
Definition: gprs_ns2_vty.c:254
bool sns_only
should this NS-VC only be used for SNS-SIZE and SNS-CONFIG?
Definition: gprs_ns2_internal.h:264
struct osmo_sockaddr addr
Definition: gprs_ns2_frgre.c:112
void ns2_sns_notify_alive(struct gprs_ns2_nse *nse, struct gprs_ns2_vc *nsvc, bool alive)
Definition: gprs_ns2_sns.c:2587
#define LOG_NS_SIGNAL(nsvc, direction, pdu_type, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:33
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:466
@ GPRS_NS2_AFF_CAUSE_SNS_FAILURE
Definition: gprs_ns2.h:85
@ NS2_SNS_EV_RX_CONFIG_ACK
Definition: gprs_ns2_internal.h:342
struct gprs_ns2_vc_bind * bind
pointer to NS VL bind.
Definition: gprs_ns2_internal.h:242
size_t num_max_ip6_remote
Definition: gprs_ns2_sns.c:181
@ NS_IE_IPv6_EP_NR
Definition: gsm_08_16.h:76
int gprs_ns2_sns_del_endpoint(struct gprs_ns2_nse *nse, const struct osmo_sockaddr *saddr)
gprs_ns2_sns_del_endpoint
Definition: gprs_ns2_sns.c:2513
@ SNS_PDUT_SIZE_ACK
Definition: gsm_08_16.h:61
int osmo_sockaddr_str_to_sockaddr(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_storage *dst)
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
static int ns2_validate_block(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
Definition: gprs_ns2_message.c:70
int dscp
Definition: gprs_ns2_vty.c:70
static int alive_timer_elapsed_ms(struct gprs_ns2_vc_priv *priv)
Definition: gprs_ns2_vc_fsm.c:189
int ns2_vc_fsm_start(struct gprs_ns2_vc *nsvc)
Start a NS-VC FSM.
Definition: gprs_ns2_vc_fsm.c:813
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:356
static int do_sns_change_weight(struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:629
uint16_t nsei
Definition: gprs_ns.h:128
static int ns_sns_append_remote_eps(struct osmo_fsm_inst *fi, const struct tlv_parsed *tp)
Definition: gprs_ns2_sns.c:1098
void osmo_iofd_set_txqueue_max_length(struct osmo_io_fd *iofd, unsigned int size)
int ns2_vc_is_unblocked(struct gprs_ns2_vc *nsvc)
is the given NS-VC unblocked?
Definition: gprs_ns2_vc_fsm.c:983
size_t num_max_nsvcs
Definition: gprs_ns_sns.c:37
enum gprs_ns2_vc_mode mode
Definition: gprs_ns2_internal.h:269
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:376
#define timespecsub(a, b, result)
@ GPRS_NS2_ST_UNBLOCKED
Definition: gprs_ns2_vc_fsm.c:94
uint32_t txqueue_max_length
Definition: gprs_ns2_internal.h:170
static int ip4_weight_sum(const struct ns2_sns_elems *elems, bool data_weight)
Definition: gprs_ns2_sns.c:216
static void vty_nse_free(struct vty_nse *vnse)
Definition: gprs_ns2_vty.c:181
static void recv_test_procedure(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_vc_fsm.c:201
static int do_sns_add(struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:230
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
struct llist_head binds
Definition: gprs_ns2_sns.c:147
int DNS
Definition: common_vty.c:66
Definition: gprs_ns2_sns.c:116
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:418
@ GPRS_NS_LL_FR_GRE
NS/FR/GRE/IP.
Definition: gprs_ns.h:56
void(* free_vc)(struct gprs_ns2_vc *nsvc)
free the vc priv data
Definition: gprs_ns2_internal.h:313
struct llist_head binding
linked lists of all NSVC binds (e.g.
Definition: gprs_ns2_internal.h:159
int osmo_iofd_get_fd(const struct osmo_io_fd *iofd)
@ GPRS_NS2_DIALECT_UNDEF
Definition: gprs_ns2.h:36
#define CMD_ERR_INCOMPLETE
static int ns2_tx_simple(struct gprs_ns2_vc *nsvc, uint8_t pdu_type)
Definition: gprs_ns2_message.c:178
static void ns2_sns_st_bss_config_sgsn(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:1157
@ NS_STAT_ALIVE_DELAY
Definition: gprs_ns.c:167
static void gprs_sns_st_size(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns_sns.c:313
int gprs_ns2_sns_del_bind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:2675
struct ns2_sns_elems remote
Definition: gprs_ns2_sns.c:175
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:273
static const struct osmo_fsm_state ns2_vc_states[]
Definition: gprs_ns2_vc_fsm.c:489
struct osmo_timer_list timer
vty_out(vty, "!%s", VTY_NEWLINE)
uint16_t nsei
Definition: gprs_ns2_internal.h:176
static struct gprs_ns2_vc * nsvc_for_bind_and_remote(struct gprs_ns2_nse *nse, struct gprs_ns2_vc_bind *bind, const struct osmo_sockaddr *remote)
Definition: gprs_ns2_sns.c:404
@ 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
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
static uint8_t * msgb_tv_put(struct msgb *msg, uint8_t tag, uint8_t val)
@ SNS_PDUT_SIZE
Definition: gsm_08_16.h:60
uint16_t timeout[NS_TIMERS_COUNT]
Definition: gprs_ns2_internal.h:164
static int ip4_weight_sum(const struct gprs_ns_ie_ip4_elem *ip4, unsigned int num, bool data_weight)
Definition: gprs_ns_sns.c:57
int ns2_vc_block(struct gprs_ns2_vc *nsvc)
Block a NS-VC.
Definition: gprs_ns2_vc_fsm.c:832
struct sns_endpoint * initial
Definition: gprs_ns2_sns.c:160
@ NS_CAUSE_INVAL_ESSENT_IE
Definition: gsm_08_16.h:93
struct osmo_fd fd
Definition: gprs_ns.h:94
@ GPRS_SNS_EV_ADD
Definition: gprs_ns_sns.c:283
static void ns2_sns_st_sgsn_wait_config_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:2827
struct osmo_io_fd * iofd
Definition: gprs_ns2_udp.c:50
static int gprs_sns_fsm_bss_timer_cb(struct osmo_fsm_inst *fi)
Definition: gprs_ns_sns.c:602
const char * osmo_sockaddr_to_str(const struct osmo_sockaddr *sockaddr)
uint8_t trans_id
Definition: gprs_ns2_sns.c:125
void vty_out_stat_item_group(struct vty *vty, const char *prefix, struct osmo_stat_item_group *statg)
void ns2_vty_dump_nsvc(struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats)
Definition: gprs_ns2_vty.c:1900
static struct gprs_ns2_vc * nsvc_by_ip6_elem(struct gprs_ns2_nse *nse, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:269
static bool vty_nse_check_sns(struct gprs_ns2_nse *nse)
Definition: gprs_ns2_vty.c:230