libosmogb 1.10.0.57-8972
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 8 |
#define | NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries|tsns-prov)" |
#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 , NS_TOUT_TSNS_PROV } |
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 , 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 , S_SNS_CONFIGURED } |
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... | |
struct gprs_nsvc * | gprs_ns_nsip_connect_sns (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 using SNS auto-configuration. 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_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... | |
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... | |
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 given 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_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. More... | |
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... | |
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. 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) |
char * | gprs_ns_ll_str_buf (char *buf, size_t buf_len, const struct gprs_nsvc *nsvc) |
char * | gprs_ns_ll_str_c (const void *ctx, 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 | |
const struct value_string | gprs_ns_signal_ns_names [] |
#define NS_ALLOC_HEADROOM 20 |
#define NS_ALLOC_SIZE 3072 |
#define NS_DESC_A | ( | st | ) | ((st) & NSE_S_ALIVE ? "ALIVE" : "DEAD") |
#define NS_DESC_B | ( | st | ) | ((st) & NSE_S_BLOCKED ? "BLOCKED" : "UNBLOCKED") |
#define NS_DESC_R | ( | st | ) | ((st) & NSE_S_RESET ? "RESET" : "UNRESET") |
#define NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries|tsns-prov)" |
#define NS_TIMERS_COUNT 8 |
#define NS_TIMERS_HELP |
#define NSE_S_ALIVE 0x0002 |
#define NSE_S_BLOCKED 0x0001 |
#define NSE_S_RESET 0x0004 |
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 | ) |