comparison spandsp-0.0.6pre17/src/spandsp/private/v42.h @ 4:26cd8f1ef0b1

import spandsp-0.0.6pre17
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Fri, 25 Jun 2010 15:50:58 +0200
parents
children
comparison
equal deleted inserted replaced
3:c6c5a16ce2f2 4:26cd8f1ef0b1
1 /*
2 * SpanDSP - a series of DSP components for telephony
3 *
4 * private/v42.h
5 *
6 * Written by Steve Underwood <steveu@coppice.org>
7 *
8 * Copyright (C) 2003 Steve Underwood
9 *
10 * All rights reserved.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 2.1,
14 * as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 * $Id: v42.h,v 1.2 2009/11/04 15:52:06 steveu Exp $
26 */
27
28 #if !defined(_SPANDSP_PRIVATE_V42_H_)
29 #define _SPANDSP_PRIVATE_V42_H_
30
31 /*!
32 LAP-M descriptor. This defines the working state for a single instance of LAP-M.
33 */
34 struct lapm_state_s
35 {
36 int handle;
37 hdlc_rx_state_t hdlc_rx;
38 hdlc_tx_state_t hdlc_tx;
39
40 v42_frame_handler_t iframe_receive;
41 void *iframe_receive_user_data;
42
43 v42_status_func_t status_callback;
44 void *status_callback_user_data;
45
46 int state;
47 int tx_waiting;
48 int debug;
49 /*! TRUE if originator. FALSE if answerer */
50 int we_are_originator;
51 /*! Remote network type (unknown, answerer. originator) */
52 int peer_is_originator;
53 /*! Next N(S) for transmission */
54 int next_tx_frame;
55 /*! The last of our frames which the peer acknowledged */
56 int last_frame_peer_acknowledged;
57 /*! Next N(R) for reception */
58 int next_expected_frame;
59 /*! The last of the peer's frames which we acknowledged */
60 int last_frame_we_acknowledged;
61 /*! TRUE if we sent an I or S frame with the F-bit set */
62 int solicit_f_bit;
63 /*! Retransmission count */
64 int retransmissions;
65 /*! TRUE if peer is busy */
66 int busy;
67
68 /*! Acknowledgement timer */
69 int t401_timer;
70 /*! Reply delay timer - optional */
71 int t402_timer;
72 /*! Inactivity timer - optional */
73 int t403_timer;
74 /*! Maximum number of octets in an information field */
75 int n401;
76 /*! Window size */
77 int window_size_k;
78
79 lapm_frame_queue_t *txqueue;
80 lapm_frame_queue_t *tx_next;
81 lapm_frame_queue_t *tx_last;
82 queue_state_t *tx_queue;
83
84 span_sched_state_t sched;
85 /*! \brief Error and flow logging control */
86 logging_state_t logging;
87 };
88
89 /*!
90 V.42 descriptor. This defines the working state for a single instance of V.42.
91 */
92 struct v42_state_s
93 {
94 /*! TRUE if we are the calling party, otherwise FALSE */
95 int calling_party;
96 /*! TRUE if we should detect whether the far end is V.42 capable. FALSE if we go
97 directly to protocol establishment */
98 int detect;
99
100 /*! Stage in negotiating V.42 support */
101 int rx_negotiation_step;
102 int rxbits;
103 int rxstream;
104 int rxoks;
105 int odp_seen;
106 int txbits;
107 int txstream;
108 int txadps;
109 /*! The LAP.M context */
110 lapm_state_t lapm;
111
112 /*! V.42 support detection timer */
113 int t400_timer;
114 /*! \brief Error and flow logging control */
115 logging_state_t logging;
116 };
117
118 #endif
119 /*- End of file ------------------------------------------------------------*/

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.