libosmogb 1.9.0.196-9975
Osmocom Gb library
gprs_ns2_message.c File Reference

NS-over-FR-over-GRE implementation. More...

Macros

#define ERR_IF_NSVC_USES_SNS(nsvc, reason)
 

Functions

static int ns2_validate_reset (struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
 
static int ns2_validate_reset_ack (struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
 
static int ns2_validate_block (struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
 
static int ns2_validate_block_ack (struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
 
static int ns2_validate_status (struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
 
int ns2_validate (struct gprs_ns2_vc *nsvc, uint8_t pdu_type, struct msgb *msg, struct tlv_parsed *tp, uint8_t *cause)
 
static int ns_vc_tx (struct gprs_ns2_vc *nsvc, struct msgb *msg)
 
static int ns2_tx_simple (struct gprs_ns2_vc *nsvc, uint8_t pdu_type)
 
int ns2_tx_block (struct gprs_ns2_vc *nsvc, uint8_t cause, uint16_t *nsvci)
 Transmit a NS-BLOCK on a given NS-VC. More...
 
int ns2_tx_block_ack (struct gprs_ns2_vc *nsvc, uint16_t *nsvci)
 Transmit a NS-BLOCK-ACK on a given NS-VC. More...
 
int ns2_tx_reset (struct gprs_ns2_vc *nsvc, uint8_t cause)
 Transmit a NS-RESET on a given NS-VC. More...
 
int ns2_tx_reset_ack (struct gprs_ns2_vc *nsvc)
 Transmit a NS-RESET-ACK on a given NS-VC. More...
 
int ns2_tx_unblock (struct gprs_ns2_vc *nsvc)
 Transmit a NS-UNBLOCK on a given NS-VC. More...
 
int ns2_tx_unblock_ack (struct gprs_ns2_vc *nsvc)
 Transmit a NS-UNBLOCK-ACK on a given NS-VC. More...
 
int ns2_tx_alive (struct gprs_ns2_vc *nsvc)
 Transmit a NS-ALIVE on a given NS-VC. More...
 
int ns2_tx_alive_ack (struct gprs_ns2_vc *nsvc)
 Transmit a NS-ALIVE-ACK on a given NS-VC. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

NS-over-FR-over-GRE implementation.

GPRS Networks Service (NS) messages on the Gb interface. 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) as well as its successor 3GPP TS 48.016

Macro Definition Documentation

◆ ERR_IF_NSVC_USES_SNS

#define ERR_IF_NSVC_USES_SNS (   nsvc,
  reason 
)
Value:
do { \
if (!nsvc->nse->bss_sns_fi) \
break; \
LOGNSVC(nsvc, LOGL_DEBUG, "invalid packet %s with SNS\n", reason); \
} while (0)

Function Documentation

◆ ns2_tx_alive()

int ns2_tx_alive ( struct gprs_ns2_vc nsvc)

Transmit a NS-ALIVE on a given NS-VC.

Parameters
[in]nsvcNS-VC on which the NS-ALIVE is to be transmitted
Returns
0 in case of success

References LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, log_set_context(), ns2_tx_simple(), NS_PDUT_ALIVE, and gprs_ns2_vc::nse.

Referenced by alive_timeout_handler(), and start_test_procedure().

◆ ns2_tx_alive_ack()

int ns2_tx_alive_ack ( struct gprs_ns2_vc nsvc)

Transmit a NS-ALIVE-ACK on a given NS-VC.

Parameters
[in]nsvcNS-VC on which the NS-ALIVE-ACK is to be transmitted
Returns
0 in case of success

References LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, log_set_context(), ns2_tx_simple(), NS_PDUT_ALIVE_ACK, and gprs_ns2_vc::nse.

Referenced by ns2_vc_fsm_allstate_action().

◆ ns2_tx_block()

int ns2_tx_block ( struct gprs_ns2_vc nsvc,
uint8_t  cause,
uint16_t *  nsvci 
)

Transmit a NS-BLOCK on a given NS-VC.

Parameters
[in]vcNS-VC on which the NS-BLOCK is to be transmitted
[in]causeNumeric NS Cause value
[in]nsvciif given this NSVCI will be encoded. If NULL the nsvc->nsvci will be used.
Returns
0 in case of success

References cause, gprs_ns2_vc::ctrg, ERR_IF_NSVC_USES_SNS, gprs_ns2_cause_str(), LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_SIGNAL, log_set_context(), LOGL_INFO, msg, msgb_put(), msgb_tvlv_put(), ns2_msgb_alloc(), NS_CTR_BLOCKED, NS_IE_CAUSE, NS_IE_VCI, NS_PDUT_BLOCK, ns_vc_tx(), gprs_ns2_vc::nse, gprs_ns2_vc::nsvci, osmo_htons, gprs_ns_hdr::pdu_type, rate_ctr_group_get_ctr(), and rate_ctr_inc().

Referenced by ns2_st_blocked(), and ns2_st_blocked_onenter().

◆ ns2_tx_block_ack()

int ns2_tx_block_ack ( struct gprs_ns2_vc nsvc,
uint16_t *  nsvci 
)

Transmit a NS-BLOCK-ACK on a given NS-VC.

Parameters
[in]nsvcNS-VC on which the NS-BLOCK is to be transmitted
[in]nsvciif given this NSVCI will be encoded. If NULL the nsvc->nsvci will be used.
Returns
0 in case of success

References ERR_IF_NSVC_USES_SNS, LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_TX_SIGNAL, log_set_context(), msg, msgb_put(), msgb_tvlv_put(), ns2_msgb_alloc(), NS_IE_VCI, NS_PDUT_BLOCK_ACK, ns_vc_tx(), gprs_ns2_vc::nse, gprs_ns2_vc::nsvci, osmo_htons, and gprs_ns_hdr::pdu_type.

Referenced by ns2_st_blocked(), ns2_st_unblocked(), and ns2_vc_rx().

◆ ns2_tx_reset()

int ns2_tx_reset ( struct gprs_ns2_vc nsvc,
uint8_t  cause 
)

Transmit a NS-RESET on a given NS-VC.

Parameters
[in]nsvcNS-VC used for transmission
[in]causeNumeric NS cause value
Returns
0 in case of success

References cause, ERR_IF_NSVC_USES_SNS, gprs_ns2_cause_str(), LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_SIGNAL, log_set_context(), LOGL_INFO, msg, msgb_put(), msgb_tvlv_put(), ns2_msgb_alloc(), NS_IE_CAUSE, NS_IE_NSEI, NS_IE_VCI, NS_PDUT_RESET, ns_vc_tx(), gprs_ns2_vc::nse, nsei, gprs_ns2_nse::nsei, gprs_ns2_vc::nsvci, osmo_htons, and gprs_ns_hdr::pdu_type.

Referenced by ns2_st_reset_onenter().

◆ ns2_tx_reset_ack()

int ns2_tx_reset_ack ( struct gprs_ns2_vc nsvc)

Transmit a NS-RESET-ACK on a given NS-VC.

Parameters
[in]nsvcNS-VC used for transmission
Returns
0 in case of success

References ERR_IF_NSVC_USES_SNS, LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_TX_SIGNAL, log_set_context(), msg, msgb_put(), msgb_tvlv_put(), ns2_msgb_alloc(), NS_IE_NSEI, NS_IE_VCI, NS_PDUT_RESET_ACK, ns_vc_tx(), gprs_ns2_vc::nse, nsei, gprs_ns2_nse::nsei, gprs_ns2_vc::nsvci, osmo_htons, and gprs_ns_hdr::pdu_type.

Referenced by ns2_st_reset(), and ns2_vc_rx().

◆ ns2_tx_simple()

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

Parameters
[in]nsvcNS-VC through which to transmit the ACK
[in]trans_idTransaction ID which to acknowledge
[in]causePointer to cause value (NULL if no cause to be sent)
[in]ip4_elemsArray of IPv4 Elements
[in]num_ip4_elemsnumber of ip4_elems
Returns
0 on success; negative in case of error

References gprs_ns2_nse::bss_sns_fi, cause, gprs_ns2_cause_str(), LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_SIGNAL, log_set_context(), LOGL_ERROR, LOGL_INFO, LOGNSVC, msg, msgb_free(), msgb_put(), msgb_tvlv_put(), msgb_v_put(), ns2_msgb_alloc(), NS_IE_CAUSE, NS_IE_IPv4_LIST, NS_IE_IPv6_LIST, NS_IE_NSEI, ns_vc_tx(), gprs_ns2_vc::nse, nsei, gprs_ns2_nse::nsei, osmo_htons, gprs_ns_hdr::pdu_type, and SNS_PDUT_ACK.

Referenced by ns2_sns_st_configured_add(), ns2_sns_st_configured_change(), and ns2_sns_st_configured_delete().

◆ ns2_tx_sns_add()

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.

Parameters
[in]nsvcNS-VC through which to transmit the SNS-CONFIG
[in]trans_idThe transaction id
[in]ip4_elemsArray of IPv4 Elements
[in]num_ip4_elemsnumber of ip4_elems
[in]ip6_elemsArray of IPv6 Elements
[in]num_ip6_elemsnumber of ip6_elems
Returns
0 on success; negative in case of error

References ns2_tx_sns_procedure(), and SNS_PDUT_ADD.

Referenced by ns2_sns_st_local_procedure_onenter().

◆ ns2_tx_sns_change_weight()

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.

Parameters
[in]nsvcNS-VC through which to transmit the SNS-CONFIG
[in]trans_idThe transaction id
[in]ip4_elemsArray of IPv4 Elements
[in]num_ip4_elemsnumber of ip4_elems
[in]ip6_elemsArray of IPv6 Elements
[in]num_ip6_elemsnumber of ip6_elems
Returns
0 on success; negative in case of error

References ns2_tx_sns_procedure(), and SNS_PDUT_CHANGE_WEIGHT.

Referenced by ns2_sns_st_local_procedure_onenter().

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

Parameters
[in]nsvcNS-VC through which to transmit the SNS-CONFIG
[in]end_flagWhether or not this is the last SNS-CONFIG
[in]ip4_elemsArray of IPv4 Elements
[in]num_ip4_elemsnumber of ip4_elems
Returns
0 on success; negative in case of error

References gprs_ns2_nse::bss_sns_fi, LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_SIGNAL, log_set_context(), LOGL_ERROR, LOGL_INFO, LOGNSVC, msg, msgb_free(), msgb_put(), msgb_tvlv_put(), msgb_v_put(), ns2_msgb_alloc(), NS_IE_IPv4_LIST, NS_IE_IPv6_LIST, NS_IE_NSEI, ns_vc_tx(), gprs_ns2_vc::nse, nsei, gprs_ns2_nse::nsei, osmo_htons, gprs_ns_hdr::pdu_type, and SNS_PDUT_CONFIG.

Referenced by ns2_sns_st_bss_config_bss_onenter(), and ns2_sns_st_sgsn_wait_config_ack_onenter().

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

Parameters
[in]nsvcNS-VC through which to transmit the SNS-CONFIG-ACK
[in]causePointer to cause value (NULL if no cause to be sent)
Returns
0 on success; negative in case of error

References gprs_ns2_nse::bss_sns_fi, cause, gprs_ns2_cause_str(), LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_TX_SIGNAL, log_set_context(), LOGL_ERROR, LOGL_INFO, LOGNSVC, msg, msgb_free(), msgb_put(), msgb_tvlv_put(), ns2_msgb_alloc(), NS_IE_CAUSE, NS_IE_NSEI, ns_vc_tx(), gprs_ns2_vc::nse, nsei, gprs_ns2_nse::nsei, osmo_htons, gprs_ns_hdr::pdu_type, and SNS_PDUT_CONFIG_ACK.

Referenced by ns2_sns_st_bss_config_sgsn(), and ns2_sns_st_sgsn_wait_config().

◆ ns2_tx_sns_del()

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.

Parameters
[in]nsvcNS-VC through which to transmit the SNS-CONFIG
[in]trans_idThe transaction id
[in]ip4_elemsArray of IPv4 Elements
[in]num_ip4_elemsnumber of ip4_elems
[in]ip6_elemsArray of IPv6 Elements
[in]num_ip6_elemsnumber of ip6_elems
Returns
0 on success; negative in case of error

References ns2_tx_sns_procedure(), and SNS_PDUT_DELETE.

Referenced by ns2_sns_st_local_procedure_onenter().

◆ ns2_tx_sns_procedure()

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

Encode + Transmit a SNS-ADD/SNS-CHANGE-WEIGHT as per Section 9.3.2/9.3.3.

Parameters
[in]nsvcNS-VC through which to transmit the SNS-CONFIG
[in]pduThe PDU type to send out
[in]trans_idThe transaction id
[in]ip4_elemsArray of IPv4 Elements
[in]num_ip4_elemsnumber of ip4_elems
[in]ip6_elemsArray of IPv6 Elements
[in]num_ip6_elemsnumber of ip6_elems
Returns
0 on success; negative in case of error

References gprs_ns2_nse::bss_sns_fi, LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, log_set_context(), LOGL_ERROR, LOGNSVC, msg, msgb_free(), msgb_put(), msgb_tvlv_put(), msgb_v_put(), ns2_msgb_alloc(), NS_IE_IPv4_LIST, NS_IE_IPv6_LIST, NS_IE_NSEI, ns_vc_tx(), gprs_ns2_vc::nse, nsei, gprs_ns2_nse::nsei, osmo_htons, and gprs_ns_hdr::pdu_type.

Referenced by ns2_tx_sns_add(), ns2_tx_sns_change_weight(), and ns2_tx_sns_del().

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

Parameters
[in]nsvcNS-VC through which to transmit the SNS-SIZE
[in]reset_flagWhether or not to add a RESET flag
[in]max_nr_nsvcMaximum number of NS-VCs
[in]ip4_ep_nrNumber of IPv4 endpoints (< 0 will omit the TLV)
[in]ip6_ep_nrNumber of IPv6 endpoints (< 0 will omit the TLV)
Returns
0 on success; negative in case of error

References gprs_ns2_nse::bss_sns_fi, LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_SIGNAL, log_set_context(), LOGL_ERROR, LOGL_INFO, LOGNSVC, msg, msgb_free(), msgb_put(), msgb_tv16_put(), msgb_tv_put(), msgb_tvlv_put(), ns2_msgb_alloc(), NS_IE_IPv4_EP_NR, NS_IE_IPv6_EP_NR, NS_IE_MAX_NR_NSVC, NS_IE_NSEI, NS_IE_RESET_FLAG, ns_vc_tx(), gprs_ns2_vc::nse, nsei, gprs_ns2_nse::nsei, osmo_htons, gprs_ns_hdr::pdu_type, and SNS_PDUT_SIZE.

Referenced by ns2_sns_st_bss_size_onenter().

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

Parameters
[in]nsvcNS-VC through which to transmit the SNS-SIZE-ACK
[in]causePointer to cause value (NULL if no cause to be sent)
Returns
0 on success; negative in case of error

References gprs_ns2_nse::bss_sns_fi, cause, gprs_ns2_cause_str(), LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_SIGNAL, log_set_context(), LOGL_ERROR, LOGL_INFO, LOGNSVC, msg, msgb_free(), msgb_put(), msgb_tvlv_put(), ns2_msgb_alloc(), NS_IE_CAUSE, NS_IE_NSEI, ns_vc_tx(), gprs_ns2_vc::nse, nsei, gprs_ns2_nse::nsei, osmo_htons, gprs_ns_hdr::pdu_type, and SNS_PDUT_SIZE_ACK.

Referenced by ns2_sns_st_all_action_sgsn().

◆ ns2_tx_status()

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.

Parameters
[in]nsvcNS-VC to be used for transmission
[in]causeNumeric NS cause value
[in]bvciBVCI to be reset within NSVC
[in]orig_msgmessage causing the STATUS
[in]nsvciif given this NSVCI will be encoded. If NULL the nsvc->nsvci will be used.
Returns
0 in case of success

References gprs_ns2_vc::bind, bvci, cause, gprs_ns2_cause_str(), msgb::l2h, LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_SIGNAL, log_set_context(), LOGL_INFO, msg, msgb_l2len(), msgb_length(), msgb_put(), msgb_tvlv_put(), gprs_ns2_vc_bind::mtu, ns2_msgb_alloc(), NS_CAUSE_BVCI_UNKNOWN, NS_CAUSE_INVAL_ESSENT_IE, NS_CAUSE_MISSING_ESSENT_IE, NS_CAUSE_NSVC_BLOCKED, NS_CAUSE_NSVC_UNKNOWN, NS_CAUSE_PDU_INCOMP_PSTATE, NS_CAUSE_PROTO_ERR_UNSPEC, NS_CAUSE_SEM_INCORR_PDU, NS_IE_CAUSE, NS_IE_PDU, NS_IE_VCI, NS_PDUT_STATUS, ns_vc_tx(), gprs_ns2_vc::nse, gprs_ns2_vc::nsvci, osmo_htons, gprs_ns_hdr::pdu_type, and TVLV_GROSS_LEN().

Referenced by ns2_vc_fsm_allstate_action(), and ns2_vc_rx().

◆ ns2_tx_unblock()

int ns2_tx_unblock ( struct gprs_ns2_vc nsvc)

Transmit a NS-UNBLOCK on a given NS-VC.

Parameters
[in]nsvcNS-VC on which the NS-UNBLOCK is to be transmitted
Returns
0 in case of success

References ERR_IF_NSVC_USES_SNS, LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, log_set_context(), ns2_tx_simple(), NS_PDUT_UNBLOCK, and gprs_ns2_vc::nse.

Referenced by ns2_st_blocked_onenter().

◆ ns2_tx_unblock_ack()

int ns2_tx_unblock_ack ( struct gprs_ns2_vc nsvc)

Transmit a NS-UNBLOCK-ACK on a given NS-VC.

Parameters
[in]nsvcNS-VC on which the NS-UNBLOCK-ACK is to be transmitted
Returns
0 in case of success

References ERR_IF_NSVC_USES_SNS, LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, log_set_context(), ns2_tx_simple(), NS_PDUT_UNBLOCK_ACK, and gprs_ns2_vc::nse.

Referenced by ns2_st_blocked(), and ns2_st_unblocked().

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

Parameters
[in]nsvcNS-VC on which the NS-UNITDATA is to be transmitted
[in]bvciBVCI to encode in NS-UNITDATA header
[in]sducontrolSDU control octet of NS header
[in]msgmessage buffer containing payload
Returns
0 in case of success

References bvci, gprs_ns_hdr::data, if(), LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_DATA, log_set_context(), LOGL_ERROR, LOGL_INFO, LOGNSVC, msg, msgb_free(), msgb_push(), NS_PDUT_UNITDATA, ns_vc_tx(), gprs_ns2_vc::nse, and gprs_ns_hdr::pdu_type.

Referenced by gprs_ns2_recv_prim().

◆ ns2_validate()

◆ ns2_validate_block()

static int ns2_validate_block ( struct gprs_ns2_vc nsvc,
struct msgb msg,
struct tlv_parsed tp,
uint8_t *  cause 
)
static

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

◆ ns2_validate_reset()

static int ns2_validate_reset ( struct gprs_ns2_vc nsvc,
struct msgb msg,
struct tlv_parsed tp,
uint8_t *  cause 
)
static

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

◆ ns2_validate_status()

◆ ns_vc_tx()