libosmogb 1.10.0.57-8972
Osmocom Gb library
|
#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <osmocom/core/fsm.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/signal.h>
#include <osmocom/core/socket.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gprs/gprs_msgb.h>
#include <osmocom/gprs/gprs_ns.h>
#include "common_vty.h"
#include "gb_internal.h"
#include <osmocom/vty/vty.h>
#include <osmocom/vty/misc.h>
Data Structures | |
struct | gprs_sns_state |
Macros | |
#define | S(x) (1 << (x)) |
#define | ip4_weight_sum_data(x, y) ip4_weight_sum(x, y, true) |
#define | ip4_weight_sum_sig(x, y) ip4_weight_sum(x, y, false) |
Functions | |
static struct gprs_ns_inst * | ns_inst_from_fi (struct osmo_fsm_inst *fi) |
static int | ip4_weight_sum (const struct gprs_ns_ie_ip4_elem *ip4, unsigned int num, bool data_weight) |
static struct gprs_nsvc * | nsvc_by_ip4_elem (struct gprs_ns_inst *nsi, const struct gprs_ns_ie_ip4_elem *ip4) |
static struct gprs_nsvc * | gprs_nsvc_create_ip4 (struct gprs_ns_inst *nsi, const struct gprs_ns_ie_ip4_elem *ip4) |
static int | create_missing_nsvcs (struct osmo_fsm_inst *fi) |
static int | add_remote_ip4_elem (struct gprs_sns_state *gss, const struct gprs_ns_ie_ip4_elem *ip4) |
static int | remove_remote_ip4_elem (struct gprs_sns_state *gss, const struct gprs_ns_ie_ip4_elem *ip4) |
static int | update_remote_ip4_elem (struct gprs_sns_state *gss, const struct gprs_ns_ie_ip4_elem *ip4) |
static int | do_sns_change_weight (struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4) |
static int | do_sns_delete (struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4) |
static int | do_sns_add (struct osmo_fsm_inst *fi, const struct gprs_ns_ie_ip4_elem *ip4) |
static void | gprs_sns_st_unconfigured (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
static void | gprs_sns_st_size (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
static void | gprs_sns_st_size_onenter (struct osmo_fsm_inst *fi, uint32_t old_state) |
static void | gprs_sns_st_config_bss (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
static void | gprs_sns_st_config_bss_onenter (struct osmo_fsm_inst *fi, uint32_t old_state) |
static void | gprs_sns_st_config_sgsn (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
static void | gprs_sns_st_configured (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
static void | gprs_sns_st_configured_onenter (struct osmo_fsm_inst *fi, uint32_t old_state) |
static int | gprs_sns_fsm_bss_timer_cb (struct osmo_fsm_inst *fi) |
struct osmo_fsm_inst * | gprs_sns_bss_fsm_alloc (void *ctx, struct gprs_nsvc *nsvc, const char *id) |
int | gprs_sns_bss_fsm_start (struct gprs_ns_inst *nsi) |
int | gprs_ns_rx_sns (struct gprs_ns_inst *nsi, struct msgb *msg, struct tlv_parsed *tp) |
int | gprs_sns_init (void) |
static void | vty_dump_sns_ip4 (struct vty *vty, const struct gprs_ns_ie_ip4_elem *ip4) |
void | gprs_sns_dump_vty (struct vty *vty, const struct gprs_ns_inst *nsi, bool stats) |
Variables | |
static const struct value_string | gprs_sns_event_names [] |
static const struct osmo_fsm_state | gprs_sns_bss_states [] |
static struct osmo_fsm | gprs_sns_bss_fsm |
#define ip4_weight_sum_data | ( | x, | |
y | |||
) | ip4_weight_sum(x, y, true) |
#define ip4_weight_sum_sig | ( | x, | |
y | |||
) | ip4_weight_sum(x, y, false) |
enum gprs_sns_bss_state |
enum gprs_sns_event |
|
static |
References gprs_sns_state::ip4_remote, gprs_sns_state::num_ip4_remote, and gprs_sns_state::num_max_ip4_remote.
Referenced by do_sns_add().
|
static |
References gprs_nsvc::data_weight, gprs_ns_ie_ip4_elem::data_weight, gprs_ns_ll_str(), gprs_nsvc_create_ip4(), gprs_sns_state::ip4_remote, LOGL_ERROR, LOGL_INFO, LOGPFSML, ns_inst_from_fi(), gprs_nsvc::nsi, gprs_sns_state::nsi, nsvc_by_ip4_elem(), gprs_sns_state::num_ip4_remote, osmo_fsm_inst::priv, gprs_nsvc::sig_weight, and gprs_ns_ie_ip4_elem::sig_weight.
Referenced by gprs_sns_st_config_sgsn().
|
static |
References add_remote_ip4_elem(), gprs_nsvc::data_weight, gprs_ns_ll_str(), gprs_nsvc_create_ip4(), gprs_nsvc_start_test(), LOGL_ERROR, LOGL_INFO, LOGPFSML, NS_CAUSE_EQUIP_FAIL, NS_CAUSE_INVAL_NR_NS_VC, NS_CAUSE_PROTO_ERR_UNSPEC, ns_inst_from_fi(), gprs_nsvc::nsi, gprs_sns_state::nsi, nsvc_by_ip4_elem(), osmo_fsm_inst::priv, remove_remote_ip4_elem(), and gprs_nsvc::sig_weight.
Referenced by gprs_sns_st_configured().
|
static |
References gprs_nsvc::data_weight, gprs_ns_ie_ip4_elem::data_weight, gprs_ns_ll_str(), LOGL_INFO, LOGL_NOTICE, LOGPFSML, NS_CAUSE_NSVC_UNKNOWN, ns_inst_from_fi(), gprs_nsvc::nsi, gprs_sns_state::nsi, nsvc_by_ip4_elem(), osmo_fsm_inst::priv, gprs_nsvc::sig_weight, gprs_ns_ie_ip4_elem::sig_weight, and update_remote_ip4_elem().
Referenced by gprs_sns_st_configured().
|
static |
int gprs_ns_rx_sns | ( | struct gprs_ns_inst * | nsi, |
struct msgb * | msg, | ||
struct tlv_parsed * | tp | ||
) |
References gprs_ns_inst::bss_sns_fi, gprs_ns_hdr::data, DNS, get_value_string(), gprs_ns_pdu_strings, GPRS_SNS_EV_ADD, GPRS_SNS_EV_CHANGE_WEIGHT, GPRS_SNS_EV_CONFIG, GPRS_SNS_EV_CONFIG_ACK, GPRS_SNS_EV_CONFIG_END, GPRS_SNS_EV_DELETE, GPRS_SNS_EV_SIZE, GPRS_SNS_EV_SIZE_ACK, LOGL_DEBUG, LOGL_ERROR, LOGL_NOTICE, LOGP, msg, msgb_nsei, nsei, osmo_fsm_inst_dispatch, gprs_ns_hdr::pdu_type, SNS_PDUT_ACK, SNS_PDUT_ADD, SNS_PDUT_CHANGE_WEIGHT, SNS_PDUT_CONFIG, SNS_PDUT_CONFIG_ACK, SNS_PDUT_DELETE, SNS_PDUT_SIZE, and SNS_PDUT_SIZE_ACK.
Referenced by gprs_ns_process_msg().
|
static |
References gprs_ns_inst::bss_sns_fi, gprs_ns_ie_ip4_elem::data_weight, gprs_nsvc_create2(), gprs_ns_ie_ip4_elem::ip_addr, gprs_sns_state::next_nsvci, gprs_nsvc::nsei, gprs_sns_state::nsi, gprs_sns_state::nsvc_hack, osmo_fsm_inst::priv, gprs_ns_ie_ip4_elem::sig_weight, and gprs_ns_ie_ip4_elem::udp_port.
Referenced by create_missing_nsvcs(), and do_sns_add().
struct osmo_fsm_inst * gprs_sns_bss_fsm_alloc | ( | void * | ctx, |
struct gprs_nsvc * | nsvc, | ||
const char * | id | ||
) |
References gprs_nsvc::bts_addr, gprs_ns_ie_ip4_elem::data_weight, gprs_sns_bss_fsm, gprs_nsvc::ip, gprs_sns_state::ip4_local, gprs_ns_ie_ip4_elem::ip_addr, gprs_ns_inst::local_ip, gprs_ns_inst::local_port, LOGL_DEBUG, gprs_sns_state::next_nsvci, gprs_nsvc::nsi, gprs_sns_state::nsi, gprs_ns_inst::nsip, gprs_sns_state::nsvc_hack, gprs_sns_state::num_ip4_local, gprs_sns_state::num_max_ip4_remote, gprs_sns_state::num_max_nsvcs, osmo_fsm_inst_alloc(), osmo_fsm_inst_term, OSMO_FSM_TERM_ERROR, osmo_sock_local_ip(), osmo_fsm_inst::priv, gprs_ns_ie_ip4_elem::sig_weight, and gprs_ns_ie_ip4_elem::udp_port.
Referenced by gprs_ns_nsip_connect_sns().
int gprs_sns_bss_fsm_start | ( | struct gprs_ns_inst * | nsi | ) |
References gprs_ns_inst::bss_sns_fi, GPRS_SNS_EV_START, and osmo_fsm_inst_dispatch.
Referenced by gprs_ns_nsip_connect_sns().
void gprs_sns_dump_vty | ( | struct vty * | vty, |
const struct gprs_ns_inst * | nsi, | ||
bool | stats | ||
) |
References gprs_ns_inst::bss_sns_fi, gprs_sns_state::ip4_local, gprs_sns_state::ip4_remote, gprs_sns_state::nsi, gprs_sns_state::num_ip4_local, gprs_sns_state::num_ip4_remote, gprs_sns_state::num_max_ip4_remote, gprs_sns_state::num_max_nsvcs, osmo_fsm_inst::priv, vty_dump_sns_ip4(), VTY_NEWLINE, vty_out(), and vty_out_fsm_inst().
Referenced by dump_ns().
|
static |
int gprs_sns_init | ( | void | ) |
References DNS, gprs_sns_bss_fsm, osmo_fsm::log_subsys, and osmo_fsm_register().
Referenced by gprs_ns_instantiate().
|
static |
|
static |
|
static |
References cause, create_missing_nsvcs(), data, gprs_ns_tx_sns_config_ack(), GPRS_SNS_EV_CONFIG, GPRS_SNS_EV_CONFIG_END, GPRS_SNS_ST_CONFIGURED, GPRS_SNS_ST_UNCONFIGURED, gprs_start_alive_all_nsvcs(), gprs_sns_state::ip4_remote, ip4_weight_sum_data, ip4_weight_sum_sig, LOGL_INFO, LOGPFSML, NS_CAUSE_INVAL_NR_IPv4_EP, NS_CAUSE_INVAL_WEIGH, NS_IE_IPv4_LIST, NS_IE_RESET_FLAG, ns_inst_from_fi(), gprs_sns_state::nsi, gprs_sns_state::nsvc_hack, gprs_sns_state::num_ip4_remote, OSMO_ASSERT, osmo_fsm_inst_state_chg, osmo_fsm_inst::priv, TLVP_LEN, TLVP_PRESENT, and TLVP_VAL.
|
static |
References cause, data, do_sns_add(), do_sns_change_weight(), do_sns_delete(), gprs_ns_tx_sns_ack(), GPRS_SNS_EV_ADD, GPRS_SNS_EV_CHANGE_WEIGHT, GPRS_SNS_EV_DELETE, gprs_sns_state::ip4_remote, ip_addr, NS_CAUSE_INVAL_NR_IPv4_EP, NS_CAUSE_UNKN_IP_ADDR, NS_IE_IP_ADDR, NS_IE_IPv4_LIST, NS_IE_TRANS_ID, gprs_sns_state::nsvc_hack, gprs_sns_state::num_ip4_remote, osmo_fsm_inst::priv, TLVP_LEN, TLVP_PRES_LEN, TLVP_PRESENT, and TLVP_VAL.
|
static |
References osmo_signal_dispatch(), S_SNS_CONFIGURED, and SS_L_NS.
|
static |
|
static |
|
static |
|
static |
References data_weight, gprs_ns_ie_ip4_elem::data_weight, and gprs_ns_ie_ip4_elem::sig_weight.
|
inlinestatic |
References gprs_sns_state::nsi, and osmo_fsm_inst::priv.
Referenced by create_missing_nsvcs(), do_sns_add(), do_sns_change_weight(), do_sns_delete(), gprs_sns_fsm_bss_timer_cb(), gprs_sns_st_config_sgsn(), gprs_sns_st_size(), and gprs_sns_st_unconfigured().
|
static |
References gprs_nsvc_by_rem_addr(), gprs_ns_ie_ip4_elem::ip_addr, and gprs_ns_ie_ip4_elem::udp_port.
Referenced by create_missing_nsvcs(), do_sns_add(), do_sns_change_weight(), and do_sns_delete().
|
static |
References gprs_sns_state::ip4_remote, and gprs_sns_state::num_ip4_remote.
Referenced by do_sns_add(), and do_sns_delete().
|
static |
|
static |
References gprs_ns_ie_ip4_elem::data_weight, gprs_ns_ie_ip4_elem::ip_addr, gprs_ns_ie_ip4_elem::sig_weight, gprs_ns_ie_ip4_elem::udp_port, VTY_NEWLINE, and vty_out().
Referenced by gprs_sns_dump_vty().
|
static |
Referenced by gprs_sns_bss_fsm_alloc(), and gprs_sns_init().
|
static |
|
static |