libosmoisdn 1.9.0.197-fb8cd
Osmocom ISDN library
v110.h
Go to the documentation of this file.
1#pragma once
2
3#include <osmocom/core/bits.h>
4
5/* See Section 5.1.2.1 of ITU-T V.110 */
6#define MAX_D_BITS 48
7#define MAX_E_BITS 7
8#define MAX_S_BITS 9
9#define MAX_X_BITS 2
10
17};
18
19int osmo_v110_decode_frame(struct osmo_v110_decoded_frame *fr, const ubit_t *ra_bits, size_t n_bits);
20int osmo_v110_encode_frame(ubit_t *ra_bits, size_t n_bits, const struct osmo_v110_decoded_frame *fr);
21
22void osmo_v110_ubit_dump(FILE *outf, const ubit_t *fr, size_t in_len);
23
24
40};
41
43
44#define osmo_v110_e1e2e3_set(e_bits, rate) \
45 memcpy(e_bits, osmo_v110_e1e2e3[rate], 3)
46#define osmo_v110_e1e2e3_cmp(e_bits, rate) \
47 memcmp(e_bits, osmo_v110_e1e2e3[rate], 3)
48
52
54 const ubit_t *d_in, size_t in_len);
55
56int osmo_v110_sync_ra1_ir_to_user(enum osmo_v100_sync_ra1_rate rate, ubit_t *d_out, size_t out_len,
57 const struct osmo_v110_decoded_frame *fr);
uint8_t ubit_t
a 'decoded' representation of a single V.110 frame.
Definition: v110.h:12
ubit_t s_bits[MAX_S_BITS]
Definition: v110.h:15
ubit_t x_bits[MAX_X_BITS]
Definition: v110.h:16
ubit_t d_bits[MAX_D_BITS]
Definition: v110.h:13
ubit_t e_bits[MAX_E_BITS]
Definition: v110.h:14
int osmo_v110_sync_ra1_get_intermediate_rate(enum osmo_v100_sync_ra1_rate rate)
obtain the intermediate rate (in bits/s) for specified RA1 rate
Definition: v110.c:554
#define MAX_E_BITS
Definition: v110.h:7
void osmo_v110_ubit_dump(FILE *outf, const ubit_t *fr, size_t in_len)
Print a encoded V.110 frame in the same table-like structure as the spec.
Definition: v110.c:127
#define MAX_S_BITS
Definition: v110.h:8
const ubit_t osmo_v110_e1e2e3[_NUM_OSMO_V110_SYNC_RA1][3]
E1/E2/E3 bit values as per Table 5/V.110.
Definition: v110.c:147
int osmo_v110_sync_ra1_user_to_ir(enum osmo_v100_sync_ra1_rate rate, struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len)
perform V.110 RA1 function in user rate -> intermediate rate direction.
Definition: v110.c:568
osmo_v100_sync_ra1_rate
enum for each supported V.110 synchronous RA1 function (one for each user bitrate)
Definition: v110.h:26
@ OSMO_V110_SYNC_RA1_14400
Definition: v110.h:34
@ OSMO_V110_SYNC_RA1_9600
Definition: v110.h:32
@ OSMO_V110_SYNC_RA1_28800
Definition: v110.h:37
@ OSMO_V110_SYNC_RA1_1200
Definition: v110.h:28
@ OSMO_V110_SYNC_RA1_4800
Definition: v110.h:30
@ OSMO_V110_SYNC_RA1_2400
Definition: v110.h:29
@ OSMO_V110_SYNC_RA1_12000
Definition: v110.h:33
@ _NUM_OSMO_V110_SYNC_RA1
Definition: v110.h:39
@ OSMO_V110_SYNC_RA1_7200
Definition: v110.h:31
@ OSMO_V110_SYNC_RA1_38400
Definition: v110.h:38
@ OSMO_V110_SYNC_RA1_600
Definition: v110.h:27
@ OSMO_V110_SYNC_RA1_19200
Definition: v110.h:35
@ OSMO_V110_SYNC_RA1_24000
Definition: v110.h:36
int osmo_v110_sync_ra1_get_user_data_chunk_bitlen(enum osmo_v100_sync_ra1_rate rate)
obtain the size (in number of bits) of the user data bits in one V.110 frame for specified RA1 rate
Definition: v110.c:536
#define MAX_X_BITS
Definition: v110.h:9
int osmo_v110_decode_frame(struct osmo_v110_decoded_frame *fr, const ubit_t *ra_bits, size_t n_bits)
Decode a 80-bit V.110 frame present as 80 ubits into a struct osmo_v110_decoded_frame.
Definition: v110.c:45
#define MAX_D_BITS
Definition: v110.h:6
int osmo_v110_sync_ra1_ir_to_user(enum osmo_v100_sync_ra1_rate rate, ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr)
perform V.110 RA1 function in intermediate rate -> user rate direction.
Definition: v110.c:583
int osmo_v110_sync_ra1_get_user_data_rate(enum osmo_v100_sync_ra1_rate rate)
obtain the user data rate (in bits/s) for specified RA1 rate
Definition: v110.c:545
int osmo_v110_encode_frame(ubit_t *ra_bits, size_t n_bits, const struct osmo_v110_decoded_frame *fr)
Encode a struct osmo_v110_decoded_frame into an 80-bit V.110 frame as ubits.
Definition: v110.c:84