libosmogb 1.10.0.64-ff3d
Osmocom Gb library
|
NS-over-FR-over-GRE implementation. More...
#include <errno.h>
#include <osmocom/core/byteswap.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/stat_item.h>
#include <osmocom/core/stats.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gprs/gprs_msgb.h>
#include <osmocom/gprs/gprs_ns2.h>
#include <osmocom/gprs/protocol/gsm_08_16.h>
#include "gprs_ns2_internal.h"
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... | |
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
#define ERR_IF_NSVC_USES_SNS | ( | nsvc, | |
reason | |||
) |
int ns2_tx_alive | ( | struct gprs_ns2_vc * | nsvc | ) |
Transmit a NS-ALIVE on a given NS-VC.
[in] | nsvc | NS-VC on which the NS-ALIVE is to be transmitted |
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().
int ns2_tx_alive_ack | ( | struct gprs_ns2_vc * | nsvc | ) |
Transmit a NS-ALIVE-ACK on a given NS-VC.
[in] | nsvc | NS-VC on which the NS-ALIVE-ACK is to be transmitted |
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().
int ns2_tx_block | ( | struct gprs_ns2_vc * | nsvc, |
uint8_t | cause, | ||
uint16_t * | nsvci | ||
) |
Transmit a NS-BLOCK on a given NS-VC.
[in] | vc | NS-VC on which the NS-BLOCK is to be transmitted |
[in] | cause | Numeric NS Cause value |
[in] | nsvci | if given this NSVCI will be encoded. If NULL the nsvc->nsvci will be used. |
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().
int ns2_tx_block_ack | ( | struct gprs_ns2_vc * | nsvc, |
uint16_t * | nsvci | ||
) |
Transmit a NS-BLOCK-ACK on a given NS-VC.
[in] | nsvc | NS-VC on which the NS-BLOCK is to be transmitted |
[in] | nsvci | if given this NSVCI will be encoded. If NULL the nsvc->nsvci will be used. |
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().
int ns2_tx_reset | ( | struct gprs_ns2_vc * | nsvc, |
uint8_t | cause | ||
) |
Transmit a NS-RESET on a given NS-VC.
[in] | nsvc | NS-VC used for transmission |
[in] | cause | Numeric NS cause value |
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().
int ns2_tx_reset_ack | ( | struct gprs_ns2_vc * | nsvc | ) |
Transmit a NS-RESET-ACK on a given NS-VC.
[in] | nsvc | NS-VC used for transmission |
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().
|
static |
References LOG_CTX_GB_NSE, LOG_CTX_GB_NSVC, LOG_NS_TX_SIGNAL, log_set_context(), msg, msgb_put(), ns2_msgb_alloc(), ns_vc_tx(), gprs_ns2_vc::nse, pdu_type, and gprs_ns_hdr::pdu_type.
Referenced by ns2_tx_alive(), ns2_tx_alive_ack(), ns2_tx_unblock(), and ns2_tx_unblock_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.
[in] | nsvc | NS-VC through which to transmit the ACK |
[in] | trans_id | Transaction ID which to acknowledge |
[in] | cause | Pointer to cause value (NULL if no cause to be sent) |
[in] | ip4_elems | Array of IPv4 Elements |
[in] | num_ip4_elems | number of ip4_elems |
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().
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.
[in] | nsvc | NS-VC through which to transmit the SNS-CONFIG |
[in] | trans_id | The transaction id |
[in] | ip4_elems | Array of IPv4 Elements |
[in] | num_ip4_elems | number of ip4_elems |
[in] | ip6_elems | Array of IPv6 Elements |
[in] | num_ip6_elems | number of ip6_elems |
References ns2_tx_sns_procedure(), and SNS_PDUT_ADD.
Referenced by ns2_sns_st_local_procedure_onenter().
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.
[in] | nsvc | NS-VC through which to transmit the SNS-CONFIG |
[in] | trans_id | The transaction id |
[in] | ip4_elems | Array of IPv4 Elements |
[in] | num_ip4_elems | number of ip4_elems |
[in] | ip6_elems | Array of IPv6 Elements |
[in] | num_ip6_elems | number of ip6_elems |
References ns2_tx_sns_procedure(), and SNS_PDUT_CHANGE_WEIGHT.
Referenced by ns2_sns_st_local_procedure_onenter().
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.
[in] | nsvc | NS-VC through which to transmit the SNS-CONFIG |
[in] | end_flag | Whether or not this is the last SNS-CONFIG |
[in] | ip4_elems | Array of IPv4 Elements |
[in] | num_ip4_elems | number of ip4_elems |
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().
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.
[in] | nsvc | NS-VC through which to transmit the SNS-CONFIG-ACK |
[in] | cause | Pointer to cause value (NULL if no cause to be sent) |
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().
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.
[in] | nsvc | NS-VC through which to transmit the SNS-CONFIG |
[in] | trans_id | The transaction id |
[in] | ip4_elems | Array of IPv4 Elements |
[in] | num_ip4_elems | number of ip4_elems |
[in] | ip6_elems | Array of IPv6 Elements |
[in] | num_ip6_elems | number of ip6_elems |
References ns2_tx_sns_procedure(), and SNS_PDUT_DELETE.
Referenced by ns2_sns_st_local_procedure_onenter().
|
static |
Encode + Transmit a SNS-ADD/SNS-CHANGE-WEIGHT as per Section 9.3.2/9.3.3.
[in] | nsvc | NS-VC through which to transmit the SNS-CONFIG |
[in] | pdu | The PDU type to send out |
[in] | trans_id | The transaction id |
[in] | ip4_elems | Array of IPv4 Elements |
[in] | num_ip4_elems | number of ip4_elems |
[in] | ip6_elems | Array of IPv6 Elements |
[in] | num_ip6_elems | number of ip6_elems |
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().
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.
[in] | nsvc | NS-VC through which to transmit the SNS-SIZE |
[in] | reset_flag | Whether or not to add a RESET flag |
[in] | max_nr_nsvc | Maximum number of NS-VCs |
[in] | ip4_ep_nr | Number of IPv4 endpoints (< 0 will omit the TLV) |
[in] | ip6_ep_nr | Number of IPv6 endpoints (< 0 will omit the TLV) |
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().
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.
[in] | nsvc | NS-VC through which to transmit the SNS-SIZE-ACK |
[in] | cause | Pointer to cause value (NULL if no cause to be sent) |
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().
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.
[in] | nsvc | NS-VC to be used for transmission |
[in] | cause | Numeric NS cause value |
[in] | bvci | BVCI to be reset within NSVC |
[in] | orig_msg | message causing the STATUS |
[in] | nsvci | if given this NSVCI will be encoded. If NULL the nsvc->nsvci will be used. |
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().
int ns2_tx_unblock | ( | struct gprs_ns2_vc * | nsvc | ) |
Transmit a NS-UNBLOCK on a given NS-VC.
[in] | nsvc | NS-VC on which the NS-UNBLOCK is to be transmitted |
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().
int ns2_tx_unblock_ack | ( | struct gprs_ns2_vc * | nsvc | ) |
Transmit a NS-UNBLOCK-ACK on a given NS-VC.
[in] | nsvc | NS-VC on which the NS-UNBLOCK-ACK is to be transmitted |
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().
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.
[in] | nsvc | NS-VC on which the NS-UNITDATA is to be transmitted |
[in] | bvci | BVCI to encode in NS-UNITDATA header |
[in] | sducontrol | SDU control octet of NS header |
[in] | msg | message buffer containing payload |
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().
int ns2_validate | ( | struct gprs_ns2_vc * | nsvc, |
uint8_t | pdu_type, | ||
struct msgb * | msg, | ||
struct tlv_parsed * | tp, | ||
uint8_t * | cause | ||
) |
References cause, msg, msgb_l2len(), ns2_validate_block(), ns2_validate_block_ack(), ns2_validate_reset(), ns2_validate_reset_ack(), ns2_validate_status(), NS_CAUSE_PROTO_ERR_UNSPEC, NS_PDUT_ALIVE, NS_PDUT_ALIVE_ACK, NS_PDUT_BLOCK, NS_PDUT_BLOCK_ACK, NS_PDUT_RESET, NS_PDUT_RESET_ACK, NS_PDUT_STATUS, NS_PDUT_UNBLOCK, NS_PDUT_UNBLOCK_ACK, and pdu_type.
Referenced by ns2_vc_rx().
|
static |
References cause, NS_CAUSE_MISSING_ESSENT_IE, NS_IE_CAUSE, NS_IE_VCI, and TLVP_PRES_LEN.
Referenced by ns2_validate().
|
static |
References cause, NS_CAUSE_MISSING_ESSENT_IE, NS_IE_VCI, and TLVP_PRES_LEN.
Referenced by ns2_validate().
|
static |
References cause, NS_CAUSE_MISSING_ESSENT_IE, NS_IE_CAUSE, NS_IE_NSEI, NS_IE_VCI, and TLVP_PRES_LEN.
Referenced by ns2_validate().
|
static |
References cause, NS_CAUSE_MISSING_ESSENT_IE, NS_IE_NSEI, NS_IE_VCI, and TLVP_PRES_LEN.
Referenced by ns2_validate().
|
static |
References cause, GPRS_NS2_VC_MODE_BLOCKRESET, gprs_ns2_vc::mode, 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_CAUSE_UNKN_IP_TEST_FAILED, NS_IE_BVCI, NS_IE_CAUSE, NS_IE_IPv4_LIST, NS_IE_IPv6_LIST, NS_IE_PDU, NS_IE_VCI, TLVP_PRES_LEN, TLVP_PRESENT, and tlvp_val8().
Referenced by ns2_validate().
|
static |
References gprs_ns2_vc::bind, msg, and gprs_ns2_vc_bind::send_vc.
Referenced by ns2_tx_block(), ns2_tx_block_ack(), ns2_tx_reset(), ns2_tx_reset_ack(), ns2_tx_simple(), ns2_tx_sns_ack(), ns2_tx_sns_config(), ns2_tx_sns_config_ack(), ns2_tx_sns_procedure(), ns2_tx_sns_size(), ns2_tx_sns_size_ack(), ns2_tx_status(), and ns2_tx_unit_data().