26 #if !defined(_SPANDSP_UDPTL_H_) 27 #define _SPANDSP_UDPTL_H_ 29 #define LOCAL_FAX_MAX_DATAGRAM 400 30 #define LOCAL_FAX_MAX_FEC_PACKETS 5 32 #define UDPTL_BUF_MASK 15 34 typedef int (*udptl_rx_packet_handler_t) (
void *user_data,
const uint8_t msg[],
int len,
int seq_no);
39 uint8_t buf[LOCAL_FAX_MAX_DATAGRAM];
45 uint8_t buf[LOCAL_FAX_MAX_DATAGRAM];
46 int fec_len[LOCAL_FAX_MAX_FEC_PACKETS];
47 uint8_t fec[LOCAL_FAX_MAX_FEC_PACKETS][LOCAL_FAX_MAX_DATAGRAM];
54 udptl_rx_packet_handler_t rx_packet_handler;
81 int rx_expected_seq_no;
89 UDPTL_ERROR_CORRECTION_NONE,
90 UDPTL_ERROR_CORRECTION_FEC,
91 UDPTL_ERROR_CORRECTION_REDUNDANCY
96 #if defined(__cplusplus) 105 int udptl_rx_packet(
udptl_state_t *s,
const uint8_t buf[],
int len);
113 int udptl_build_packet(
udptl_state_t *s, uint8_t buf[],
const uint8_t msg[],
int msg_len);
121 int udptl_set_error_correction(
udptl_state_t *s,
int ec_scheme,
int span,
int entries);
129 int udptl_get_error_correction(
udptl_state_t *s,
int *ec_scheme,
int *span,
int *entries);
131 int udptl_set_local_max_datagram(
udptl_state_t *s,
int max_datagram);
135 int udptl_set_far_max_datagram(
udptl_state_t *s,
int max_datagram);
147 udptl_state_t *udptl_init(
udptl_state_t *s,
int ec_scheme,
int span,
int entries, udptl_rx_packet_handler_t rx_packet_handler,
void *user_data);
154 #if defined(__cplusplus)
int far_max_datagram_size
Definition: udptl.h:71
int error_correction_scheme
Definition: udptl.h:59
int error_correction_span
Definition: udptl.h:67
int error_correction_entries
Definition: udptl.h:63
int local_max_datagram_size
Definition: udptl.h:75