libosmogb
0.12.0.47-7c74
Osmocom Gb library
|
GPRS Networks Service (NS) messages on the Gb interface. More...
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/byteswap.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/stat_item.h>
#include <osmocom/core/stats.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/signal.h>
#include <osmocom/gprs/gprs_ns.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gprs/gprs_ns_frgre.h>
#include "common_vty.h"
Macros | |
#define | ns_set_state(ns_, st_) ns_set_state_with_log(ns_, st_, false, __FILE__, __LINE__) |
#define | ns_set_remote_state(ns_, st_) ns_set_state_with_log(ns_, st_, true, __FILE__, __LINE__) |
#define | ns_mark_blocked(ns_) ns_set_state(ns_, (ns_)->state | NSE_S_BLOCKED) |
#define | ns_mark_unblocked(ns_) ns_set_state(ns_, (ns_)->state & (~NSE_S_BLOCKED)); |
#define | CHECK_TX_RC(rc, nsvc) |
Enumerations | |
enum | ns_ctr { NS_CTR_PKTS_IN, NS_CTR_PKTS_OUT, NS_CTR_BYTES_IN, NS_CTR_BYTES_OUT, NS_CTR_BLOCKED, NS_CTR_DEAD, NS_CTR_REPLACED, NS_CTR_NSEI_CHG, NS_CTR_INV_VCI, NS_CTR_INV_NSEI, NS_CTR_LOST_ALIVE, NS_CTR_LOST_RESET } |
enum | ns_stat { NS_STAT_ALIVE_DELAY } |
Functions | |
struct msgb * | gprs_ns_msgb_alloc (void) |
static void | ns_set_state_with_log (struct gprs_nsvc *nsvc, uint32_t state, bool is_remote, const char *file, unsigned line) |
struct gprs_nsvc * | gprs_nsvc_by_nsvci (struct gprs_ns_inst *nsi, uint16_t nsvci) |
Lookup struct gprs_nsvc based on NSVCI. More... | |
struct gprs_nsvc * | gprs_nsvc_by_nsei (struct gprs_ns_inst *nsi, uint16_t nsei) |
Lookup struct gprs_nsvc based on NSEI. More... | |
static struct gprs_nsvc * | gprs_active_nsvc_by_nsei (struct gprs_ns_inst *nsi, uint16_t nsei) |
static struct gprs_nsvc * | nsvc_by_rem_addr (struct gprs_ns_inst *nsi, struct sockaddr_in *sin) |
static void | gprs_ns_timer_cb (void *data) |
struct gprs_nsvc * | gprs_nsvc_create (struct gprs_ns_inst *nsi, uint16_t nsvci) |
void | gprs_nsvc_delete (struct gprs_nsvc *nsvc) |
Delete given NS-VC. More... | |
static void | ns_osmo_signal_dispatch (struct gprs_nsvc *nsvc, unsigned int signal, uint8_t cause) |
static void | ns_osmo_signal_dispatch_mismatch (struct gprs_nsvc *nsvc, struct msgb *msg, uint8_t pdu_type, uint8_t ie_type) |
static void | ns_osmo_signal_dispatch_replaced (struct gprs_nsvc *nsvc, struct gprs_nsvc *old_nsvc) |
const char * | gprs_ns_cause_str (enum ns_cause cause) |
Obtain a human-readable string for NS cause value. More... | |
static int | nsip_sendmsg (struct gprs_nsvc *nsvc, struct msgb *msg) |
int | grps_ns_frgre_sendmsg (struct gprs_nsvc *nsvc, struct msgb *msg) |
static int | gprs_ns_tx (struct gprs_nsvc *nsvc, struct msgb *msg) |
static int | gprs_ns_tx_simple (struct gprs_nsvc *nsvc, uint8_t pdu_type) |
int | gprs_ns_tx_reset (struct gprs_nsvc *nsvc, uint8_t cause) |
Transmit a NS-RESET on a given NSVC. More... | |
int | gprs_ns_tx_status (struct gprs_nsvc *nsvc, uint8_t cause, uint16_t bvci, struct msgb *orig_msg) |
Transmit a NS-STATUS on a given NSVC. More... | |
int | gprs_ns_tx_block (struct gprs_nsvc *nsvc, uint8_t cause) |
Transmit a NS-BLOCK on a tiven NS-VC. More... | |
int | gprs_ns_tx_unblock (struct gprs_nsvc *nsvc) |
Transmit a NS-UNBLOCK on a given NS-VC. More... | |
int | gprs_ns_tx_alive (struct gprs_nsvc *nsvc) |
Transmit a NS-ALIVE on a given NS-VC. More... | |
int | gprs_ns_tx_alive_ack (struct gprs_nsvc *nsvc) |
Transmit a NS-ALIVE-ACK on a given NS-VC. More... | |
static void | nsvc_start_timer (struct gprs_nsvc *nsvc, enum nsvc_timer_mode mode) |
static int | nsvc_timer_elapsed_ms (struct gprs_nsvc *nsvc) |
static int | gprs_ns_tx_reset_ack (struct gprs_nsvc *nsvc) |
int | gprs_ns_sendmsg (struct gprs_ns_inst *nsi, struct msgb *msg) |
High-level function for transmitting a NS-UNITDATA messsage. More... | |
static int | gprs_ns_rx_unitdata (struct gprs_nsvc *nsvc, struct msgb *msg) |
static int | gprs_ns_rx_status (struct gprs_nsvc *nsvc, struct msgb *msg) |
static int | gprs_nsvc_replace_if_found (uint16_t nsvci, struct gprs_nsvc **nsvc, struct gprs_nsvc **old_nsvc) |
static int | gprs_ns_rx_reset (struct gprs_nsvc **nsvc, struct msgb *msg) |
static int | gprs_ns_rx_reset_ack (struct gprs_nsvc **nsvc, struct msgb *msg) |
static int | gprs_ns_rx_block (struct gprs_nsvc *nsvc, struct msgb *msg) |
int | gprs_ns_vc_create (struct gprs_ns_inst *nsi, struct msgb *msg, struct gprs_nsvc *fallback_nsvc, struct gprs_nsvc **new_nsvc) |
Create/get NS-VC independently from underlying transport layer. More... | |
int | gprs_ns_process_msg (struct gprs_ns_inst *nsi, struct msgb *msg, struct gprs_nsvc **nsvc) |
Process NS message independently from underlying transport layer. More... | |
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. More... | |
const char * | gprs_ns_ll_str (const struct gprs_nsvc *nsvc) |
void | gprs_ns_ll_copy (struct gprs_nsvc *nsvc, struct gprs_nsvc *other) |
void | gprs_ns_ll_clear (struct gprs_nsvc *nsvc) |
struct gprs_ns_inst * | gprs_ns_instantiate (gprs_ns_cb_t *cb, void *ctx) |
Create a new GPRS NS instance. More... | |
void | gprs_ns_close (struct gprs_ns_inst *nsi) |
void | gprs_ns_destroy (struct gprs_ns_inst *nsi) |
Destroy an entire NS instance. More... | |
static struct msgb * | read_nsip_msg (struct osmo_fd *bfd, int *error, struct sockaddr_in *saddr) |
static int | handle_nsip_read (struct osmo_fd *bfd) |
static int | handle_nsip_write (struct osmo_fd *bfd) |
static int | nsip_fd_cb (struct osmo_fd *bfd, unsigned int what) |
int | gprs_ns_nsip_listen (struct gprs_ns_inst *nsi) |
Create a listening socket for GPRS NS/UDP/IP. More... | |
int | gprs_nsvc_reset (struct gprs_nsvc *nsvc, uint8_t cause) |
Initiate a RESET procedure. More... | |
struct gprs_nsvc * | gprs_ns_nsip_connect (struct gprs_ns_inst *nsi, struct sockaddr_in *dest, uint16_t nsei, uint16_t nsvci) |
Establish a NS connection (from the BSS) to the SGSN. More... | |
void | gprs_ns_set_log_ss (int ss) |
char * | gprs_nsvc_state_append (char *s, struct gprs_nsvc *nsvc) |
Append the nsvc state to a talloc string. More... | |
Variables | |
static const struct tlv_definition | ns_att_tlvdef |
static const struct rate_ctr_desc | nsvc_ctr_description [] |
static const struct rate_ctr_group_desc | nsvc_ctrg_desc |
static const struct osmo_stat_item_desc | nsvc_stat_description [] |
static const struct osmo_stat_item_group_desc | nsvc_statg_desc |
const struct value_string | gprs_ns_signal_ns_names [] |
const struct value_string | gprs_ns_pdu_strings [] |
static const struct value_string | ns_cause_str [] |
static enum ns_timeout | timer_mode_tout [_NSVC_TIMER_NR] |
static const struct value_string | timer_mode_strs [] |
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).