/usr/include/spandsp/private/hdlc.h is in libspandsp-dev 0.0.6+dfsg-0.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | /*
* SpanDSP - a series of DSP components for telephony
*
* private/hdlc.h
*
* Written by Steve Underwood <steveu@coppice.org>
*
* Copyright (C) 2003 Steve Underwood
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(_SPANDSP_PRIVATE_HDLC_H_)
#define _SPANDSP_PRIVATE_HDLC_H_
/*!
HDLC receive descriptor. This contains all the state information for an HDLC receiver.
*/
struct hdlc_rx_state_s
{
/*! 2 for CRC-16, 4 for CRC-32 */
int crc_bytes;
/*! \brief Maximum permitted frame length. */
size_t max_frame_len;
/*! \brief The callback routine called to process each good received frame. */
hdlc_frame_handler_t frame_handler;
/*! \brief An opaque parameter passed to the frame callback routine. */
void *frame_user_data;
/*! \brief The callback routine called to report status changes. */
modem_rx_status_func_t status_handler;
/*! \brief An opaque parameter passed to the status callback routine. */
void *status_user_data;
/*! \brief TRUE if bad frames are to be reported. */
int report_bad_frames;
/*! \brief The number of consecutive flags which must be seen before framing is
declared OK. */
int framing_ok_threshold;
/*! \brief TRUE if framing OK has been announced. */
int framing_ok_announced;
/*! \brief Number of consecutive flags seen so far. */
int flags_seen;
/*! \brief The raw (stuffed) bit stream buffer. */
unsigned int raw_bit_stream;
/*! \brief The destuffed bit stream buffer. */
unsigned int byte_in_progress;
/*! \brief The current number of bits in byte_in_progress. */
int num_bits;
/*! \brief TRUE if in octet counting mode (e.g. for MTP). */
int octet_counting_mode;
/*! \brief Octet count, to achieve the functionality needed for things
like MTP. */
int octet_count;
/*! \brief The number of octets to be allowed between octet count reports. */
int octet_count_report_interval;
/*! \brief Buffer for a frame in progress. */
uint8_t buffer[HDLC_MAXFRAME_LEN + 4];
/*! \brief Length of a frame in progress. */
size_t len;
/*! \brief The number of bytes of good frames received (CRC not included). */
unsigned long int rx_bytes;
/*! \brief The number of good frames received. */
unsigned long int rx_frames;
/*! \brief The number of frames with CRC errors received. */
unsigned long int rx_crc_errors;
/*! \brief The number of too short and too long frames received. */
unsigned long int rx_length_errors;
/*! \brief The number of HDLC aborts received. */
unsigned long int rx_aborts;
};
/*!
HDLC transmit descriptor. This contains all the state information for an
HDLC transmitter.
*/
struct hdlc_tx_state_s
{
/*! 2 for CRC-16, 4 for CRC-32 */
int crc_bytes;
/*! \brief The callback routine called to indicate transmit underflow. */
hdlc_underflow_handler_t underflow_handler;
/*! \brief An opaque parameter passed to the callback routine. */
void *user_data;
/*! \brief The minimum flag octets to insert between frames. */
int inter_frame_flags;
/*! \brief TRUE if frame creation works in progressive mode. */
int progressive;
/*! \brief Maximum permitted frame length. */
size_t max_frame_len;
/*! \brief The stuffed bit stream being created. */
uint32_t octets_in_progress;
/*! \brief The number of bits currently in octets_in_progress. */
int num_bits;
/*! \brief The currently rotated state of the flag octet. */
int idle_octet;
/*! \brief The number of flag octets to send for a timed burst of flags. */
int flag_octets;
/*! \brief The number of abort octets to send for a timed burst of aborts. */
int abort_octets;
/*! \brief TRUE if the next underflow of timed flag octets should be reported */
int report_flag_underflow;
/*! \brief The current message being transmitted, with its CRC attached. */
uint8_t buffer[HDLC_MAXFRAME_LEN + 4];
/*! \brief The length of the message in the buffer. */
size_t len;
/*! \brief The current send position within the buffer. */
size_t pos;
/*! \brief The running CRC, as data fills the frame buffer. */
uint32_t crc;
/*! \brief The current byte being broken into bits for transmission. */
int byte;
/*! \brief The number of bits remaining in byte. */
int bits;
/*! \brief TRUE if transmission should end on buffer underflow .*/
int tx_end;
};
#endif
/*- End of file ------------------------------------------------------------*/
|