libosmogb
0.12.0.47-7c74
Osmocom Gb library
|
#include <stdint.h>
#include <netinet/in.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/select.h>
#include <osmocom/gprs/gprs_msgb.h>
#include <osmocom/gprs/protocol/gsm_08_16.h>
Go to the source code of this file.
Data Structures | |
struct | gprs_ns_inst |
An instance of the NS protocol stack. More... | |
struct | gprs_nsvc |
Structure representing a single NS-VC. More... | |
struct | ns_signal_data |
Macros | |
#define | NS_TIMERS_COUNT 7 |
#define | NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries)" |
#define | NS_TIMERS_HELP |
#define | NS_ALLOC_SIZE 3072 |
#define | NS_ALLOC_HEADROOM 20 |
#define | NSE_S_BLOCKED 0x0001 |
#define | NSE_S_ALIVE 0x0002 |
#define | NSE_S_RESET 0x0004 |
#define | NS_DESC_B(st) ((st) & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED") |
#define | NS_DESC_A(st) ((st) & NSE_S_ALIVE ? "ALIVE" : "DEAD") |
#define | NS_DESC_R(st) ((st) & NSE_S_RESET ? "RESET" : "UNRESET") |
Typedefs | |
typedef int | gprs_ns_cb_t(enum gprs_ns_evt event, struct gprs_nsvc *nsvc, struct msgb *msg, uint16_t bvci) |
Osmocom GPRS callback function type. More... | |
Enumerations | |
enum | ns_timeout { NS_TOUT_TNS_BLOCK, NS_TOUT_TNS_BLOCK_RETRIES, NS_TOUT_TNS_RESET, NS_TOUT_TNS_RESET_RETRIES, NS_TOUT_TNS_TEST, NS_TOUT_TNS_ALIVE, NS_TOUT_TNS_ALIVE_RETRIES } |
enum | gprs_ns_ll { GPRS_NS_LL_UDP, GPRS_NS_LL_E1, GPRS_NS_LL_FR_GRE } |
Osmocom NS link layer types. More... | |
enum | gprs_ns_evt { GPRS_NS_EVT_UNIT_DATA } |
Osmoco NS events. More... | |
enum | gprs_ns_cs { GPRS_NS_CS_CREATED, GPRS_NS_CS_FOUND, GPRS_NS_CS_REJECTED, GPRS_NS_CS_SKIPPED, GPRS_NS_CS_ERROR } |
Osmocom NS VC create status. More... | |
enum | nsvc_timer_mode { NSVC_TIMER_TNS_TEST, NSVC_TIMER_TNS_ALIVE, NSVC_TIMER_TNS_RESET, _NSVC_TIMER_NR } |
enum | signal_ns { S_NS_RESET, S_NS_BLOCK, S_NS_UNBLOCK, S_NS_ALIVE_EXP, S_NS_REPLACED, S_NS_MISMATCH } |
Functions | |
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... | |
int | gprs_ns_nsip_listen (struct gprs_ns_inst *nsi) |
Create a listening socket for GPRS NS/UDP/IP. 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... | |
int | gprs_ns_sendmsg (struct gprs_ns_inst *nsi, struct msgb *msg) |
High-level function for transmitting a NS-UNITDATA messsage. More... | |
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_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_frgre_listen (struct gprs_ns_inst *nsi) |
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... | |
struct gprs_nsvc * | gprs_nsvc_by_nsei (struct gprs_ns_inst *nsi, uint16_t nsei) |
Lookup struct gprs_nsvc based on NSEI. More... | |
struct gprs_nsvc * | gprs_nsvc_by_nsvci (struct gprs_ns_inst *nsi, uint16_t nsvci) |
Lookup struct gprs_nsvc based on NSVCI. More... | |
int | gprs_nsvc_reset (struct gprs_nsvc *nsvc, uint8_t cause) |
Initiate a RESET procedure. More... | |
int | gprs_ns_vty_init (struct gprs_ns_inst *nsi) |
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 msgb * | gprs_ns_msgb_alloc (void) |
const char * | gprs_ns_cause_str (enum ns_cause cause) |
Obtain a human-readable string for NS cause value. 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 | |
enum ns_timeout | __attribute__ |
const struct value_string | gprs_ns_signal_ns_names [] |
#define NS_ALLOC_HEADROOM 20 |
Referenced by gprs_ns_msgb_alloc(), and read_nsip_msg().
#define NS_ALLOC_SIZE 3072 |
Referenced by gprs_ns_msgb_alloc(), read_nsfrgre_msg(), and read_nsip_msg().
#define NS_DESC_A | ( | st | ) | ((st) & NSE_S_ALIVE ? "ALIVE" : "DEAD") |
Referenced by dump_nse(), gprs_nsvc_state_append(), and ns_set_state_with_log().
#define NS_DESC_B | ( | st | ) | ((st) & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED") |
Referenced by dump_nse(), gprs_nsvc_state_append(), and ns_set_state_with_log().
#define NS_DESC_R | ( | st | ) | ((st) & NSE_S_RESET ? "RESET" : "UNRESET") |
Referenced by ns_set_state_with_log().
#define NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries)" |
#define NS_TIMERS_COUNT 7 |
#define NS_TIMERS_HELP |
#define NSE_S_ALIVE 0x0002 |
Referenced by gprs_active_nsvc_by_nsei(), gprs_ns_process_msg(), gprs_ns_rx_reset(), gprs_ns_rx_reset_ack(), and gprs_ns_vc_create().
#define NSE_S_BLOCKED 0x0001 |
#define NSE_S_RESET 0x0004 |
Referenced by gprs_ns_process_msg(), gprs_ns_rx_reset_ack(), gprs_ns_timer_cb(), and gprs_nsvc_reset().
typedef int gprs_ns_cb_t(enum gprs_ns_evt event, struct gprs_nsvc *nsvc, struct msgb *msg, uint16_t bvci) |
Osmocom GPRS callback function type.
enum gprs_ns_cs |
enum gprs_ns_evt |
enum gprs_ns_ll |
enum ns_timeout |
enum nsvc_timer_mode |
enum signal_ns |
int gprs_ns_frgre_listen | ( | struct gprs_ns_inst * | nsi | ) |
int gprs_ns_vty_init | ( | struct gprs_ns_inst * | nsi | ) |
References config_write_ns(), ns_node, and gprs_nsvc::nsi.
enum ns_timeout __attribute__ |