libosmogb  1.5.1
Osmocom Gb library
bssgp_bvc_fsm.h File Reference
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  bssgp_bvc_fsm_ops
 

Enumerations

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
}
 

Functions

struct osmo_fsm_instbssgp_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_instbssgp_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_instbssgp_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_instbssgp_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...
 

Enumeration Type Documentation

◆ 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 

Function Documentation

◆ bssgp_bvc_fsm_alloc_ptp_bss()

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).

Parameters
[in]ctxtalloc context from which to allocate
[in]nsiNS Instance on which this BVC operates
[in]nseiNS Entity Identifier on which this BVC operates
[in]bvciBVCI of this FSM
[in]ra_idRouting Area Identity of the cell (reported to SGSN)
[in]cell_idCell 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()

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).

Parameters
[in]ctxtalloc context from which to allocate
[in]nsiNS Instance on which this BVC operates
[in]nseiNS Entity Identifier on which this BVC operates
[in]bvciBVCI 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()

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).

Parameters
[in]ctxtalloc context from which to allocate
[in]nsiNS Instance on which this BVC operates
[in]nseiNS Entity Identifier on which this BVC operates
[in]featuresFeature [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()

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).

Parameters
[in]ctxtalloc context from which to allocate
[in]nsiNS Instance on which this BVC operates
[in]nseiNS Entity Identifier on which this BVC operates
[in]featuresFeature [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)

Determine the cause value why given BVC FSM is blocked.

References bvc_fsm_priv::block_cause, bssgp_bvc_fsm, osmo_fsm_inst::fsm, OSMO_ASSERT, and osmo_fsm_inst::priv.

◆ bssgp_bvc_fsm_get_features_advertised()

uint32_t bssgp_bvc_fsm_get_features_advertised ( struct osmo_fsm_inst fi)

Return the advertised features / extended features.

References bvc_fsm_priv::advertised, bssgp_bvc_fsm, bvc_fsm_priv::features, osmo_fsm_inst::fsm, OSMO_ASSERT, and osmo_fsm_inst::priv.

◆ bssgp_bvc_fsm_get_features_negotiated()

uint32_t bssgp_bvc_fsm_get_features_negotiated ( struct osmo_fsm_inst fi)

Return the negotiated features / extended features.

References bssgp_bvc_fsm, bvc_fsm_priv::features, osmo_fsm_inst::fsm, bvc_fsm_priv::negotiated, OSMO_ASSERT, and osmo_fsm_inst::priv.

◆ bssgp_bvc_fsm_get_features_received()

uint32_t bssgp_bvc_fsm_get_features_received ( struct osmo_fsm_inst fi)

Return the received features / extended features.

References bssgp_bvc_fsm, bvc_fsm_priv::features, osmo_fsm_inst::fsm, OSMO_ASSERT, osmo_fsm_inst::priv, and bvc_fsm_priv::received.

◆ bssgp_bvc_fsm_get_max_pdu_len()

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.

9.2.10)

References bssgp_bvc_fsm, osmo_fsm_inst::fsm, bvc_fsm_priv::max_pdu_len, OSMO_ASSERT, and osmo_fsm_inst::priv.

◆ bssgp_bvc_fsm_is_unblocked()

bool bssgp_bvc_fsm_is_unblocked ( struct osmo_fsm_inst fi)

Return if the given BVC FSM is in UNBLOCKED state.

References BSSGP_BVCFSM_S_UNBLOCKED, and osmo_fsm_inst::state.

◆ 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 
)

Set 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. 9.2.10)

References bssgp_bvc_fsm, osmo_fsm_inst::fsm, bvc_fsm_priv::max_pdu_len, OSMO_ASSERT, and osmo_fsm_inst::priv.

◆ bssgp_bvc_fsm_set_ops()

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.

Parameters
[in]fiFSM instance for which the data shall be set
[in]opsBSSGP BVC FSM operations (call-back functions) to register
[in]ops_privopaque/private data pointer passed through to call-backs

References bssgp_bvc_fsm, osmo_fsm_inst::fsm, bvc_fsm_priv::ops, bvc_fsm_priv::ops_priv, OSMO_ASSERT, and osmo_fsm_inst::priv.

NS_DESC_A
#define NS_DESC_A(st)
Definition: gprs_ns.h:49
stats.h
OSMO_FSM_TERM_ERROR
OSMO_FSM_TERM_ERROR
data_weight
uint8_t data_weight
Definition: gsm_08_16.h:5
GPRS_NS2_EV_REQ_OM_BLOCK
@ GPRS_NS2_EV_REQ_OM_BLOCK
Definition: gprs_ns2_vc_fsm.c:120
ns2_vc_unblock
int ns2_vc_unblock(struct gprs_ns2_vc *nsvc)
Unblock a NS-VC.
Definition: gprs_ns2_vc_fsm.c:754
sig_weight
uint8_t sig_weight
Definition: gsm_08_16.h:4
ns2_vc_fsm
static struct osmo_fsm ns2_vc_fsm
Definition: gprs_ns2_vc_fsm.c:676
ns2_sns_st_configured_add
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:1063
version
uint8_t version
vty::index
void * index
gprs_ns2_vc_priv
Definition: gprs_ns2_vc_fsm.c:54
gprs_ns2_ip_bind_by_sockaddr
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:283
config_write_ns_bind
static int config_write_ns_bind(struct vty *vty)
Definition: gprs_ns2_vty.c:559
gprs_ns2_vc_priv::mode
enum ns2_timeout mode
Definition: gprs_ns2_vc_fsm.c:71
gprs_ns_timer_strs
static const struct value_string gprs_ns_timer_strs[]
Definition: gprs_ns2_vty.c:90
osmo_timer_list
FR_ROLE_USER_EQUIPMENT
@ FR_ROLE_USER_EQUIPMENT
Definition: frame_relay.h:38
NS_CAUSE_INVAL_WEIGH
@ NS_CAUSE_INVAL_WEIGH
Definition: gsm_08_16.h:99
gprs_ns_tx_unblock
int gprs_ns_tx_unblock(struct gprs_nsvc *nsvc)
Transmit a NS-UNBLOCK on a given NS-VC.
Definition: gprs_ns.c:692
_config_write_ns_nse
static void _config_write_ns_nse(struct vty *vty, struct gprs_ns2_nse *nse)
Definition: gprs_ns2_vty.c:521
ns2_get_sns_endpoint
static struct sns_endpoint * ns2_get_sns_endpoint(struct ns2_sns_state *state, const struct osmo_sockaddr *saddr)
Definition: gprs_ns2_sns.c:1695
gprs_ns2_nsvc_by_sockaddr_nse
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:1095
nsip_vc_sendmsg
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:161
gprs_ns_inst::bss_sns_fi
struct osmo_fsm_inst * bss_sns_fi
Definition: gprs_ns.h:110
GPRS_NS2_EV_RX_UNBLOCK_ACK
@ GPRS_NS2_EV_RX_UNBLOCK_ACK
Definition: gprs_ns2_vc_fsm.c:110
gprs_ns2_vc::ctrg
struct rate_ctr_group * ctrg
Definition: gprs_ns2_internal.h:222
tlvp_val16be
static uint16_t tlvp_val16be(const struct tlv_parsed *tp, int pos)
osmo_sockaddr::sa
struct sockaddr sa
gprs_ns2_sns_del_bind
int gprs_ns2_sns_del_bind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:1898
LOGNSVC
#define LOGNSVC(nsvc, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:18
log_set_nsvc_filter
static void log_set_nsvc_filter(struct log_target *target, struct gprs_ns2_vc *nsvc)
Definition: gprs_ns2_vty.c:1937
nsip_fd_cb
static int nsip_fd_cb(struct osmo_fd *bfd, unsigned int what)
Definition: gprs_ns2_udp.c:266
gprs_ns2_ip_connect_inactive
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:1028
gprs_ns2_free_nse
void gprs_ns2_free_nse(struct gprs_ns2_nse *nse)
Destroy given NS Entity.
Definition: gprs_ns2.c:828
NS2_CS_CREATED
@ NS2_CS_CREATED
A NSVC object has been created.
Definition: gprs_ns2_internal.h:85
ns2_nsvc_create_ip4
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:320
ns2_tx_unblock_ack
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:356
GPRS_SNS_ST_CONFIGURED
@ GPRS_SNS_ST_CONFIGURED
Definition: gprs_ns_sns.c:275
NS_IE_NSEI
@ NS_IE_NSEI
Definition: gsm_08_16.h:70
ns2_tx_alive
int ns2_tx_alive(struct gprs_ns2_vc *nsvc)
Transmit a NS-ALIVE on a given NS-VC.
Definition: gprs_ns2_message.c:371
osmo_sockaddr_cmp
int osmo_sockaddr_cmp(const struct osmo_sockaddr *a, const struct osmo_sockaddr *b)
osmo_fsm_inst::priv
void * priv
ns2_tx_sns_ack
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:492
gprs_ns2_bind_by_name
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:1366
osmo_fsm_state
ip4_weight_sum_data
#define ip4_weight_sum_data(x, y)
Definition: gprs_ns2_sns.c:185
DNS
#define DNS
Definition: gprs_ns2_vc_fsm.c:52
vty_nse
Definition: gprs_ns2_vty.c:74
NS_IE_PDU
@ NS_IE_PDU
Definition: gsm_08_16.h:68
read_nsip_msg
static struct msgb * read_nsip_msg(struct osmo_fd *bfd, int *error, struct osmo_sockaddr *saddr, const struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_udp.c:173
gprs_ns2_vty_init
int gprs_ns2_vty_init(struct gprs_ns2_inst *nsi)
Definition: gprs_ns2_vty.c:2050
signal.h
gprs_ns2_ip_connect
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:1053
ns2_sns_state::num_ip4_remote
unsigned int num_ip4_remote
Definition: gprs_ns2_sns.c:157
gprs_ns2_vc::priv
void * priv
can be used by the bind/driver of the virtual circuit.
Definition: gprs_ns2_internal.h:217
nsip_sendmsg
static int nsip_sendmsg(struct gprs_ns2_vc_bind *bind, struct msgb *msg, struct osmo_sockaddr *dest)
Definition: gprs_ns2_udp.c:142
config_write_nsvc
static void config_write_nsvc(struct vty *vty, const struct gprs_ns2_vc *nsvc)
Definition: gprs_ns2_vty.c:470
vty_ll_names
const struct value_string vty_ll_names[]
Definition: gprs_ns2_vty.c:110
gprs_ns_ie_ip6_elem::data_weight
uint8_t data_weight
Definition: gsm_08_16.h:36
ns2_tx_status
int ns2_tx_status(struct gprs_ns2_vc *nsvc, uint8_t cause, uint16_t bvci, struct msgb *orig_msg)
Transmit a NS-STATUS on a given NS-VC.
Definition: gprs_ns2_message.c:429
vty_nse_bind::list
struct llist_head list
Definition: gprs_ns2_vty.c:85
vty.h
gprs_ns2_inst
An instance of the NS protocol stack.
Definition: gprs_ns2_internal.h:119
gprs_nsvc::persistent
unsigned int persistent
Definition: gprs_ns.h:140
get_value_string
const char * get_value_string(const struct value_string *vs, uint32_t val)
ns2_sns_st_configured
static void ns2_sns_st_configured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:1299
rate_ctr_add
void rate_ctr_add(struct rate_ctr *ctr, int inc)
gprs_ns2_vc_bind::statg
struct osmo_stat_item_group * statg
Definition: gprs_ns2_internal.h:271
osmo_fsm_inst_term
#define osmo_fsm_inst_term(fi, cause, data)
gprs_msgb.h
gprs_sns_st_unconfigured
static void gprs_sns_st_unconfigured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns_sns.c:301
gprs_bssgp.h
GPRS_NS2_EV_RX_UNITDATA
@ GPRS_NS2_EV_RX_UNITDATA
Definition: gprs_ns2_vc_fsm.c:117
ns2_vc_fsm_clean
static void ns2_vc_fsm_clean(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
Definition: gprs_ns2_vc_fsm.c:668
ns2_ip_get_bind_by_index
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:555
cause
uint8_t cause
vc_driver_ip
struct gprs_ns2_vc_driver vc_driver_ip
Definition: gprs_ns2_udp.c:43
vty_out_fsm_inst2
void vty_out_fsm_inst2(struct vty *vty, const char *prefix, struct osmo_fsm_inst *fsmi)
osmo_fsm::name
const char * name
vty_nse::list
struct llist_head list
Definition: gprs_ns2_vty.c:75
osmo_sock_init_osa_ofd
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)
GPRS_SNS_ST_UNCONFIGURED
@ GPRS_SNS_ST_UNCONFIGURED
Definition: gprs_ns_sns.c:271
pdu_type
uint8_t pdu_type
NS PDU type.
Definition: gsm_08_16.h:2
GPRS_SNS_ST_CONFIG_SGSN
@ GPRS_SNS_ST_CONFIG_SGSN
SNS-CONFIG procedure (SGSN->BSS) ongoing.
Definition: gprs_ns_sns.c:274
IPv6
@ IPv6
Definition: gprs_ns2_sns.c:61
NS_CAUSE_PROTO_ERR_UNSPEC
@ NS_CAUSE_PROTO_ERR_UNSPEC
Definition: gsm_08_16.h:92
ns2_tx_block_ack
int ns2_tx_block_ack(struct gprs_ns2_vc *nsvc)
Transmit a NS-BLOCK-ACK on a given NS-VC.
Definition: gprs_ns2_message.c:243
osmo_timer_add
void osmo_timer_add(struct osmo_timer_list *timer)
GPRS_NS2_AFF_CAUSE_SNS_CONFIGURED
@ GPRS_NS2_AFF_CAUSE_SNS_CONFIGURED
Definition: gprs_ns2.h:84
gprs_ns2_ip_bind_set_sns_weight
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:586
gprs_ns2_vty_init_reduced
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:2017
DLCI_STR
#define DLCI_STR
Definition: gprs_ns2_vty.c:56
gprs_ns2_internal.h
GPRS_SNS_ST_UNCONFIGURED
@ GPRS_SNS_ST_UNCONFIGURED
Definition: gprs_ns2_sns.c:65
gprs_ns2_vc_bind::dump_vty
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:263
NS_ALLOC_HEADROOM
#define NS_ALLOC_HEADROOM
Definition: gprs_ns.h:31
OSMO_ASSERT
#define OSMO_ASSERT(exp)
gprs_ns2_create_nse
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:780
GPRS_NS2_LL_FR_GRE
@ GPRS_NS2_LL_FR_GRE
NS/FR/GRE/IP.
Definition: gprs_ns2.h:48
vty_nse_remove_vbind
static int vty_nse_remove_vbind(struct vty_nse *vnse, struct vty_bind *vbind)
Definition: gprs_ns2_vty.c:207
priv_bind::dscp
int dscp
Definition: gprs_ns2_frgre.c:114
gprs_sns_init
int gprs_sns_init(void)
Definition: gprs_ns_sns.c:736
gprs_nsvc::nsi
struct gprs_ns_inst * nsi
pointer to NS Instance
Definition: gprs_ns.h:126
osmo_prim_init
static void osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap, unsigned int primitive, enum osmo_prim_operation operation, struct msgb *msg)
msgb_put
static unsigned char * msgb_put(struct msgb *msgb, unsigned int len)
gprs_ns2_sns_del_endpoint
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:1753
NS_TOUT_TNS_ALIVE
@ NS_TOUT_TNS_ALIVE
Definition: gprs_ns.h:39
NS_PDUT_BLOCK
@ NS_PDUT_BLOCK
Definition: gsm_08_16.h:46
ns2_vc_fsm_start
int ns2_vc_fsm_start(struct gprs_ns2_vc *nsvc)
Start a NS-VC FSM.
Definition: gprs_ns2_vc_fsm.c:727
GPRS_SNS_EV_CONFIG_ACK
@ GPRS_SNS_EV_CONFIG_ACK
Definition: gprs_ns_sns.c:282
remove_remote_ip4_elem
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
ns_vc_tx
static int ns_vc_tx(struct gprs_ns2_vc *nsvc, struct msgb *msg)
Definition: gprs_ns2_message.c:169
ns2_tx_sns_config_ack
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:603
NS_IE_VCI
@ NS_IE_VCI
Definition: gsm_08_16.h:67
GPRS_SNS_EV_RX_CONFIG_END
@ GPRS_SNS_EV_RX_CONFIG_END
SNS-CONFIG with end flag received.
Definition: gprs_ns2_sns.c:77
data
uint8_t data[0]
variable-length payload
Definition: gsm_08_16.h:3
gprs_sns_dump_vty
void gprs_sns_dump_vty(struct vty *vty, const struct gprs_ns_inst *nsi, bool stats)
Definition: gprs_ns_sns.c:753
vty_nsi
static struct gprs_ns_inst * vty_nsi
Definition: gprs_ns_vty.c:51
gprs_ns2_nse::nsvc
struct llist_head nsvc
llist head to hold all nsvc
Definition: gprs_ns2_internal.h:154
osmo_identifier_sanitize_buf
void osmo_identifier_sanitize_buf(char *str, const char *sep_chars, char replace_with)
ns2_st_blocked
static void ns2_st_blocked(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:329
ns2_sns_state::ip6_remote
struct gprs_ns_ie_ip6_elem * ip6_remote
Definition: gprs_ns2_sns.c:160
ns_inst_from_fi
static struct gprs_ns2_inst * ns_inst_from_fi(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_vc_fsm.c:142
gprs_ns2_vc_bind::sns_data_weight
uint8_t sns_data_weight
the IP-SNS data weight when doing dynamic configuration
Definition: gprs_ns2_internal.h:269
gprs_ns2_vc_bind::accept_ipaccess
bool accept_ipaccess
Definition: gprs_ns2_internal.h:244
gprs_ns2_vc_bind::send_vc
int(* send_vc)(struct gprs_ns2_vc *nsvc, struct msgb *msg)
send a msg over a VC
Definition: gprs_ns2_internal.h:257
LOG_FLT_GB_NSVC
LOG_FLT_GB_NSVC
NSE_CMD_STR
#define NSE_CMD_STR
Definition: gprs_ns_vty.c:280
GPRS_SNS_EV_RX_ADD
@ GPRS_SNS_EV_RX_ADD
Definition: gprs_ns2_sns.c:79
dump_ns_entities
static void dump_ns_entities(struct vty *vty, const struct gprs_ns2_inst *nsi, bool stats, bool persistent_only)
Definition: gprs_ns2_vty.c:1770
LOG_CTX_GB_NSVC
LOG_CTX_GB_NSVC
NS_PDUT_ALIVE_ACK
@ NS_PDUT_ALIVE_ACK
Definition: gsm_08_16.h:52
gprs_ns_tx_block
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
gprs_ns_inst::frgre
struct gprs_ns_inst::@15 frgre
NS-over-FR-over-GRE-over-IP specific bits.
common_vty.h
TLVP_PRES_LEN
#define TLVP_PRES_LEN(tp, tag, min_len)
dump_nse
static void dump_nse(struct vty *vty, const struct gprs_ns2_nse *nse, bool stats, bool persistent_only)
Definition: gprs_ns2_vty.c:1732
priv_vc
Definition: gprs_ns2_fr.c:119
GPRS_NS2_EV_RX_BLOCK
@ GPRS_NS2_EV_RX_BLOCK
Definition: gprs_ns2_vc_fsm.c:111
gprs_ns_frgre_listen
int gprs_ns_frgre_listen(struct gprs_ns_inst *nsi)
Definition: gprs_ns_frgre.c:326
ERR_IF_NSVC_USES_SNS
#define ERR_IF_NSVC_USES_SNS(nsvc, reason)
Definition: gprs_ns2_message.c:42
log_set_nse_filter
static void log_set_nse_filter(struct log_target *target, struct gprs_ns2_nse *nse)
Definition: gprs_ns2_vty.c:1925
NS_CAUSE_INVAL_NR_NS_VC
@ NS_CAUSE_INVAL_NR_NS_VC
Definition: gsm_08_16.h:98
gprs_ns_hdr::pdu_type
uint8_t pdu_type
NS PDU type.
Definition: gsm_08_16.h:18
ns2_vc_rx
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:764
gprs_ns2_ll
gprs_ns2_ll
Osmocom NS link layer types.
Definition: gprs_ns2.h:44
osmo_fd::cb
int(* cb)(struct osmo_fd *fd, unsigned int what)
dump_nsvc
static void dump_nsvc(struct vty *vty, struct gprs_ns2_vc *nsvc, bool stats)
Definition: gprs_ns2_vty.c:1711
ns2_sns_state::sns_endpoints
struct llist_head sns_endpoints
Definition: gprs_ns2_sns.c:121
ns2_nse_notify_unblocked
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:1239
gprs_ns_inst::use_reset_block_unblock
bool use_reset_block_unblock
IPA compatibility: NS-RESET/BLOCK/UNBLOCK even on IP-SNS.
Definition: gprs_ns.h:101
ns2_sns_state::ip6_local
struct gprs_ns_ie_ip6_elem * ip6_local
Definition: gprs_ns2_sns.c:146
PRIM_OP_INDICATION
PRIM_OP_INDICATION
ns2_tx_sns_size
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:646
alive_timeout_handler
static void alive_timeout_handler(void *data)
Definition: gprs_ns2_vc_fsm.c:196
VTY_NEWLINE
#define VTY_NEWLINE
ns2_tx_alive_ack
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:383
GPRS_SNS_EV_CHANGE_WEIGHT
@ GPRS_SNS_EV_CHANGE_WEIGHT
Definition: gprs_ns_sns.c:285
gprs_nsvc::ll
enum gprs_ns_ll ll
which link-layer are we based on?
Definition: gprs_ns.h:147
osmo_fsm::log_subsys
int log_subsys
msgb.h
handle_rx_gre_ipv4
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
ns2_prim_status_ind
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:541
gprs_ns2_vc::statg
struct osmo_stat_item_group * statg
Definition: gprs_ns2_internal.h:223
binds
static struct llist_head binds
Definition: gprs_ns2_vty.c:60
ns2_tx_reset
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
osmo_clock_gettime
int osmo_clock_gettime(clockid_t clk_id, struct timespec *tp)
SNS_PDUT_CHANGE_WEIGHT
@ SNS_PDUT_CHANGE_WEIGHT
Definition: gsm_08_16.h:56
osmo_fsm_inst_alloc
struct osmo_fsm_inst * osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv, int log_level, const char *id)
TLVP_LEN
#define TLVP_LEN(x, y)
ns2_st_unconfigured
static void ns2_st_unconfigured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:238
msg
uint8_t msg[0]
ns2_st_blocked_onenter
static void ns2_st_blocked_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_vc_fsm.c:306
gprs_ns2_vc_bind::accept_sns
bool accept_sns
Definition: gprs_ns2_internal.h:245
gprs_nsvc_delete
void gprs_nsvc_delete(struct gprs_nsvc *nsvc)
Delete given NS-VC.
Definition: gprs_ns.c:353
vty_nse_bind
Definition: gprs_ns2_vty.c:84
llist_for_each_entry_safe
#define llist_for_each_entry_safe(pos, n, head, member)
vty_dump_sns_ip4
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:1617
vty_bind::accept_sns
bool accept_sns
Definition: gprs_ns2_vty.c:69
ns2_validate_reset
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
ns2_validate
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:135
CMD_ERR_NOTHING_TODO
#define CMD_ERR_NOTHING_TODO
osmo_sockaddr
ns2_vc_event_names
static const struct value_string ns2_vc_event_names[]
Definition: gprs_ns2_vc_fsm.c:124
get_string_value
int get_string_value(const struct value_string *vs, const char *str)
ns_node
static struct cmd_node ns_node
Definition: gprs_ns2_vty.c:242
gprs_ns_ie_ip6_elem::ip_addr
struct in6_addr ip_addr
Definition: gsm_08_16.h:33
gprs_ns2_nse::nsi
struct gprs_ns2_inst * nsi
entry back to ns2_inst
Definition: gprs_ns2_internal.h:148
llist_head::next
struct llist_head * next
msgb_v_put
static uint8_t * msgb_v_put(struct msgb *msg, uint8_t val)
nsvc_by_ip4_elem
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
NS_DESC_B
#define NS_DESC_B(st)
Definition: gprs_ns.h:48
gprs_ns_inst::nsip
struct gprs_ns_inst::@14 nsip
NS-over-IP specific bits.
gprs_ns2_inst::nse
struct llist_head nse
linked lists of all NSVC in this instance
Definition: gprs_ns2_internal.h:130
ns2_tx_sns_config
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:550
NS_CTR_BLOCKED
@ NS_CTR_BLOCKED
Definition: gprs_ns.c:133
add_remote_ip6_elem
static int add_remote_ip6_elem(struct ns2_sns_state *gss, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:492
get_value_string_or_null
const char * get_value_string_or_null(const struct value_string *vs, uint32_t val)
rate_ctr.h
gprs_ns2_nse::ll
enum gprs_ns2_ll ll
which link-layer are we based on?
Definition: gprs_ns2_internal.h:170
ns2_tx_unblock
int ns2_tx_unblock(struct gprs_ns2_vc *nsvc)
Transmit a NS-UNBLOCK on a given NS-VC.
Definition: gprs_ns2_message.c:340
NS_CAUSE_INVAL_NR_IPv6_EP
@ NS_CAUSE_INVAL_NR_IPv6_EP
Definition: gsm_08_16.h:97
NS_CTR_LOST_ALIVE
@ NS_CTR_LOST_ALIVE
Definition: gprs_ns.c:139
name
const char * name
ns2_tx_sns_config
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:550
msgb_tv16_put
static uint8_t * msgb_tv16_put(struct msgb *msg, uint8_t tag, uint16_t val)
gprs_ns2_vc_priv::initiate_reset
bool initiate_reset
Definition: gprs_ns2_vc_fsm.c:62
LOG_CTX_GB_NSE
LOG_CTX_GB_NSE
osmo_sockaddr_to_str
const char * osmo_sockaddr_to_str(const struct osmo_sockaddr *sockaddr)
ns2_recv_unitdata
static void ns2_recv_unitdata(struct osmo_fsm_inst *fi, struct msgb *msg)
Definition: gprs_ns2_vc_fsm.c:545
vty_bind
Definition: gprs_ns2_vty.c:63
osmo_fsm_term_cause
osmo_fsm_term_cause
ns2_sns_state::ip4_local
struct gprs_ns_ie_ip4_elem * ip4_local
Definition: gprs_ns2_sns.c:142
gprs_ns2_fr_connect
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:963
OSMO_FD_READ
#define OSMO_FD_READ
NS_CAUSE_MISSING_ESSENT_IE
@ NS_CAUSE_MISSING_ESSENT_IE
Definition: gsm_08_16.h:94
gprs_ns2_is_ip_bind
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
ns2_vc_create_ip
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:295
ns2_sns_st_config_bss
static void ns2_sns_st_config_bss(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:863
gprs_ns2_vc_state
gprs_ns2_vc_state
Definition: gprs_ns2_vc_fsm.c:94
osmo_log_vty2tgt
struct log_target * osmo_log_vty2tgt(struct vty *vty)
osmo_sockaddr_str::ip
char ip[INET6_ADDRSTRLEN]
nsvc_by_ip4_elem
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:206
gprs_ns2_nse
Structure repesenting a NSE.
Definition: gprs_ns2_internal.h:144
GPRS_SNS_EV_REQ_ADD_BIND
@ GPRS_SNS_EV_REQ_ADD_BIND
Definition: gprs_ns2_sns.c:84
INIT_LLIST_HEAD
#define INIT_LLIST_HEAD(ptr)
vty_out_rate_ctr_group
void vty_out_rate_ctr_group(struct vty *vty, const char *prefix, struct rate_ctr_group *ctrg)
gprs_ns2_fr_nsvc_dlci
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
ns2_st_unconfigured_onenter
static void ns2_st_unconfigured_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_vc_fsm.c:233
gprs_ns2_sns_add_endpoint
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:1713
ns2_validate_status
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
@ NS_TOUT_TSNS_CONFIG_RETRIES
Definition: gprs_ns2_internal.h:64
gprs_sns_state::next_nsvci
uint16_t next_nsvci
Definition: gprs_ns_sns.c:47
gprs_ns2_vc_priv::nsvc
struct gprs_ns2_vc * nsvc
Definition: gprs_ns2_vc_fsm.c:55
osmo_ntohs
#define osmo_ntohs(x)
gprs_ns2_ip_bind_by_sockaddr
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:283
ns2_sns_state::initial_bind
struct ns2_sns_bind * initial_bind
Definition: gprs_ns2_sns.c:125
vty_nse::nsei
uint16_t nsei
Definition: gprs_ns2_vty.c:76
osmo_sockaddr::sin6
struct sockaddr_in6 sin6
GPRS_SNS_ST_CONFIG_SGSN
@ GPRS_SNS_ST_CONFIG_SGSN
SNS-CONFIG procedure (SGSN->BSS) ongoing.
Definition: gprs_ns2_sns.c:68
gprs_sns_event_names
static const struct value_string gprs_sns_event_names[]
Definition: gprs_ns2_sns.c:88
ns2_sns_st_config_sgsn
static void ns2_sns_st_config_sgsn(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:1029
ns_sns_configured_timeout
static int ns_sns_configured_timeout(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_sns.c:909
NS_TOUT_TNS_RESET
@ NS_TOUT_TNS_RESET
Definition: gprs_ns.h:36
ns2_sns_st_configured_delete
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:1129
GRE_PTYPE_IPv4
#define GRE_PTYPE_IPv4
Definition: gprs_ns_frgre.c:46
gprs_ns2_sns_count
int gprs_ns2_sns_count(struct gprs_ns2_nse *nse)
gprs_ns2_sns_count
Definition: gprs_ns2_sns.c:1806
gre_hdr::ptype
uint16_t ptype
Definition: gprs_ns2_fr.c:88
log_target::filter_data
void * filter_data[LOG_MAX_FILTERS+1]
ns2_st_alive_onleave
static void ns2_st_alive_onleave(struct osmo_fsm_inst *fi, uint32_t next_state)
Definition: gprs_ns2_vc_fsm.c:435
__attribute__
static __attribute__((constructor))
Definition: gprs_ns2_sns.c:1939
ns2_ip_bind_connect
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:386
do_sns_delete
static int do_sns_delete(struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:211
gprs_ns2_ip_bind_set_sns_weight
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:586
dump_ns_bind
static void dump_ns_bind(struct vty *vty, const struct gprs_ns2_inst *nsi, bool stats)
Definition: gprs_ns2_vty.c:1760
handle_nsip_write
static int handle_nsip_write(struct osmo_fd *bfd)
Definition: gprs_ns2_udp.c:260
gprs_nsvc::frgre
struct gprs_nsvc::@16::@19 frgre
osmo_fsm_inst
NS_TOUT_TNS_ALIVE_RETRIES
@ NS_TOUT_TNS_ALIVE_RETRIES
Definition: gprs_ns.h:40
GPRS_NS2_ST_RESET
@ GPRS_NS2_ST_RESET
Definition: gprs_ns2_vc_fsm.c:96
cmd_node
ns2_sns_state::ip4_remote
struct gprs_ns_ie_ip4_elem * ip4_remote
Definition: gprs_ns2_sns.c:156
tlvp_val8
static uint8_t tlvp_val8(const struct tlv_parsed *tp, uint8_t tag, uint8_t default_val)
ns2_tx_reset_ack
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:305
ns2_st_alive
static void ns2_st_alive(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:411
ns2_sns_state::num_max_nsvcs
size_t num_max_nsvcs
Definition: gprs_ns2_sns.c:151
GPRS_NS2_LL_FR
@ GPRS_NS2_LL_FR
NS/FR.
Definition: gprs_ns2.h:47
gprs_ns_ie_ip6_elem::udp_port
uint16_t udp_port
Definition: gsm_08_16.h:34
GPRS_SNS_EV_RX_CHANGE_WEIGHT
@ GPRS_SNS_EV_RX_CHANGE_WEIGHT
Definition: gprs_ns2_sns.c:81
gprs_ns_inst::local_port
uint16_t local_port
Definition: gprs_ns.h:96
NS2_CS_ERROR
@ NS2_CS_ERROR
Failed to process message.
Definition: gprs_ns2_internal.h:89
ns2_sns_state::N
int N
Definition: gprs_ns2_sns.c:137
ns_bind_node
static struct cmd_node ns_bind_node
Definition: gprs_ns2_vty.c:594
NS_CAUSE_INVAL_NR_IPv4_EP
@ NS_CAUSE_INVAL_NR_IPv4_EP
Definition: gsm_08_16.h:96
gprs_ns2_vc_bind::name
const char * name
unique name
Definition: gprs_ns2_internal.h:233
update_remote_ip6_elem
static int update_remote_ip6_elem(struct ns2_sns_state *gss, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:521
ns2_sns_write_vty
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:1677
gprs_nsvc::ctrg
struct rate_ctr_group * ctrg
Definition: gprs_ns.h:143
ns2_sns_st_size_onenter
static void ns2_sns_st_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:726
osmo_fsm
msgb_length
uint16_t msgb_length(const struct msgb *msg)
gprs_ns2_vc_bind::mtu
uint16_t mtu
MTU of a NS PDU on this bind.
Definition: gprs_ns2_internal.h:251
ns2_tx_sns_config_ack
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:603
llist_del
static void llist_del(struct llist_head *entry)
gprs_ns2_ip_vc_equal
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:464
gprs_ns_inst
An instance of the NS protocol stack.
Definition: gprs_ns.h:79
ns2_tx_sns_size_ack
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:691
ns2_create_vc
enum ns2_cs ns2_create_vc(struct gprs_ns2_vc_bind *bind, struct msgb *msg, 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:875
install_lib_element_ve
void install_lib_element_ve(struct cmd_element *cmd)
GPRS_NS2_VC_MODE_BLOCKRESET
@ 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
gprs_sns_state
Definition: gprs_ns_sns.c:27
ns2_sns_write_vty
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:1677
dump_vty
static void dump_vty(const struct gprs_ns2_vc_bind *bind, struct vty *vty, bool _stats)
Definition: gprs_ns2_udp.c:87
config_write_vbind
static void config_write_vbind(struct vty *vty, struct vty_bind *vbind)
Definition: gprs_ns2_vty.c:422
osmo_timer_list::timeout
struct timeval timeout
osmo_stat_item_set
void osmo_stat_item_set(struct osmo_stat_item *item, int32_t value)
llist_first_entry
#define llist_first_entry(ptr, type, member)
NS_IE_MAX_NR_NSVC
@ NS_IE_MAX_NR_NSVC
Definition: gsm_08_16.h:74
NS_PDUT_ALIVE
@ NS_PDUT_ALIVE
Definition: gsm_08_16.h:51
NS_CAUSE_EQUIP_FAIL
@ NS_CAUSE_EQUIP_FAIL
Definition: gsm_08_16.h:86
GPRS_NS2_DIALECT_STATIC_ALIVE
@ GPRS_NS2_DIALECT_STATIC_ALIVE
Definition: gprs_ns2.h:37
osmo_ntohl
#define osmo_ntohl(x)
gprs_ns_ll_str
const char * gprs_ns_ll_str(const struct gprs_nsvc *nsvc)
Definition: gprs_ns.c:1548
gprs_sns_event
gprs_sns_event
Definition: gprs_ns2_sns.c:72
TVLV_GROSS_LEN
static uint16_t TVLV_GROSS_LEN(uint16_t len)
gprs_ns2_ip_bind_sockaddr
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
gprs_ns_hdr::data
uint8_t data[0]
variable-length payload
Definition: gsm_08_16.h:19
ns2_msgb_alloc
struct msgb * ns2_msgb_alloc(void)
Allocate a message buffer for use with the NS2 stack.
Definition: gprs_ns2.c:670
ns2_sns_update_weights
void ns2_sns_update_weights(struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:1933
gprs_ns2_nse_sns_remote
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:234
log_set_context
int log_set_context(uint8_t ctx_nr, void *value)
ns2_sns_state::num_max_ip4_remote
size_t num_max_ip4_remote
Definition: gprs_ns2_sns.c:152
gprs_ns2_vc_priv::accept_unitdata
bool accept_unitdata
Definition: gprs_ns2_vc_fsm.c:66
ns2_validate_reset_ack
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
osmo_sock_init_ofd
int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto, const char *host, uint16_t port, unsigned int flags)
gprs_ns2_nse::bss_sns_fi
struct osmo_fsm_inst * bss_sns_fi
Definition: gprs_ns2_internal.h:175
gprs_nsvc_by_nsei
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
msgb
msgb_push
static unsigned char * msgb_push(struct msgb *msgb, unsigned int len)
gprs_ns2_ip_vc_remote
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
GPRS_SNS_EV_REQ_NO_NSVC
@ GPRS_SNS_EV_REQ_NO_NSVC
Definition: gprs_ns2_sns.c:82
gprs_nsvc_reset
int gprs_nsvc_reset(struct gprs_nsvc *nsvc, uint8_t cause)
Initiate a RESET procedure.
Definition: gprs_ns.c:2110
LOGL_INFO
#define LOGL_INFO
install_node
void install_node(struct cmd_node *node, int(*func)(struct vty *))
NS2_CS_REJECTED
@ NS2_CS_REJECTED
Rejected and answered message.
Definition: gprs_ns2_internal.h:87
ns2_sns_state::num_ip6_remote
unsigned int num_ip6_remote
Definition: gprs_ns2_sns.c:161
rate_ctr_inc
static void rate_ctr_inc(struct rate_ctr *ctr)
log_target
CONFIG_NODE
CONFIG_NODE
GPRS_NS2_VC_MODE_ALIVE
@ 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
@ GPRS_NS2_PRIM_UNIT_DATA
Definition: gprs_ns2.h:53
vty_fr_role_names
const struct value_string vty_fr_role_names[]
Definition: gprs_ns2_vty.c:104
GPRS_NS2_ST_RECOVERING
@ GPRS_NS2_ST_RECOVERING
Definition: gprs_ns2_vc_fsm.c:100
ns2_validate_block_ack
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
ns2_tx_unit_data
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:398
gprs_ns2_nsvc_by_sockaddr_bind
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:121
gprs_ns_ie_ip4_elem
Section 10.3.2c List of IP4 Elements.
Definition: gsm_08_16.h:24
NS_PDUT_RESET
@ NS_PDUT_RESET
Definition: gsm_08_16.h:44
DEFUN_HIDDEN
DEFUN_HIDDEN(show_ns, show_ns_cmd, "show ns", SHOW_STR SHOW_NS_STR)
Definition: gprs_ns2_vty.c:1781
config_write_ns
static int config_write_ns(struct vty *vty)
Definition: gprs_ns2_vty.c:570
gprs_sns_st_config_bss_onenter
static void gprs_sns_st_config_bss_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns_sns.c:364
NS_TIMERS
#define NS_TIMERS
Definition: gprs_ns.h:18
ns2_sns_state::sns_nsvc
struct gprs_ns2_vc * sns_nsvc
Definition: gprs_ns2_sns.c:135
gprs_ns_tx_sns_config
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
gprs_ns2_sns_add_bind
int gprs_ns2_sns_add_bind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:1867
NS_CAUSE_OM_INTERVENTION
@ NS_CAUSE_OM_INTERVENTION
Definition: gsm_08_16.h:85
gprs_ns_ll
gprs_ns_ll
Osmocom NS link layer types.
Definition: gprs_ns.h:53
gre_hdr
Definition: gprs_ns2_fr.c:86
gprs_ns2_nsvc_by_nsvci
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:761
config_write_ns_nse
static int config_write_ns_nse(struct vty *vty)
Definition: gprs_ns2_vty.c:545
gprs_ns2_nse::persistent
bool persistent
true if this NSE was created by VTY or pcu socket)
Definition: gprs_ns2_internal.h:160
ns2_vc_alloc
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:580
GPRS_NS2_DIALECT_STATIC_RESETBLOCK
@ GPRS_NS2_DIALECT_STATIC_RESETBLOCK
Definition: gprs_ns2.h:38
osmo_fsm_inst_dispatch
#define osmo_fsm_inst_dispatch(fi, event, data)
ns2_vc_force_unconfigured
int ns2_vc_force_unconfigured(struct gprs_ns2_vc *nsvc)
Reset a NS-VC FSM.
Definition: gprs_ns2_vc_fsm.c:738
gprs_ns.h
tlv.h
CFG_LOG_NODE
CFG_LOG_NODE
osmo_fr_network_alloc
struct osmo_fr_network * osmo_fr_network_alloc(void *ctx)
Definition: frame_relay.c:898
gprs_ns2_vc_bind::sns_sig_weight
uint8_t sns_sig_weight
the IP-SNS signalling weight when doing dynamic configuration
Definition: gprs_ns2_internal.h:267
osmo_gprs_ns2_prim
Definition: gprs_ns2.h:109
nsei
uint16_t nsei
Identifiers of a BTS, equal to 'struct bssgp_bts_ctx'.
Definition: gprs_msgb.h:9
GPRS_SNS_ST_CONFIG_BSS
@ GPRS_SNS_ST_CONFIG_BSS
SNS-CONFIG procedure (BSS->SGSN) ongoing.
Definition: gprs_ns_sns.c:273
GPRS_SNS_ST_CONFIGURED
@ GPRS_SNS_ST_CONFIGURED
Definition: gprs_ns2_sns.c:69
NS_CTR_BYTES_OUT_DROP
@ NS_CTR_BYTES_OUT_DROP
Definition: gprs_ns2_internal.h:98
handle_nsip_read
static int handle_nsip_read(struct osmo_fd *bfd)
Definition: gprs_ns2_udp.c:217
gprs_sns_st_configured
static void gprs_sns_st_configured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns_sns.c:434
create_missing_nsvcs
static int create_missing_nsvcs(struct osmo_fsm_inst *fi)
Definition: gprs_ns_sns.c:108
ns2_bind_alloc
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:1482
vty_bind::ip_sns_data_weight
uint8_t ip_sns_data_weight
Definition: gprs_ns2_vty.c:71
gprs_ns2_vc_driver::name
const char * name
Definition: gprs_ns2_internal.h:275
msgb_free
void msgb_free(struct msgb *m)
GPRS_NS2_EV_RX_ALIVE_ACK
@ GPRS_NS2_EV_RX_ALIVE_ACK
Definition: gprs_ns2_vc_fsm.c:114
msgb_nsei
#define msgb_nsei(__x)
Definition: gprs_msgb.h:23
GPRS_NS2_ST_BLOCKED
@ GPRS_NS2_ST_BLOCKED
Definition: gprs_ns2_vc_fsm.c:97
vty_out_fsm_inst
void vty_out_fsm_inst(struct vty *vty, struct osmo_fsm_inst *fsmi)
dump_nse
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
@ GPRS_NS2_EV_RX_UNBLOCK
Definition: gprs_ns2_vc_fsm.c:109
byteswap.h
gprs_nsvc::nsvci
uint16_t nsvci
end-to-end significance
Definition: gprs_ns.h:129
vty
vty_nsi
static struct gprs_ns2_inst * vty_nsi
Definition: gprs_ns2_vty.c:58
gprs_ns2_fr_bind_role
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:905
ns2_ip_count_bind
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:533
osmo_fd_close
void osmo_fd_close(struct osmo_fd *fd)
vty_nse::binds
struct llist_head binds
Definition: gprs_ns2_vty.c:80
gprs_ns2_cause_str
static const char * gprs_ns2_cause_str(enum ns_cause val)
Obtain a human-readable string for NS primitives.
Definition: gprs_ns2.h:106
NS_TOUT_TNS_BLOCK_RETRIES
@ NS_TOUT_TNS_BLOCK_RETRIES
Definition: gprs_ns.h:35
gprs_ns2_vc
Structure representing a single NS-VC.
Definition: gprs_ns2_internal.h:188
ns2_vc_fsm_timer_cb
static int ns2_vc_fsm_timer_cb(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_vc_fsm.c:492
NS_CAUSE_BVCI_UNKNOWN
@ NS_CAUSE_BVCI_UNKNOWN
Definition: gsm_08_16.h:89
gprs_sns_state::num_ip4_remote
unsigned int num_ip4_remote
Definition: gprs_ns_sns.c:42
gprs_ns2_vc::nse
struct gprs_ns2_nse * nse
pointer to NS Instance
Definition: gprs_ns2_internal.h:196
GPRS_NS2_EV_REQ_OM_UNBLOCK
@ GPRS_NS2_EV_REQ_OM_UNBLOCK
Definition: gprs_ns2_vc_fsm.c:121
gprs_ns2.h
vty_bind_by_name
static struct vty_bind * vty_bind_by_name(const char *name)
Definition: gprs_ns2_vty.c:117
ns2_sns_update_weights
void ns2_sns_update_weights(struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:1933
ns2_sns_st_unconfigured
static void ns2_sns_st_unconfigured(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:697
gprs_ns2_vc_priv::timer_started
struct timespec timer_started
Definition: gprs_ns2_vc_fsm.c:73
handle_nsfrgre_read
static int handle_nsfrgre_read(struct osmo_fd *bfd)
Definition: gprs_ns_frgre.c:249
CMD_WARNING
#define CMD_WARNING
GPRS_NS2_LL_UNDEF
@ GPRS_NS2_LL_UNDEF
undefined, used by vty
Definition: gprs_ns2.h:45
GPRS_SNS_EV_REQ_SELECT_ENDPOINT
@ GPRS_SNS_EV_REQ_SELECT_ENDPOINT
Select a SNS endpoint from the list.
Definition: gprs_ns2_sns.c:73
NS_ALLOC_SIZE
#define NS_ALLOC_SIZE
Definition: gprs_ns.h:30
gprs_ns_frgre_sendmsg
int gprs_ns_frgre_sendmsg(struct gprs_nsvc *nsvc, struct msgb *msg)
Definition: gprs_ns_frgre.c:282
ns2_sns_state::reselection_running
bool reselection_running
Definition: gprs_ns2_sns.c:127
NS_CAUSE_UNKN_IP_ADDR
@ NS_CAUSE_UNKN_IP_ADDR
Definition: gsm_08_16.h:101
sns_endpoint::saddr
struct osmo_sockaddr saddr
Definition: gprs_ns2_sns.c:107
gprs_ns2_fr_bind
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:798
gprs_ns2_ip_bind_set_dscp
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:510
gprs_ns_tx_sns_size
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
ns_sns_st_config_sgsn_ip4
static void ns_sns_st_config_sgsn_ip4(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:919
osmo_timer_schedule
void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds)
NS_CTR_PKTS_OUT_DROP
@ NS_CTR_PKTS_OUT_DROP
Definition: gprs_ns2_internal.h:95
ENABLE_NODE
ENABLE_NODE
osmo_fsm_inst_state_name
static const char * osmo_fsm_inst_state_name(struct osmo_fsm_inst *fi)
osmo_htonl
#define osmo_htonl(x)
gprs_nsvc::data_weight
uint8_t data_weight
signaling weight.
Definition: gprs_ns.h:162
osmo_signal_dispatch
void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data)
stop_test_procedure
static void stop_test_procedure(struct gprs_ns2_vc_priv *priv)
Definition: gprs_ns2_vc_fsm.c:163
gprs_ns2_vc_priv::alive
struct gprs_ns2_vc_priv::@27 alive
GPRS_SNS_EV_SIZE_ACK
@ GPRS_SNS_EV_SIZE_ACK
Definition: gprs_ns_sns.c:279
ns2_vc_unblock
int ns2_vc_unblock(struct gprs_ns2_vc *nsvc)
Unblock a NS-VC.
Definition: gprs_ns2_vc_fsm.c:754
vty::node
int node
NS2_CS_FOUND
@ NS2_CS_FOUND
A NSVC object has been found.
Definition: gprs_ns2_internal.h:86
GPRS_NS2_EV_REQ_START
@ GPRS_NS2_EV_REQ_START
Definition: gprs_ns2_vc_fsm.c:104
ns2_sns_state::num_ip6_local
size_t num_ip6_local
Definition: gprs_ns2_sns.c:147
ns2_sns_state::num_ip4_local
size_t num_ip4_local
Definition: gprs_ns2_sns.c:143
ns2_st_reset_onenter
static void ns2_st_reset_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_vc_fsm.c:264
sns_endpoint
Definition: gprs_ns2_sns.c:105
ns2_st_reset
static void ns2_st_reset(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:279
gprs_ns_inst::dscp
int dscp
Definition: gprs_ns.h:99
GPRS_SNS_EV_RX_SIZE_ACK
@ GPRS_SNS_EV_RX_SIZE_ACK
Definition: gprs_ns2_sns.c:75
gprs_ns2_sns_add_endpoint
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:1713
ns2_sns_type
ns2_sns_type
Definition: gprs_ns2_sns.c:59
log_set_nsvc_filter
static void log_set_nsvc_filter(struct log_target *target, struct gprs_nsvc *nsvc)
Definition: gprs_ns_vty.c:67
gprs_ns2_vc_priv::initiator
bool initiator
Definition: gprs_ns2_vc_fsm.c:60
gprs_ns2_vc::fi
struct osmo_fsm_inst * fi
Definition: gprs_ns2_internal.h:227
NS_TOUT_TSNS_PROV
@ NS_TOUT_TSNS_PROV
Definition: gprs_ns.h:41
vty_bind_alloc
static struct vty_bind * vty_bind_alloc(const char *name)
Definition: gprs_ns2_vty.c:127
vty_bind_free
static void vty_bind_free(struct vty_bind *vbind)
Definition: gprs_ns2_vty.c:145
vty_nse_bind::vbind
struct vty_bind * vbind
Definition: gprs_ns2_vty.c:86
gprs_nsvc
Structure representing a single NS-VC.
Definition: gprs_ns.h:122
gprs_ns_hdr
Common header of GPRS NS.
Definition: gsm_08_16.h:17
gprs_sns_st_size_onenter
static void gprs_sns_st_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns_sns.c:334
rate_ctr_group::ctr
struct rate_ctr ctr[0]
ns2_sns_st_configured_change
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:1251
L_NS_NODE
L_NS_NODE
LOGNSE
#define LOGNSE(nse, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:11
osmo_fsm_inst::state
uint32_t state
gprs_sns_event_names
static const struct value_string gprs_sns_event_names[]
Definition: gprs_ns_sns.c:288
gprs_ns2_vc_bind
Structure repesenting a bind instance.
Definition: gprs_ns2_internal.h:231
create_missing_nsvcs
static int create_missing_nsvcs(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_sns.c:347
ns2_tx_block_ack
int ns2_tx_block_ack(struct gprs_ns2_vc *nsvc)
Transmit a NS-BLOCK-ACK on a given NS-VC.
Definition: gprs_ns2_message.c:243
nse_inst_from_fi
static struct gprs_ns2_nse * nse_inst_from_fi(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_sns.c:164
GPRS_SNS_EV_RX_SIZE
@ GPRS_SNS_EV_RX_SIZE
Definition: gprs_ns2_sns.c:74
ns2_vc_force_unconfigured
int ns2_vc_force_unconfigured(struct gprs_ns2_vc *nsvc)
Reset a NS-VC FSM.
Definition: gprs_ns2_vc_fsm.c:738
NS_CTR_UNBLOCKED
@ NS_CTR_UNBLOCKED
Definition: gprs_ns2_internal.h:100
NS_IE_BVCI
@ NS_IE_BVCI
Definition: gsm_08_16.h:69
event
event
talloc.h
gprs_sns_state::nsi
struct gprs_ns_inst * nsi
Definition: gprs_ns_sns.c:28
gprs_sns_dump_vty
void gprs_sns_dump_vty(struct vty *vty, const struct gprs_ns_inst *nsi, bool stats)
Definition: gprs_ns_sns.c:753
gprs_ns2_vc_bind::transfer_capability
int transfer_capability
transfer capability in mbit
Definition: gprs_ns2_internal.h:248
vty_nse_add_vbind
static int vty_nse_add_vbind(struct vty_nse *vnse, struct vty_bind *vbind)
Definition: gprs_ns2_vty.c:186
ns_nse_node
static struct cmd_node ns_nse_node
Definition: gprs_ns2_vty.c:861
handle_nsfrgre_write
static int handle_nsfrgre_write(struct osmo_fd *bfd)
Definition: gprs_ns_frgre.c:276
GPRS_SNS_EV_DELETE
@ GPRS_SNS_EV_DELETE
Definition: gprs_ns_sns.c:284
gprs_ns2_vc_event
gprs_ns2_vc_event
Definition: gprs_ns2_vc_fsm.c:103
NS_IE_CAUSE
@ NS_IE_CAUSE
Definition: gsm_08_16.h:66
priv_vc::remote
struct osmo_sockaddr remote
Definition: gprs_ns2_fr.c:120
ns_node
static struct cmd_node ns_node
Definition: gprs_ns_vty.c:79
remove_remote_ip6_elem
static int remove_remote_ip6_elem(struct ns2_sns_state *gss, const struct gprs_ns_ie_ip6_elem *ip6)
Definition: gprs_ns2_sns.c:505
GPRS_SNS_EV_CONFIG
@ GPRS_SNS_EV_CONFIG
Definition: gprs_ns_sns.c:280
osmo_identifier_valid
bool osmo_identifier_valid(const char *str)
GPRS_NS2_ENDPOINT_REQUEST_CHANGE
@ GPRS_NS2_ENDPOINT_REQUEST_CHANGE
Definition: gprs_ns2.h:99
ns2_sns_state::ip
enum ns2_sns_type ip
Definition: gprs_ns2_sns.c:118
SNS_PDUT_ADD
@ SNS_PDUT_ADD
Definition: gsm_08_16.h:55
TLVP_PRESENT
#define TLVP_PRESENT(x, y)
gprs_ns_rx_sns
int gprs_ns_rx_sns(struct gprs_ns_inst *nsi, struct msgb *msg, struct tlv_parsed *tp)
Definition: gprs_ns_sns.c:686
ns2_vc_fsm_allstate_action
static void ns2_vc_fsm_allstate_action(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:579
gprs_ns2_vc_driver::free_bind
void(* free_bind)(struct gprs_ns2_vc_bind *driver)
Definition: gprs_ns2_internal.h:277
NS_PDUT_RESET_ACK
@ NS_PDUT_RESET_ACK
Definition: gsm_08_16.h:45
GPRS_SNS_ST_SIZE
@ GPRS_SNS_ST_SIZE
SNS-SIZE procedure ongoing.
Definition: gprs_ns_sns.c:272
llist_head
NS_IE_IP_ADDR
@ NS_IE_IP_ADDR
Definition: gsm_08_16.h:78
ns2_sns_state::nse
struct gprs_ns2_nse * nse
Definition: gprs_ns2_sns.c:116
ns2_timeout
ns2_timeout
Definition: gprs_ns2_internal.h:54
vty_bind::list
struct llist_head list
Definition: gprs_ns2_vty.c:64
if
if(vty->type==VTY_SHELL_SERV)
gprs_nsvc_by_rem_addr
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
gre_hdr::flags
uint16_t flags
Definition: gprs_ns2_fr.c:87
nsvc_force_unconf_cb
static int nsvc_force_unconf_cb(struct gprs_ns2_vc *nsvc, void *ctx)
Definition: gprs_ns2_vty.c:1861
gprs_sns_st_config_bss
static void gprs_sns_st_config_bss(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns_sns.c:343
gprs_ns_ie_ip6_elem::sig_weight
uint8_t sig_weight
Definition: gsm_08_16.h:35
ip4_weight_sum_data
#define ip4_weight_sum_data(x, y)
Definition: gprs_ns_sns.c:71
gprs_sns_bss_states
static const struct osmo_fsm_state gprs_sns_bss_states[]
Definition: gprs_ns_sns.c:557
log_tgt_mutex_lock
#define log_tgt_mutex_lock()
osmo_fr_network
Definition: frame_relay.h:53
NS_TOUT_TNS_TEST
@ NS_TOUT_TNS_TEST
Definition: gprs_ns.h:38
NSVCI_STR
#define NSVCI_STR
Definition: gprs_ns2_vty.c:55
sns_endpoint::list
struct llist_head list
Definition: gprs_ns2_sns.c:106
gprs_ns2_vc_bind::nsi
struct gprs_ns2_inst * nsi
a pointer back to the nsi
Definition: gprs_ns2_internal.h:241
DEFUN
DEFUN(cfg_ns, cfg_ns_cmd, "ns", "Configure the GPRS Network Service")
Definition: gprs_ns_vty.c:162
gprs_ns_tx_sns_ack
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
osmo_fsm_inst::T
int T
osmo_timer_pending
int osmo_timer_pending(struct osmo_timer_list *timer)
osmo_sockaddr::u
union osmo_sockaddr::@22 u
ns2_tx_block
int ns2_tx_block(struct gprs_ns2_vc *nsvc, uint8_t cause)
Transmit a NS-BLOCK on a given NS-VC.
Definition: gprs_ns2_message.c:211
gprs_ns_inst::gprs_nsvcs
struct llist_head gprs_nsvcs
linked lists of all NSVC in this instance
Definition: gprs_ns.h:84
ip4_weight_sum
static int ip4_weight_sum(const struct gprs_ns_ie_ip4_elem *ip4, unsigned int num, bool data_weight)
Definition: gprs_ns2_sns.c:171
gb_internal.h
gprs_ns_pdu_strings
const struct value_string gprs_ns_pdu_strings[]
Definition: gprs_ns.c:398
NS_PDUT_BLOCK_ACK
@ NS_PDUT_BLOCK_ACK
Definition: gsm_08_16.h:47
msgb_l2len
static unsigned int msgb_l2len(const struct msgb *msgb)
ns_nse_nsvc_udp_cmds
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:1041
GPRS_SNS_EV_START
@ GPRS_SNS_EV_START
Definition: gprs_ns_sns.c:277
ns2_nsvc_create_ip6
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:333
ns2_sns_st_config_sgsn_onenter
static void ns2_sns_st_config_sgsn_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:1021
osmo_timer_setup
void osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data)
gprs_ns2_vc_bind::priv
void * priv
driver private structure
Definition: gprs_ns2_internal.h:239
OSMO_FSM_TERM_REQUEST
OSMO_FSM_TERM_REQUEST
ns2_dialect_to_vc_mode
enum gprs_ns2_vc_mode ns2_dialect_to_vc_mode(enum gprs_ns2_dialect dialect)
Definition: gprs_ns2.c:1378
ns2_clear_ipv46_entries
static void ns2_clear_ipv46_entries(struct ns2_sns_state *gss)
Definition: gprs_ns2_sns.c:282
GPRS_NS2_DIALECT_IPACCESS
@ GPRS_NS2_DIALECT_IPACCESS
Definition: gprs_ns2.h:39
TLVP_VAL_MINLEN
#define TLVP_VAL_MINLEN(_tp, tag, min_len)
GPRS_NS2_DIALECT_SNS
@ GPRS_NS2_DIALECT_SNS
Definition: gprs_ns2.h:40
osmo_fsm_inst_state_chg
#define osmo_fsm_inst_state_chg(fi, new_state, timeout_secs, T)
gprs_sns_st_config_sgsn
static void gprs_sns_st_config_sgsn(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns_sns.c:371
GPRS_NS2_AFF_CAUSE_VC_RECOVERY
@ GPRS_NS2_AFF_CAUSE_VC_RECOVERY
Definition: gprs_ns2.h:80
gsm_08_16.h
gprs_ns_ie_ip4_elem::udp_port
uint16_t udp_port
Definition: gsm_08_16.h:26
gprs_sns_bss_state
gprs_sns_bss_state
Definition: gprs_ns2_sns.c:64
ns2_st_unblocked_on_enter
static void ns2_st_unblocked_on_enter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_vc_fsm.c:380
ns2_sns_bss_states
static const struct osmo_fsm_state ns2_sns_bss_states[]
Definition: gprs_ns2_sns.c:1326
gprs_nsvc_create2
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
ip_addr
uint32_t ip_addr
Definition: gsm_08_16.h:2
vty_fr_network
static struct osmo_fr_network * vty_fr_network
Definition: gprs_ns2_vty.c:59
ns2_sns_state::alive
bool alive
Definition: gprs_ns2_sns.c:139
GPRS_NS2_AFF_CAUSE_SNS_NO_ENDPOINTS
@ GPRS_NS2_AFF_CAUSE_SNS_NO_ENDPOINTS
Definition: gprs_ns2.h:86
gprs_ns2_start_alive_all_nsvcs
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:1311
gprs_sns_state::num_max_ip4_remote
size_t num_max_ip4_remote
Definition: gprs_ns_sns.c:38
gprs_ns2_vc_bind::driver
struct gprs_ns2_vc_driver * driver
Definition: gprs_ns2_internal.h:242
ns_inst_from_fi
static struct gprs_ns_inst * ns_inst_from_fi(struct osmo_fsm_inst *fi)
Definition: gprs_ns_sns.c:50
gprs_sns_bss_fsm_start
int gprs_sns_bss_fsm_start(struct gprs_ns_inst *nsi)
Definition: gprs_ns_sns.c:680
ns2_sns_st_config_bss_onenter
static void ns2_sns_st_config_bss_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:884
osmo_sock_local_ip
int osmo_sock_local_ip(char *local_ip, const char *remote_ip)
ns2_tx_unblock_ack
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:356
llist_count
static unsigned int llist_count(const struct llist_head *head)
NS_PDUT_UNITDATA
@ NS_PDUT_UNITDATA
Definition: gsm_08_16.h:43
osmo_fr_role
osmo_fr_role
Definition: frame_relay.h:37
osmo_sockaddr_str_from_str
int osmo_sockaddr_str_from_str(struct osmo_sockaddr_str *sockaddr_str, const char *ip, uint16_t port)
vty_dump_sns_ip6
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:1624
NS_TOUT_TSNS_SIZE_RETRIES
@ NS_TOUT_TSNS_SIZE_RETRIES
Definition: gprs_ns2_internal.h:63
NS_IE_RESET_FLAG
@ NS_IE_RESET_FLAG
Definition: gsm_08_16.h:77
do_sns_delete
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:595
gprs_ns2_vc_bind::ll
enum gprs_ns2_ll ll
which link-layer are we based on?
Definition: gprs_ns2_internal.h:254
S
#define S(x)
Definition: gprs_ns2_sns.c:57
update_remote_ip4_elem
static int update_remote_ip4_elem(struct ns2_sns_state *gss, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns2_sns.c:475
ns2_tx_sns_ack
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:492
config_write_ns
static int config_write_ns(struct vty *vty)
Definition: gprs_ns_vty.c:85
llist_for_each_entry
#define llist_for_each_entry(pos, head, member)
ip6_weight_sum_sig
#define ip6_weight_sum_sig(x, y)
Definition: gprs_ns2_sns.c:204
read_nsfrgre_msg
static struct msgb * read_nsfrgre_msg(struct osmo_fd *bfd, int *error, struct sockaddr_in *saddr)
Definition: gprs_ns_frgre.c:147
ns2_vc_fsm_alloc
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:704
free_vc
static void free_vc(struct gprs_ns2_vc *nsvc)
Definition: gprs_ns2_udp.c:74
add_remote_ip4_elem
static int add_remote_ip4_elem(struct ns2_sns_state *gss, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns2_sns.c:435
gprs_sns_bss_fsm
static struct osmo_fsm gprs_sns_bss_fsm
Definition: gprs_ns_sns.c:617
SHOW_NS_STR
#define SHOW_NS_STR
Definition: gprs_ns2_vty.c:54
gprs_ns2_free_nsvc
void gprs_ns2_free_nsvc(struct gprs_ns2_vc *nsvc)
Destroy/release given NS-VC.
Definition: gprs_ns2.c:627
bvci
uint16_t bvci
Definition: gprs_msgb.h:10
ns2_validate
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:135
LOGL_NOTICE
#define LOGL_NOTICE
NS_TOUT_TNS_BLOCK
@ NS_TOUT_TNS_BLOCK
Definition: gprs_ns.h:34
ns2_st_alive_onenter
static void ns2_st_alive_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_vc_fsm.c:420
gprs_ns2_ip_bind
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:310
prim.h
gprs_ns2_ll_str
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:301
ip4_weight_sum_sig
#define ip4_weight_sum_sig(x, y)
Definition: gprs_ns_sns.c:72
gprs_ns_rcvmsg
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
GPRS_NS2_EV_RX_RESET
@ GPRS_NS2_EV_RX_RESET
Definition: gprs_ns2_vc_fsm.c:107
llist_add
static void llist_add(struct llist_head *_new, struct llist_head *head)
osmo_sockaddr::sin
struct sockaddr_in sin
gprs_ns2_sns_add_bind
int gprs_ns2_sns_add_bind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:1867
ns2_vc_block
int ns2_vc_block(struct gprs_ns2_vc *nsvc)
Block a NS-VC.
Definition: gprs_ns2_vc_fsm.c:746
value_string
SNS_PDUT_CONFIG
@ SNS_PDUT_CONFIG
Definition: gsm_08_16.h:57
GPRS_SNS_EV_REQ_NSVC_ALIVE
@ GPRS_SNS_EV_REQ_NSVC_ALIVE
a NS-VC became alive
Definition: gprs_ns2_sns.c:83
FR_ROLE_NETWORK_EQUIPMENT
@ FR_ROLE_NETWORK_EQUIPMENT
Definition: frame_relay.h:39
NS_IE_IPv4_EP_NR
@ NS_IE_IPv4_EP_NR
Definition: gsm_08_16.h:75
GPRS_SNS_ST_SIZE
@ GPRS_SNS_ST_SIZE
SNS-SIZE procedure ongoing.
Definition: gprs_ns2_sns.c:66
dump_bind
static void dump_bind(struct vty *vty, const struct gprs_ns2_vc_bind *bind, bool stats)
Definition: gprs_ns2_vty.c:1750
vty_nse_by_nsei
static struct vty_nse * vty_nse_by_nsei(uint16_t nsei)
Definition: gprs_ns2_vty.c:154
gprs_nsvc::ip
struct gprs_nsvc::@16::@18 ip
gprs_ns2_ip_bind
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:310
linuxlist.h
gprs_ns2_ip_bind_set_dscp
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:510
gprs_ns2_fr_bind_netif
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:920
GPRS_NS2_EV_RX_RESET_ACK
@ GPRS_NS2_EV_RX_RESET_ACK
Definition: gprs_ns2_vc_fsm.c:108
ns2_tx_block
int ns2_tx_block(struct gprs_ns2_vc *nsvc, uint8_t cause)
Transmit a NS-BLOCK on a given NS-VC.
Definition: gprs_ns2_message.c:211
gprs_ns2_free_nsvcs
void gprs_ns2_free_nsvcs(struct gprs_ns2_nse *nse)
Destroy/release all NS-VC of given NSE.
Definition: gprs_ns2.c:657
gprs_start_alive_all_nsvcs
void gprs_start_alive_all_nsvcs(struct gprs_ns_inst *nsi)
Definition: gprs_ns.c:2246
free_bind
static void free_bind(struct gprs_ns2_vc_bind *bind)
clean up all private driver state.
Definition: gprs_ns2_udp.c:59
gprs_ns_inst::timeout
uint16_t timeout[NS_TIMERS_COUNT]
Definition: gprs_ns.h:90
gprs_ns_vty_init
int gprs_ns_vty_init(struct gprs_ns_inst *nsi)
Definition: gprs_ns_vty.c:635
add_remote_ip4_elem
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
LOG_FLT_GB_NSE
LOG_FLT_GB_NSE
dump_ns
static void dump_ns(struct vty *vty, const struct gprs_ns_inst *nsi, bool stats, bool persistent_only)
Definition: gprs_ns_vty.c:200
gprs_ns_cause_str
const char * gprs_ns_cause_str(enum ns_cause cause)
Obtain a human-readable string for NS cause value.
Definition: gprs_ns.c:446
ns2_tx_alive
int ns2_tx_alive(struct gprs_ns2_vc *nsvc)
Transmit a NS-ALIVE on a given NS-VC.
Definition: gprs_ns2_message.c:371
do_sns_add
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:638
gprs_ns2_nse_foreach_nsvc
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:1121
llist_add_tail
static void llist_add_tail(struct llist_head *_new, struct llist_head *head)
ns2_sns_st_all_action
static void ns2_sns_st_all_action(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:1416
__attribute__
static __attribute__((constructor))
Definition: gprs_ns2_vc_fsm.c:857
vty_bind::ip_sns_sig_weight
uint8_t ip_sns_sig_weight
Definition: gprs_ns2_vty.c:70
ARRAY_SIZE
#define ARRAY_SIZE(x)
SNS_PDUT_ACK
@ SNS_PDUT_ACK
Definition: gsm_08_16.h:54
gprs_ns2_nse::alive
bool alive
true if this NSE has at least one alive VC
Definition: gprs_ns2_internal.h:167
GPRS_NS2_LL_UDP
@ GPRS_NS2_LL_UDP
NS/UDP/IP.
Definition: gprs_ns2.h:46
gprs_ns_ie_ip4_elem::data_weight
uint8_t data_weight
Definition: gsm_08_16.h:28
gprs_ns2_vc::sig_weight
uint8_t sig_weight
signalling weight.
Definition: gprs_ns2_internal.h:208
gprs_sns_state::ip4_remote
struct gprs_ns_ie_ip4_elem * ip4_remote
Definition: gprs_ns_sns.c:41
ns2_tx_unblock
int ns2_tx_unblock(struct gprs_ns2_vc *nsvc)
Transmit a NS-UNBLOCK on a given NS-VC.
Definition: gprs_ns2_message.c:340
NS_IE_TRANS_ID
@ NS_IE_TRANS_ID
Definition: gsm_08_16.h:79
argv
argv
ip4_weight_sum_sig
#define ip4_weight_sum_sig(x, y)
Definition: gprs_ns2_sns.c:186
ns2_sns_dump_vty
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:1639
NS_TOUT_TNS_RESET_RETRIES
@ NS_TOUT_TNS_RESET_RETRIES
Definition: gprs_ns.h:37
NS_PDUT_UNBLOCK
@ NS_PDUT_UNBLOCK
Definition: gsm_08_16.h:48
gprs_ns2_vc::nsvci
uint16_t nsvci
uniquely identifies NS-VC if VC contains nsvci
Definition: gprs_ns2_internal.h:205
GPRS_NS2_EV_REQ_FORCE_UNCONFIGURED
@ GPRS_NS2_EV_REQ_FORCE_UNCONFIGURED
Definition: gprs_ns2_vc_fsm.c:119
gprs_ns2_free_bind
void gprs_ns2_free_bind(struct gprs_ns2_vc_bind *bind)
Destroy a given bind.
Definition: gprs_ns2.c:1326
ns2_sns_replace_nsvc
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:246
gprs_ns2_vc_priv::initiate_block
bool initiate_block
Definition: gprs_ns2_vc_fsm.c:61
gprs_ns2_vc_driver
Definition: gprs_ns2_internal.h:274
osmo_timer_del
void osmo_timer_del(struct osmo_timer_list *timer)
gprs_nsvc_create_ip4
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
osmo_fsm_register
int osmo_fsm_register(struct osmo_fsm *fsm)
msgb_tvlv_put
static uint8_t * msgb_tvlv_put(struct msgb *msg, uint8_t tag, uint16_t len, const uint8_t *val)
ns2_sns_state
Definition: gprs_ns2_sns.c:115
GPRS_NS2_EV_RX_BLOCK_ACK
@ GPRS_NS2_EV_RX_BLOCK_ACK
Definition: gprs_ns2_vc_fsm.c:112
osmo_sockaddr_str_from_sockaddr
int osmo_sockaddr_str_from_sockaddr(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_storage *src)
llist_entry
#define llist_entry(ptr, type, member)
ns2_sns_bind
Definition: gprs_ns2_sns.c:110
gprs_nsvc::remote_state
uint32_t remote_state
Definition: gprs_ns.h:132
gprs_ns2_nse::dialect
enum gprs_ns2_dialect dialect
which dialect does this NSE speaks?
Definition: gprs_ns2_internal.h:173
msgb::l2h
unsigned char * l2h
osmo_sockaddr::sas
struct sockaddr_storage sas
NS_PDUT_STATUS
@ NS_PDUT_STATUS
Definition: gsm_08_16.h:50
gprs_nsvc::statg
struct osmo_stat_item_group * statg
Definition: gprs_ns.h:144
gprs_ns2_ip_vc_local
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:432
NS_IE_IPv6_LIST
@ NS_IE_IPv6_LIST
Definition: gsm_08_16.h:73
GRE_PTYPE_KAR
#define GRE_PTYPE_KAR
Definition: gprs_ns_frgre.c:47
GPRS_NS_LL_UDP
@ GPRS_NS_LL_UDP
NS/UDP/IP.
Definition: gprs_ns.h:54
LOGPFSML
#define LOGPFSML(fi, level, fmt, args...)
install_lib_element
void install_lib_element(int ntype, struct cmd_element *cmd)
OSMO_FD_WRITE
#define OSMO_FD_WRITE
vty_bind::ll
enum gprs_ns2_ll ll
Definition: gprs_ns2_vty.c:66
GPRS_NS2_ST_UNCONFIGURED
@ GPRS_NS2_ST_UNCONFIGURED
Definition: gprs_ns2_vc_fsm.c:95
gprs_ns_ie_ip6_elem
Section 10.3.2d List of IP6 Elements.
Definition: gsm_08_16.h:32
gprs_sns_state::nsvc_hack
struct gprs_nsvc * nsvc_hack
Definition: gprs_ns_sns.c:29
gprs_sns_state::num_ip4_local
size_t num_ip4_local
Definition: gprs_ns_sns.c:33
gprs_ns2_sns_bss_fsm
static struct osmo_fsm gprs_ns2_sns_bss_fsm
Definition: gprs_ns2_sns.c:1506
NS_CTR_BYTES_OUT
@ NS_CTR_BYTES_OUT
Definition: gprs_ns.c:132
nsfrgre_fd_cb
static int nsfrgre_fd_cb(struct osmo_fd *bfd, unsigned int what)
Definition: gprs_ns_frgre.c:314
GPRS_SNS_EV_RX_CONFIG
@ GPRS_SNS_EV_RX_CONFIG
Definition: gprs_ns2_sns.c:76
gprs_ns2_sns_count
int gprs_ns2_sns_count(struct gprs_ns2_nse *nse)
gprs_ns2_sns_count
Definition: gprs_ns2_sns.c:1806
update_remote_ip4_elem
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
ns2_sns_dump_vty
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:1639
argc
argc
ip6_weight_sum_data
#define ip6_weight_sum_data(x, y)
Definition: gprs_ns2_sns.c:203
NS_TIMERS_HELP
#define NS_TIMERS_HELP
Definition: gprs_ns.h:19
gprs_sns_state::ip4_local
struct gprs_ns_ie_ip4_elem * ip4_local
Definition: gprs_ns_sns.c:32
NS_CAUSE_UNKN_IP_EP
@ NS_CAUSE_UNKN_IP_EP
Definition: gsm_08_16.h:100
ns2_sns_rx
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:1557
NS_CTR_LOST_RESET
@ NS_CTR_LOST_RESET
Definition: gprs_ns.c:140
GPRS_SNS_EV_RX_CONFIG_ACK
@ GPRS_SNS_EV_RX_CONFIG_ACK
Definition: gprs_ns2_sns.c:78
SS_L_NS
SS_L_NS
gprs_ns_timer_strs
static const struct value_string gprs_ns_timer_strs[]
Definition: gprs_ns_vty.c:55
ns2_sns_bind::list
struct llist_head list
Definition: gprs_ns2_sns.c:111
S
#define S(x)
Definition: gprs_ns2_vc_fsm.c:50
GRE_PTYPE_FR
#define GRE_PTYPE_FR
Definition: gprs_ns_frgre.c:45
LOGBIND
#define LOGBIND(bind, lvl, fmt, args ...)
Definition: gprs_ns2_internal.h:14
remove_remote_ip4_elem
static int remove_remote_ip4_elem(struct ns2_sns_state *gss, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns2_sns.c:459
log_tgt_mutex_unlock
#define log_tgt_mutex_unlock()
IPPROTO_GRE
#define IPPROTO_GRE
Definition: gprs_ns_frgre.c:50
gprs_ns2_fr_nsvc_by_dlci
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
gprs_ns2_vc_bind::nsvc
struct llist_head nsvc
list of all VC
Definition: gprs_ns2_internal.h:237
osmo_fd
gprs_ns2_vc::data_weight
uint8_t data_weight
data weight.
Definition: gprs_ns2_internal.h:214
osmo_fsm_state::in_event_mask
uint32_t in_event_mask
gprs_nsvc_start_test
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:2236
IPv4
@ IPv4
Definition: gprs_ns2_sns.c:60
sockaddr_str.h
L_NS_BIND_NODE
L_NS_BIND_NODE
vty_nse_alloc
static struct vty_nse * vty_nse_alloc(uint16_t nsei)
Definition: gprs_ns2_vty.c:164
gprs_nsvc::remote_end_is_sgsn
unsigned int remote_end_is_sgsn
Definition: gprs_ns.h:139
gprs_ns2_vc_priv::timer
struct osmo_timer_list timer
Definition: gprs_ns2_vc_fsm.c:70
GPRS_NS2_EV_RX_ALIVE
@ GPRS_NS2_EV_RX_ALIVE
Definition: gprs_ns2_vc_fsm.c:113
ns_signal_data
Definition: gprs_ns.h:245
LOGP
#define LOGP(ss, level, fmt, args...)
gprs_ns2_vc_priv::N
int N
Definition: gprs_ns2_vc_fsm.c:57
SNS_PDUT_CONFIG_ACK
@ SNS_PDUT_CONFIG_ACK
Definition: gsm_08_16.h:58
NS_CAUSE_UNKN_IP_TEST_FAILED
@ NS_CAUSE_UNKN_IP_TEST_FAILED
Definition: gsm_08_16.h:102
ns2_sns_st_size
static void ns2_sns_st_size(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:702
vty_dump_sns_ip4
static void vty_dump_sns_ip4(struct vty *vty, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:746
msgb_alloc
struct msgb * msgb_alloc(uint16_t size, const char *name)
llist_empty
static int llist_empty(const struct llist_head *head)
gprs_ns2_fr_bind_by_netif
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:936
gprs_ns2_lltype_str
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
gprs_ns2_nsvc_by_sockaddr_bind
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:121
S
#define S(x)
Definition: gprs_ns_sns.c:25
nses
static struct llist_head nses
Definition: gprs_ns2_vty.c:61
NS_CAUSE_NSVC_UNKNOWN
@ NS_CAUSE_NSVC_UNKNOWN
Definition: gsm_08_16.h:88
L_NS_NSE_NODE
L_NS_NSE_NODE
NS_CAUSE_SEM_INCORR_PDU
@ NS_CAUSE_SEM_INCORR_PDU
Definition: gsm_08_16.h:90
GPRS_NS2_EV_RX_STATUS
@ GPRS_NS2_EV_RX_STATUS
Definition: gprs_ns2_vc_fsm.c:115
ns2_vc_is_unblocked
int ns2_vc_is_unblocked(struct gprs_ns2_vc *nsvc)
is the given NS-VC unblocked?
Definition: gprs_ns2_vc_fsm.c:851
gprs_ns_inst::unknown_nsvc
struct gprs_nsvc * unknown_nsvc
a NSVC object that's needed to deal with packets for unknown NSVC
Definition: gprs_ns.h:88
GPRS_SNS_EV_CONFIG_END
@ GPRS_SNS_EV_CONFIG_END
SNS-CONFIG with end flag received.
Definition: gprs_ns_sns.c:281
ns2_st_unblocked
static void ns2_st_unblocked(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_vc_fsm.c:394
gprs_ns2_vc_mode
gprs_ns2_vc_mode
Definition: gprs_ns2.h:25
fsm.h
ns2_sns_st_configured_onenter
static void ns2_sns_st_configured_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns2_sns.c:1320
vty_bind::accept_ipaccess
bool accept_ipaccess
Definition: gprs_ns2_vty.c:68
gprs_ns2_vc_priv::om_blocked
bool om_blocked
Definition: gprs_ns2_vc_fsm.c:64
gprs_nsvc::state
uint32_t state
uniquely identifies NS-VC at SGSN
Definition: gprs_ns.h:131
gprs_sns_st_configured_onenter
static void gprs_sns_st_configured_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
Definition: gprs_ns_sns.c:551
osmo_sockaddr_local_ip
int osmo_sockaddr_local_ip(struct osmo_sockaddr *local_ip, const struct osmo_sockaddr *remote_ip)
osmo_htons
#define osmo_htons(x)
ns2_tx_sns_size
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:646
llist_head::prev
struct llist_head * prev
frame_relay.h
vty_bind::name
const char * name
Definition: gprs_ns2_vty.c:65
GPRS_SNS_EV_SIZE
@ GPRS_SNS_EV_SIZE
Definition: gprs_ns_sns.c:278
osmo_stat_item_group::items
struct osmo_stat_item * items[0]
gprs_ns_inst::local_ip
uint32_t local_ip
Definition: gprs_ns.h:95
ns2_sns_bind::bind
struct gprs_ns2_vc_bind * bind
Definition: gprs_ns2_sns.c:112
DLNS
#define DLNS
gprs_nsvc::sig_weight
uint8_t sig_weight
signalling weight.
Definition: gprs_ns.h:160
NS_CAUSE_NSVC_BLOCKED
@ NS_CAUSE_NSVC_BLOCKED
Definition: gsm_08_16.h:87
gprs_sns_bss_fsm_alloc
struct osmo_fsm_inst * gprs_sns_bss_fsm_alloc(void *ctx, struct gprs_nsvc *nsvc, const char *id)
Definition: gprs_ns_sns.c:630
GPRS_SNS_EV_RX_DELETE
@ GPRS_SNS_EV_RX_DELETE
Definition: gprs_ns2_sns.c:80
SNS_PDUT_DELETE
@ SNS_PDUT_DELETE
Definition: gsm_08_16.h:59
logging.h
NS2_CS_SKIPPED
@ NS2_CS_SKIPPED
Skipped message.
Definition: gprs_ns2_internal.h:88
do_sns_change_weight
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
ns2_sns_fsm_bss_timer_cb
static int ns2_sns_fsm_bss_timer_cb(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_sns.c:1376
CMD_SUCCESS
return CMD_SUCCESS
gprs_ns2_vc::nsvci_is_valid
bool nsvci_is_valid
Definition: gprs_ns2_internal.h:219
priv_bind
Definition: gprs_ns2_fr.c:99
gprs_ns2_vc::persistent
bool persistent
true if this NS was created by VTY or pcu socket)
Definition: gprs_ns2_internal.h:202
gprs_ns_inst::enabled
unsigned int enabled
Definition: gprs_ns.h:107
gprs_ns_tx_sns_config_ack
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
ns_sns_st_config_sgsn_ip6
static void ns_sns_st_config_sgsn_ip6(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns2_sns.c:970
ENCAPS_STR
#define ENCAPS_STR
Definition: gprs_ns_vty.c:471
gprs_ns_ie_ip4_elem::sig_weight
uint8_t sig_weight
Definition: gsm_08_16.h:27
list
struct llist_head list
NS_PDUT_UNBLOCK_ACK
@ NS_PDUT_UNBLOCK_ACK
Definition: gsm_08_16.h:49
gprs_ns_ie_ip4_elem::ip_addr
uint32_t ip_addr
Definition: gsm_08_16.h:25
ns2_tx_reset_ack
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:305
GPRS_SNS_ST_CONFIG_BSS
@ GPRS_SNS_ST_CONFIG_BSS
SNS-CONFIG procedure (BSS->SGSN) ongoing.
Definition: gprs_ns2_sns.c:67
ns2_driver_alloc_vc
static struct priv_vc * ns2_driver_alloc_vc(struct gprs_ns2_vc_bind *bind, struct gprs_ns2_vc *nsvc, struct osmo_sockaddr *remote)
Definition: gprs_ns2_udp.c:205
gprs_ns2_is_ip_bind
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
@ NS_CTR_PKTS_OUT
Definition: gprs_ns.c:130
log_target::filter_map
int filter_map
__attribute__
struct gre_hdr __attribute__((packed))
ns2_sns_bss_fsm_alloc
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:1527
DEFUN
DEFUN(cfg_ns, cfg_ns_cmd, "ns", "Configure the GPRS Network Service")
Definition: gprs_ns2_vty.c:248
gprs_ns2_vc::sns_only
bool sns_only
Definition: gprs_ns2_internal.h:220
priv_bind::addr
struct osmo_sockaddr addr
Definition: gprs_ns2_frgre.c:112
priv_bind::fd
struct osmo_fd fd
Definition: gprs_ns2_frgre.c:111
ns2_sns_notify_alive
void ns2_sns_notify_alive(struct gprs_ns2_nse *nse, struct gprs_ns2_vc *nsvc, bool alive)
Definition: gprs_ns2_sns.c:1827
gprs_ns2_ip_bind_sockaddr
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
GPRS_NS2_AFF_CAUSE_SNS_FAILURE
@ GPRS_NS2_AFF_CAUSE_SNS_FAILURE
Definition: gprs_ns2.h:85
command.h
gprs_ns2_vc::bind
struct gprs_ns2_vc_bind * bind
pointer to NS VL bind.
Definition: gprs_ns2_internal.h:199
ns2_sns_state::num_max_ip6_remote
size_t num_max_ip6_remote
Definition: gprs_ns2_sns.c:153
NS_IE_IPv6_EP_NR
@ NS_IE_IPv6_EP_NR
Definition: gsm_08_16.h:76
osmo_fd::fd
int fd
socket.h
gprs_ns2_sns_del_endpoint
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:1753
SNS_PDUT_SIZE_ACK
@ SNS_PDUT_SIZE_ACK
Definition: gsm_08_16.h:61
osmo_sockaddr_str_to_sockaddr
int osmo_sockaddr_str_to_sockaddr(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_storage *dst)
gprs_ns2_nse_by_nsei
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:745
ns2_validate_block
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
vty_bind::dscp
int dscp
Definition: gprs_ns2_vty.c:67
alive_timer_elapsed_ms
static int alive_timer_elapsed_ms(struct gprs_ns2_vc_priv *priv)
Definition: gprs_ns2_vc_fsm.c:168
ns2_vc_fsm_start
int ns2_vc_fsm_start(struct gprs_ns2_vc *nsvc)
Start a NS-VC FSM.
Definition: gprs_ns2_vc_fsm.c:727
ns2_ip_bind_connect
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:386
do_sns_change_weight
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:536
telnet_interface.h
gprs_nsvc::nsei
uint16_t nsei
Definition: gprs_ns.h:128
ns2_vc_is_unblocked
int ns2_vc_is_unblocked(struct gprs_ns2_vc *nsvc)
is the given NS-VC unblocked?
Definition: gprs_ns2_vc_fsm.c:851
gprs_sns_state::num_max_nsvcs
size_t num_max_nsvcs
Definition: gprs_ns_sns.c:37
gprs_ns2_vc::mode
enum gprs_ns2_vc_mode mode
Definition: gprs_ns2_internal.h:225
ns2_tx_alive_ack
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:383
ns2_tx_status
int ns2_tx_status(struct gprs_ns2_vc *nsvc, uint8_t cause, uint16_t bvci, struct msgb *orig_msg)
Transmit a NS-STATUS on a given NS-VC.
Definition: gprs_ns2_message.c:429
timespecsub
#define timespecsub(a, b, result)
GPRS_NS2_ST_UNBLOCKED
@ GPRS_NS2_ST_UNBLOCKED
Definition: gprs_ns2_vc_fsm.c:98
LOGL_DEBUG
#define LOGL_DEBUG
select.h
vty_nse_free
static void vty_nse_free(struct vty_nse *vnse)
Definition: gprs_ns2_vty.c:176
recv_test_procedure
static void recv_test_procedure(struct osmo_fsm_inst *fi)
Definition: gprs_ns2_vc_fsm.c:179
do_sns_add
static int do_sns_add(struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4)
Definition: gprs_ns_sns.c:230
OSMO_SOCK_F_BIND
#define OSMO_SOCK_F_BIND
ns2_recv_vc
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:1140
ns2_sns_state::binds
struct llist_head binds
Definition: gprs_ns2_sns.c:123
osmo_fd::data
void * data
gprs_ns2_ip_vc_remote
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
GPRS_NS_LL_FR_GRE
@ GPRS_NS_LL_FR_GRE
NS/FR/GRE/IP.
Definition: gprs_ns.h:56
gprs_ns2_vc_bind::free_vc
void(* free_vc)(struct gprs_ns2_vc *nsvc)
free the vc priv data
Definition: gprs_ns2_internal.h:260
osmo_sockaddr_str
LOGL_ERROR
#define LOGL_ERROR
gprs_ns2_inst::binding
struct llist_head binding
linked lists of all NSVC binds (e.g.
Definition: gprs_ns2_internal.h:127
osmo_sockaddr_str::port
uint16_t port
GPRS_NS2_DIALECT_UNDEF
@ GPRS_NS2_DIALECT_UNDEF
Definition: gprs_ns2.h:36
CMD_ERR_INCOMPLETE
#define CMD_ERR_INCOMPLETE
ns2_tx_simple
static int ns2_tx_simple(struct gprs_ns2_vc *nsvc, uint8_t pdu_type)
Definition: gprs_ns2_message.c:188
tlv_parsed
NS_STAT_ALIVE_DELAY
@ NS_STAT_ALIVE_DELAY
Definition: gprs_ns.c:167
gprs_sns_st_size
static void gprs_sns_st_size(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: gprs_ns_sns.c:313
gprs_ns2_sns_del_bind
int gprs_ns2_sns_del_bind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc_bind *bind)
Definition: gprs_ns2_sns.c:1898
ns2_tx_reset
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
ns2_vc_states
static const struct osmo_fsm_state ns2_vc_states[]
Definition: gprs_ns2_vc_fsm.c:440
osmo_fsm_inst::timer
struct osmo_timer_list timer
vty_out
vty_out(vty, "!%s", VTY_NEWLINE)
osmo_sock_get_name2
const char * osmo_sock_get_name2(int fd)
OSMO_MAX
#define OSMO_MAX(a, b)
gprs_ns2_nse::nsei
uint16_t nsei
Definition: gprs_ns2_internal.h:145
NS_CAUSE_PDU_INCOMP_PSTATE
@ NS_CAUSE_PDU_INCOMP_PSTATE
Definition: gsm_08_16.h:91
NS_IE_IPv4_LIST
@ NS_IE_IPv4_LIST
Definition: gsm_08_16.h:72
S_SNS_CONFIGURED
@ S_SNS_CONFIGURED
Definition: gprs_ns.h:239
gprs_nsvc_by_nsvci
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
ns2_sns_bss_fsm_alloc
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:1527
msgb_tv_put
static uint8_t * msgb_tv_put(struct msgb *msg, uint8_t tag, uint8_t val)
SNS_PDUT_SIZE
@ SNS_PDUT_SIZE
Definition: gsm_08_16.h:60
stat_item.h
TLVP_VAL
#define TLVP_VAL(x, y)
gprs_ns2_inst::timeout
uint16_t timeout[NS_TIMERS_COUNT]
Definition: gprs_ns2_internal.h:132
ip4_weight_sum
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
ns2_vc_block
int ns2_vc_block(struct gprs_ns2_vc *nsvc)
Block a NS-VC.
Definition: gprs_ns2_vc_fsm.c:746
ns2_sns_state::initial
struct sns_endpoint * initial
Definition: gprs_ns2_sns.c:133
NS_CAUSE_INVAL_ESSENT_IE
@ NS_CAUSE_INVAL_ESSENT_IE
Definition: gsm_08_16.h:93
gprs_ns_inst::fd
struct osmo_fd fd
Definition: gprs_ns.h:94
GPRS_SNS_EV_ADD
@ GPRS_SNS_EV_ADD
Definition: gprs_ns_sns.c:283
start_test_procedure
static void start_test_procedure(struct gprs_ns2_vc_priv *priv)
Definition: gprs_ns2_vc_fsm.c:148
gprs_sns_fsm_bss_timer_cb
static int gprs_sns_fsm_bss_timer_cb(struct osmo_fsm_inst *fi)
Definition: gprs_ns_sns.c:602
ip6_weight_sum
static int ip6_weight_sum(const struct gprs_ns_ie_ip6_elem *ip6, unsigned int num, bool data_weight)
Definition: gprs_ns2_sns.c:189
vty_out_stat_item_group
void vty_out_stat_item_group(struct vty *vty, const char *prefix, struct osmo_stat_item_group *statg)
misc.h
nsvc_by_ip6_elem
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:218
vty_nse_check_sns
static bool vty_nse_check_sns(struct gprs_ns2_nse *nse)
Definition: gprs_ns2_vty.c:224
GPRS_SNS_EV_REQ_DELETE_BIND
@ GPRS_SNS_EV_REQ_DELETE_BIND
Definition: gprs_ns2_sns.c:85