Loading...
Searching...
No Matches
iuup.h
Go to the documentation of this file.
#pragma once
#include <stdint.h>
#include <osmocom/core/prim.h>
#include <osmocom/gsm/protocol/gsm_25_415.h>
/***********************************************************************
* Primitives towards the lower layers (typically RTP transport)
***********************************************************************/
enum osmo_iuup_tnl_prim_type {
OSMO_IUUP_TNL_UNITDATA,
};
struct osmo_iuup_tnl_prim {
struct osmo_prim_hdr oph;
};
/***********************************************************************
* Primitives towards the upper layers at the RNL SAP
***********************************************************************/
/* 3GPP TS 25.415 Section 7.2.1 */
enum osmo_iuup_rnl_prim_type {
OSMO_IUUP_RNL_CONFIG,
OSMO_IUUP_RNL_DATA,
OSMO_IUUP_RNL_STATUS,
OSMO_IUUP_RNL_UNIT_DATA,
};
/* TS 25.413 9.2.1.3*/
#define IUUP_MAX_SUBFLOWS 7
#define IUUP_MAX_RFCIS 64
#define IUUP_TIMER_INIT_T_DEFAULT 1000
#define IUUP_TIMER_TA_T_DEFAULT 500
#define IUUP_TIMER_RC_T_DEFAULT 500
#define IUUP_TIMER_INIT_N_DEFAULT 3
#define IUUP_TIMER_TA_N_DEFAULT 1
#define IUUP_TIMER_RC_N_DEFAULT 1
struct osmo_iuup_rnl_config_timer {
uint32_t t_ms; /* time in ms */
uint32_t n_max; /* max number of repetitions */
};
struct osmo_iuup_rfci {
uint8_t used:1,
spare1:1,
id:6;
uint8_t spare2:4,
IPTI:4; /* values range 0-15, 4 bits */;
uint16_t subflow_sizes[IUUP_MAX_SUBFLOWS];
};
struct osmo_iuup_rnl_config {
/* transparent (true) or SMpSDU (false): */
bool transparent;
/* should we actively transmit INIT in SmpSDU mode? */
bool active;
/* Currently Version 0 or 1: */
uint8_t data_pdu_type;
/* Supported mode versions */
uint16_t supported_versions_mask;
uint8_t num_rfci;
uint8_t num_subflows;
bool IPTIs_present;
struct osmo_iuup_rfci rfci[IUUP_MAX_RFCIS];
/* TODO: Indication of delivery of erroneous SDUs*/
struct osmo_iuup_rnl_config_timer t_init;
struct osmo_iuup_rnl_config_timer t_ta;
struct osmo_iuup_rnl_config_timer t_rc;
};
struct osmo_iuup_rnl_data {
uint8_t rfci;
uint8_t frame_nr;
uint8_t fqc;
};
struct osmo_iuup_rnl_status {
enum iuup_procedure procedure;
union {
struct {
enum iuup_error_cause cause;
enum iuup_error_distance distance;
} error_event;
struct {
uint16_t mode_version;
uint8_t data_pdu_type;
uint8_t num_rfci;
uint8_t num_subflows;
bool IPTIs_present;
struct osmo_iuup_rfci rfci[IUUP_MAX_RFCIS];
} initialization;
struct {
} rate_control;
struct {
} time_alignment;
} u;
};
/* SAP on the upper side of IuUP, towards the user */
struct osmo_iuup_rnl_prim {
struct osmo_prim_hdr oph;
union {
struct osmo_iuup_rnl_config config;
struct osmo_iuup_rnl_data data;
struct osmo_iuup_rnl_status status;
//struct osmo_iuup_rnl_unitdata unitdata;
} u;
};
struct osmo_iuup_instance;
struct osmo_iuup_instance *osmo_iuup_instance_alloc(void *ctx, const char *id);
void osmo_iuup_instance_free(struct osmo_iuup_instance *iui);
void osmo_iuup_instance_set_user_prim_cb(struct osmo_iuup_instance *iui, osmo_prim_cb func, void *priv);
void osmo_iuup_instance_set_transport_prim_cb(struct osmo_iuup_instance *iui, osmo_prim_cb func, void *priv);
int osmo_iuup_tnl_prim_up(struct osmo_iuup_instance *iui, struct osmo_iuup_tnl_prim *itp);
int osmo_iuup_rnl_prim_down(struct osmo_iuup_instance *inst, struct osmo_iuup_rnl_prim *irp);
int osmo_iuup_compute_header_crc(const uint8_t *iuup_pdu, unsigned int pdu_len);
int osmo_iuup_compute_payload_crc(const uint8_t *iuup_pdu, unsigned int pdu_len);
struct osmo_iuup_rnl_prim *osmo_iuup_rnl_prim_alloc(void *ctx, unsigned int primitive, unsigned int operation, unsigned int size);
struct osmo_iuup_tnl_prim *osmo_iuup_tnl_prim_alloc(void *ctx, unsigned int primitive, unsigned int operation, unsigned int size);
config
write Write running configuration to or terminal n Write configuration to the copy running config startup config
data
uint8_t data[0]
Definition gsm_03_41.h:16
gsm_25_415.h
iuup_error_distance
iuup_error_distance
Definition gsm_25_415.h:190
iuup_error_cause
iuup_error_cause
Definition gsm_25_415.h:199
iuup_procedure
iuup_procedure
Definition gsm_25_415.h:181
IUUP_MAX_SUBFLOWS
#define IUUP_MAX_SUBFLOWS
Definition iuup.h:32
osmo_iuup_rnl_prim_alloc
struct osmo_iuup_rnl_prim * osmo_iuup_rnl_prim_alloc(void *ctx, unsigned int primitive, unsigned int operation, unsigned int size)
Definition iuup.c:208
osmo_iuup_instance_set_transport_prim_cb
void osmo_iuup_instance_set_transport_prim_cb(struct osmo_iuup_instance *iui, osmo_prim_cb func, void *priv)
Definition iuup.c:1053
osmo_iuup_compute_payload_crc
int osmo_iuup_compute_payload_crc(const uint8_t *iuup_pdu, unsigned int pdu_len)
Definition iuup.c:67
osmo_iuup_instance_alloc
struct osmo_iuup_instance * osmo_iuup_instance_alloc(void *ctx, const char *id)
Definition iuup.c:1020
osmo_iuup_compute_header_crc
int osmo_iuup_compute_header_crc(const uint8_t *iuup_pdu, unsigned int pdu_len)
Definition iuup.c:94
osmo_iuup_tnl_prim_type
osmo_iuup_tnl_prim_type
Definition iuup.h:11
OSMO_IUUP_TNL_UNITDATA
@ OSMO_IUUP_TNL_UNITDATA
Definition iuup.h:12
osmo_iuup_tnl_prim_up
int osmo_iuup_tnl_prim_up(struct osmo_iuup_instance *iui, struct osmo_iuup_tnl_prim *itp)
Definition iuup.c:902
osmo_iuup_instance_set_user_prim_cb
void osmo_iuup_instance_set_user_prim_cb(struct osmo_iuup_instance *iui, osmo_prim_cb func, void *priv)
Definition iuup.c:1048
osmo_iuup_rnl_prim_type
osmo_iuup_rnl_prim_type
Definition iuup.h:24
OSMO_IUUP_RNL_CONFIG
@ OSMO_IUUP_RNL_CONFIG
Definition iuup.h:25
OSMO_IUUP_RNL_STATUS
@ OSMO_IUUP_RNL_STATUS
Definition iuup.h:27
OSMO_IUUP_RNL_DATA
@ OSMO_IUUP_RNL_DATA
Definition iuup.h:26
OSMO_IUUP_RNL_UNIT_DATA
@ OSMO_IUUP_RNL_UNIT_DATA
Definition iuup.h:28
osmo_iuup_instance_free
void osmo_iuup_instance_free(struct osmo_iuup_instance *iui)
Definition iuup.c:1037
osmo_iuup_tnl_prim_alloc
struct osmo_iuup_tnl_prim * osmo_iuup_tnl_prim_alloc(void *ctx, unsigned int primitive, unsigned int operation, unsigned int size)
Definition iuup.c:219
osmo_iuup_rnl_prim_down
int osmo_iuup_rnl_prim_down(struct osmo_iuup_instance *inst, struct osmo_iuup_rnl_prim *irp)
Definition iuup.c:992
IUUP_MAX_RFCIS
#define IUUP_MAX_RFCIS
Definition iuup.h:33
prim.h
osmo_iuup_instance
Definition iuup.c:121
osmo_iuup_rfci
Definition iuup.h:45
osmo_iuup_rfci::IPTI
uint8_t IPTI
Definition iuup.h:50
osmo_iuup_rfci::subflow_sizes
uint16_t subflow_sizes[IUUP_MAX_SUBFLOWS]
Definition iuup.h:51
osmo_iuup_rfci::spare2
uint8_t spare2
Definition iuup.h:49
osmo_iuup_rfci::used
uint8_t used
Definition iuup.h:46
osmo_iuup_rfci::spare1
uint8_t spare1
Definition iuup.h:47
osmo_iuup_rfci::id
uint8_t id
Definition iuup.h:48
osmo_iuup_rnl_config_timer
Definition iuup.h:41
osmo_iuup_rnl_config_timer::n_max
uint32_t n_max
Definition iuup.h:43
osmo_iuup_rnl_config_timer::t_ms
uint32_t t_ms
Definition iuup.h:42
osmo_iuup_rnl_config
Definition iuup.h:53
osmo_iuup_rnl_config::supported_versions_mask
uint16_t supported_versions_mask
Definition iuup.h:64
osmo_iuup_rnl_config::t_ta
struct osmo_iuup_rnl_config_timer t_ta
Definition iuup.h:72
osmo_iuup_rnl_config::data_pdu_type
uint8_t data_pdu_type
Definition iuup.h:61
osmo_iuup_rnl_config::t_init
struct osmo_iuup_rnl_config_timer t_init
Definition iuup.h:71
osmo_iuup_rnl_config::active
bool active
Definition iuup.h:58
osmo_iuup_rnl_config::num_rfci
uint8_t num_rfci
Definition iuup.h:65
osmo_iuup_rnl_config::t_rc
struct osmo_iuup_rnl_config_timer t_rc
Definition iuup.h:73
osmo_iuup_rnl_config::IPTIs_present
bool IPTIs_present
Definition iuup.h:67
osmo_iuup_rnl_config::num_subflows
uint8_t num_subflows
Definition iuup.h:66
osmo_iuup_rnl_config::rfci
struct osmo_iuup_rfci rfci[IUUP_MAX_RFCIS]
Definition iuup.h:68
osmo_iuup_rnl_config::transparent
bool transparent
Definition iuup.h:55
osmo_iuup_rnl_data
Definition iuup.h:76
osmo_iuup_rnl_data::fqc
uint8_t fqc
Definition iuup.h:79
osmo_iuup_rnl_data::rfci
uint8_t rfci
Definition iuup.h:77
osmo_iuup_rnl_data::frame_nr
uint8_t frame_nr
Definition iuup.h:78
osmo_iuup_rnl_prim
Definition iuup.h:105
osmo_iuup_rnl_prim::u
union osmo_iuup_rnl_prim::@16 u
osmo_iuup_rnl_prim::oph
struct osmo_prim_hdr oph
Definition iuup.h:106
osmo_iuup_rnl_status
Definition iuup.h:82
osmo_iuup_rnl_status::distance
enum iuup_error_distance distance
Definition iuup.h:87
osmo_iuup_rnl_status::mode_version
uint16_t mode_version
Definition iuup.h:90
osmo_iuup_rnl_status::error_event
struct osmo_iuup_rnl_status::@11::@12 error_event
osmo_iuup_rnl_status::time_alignment
struct osmo_iuup_rnl_status::@11::@15 time_alignment
osmo_iuup_rnl_status::rate_control
struct osmo_iuup_rnl_status::@11::@14 rate_control
osmo_iuup_rnl_status::u
union osmo_iuup_rnl_status::@11 u
osmo_iuup_rnl_status::num_subflows
uint8_t num_subflows
Definition iuup.h:93
osmo_iuup_rnl_status::num_rfci
uint8_t num_rfci
Definition iuup.h:92
osmo_iuup_rnl_status::cause
enum iuup_error_cause cause
Definition iuup.h:86
osmo_iuup_rnl_status::rfci
struct osmo_iuup_rfci rfci[IUUP_MAX_RFCIS]
Definition iuup.h:95
osmo_iuup_rnl_status::initialization
struct osmo_iuup_rnl_status::@11::@13 initialization
osmo_iuup_rnl_status::data_pdu_type
uint8_t data_pdu_type
Definition iuup.h:91
osmo_iuup_rnl_status::procedure
enum iuup_procedure procedure
Definition iuup.h:83
osmo_iuup_rnl_status::IPTIs_present
bool IPTIs_present
Definition iuup.h:94
osmo_iuup_tnl_prim
Definition iuup.h:15
osmo_iuup_tnl_prim::oph
struct osmo_prim_hdr oph
Definition iuup.h:16
osmo_prim_hdr