libosmogb 1.10.0.65-d581.202502052026
Osmocom Gb library
|
Implement frame relay/PVC by Q.933. More...
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <errno.h>
#include <osmocom/gprs/frame_relay.h>
#include <osmocom/core/endian.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/tdef.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/vty/vty.h>
#include <osmocom/vty/tdef_vty.h>
Data Structures | |
struct | q933_a_hdr |
struct | q933_a_pvc_sts |
Macros | |
#define | LOGPFRL(frl, lvl, fmt, args ...) LOGP(DFR, lvl, "%s: " fmt, (frl)->name, ## args) |
#define | DFR DLNS |
#define | LAPF_UI 0x03 /* UI control word */ |
#define | Q931_PDISC_CC 0x08 /* protocol discriminator */ |
#define | LMI_Q933A_CALLREF 0x00 /* NULL call-ref */ |
#define | LMI_Q933A_DLCI 0 /* Q.933A DLCI */ |
#define | LMI_CISCO_DLCI 1023 /* Cisco DLCI */ |
#define | MAX_SUPPORTED_PVC 10 |
Variables | |
uint8_t | prot_disc |
uint8_t | call_ref |
uint8_t | msg_type |
const struct value_string | osmo_fr_role_names [] |
struct osmo_tdef | fr_tdefs [] |
static const struct tlv_definition | q933_att_tlvdef |
Implement frame relay/PVC by Q.933.
#define MAX_SUPPORTED_PVC 10 |
#define Q931_PDISC_CC 0x08 /* protocol discriminator */ |
|
static |
References osmo_fr_dlc::add, osmo_fr_link::cb_data, osmo_fr_dlc::del, osmo_fr_link::dlc_list, dlc_set_active(), FR_ROLE_USER_EQUIPMENT, osmo_fr_dlc::link, link_set_failed(), osmo_fr_dlc::list, llist_for_each_entry, LOGL_NOTICE, LOGPFRL, osmo_fr_network::n392, osmo_fr_network::n393, osmo_fr_link::net, osmo_fr_link::polling_count, osmo_fr_link::role, osmo_fr_link::state, osmo_fr_link::status_cb, and osmo_fr_link::succeed.
Referenced by fr_t392_cb(), rx_lmi_q933_status(), and rx_lmi_q933_status_enq().
|
static |
References Q933_IEI_PVC_STATUS, and TLVP_PRESENT.
Referenced by rx_lmi_q933_status().
|
static |
References osmo_fr_dlc::list.
Referenced by msgb_put_pvc_status().
|
static |
References osmo_fr_dlc::active, osmo_fr_dlc::cb_data, osmo_fr_dlc::dlci, osmo_fr_dlc::link, LOGL_NOTICE, LOGPFRL, and osmo_fr_dlc::status_cb.
Referenced by check_link_state(), link_set_failed(), parse_full_pvc_status(), parse_link_pvc_status(), and rx_lmi_q933_status_enq().
References hdr.
Referenced by osmo_fr_tx_dlc(), and q933_msgb_alloc().
References osmo_fr_dlc::active, osmo_fr_dlc::add, osmo_fr_dlc::del, osmo_fr_dlc::dlci, VTY_NEWLINE, and vty_out().
Referenced by fr_link_dump_vty().
References osmo_fr_link::dlc_list, fr_dlc_dump_vty(), FR_ROLE_USER_EQUIPMENT, osmo_fr_link::last_rx_seq, osmo_fr_link::last_tx_seq, osmo_fr_dlc::link, osmo_fr_dlc::list, llist_for_each_entry, osmo_fr_link::name, osmo_fr_link::role, VTY_NEWLINE, and vty_out().
Referenced by osmo_fr_network_dump_vty().
References data, osmo_fr_network::n391, osmo_fr_link::net, OSMO_ASSERT, osmo_tdef_get(), OSMO_TDEF_S, osmo_timer_schedule(), osmo_fr_link::polling_count, Q933_REPT_FULL_STATUS, Q933_REPT_LINK_INTEGRITY_VERIF, osmo_fr_link::t391, osmo_fr_network::T_defs, and tx_lmi_q933_status_enq().
Referenced by osmo_fr_link_alloc().
References check_link_state(), data, osmo_fr_link::err_count, osmo_fr_link::net, OSMO_ASSERT, osmo_tdef_get(), OSMO_TDEF_S, osmo_timer_schedule(), osmo_fr_link::t392, and osmo_fr_network::T_defs.
Referenced by osmo_fr_link_alloc().
|
static |
References osmo_fr_link::last_tx_seq.
Referenced by msgb_put_link_int_verif().
|
static |
References osmo_fr_link::cb_data, osmo_fr_link::dlc_list, dlc_set_active(), osmo_fr_dlc::link, osmo_fr_dlc::list, llist_for_each_entry, LOGL_NOTICE, LOGPFRL, osmo_fr_link::state, and osmo_fr_link::status_cb.
Referenced by check_link_state(), and rx_lmi_q933_status_enq().
References osmo_fr_link::last_rx_seq, link_get_tx_seq(), msg, and Q933_IEI_LINK_INT_VERIF.
Referenced by tx_lmi_q933_status(), and tx_lmi_q933_status_enq().
References osmo_fr_dlc::active, osmo_fr_dlc::add, osmo_fr_dlc::del, dlc_destroy(), osmo_fr_dlc::dlci, msg, Q933_IEI_PVC_STATUS, Q933_PVC_STATUS_DLC_ACTIVE, Q933_PVC_STATUS_DLC_DELETE, and Q933_PVC_STATUS_DLC_NEW.
Referenced by tx_lmi_q933_status().
struct osmo_fr_dlc * osmo_fr_dlc_alloc | ( | struct osmo_fr_link * | link, |
uint16_t | dlci | ||
) |
struct osmo_fr_dlc * osmo_fr_dlc_by_dlci | ( | struct osmo_fr_link * | link, |
uint16_t | dlci | ||
) |
References osmo_fr_link::dlc_list, osmo_fr_dlc::dlci, osmo_fr_dlc::link, osmo_fr_dlc::list, and llist_for_each_entry.
Referenced by osmo_fr_rx(), parse_full_pvc_status(), and parse_link_pvc_status().
void osmo_fr_dlc_free | ( | struct osmo_fr_dlc * | dlc | ) |
References osmo_fr_dlc::list.
Referenced by osmo_fr_link_free().
struct osmo_fr_link * osmo_fr_link_alloc | ( | struct osmo_fr_network * | net, |
enum osmo_fr_role | role, | ||
const char * | name | ||
) |
References osmo_fr_link::dlc_list, FR_ROLE_NETWORK_EQUIPMENT, FR_ROLE_USER_EQUIPMENT, fr_t391_cb(), fr_t392_cb(), INIT_LLIST_HEAD, osmo_fr_network::links, osmo_fr_link::list, LOGL_INFO, LOGPFRL, osmo_fr_link::name, osmo_fr_link::net, osmo_fr_role_str(), osmo_tdef_get(), OSMO_TDEF_S, osmo_timer_schedule(), osmo_timer_setup(), osmo_fr_link::role, osmo_fr_link::t391, osmo_fr_link::t392, and osmo_fr_network::T_defs.
Referenced by gprs_ns2_fr_bind().
void osmo_fr_link_free | ( | struct osmo_fr_link * | link | ) |
References osmo_fr_link::dlc_list, osmo_fr_dlc::link, osmo_fr_link::list, osmo_fr_dlc::list, llist_for_each_entry_safe, osmo_fr_dlc_free(), osmo_timer_del(), osmo_fr_link::t391, and osmo_fr_link::t392.
Referenced by free_bind(), gprs_ns2_fr_bind(), and osmo_fr_network_free().
struct osmo_fr_network * osmo_fr_network_alloc | ( | void * | ctx | ) |
References fr_tdefs, INIT_LLIST_HEAD, osmo_fr_network::links, osmo_fr_network::n391, osmo_fr_network::n392, osmo_fr_network::n393, osmo_tdefs_reset(), and osmo_fr_network::T_defs.
Referenced by gprs_ns2_vty_init_reduced().
void osmo_fr_network_free | ( | struct osmo_fr_network * | net | ) |
References osmo_fr_dlc::active, osmo_fr_dlc::cb_data, LMI_CISCO_DLCI, LMI_Q933A_DLCI, LOGL_ERROR, LOGL_NOTICE, LOGPFRL, msg, msgb_data(), msgb_free(), msgb_length(), OSMO_ASSERT, osmo_fr_dlc_by_dlci(), q922_to_dlci(), osmo_fr_dlc::rx_cb, rx_lmi_q922(), osmo_fr_link::state, osmo_fr_link::unknown_dlc_rx_cb, and osmo_fr_link::unknown_dlc_rx_cb_data.
Referenced by fr_netif_ofd_cb().
References osmo_fr_dlc::active, osmo_fr_link::cb_data, osmo_fr_dlc::dlci, dlci_to_q922(), osmo_fr_dlc::link, LOGL_DEBUG, LOGL_NOTICE, LOGPFRL, msg, msgb_free(), OSMO_ASSERT, osmo_fr_link::state, and osmo_fr_link::tx_cb.
Referenced by fr_vc_sendmsg().
|
static |
References osmo_fr_dlc::add, osmo_fr_dlc::del, osmo_fr_link::dlc_list, dlc_set_active(), osmo_fr_dlc::dlci, llist_for_each_entry_safe, LOGL_ERROR, LOGPFRL, osmo_fr_dlc_alloc(), osmo_fr_dlc_by_dlci(), Q933_IEI_PVC_STATUS, TLVP_PRESENT, TLVP_VAL_MINLEN, and validate_pvc_status().
Referenced by rx_lmi_q933_status().
|
static |
References osmo_fr_dlc::add, osmo_fr_dlc::del, dlc_set_active(), osmo_fr_dlc::dlci, LOGL_ERROR, LOGPFRL, osmo_fr_dlc_alloc(), osmo_fr_dlc_by_dlci(), Q933_IEI_PVC_STATUS, TLVP_PRESENT, TLVP_VAL_MINLEN, and validate_pvc_status().
Referenced by rx_lmi_q933_status().
References hdr.
Referenced by osmo_fr_rx().
References q933_a_hdr::call_ref, dlci_to_q922(), LAPF_UI, LMI_Q933A_CALLREF, msg, msg_type, q933_a_hdr::msg_type, prot_disc, and q933_a_hdr::prot_disc.
Referenced by tx_lmi_q933_status(), and tx_lmi_q933_status_enq().
References LAPF_UI, LOGL_NOTICE, LOGPFRL, MAX_SUPPORTED_PVC, msg, q933_a_hdr::msg_type, msgb_free(), msgb_l2, msgb_l3, OSMO_ASSERT, q933_a_hdr::prot_disc, Q931_MSGT_STATUS, Q931_MSGT_STATUS_ENQUIRY, Q931_PDISC_CC, q933_att_tlvdef, rx_lmi_q933_status(), rx_lmi_q933_status_enq(), and tlv_parse2().
Referenced by osmo_fr_rx().
References check_link_state(), count_pvc_status(), osmo_fr_link::expected_rep, FR_ROLE_NETWORK_EQUIPMENT, osmo_fr_link::last_rx_seq, osmo_fr_link::last_tx_seq, LOGL_ERROR, LOGL_NOTICE, LOGPFRL, MAX_SUPPORTED_PVC, msg, osmo_fr_link::net, OSMO_ASSERT, osmo_tdef_get(), OSMO_TDEF_S, osmo_timer_schedule(), parse_full_pvc_status(), parse_link_pvc_status(), Q933_IEI_LINK_INT_VERIF, Q933_IEI_REPORT_TYPE, Q933_REPT_FULL_STATUS, Q933_REPT_LINK_INTEGRITY_VERIF, Q933_REPT_SINGLE_PVC_ASYNC_STS, osmo_fr_link::role, osmo_fr_link::t392, osmo_fr_network::T_defs, TLVP_PRES_LEN, and TLVP_VAL.
Referenced by rx_lmi_q922().
References osmo_fr_dlc::add, check_link_state(), osmo_fr_dlc::del, osmo_fr_link::dlc_list, dlc_set_active(), osmo_fr_link::err_count, FR_ROLE_USER_EQUIPMENT, osmo_fr_link::last_rx_seq, osmo_fr_link::last_tx_seq, osmo_fr_dlc::link, link_set_failed(), osmo_fr_dlc::list, llist_for_each_entry, LOGL_ERROR, LOGPFRL, msg, osmo_fr_link::net, OSMO_ASSERT, osmo_tdef_get(), OSMO_TDEF_S, osmo_timer_schedule(), Q933_IEI_LINK_INT_VERIF, Q933_IEI_REPORT_TYPE, osmo_fr_link::role, osmo_fr_link::state, osmo_fr_dlc::state_send, osmo_fr_link::t392, osmo_fr_network::T_defs, TLVP_PRES_LEN, TLVP_VAL, and tx_lmi_q933_status().
Referenced by rx_lmi_q922().
|
static |
References osmo_fr_dlc::add, osmo_fr_link::cb_data, osmo_fr_dlc::del, osmo_fr_link::dlc_list, msgb::dst, msgb::list, llist_for_each_entry, msgb_put_link_int_verif(), msgb_put_pvc_status(), Q931_MSGT_STATUS, Q931_PDISC_CC, Q933_IEI_REPORT_TYPE, q933_msgb_alloc(), Q933_REPT_FULL_STATUS, Q933_REPT_LINK_INTEGRITY_VERIF, Q933_REPT_SINGLE_PVC_ASYNC_STS, osmo_fr_dlc::state_send, and osmo_fr_link::tx_cb.
Referenced by osmo_fr_dlc_alloc(), and rx_lmi_q933_status_enq().
|
static |
References osmo_fr_link::cb_data, msgb::dst, osmo_fr_link::expected_rep, msgb_put_link_int_verif(), Q931_MSGT_STATUS_ENQUIRY, Q931_PDISC_CC, Q933_IEI_REPORT_TYPE, q933_msgb_alloc(), and osmo_fr_link::tx_cb.
Referenced by fr_t391_cb().
|
static |
References len, Q933_IEI_PVC_STATUS, TLVP_LEN, and TLVP_PRESENT.
Referenced by parse_full_pvc_status(), and parse_link_pvc_status().
uint8_t call_ref |
Referenced by osmo_fr_network_alloc().
uint8_t msg_type |
Referenced by q933_msgb_alloc().
const struct value_string osmo_fr_role_names[] |
Referenced by osmo_fr_role_str().
uint8_t prot_disc |
Referenced by q933_msgb_alloc().
|
static |
Referenced by rx_lmi_q922().