private/v42.h

00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * private/v42.h
00005  *
00006  * Written by Steve Underwood <steveu@coppice.org>
00007  *
00008  * Copyright (C) 2003 Steve Underwood
00009  *
00010  * All rights reserved.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU Lesser General Public License version 2.1,
00014  * as published by the Free Software Foundation.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024  */
00025 
00026 #if !defined(_SPANDSP_PRIVATE_V42_H_)
00027 #define _SPANDSP_PRIVATE_V42_H_
00028 
00029 /*!
00030     LAP-M descriptor. This defines the working state for a single instance of LAP-M.
00031 */
00032 struct lapm_state_s
00033 {
00034     int handle;
00035     hdlc_rx_state_t hdlc_rx;
00036     hdlc_tx_state_t hdlc_tx;
00037     
00038     v42_frame_handler_t iframe_receive;
00039     void *iframe_receive_user_data;
00040 
00041     v42_status_func_t status_callback;
00042     void *status_callback_user_data;
00043 
00044     int state;
00045     int tx_waiting;
00046     int debug;
00047     /*! TRUE if originator. FALSE if answerer */
00048     int we_are_originator;
00049     /*! Remote network type (unknown, answerer. originator) */
00050     int peer_is_originator;
00051     /*! Next N(S) for transmission */
00052     int next_tx_frame;
00053     /*! The last of our frames which the peer acknowledged */
00054     int last_frame_peer_acknowledged;
00055     /*! Next N(R) for reception */
00056     int next_expected_frame;
00057     /*! The last of the peer's frames which we acknowledged */
00058     int last_frame_we_acknowledged;
00059     /*! TRUE if we sent an I or S frame with the F-bit set */
00060     int solicit_f_bit;
00061     /*! Retransmission count */
00062     int retransmissions;
00063     /*! TRUE if peer is busy */
00064     int busy;
00065 
00066     /*! Acknowledgement timer */
00067     int t401_timer;
00068     /*! Reply delay timer - optional */
00069     int t402_timer;
00070     /*! Inactivity timer - optional */
00071     int t403_timer;
00072     /*! Maximum number of octets in an information field */
00073     int n401;
00074     /*! Window size */
00075     int window_size_k;
00076         
00077     lapm_frame_queue_t *txqueue;
00078     lapm_frame_queue_t *tx_next;
00079     lapm_frame_queue_t *tx_last;
00080     queue_state_t *tx_queue;
00081     
00082     span_sched_state_t sched;
00083     /*! \brief Error and flow logging control */
00084     logging_state_t logging;
00085 };
00086 
00087 /*!
00088     V.42 descriptor. This defines the working state for a single instance of V.42.
00089 */
00090 struct v42_state_s
00091 {
00092     /*! TRUE if we are the calling party, otherwise FALSE */
00093     int calling_party;
00094     /*! TRUE if we should detect whether the far end is V.42 capable. FALSE if we go
00095         directly to protocol establishment */
00096     int detect;
00097 
00098     /*! Stage in negotiating V.42 support */
00099     int rx_negotiation_step;
00100     int rxbits;
00101     int rxstream;
00102     int rxoks;
00103     int odp_seen;
00104     int txbits;
00105     int txstream;
00106     int txadps;
00107     /*! The LAP.M context */
00108     lapm_state_t lapm;
00109 
00110     /*! V.42 support detection timer */
00111     int t400_timer;
00112     /*! \brief Error and flow logging control */
00113     logging_state_t logging;
00114 };
00115 
00116 #endif
00117 /*- End of file ------------------------------------------------------------*/

Generated on 29 Jul 2015 for spandsp by  doxygen 1.6.1