1121326Sharti/*
2121326Sharti * Copyright (c) 1996-2003
3121326Sharti *	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4121326Sharti * 	All rights reserved.
5121326Sharti *
6121326Sharti * Redistribution and use in source and binary forms, with or without
7121326Sharti * modification, are permitted provided that the following conditions
8121326Sharti * are met:
9121326Sharti * 1. Redistributions of source code must retain the above copyright
10121326Sharti *    notice, this list of conditions and the following disclaimer.
11121326Sharti * 2. Redistributions in binary form must reproduce the above copyright
12121326Sharti *    notice, this list of conditions and the following disclaimer in the
13121326Sharti *    documentation and/or other materials provided with the distribution.
14121326Sharti *
15121326Sharti * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16121326Sharti * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17121326Sharti * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18121326Sharti * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19121326Sharti * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20121326Sharti * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21121326Sharti * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22121326Sharti * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23121326Sharti * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24121326Sharti * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25121326Sharti * SUCH DAMAGE.
26121326Sharti *
27121326Sharti * Author: Hartmut Brandt <harti@freebsd.org>
28121326Sharti *
29131826Sharti * $Begemot: libunimsg/netnatm/saal/sscopdef.h,v 1.4 2004/07/08 08:22:17 brandt Exp $
30121326Sharti *
31121326Sharti * Definitions of SSCOP constants and parameter blocks. This is seen by
32121326Sharti * the outside world.
33121326Sharti */
34121326Sharti#ifndef _NETNATM_SAAL_SSCOPDEF_H_
35121326Sharti#define _NETNATM_SAAL_SSCOPDEF_H_
36121326Sharti
37121326Sharti#include <sys/types.h>
38131826Sharti#ifdef _KERNEL
39131826Sharti#include <sys/stdint.h>
40131826Sharti#else
41131826Sharti#include <stdint.h>
42131826Sharti#endif
43121326Sharti
44121326Sharti/*
45121326Sharti * AA-interface signals
46121326Sharti */
47121326Shartienum sscop_aasig {
48121326Sharti	SSCOP_ESTABLISH_request,	/* <- UU, BR */
49121326Sharti	SSCOP_ESTABLISH_indication,	/* -> UU */
50121326Sharti	SSCOP_ESTABLISH_response,	/* <- UU, BR */
51121326Sharti	SSCOP_ESTABLISH_confirm,	/* -> UU */
52121326Sharti
53121326Sharti	SSCOP_RELEASE_request,		/* <- UU */
54121326Sharti	SSCOP_RELEASE_indication,	/* -> UU, SRC */
55121326Sharti	SSCOP_RELEASE_confirm,		/* -> */
56121326Sharti
57121326Sharti	SSCOP_DATA_request,		/* <- MU */
58121326Sharti	SSCOP_DATA_indication,		/* -> MU, SN */
59121326Sharti
60121326Sharti	SSCOP_UDATA_request,		/* <- MU */
61121326Sharti	SSCOP_UDATA_indication,		/* -> MU */
62121326Sharti
63121326Sharti	SSCOP_RECOVER_indication,	/* -> */
64121326Sharti	SSCOP_RECOVER_response,		/* <- */
65121326Sharti
66121326Sharti	SSCOP_RESYNC_request,		/* <- UU */
67121326Sharti	SSCOP_RESYNC_indication,	/* -> UU */
68121326Sharti	SSCOP_RESYNC_response,		/* <- */
69121326Sharti	SSCOP_RESYNC_confirm,		/* -> */
70121326Sharti
71121326Sharti	SSCOP_RETRIEVE_request,		/* <- RN */
72121326Sharti	SSCOP_RETRIEVE_indication,	/* -> MU */
73121326Sharti	SSCOP_RETRIEVE_COMPL_indication,/* -> */
74121326Sharti};
75121326Sharti
76121326Shartienum sscop_maasig {
77121326Sharti	SSCOP_MDATA_request,		/* <- MU */
78121326Sharti	SSCOP_MDATA_indication,		/* -> MU */
79121326Sharti	SSCOP_MERROR_indication,	/* -> CODE, CNT */
80121326Sharti};
81121326Sharti
82121326Sharti/*
83121326Sharti * Values for retrieval. Numbers in SSCOP are 24bit, so
84121326Sharti * we can use the large values
85121326Sharti */
86121326Shartienum {
87121326Sharti	SSCOP_MAXSEQNO		= 0xffffff,
88121326Sharti
89121326Sharti	SSCOP_RETRIEVE_UNKNOWN	= SSCOP_MAXSEQNO + 1,
90121326Sharti	SSCOP_RETRIEVE_TOTAL	= SSCOP_MAXSEQNO + 2,
91121326Sharti};
92121326Sharti
93121326Sharti/*
94121326Sharti * SSCOP states
95121326Sharti */
96121326Shartienum sscop_state {
97121326Sharti	SSCOP_IDLE,		/* initial state */
98121326Sharti	SSCOP_OUT_PEND,		/* outgoing connection pending */
99121326Sharti	SSCOP_IN_PEND,		/* incoming connection pending */
100121326Sharti	SSCOP_OUT_DIS_PEND,	/* outgoing disconnect pending */
101121326Sharti	SSCOP_OUT_RESYNC_PEND,	/* outgoing resynchronisation pending */
102121326Sharti	SSCOP_IN_RESYNC_PEND,	/* incoming resynchronisation pending */
103121326Sharti	SSCOP_OUT_REC_PEND,	/* outgoing recovery pending */
104121326Sharti	SSCOP_REC_PEND,		/* recovery response pending */
105121326Sharti	SSCOP_IN_REC_PEND,	/* incoming recovery pending */
106121326Sharti	SSCOP_READY,		/* data transfer ready */
107121326Sharti};
108121326Sharti#define SSCOP_NSTATES 10
109121326Sharti
110121326Shartistruct sscop_param {
111121326Sharti	uint32_t	timer_cc;	/* timer_cc in msec */
112121326Sharti	uint32_t	timer_poll;	/* timer_poll im msec */
113121326Sharti	uint32_t	timer_keep_alive;/* timer_keep_alive in msec */
114121326Sharti	uint32_t	timer_no_response;/*timer_no_response in msec */
115121326Sharti	uint32_t	timer_idle;	/* timer_idle in msec */
116121326Sharti	uint32_t	maxk;		/* maximum user data in bytes */
117121326Sharti	uint32_t	maxj;		/* maximum u-u info in bytes */
118121326Sharti	uint32_t	maxcc;		/* max. retransmissions for control packets */
119121326Sharti	uint32_t	maxpd;		/* max. vt(pd) before sending poll */
120121326Sharti	uint32_t	maxstat;	/* max. number of elements in stat list */
121121326Sharti	uint32_t	mr;		/* initial window */
122121326Sharti	uint32_t	flags;		/* flags */
123121326Sharti};
124121326Shartienum {
125121326Sharti	SSCOP_ROBUST 	= 0x0001,	/* atmf/97-0216 robustness */
126121326Sharti	SSCOP_POLLREX	= 0x0002,	/* send POLL after retransmit */
127121326Sharti};
128121326Sharti
129121326Shartienum {
130121326Sharti	SSCOP_SET_TCC		= 0x0001,
131121326Sharti	SSCOP_SET_TPOLL		= 0x0002,
132121326Sharti	SSCOP_SET_TKA		= 0x0004,
133121326Sharti	SSCOP_SET_TNR		= 0x0008,
134121326Sharti	SSCOP_SET_TIDLE		= 0x0010,
135121326Sharti	SSCOP_SET_MAXK		= 0x0020,
136121326Sharti	SSCOP_SET_MAXJ		= 0x0040,
137121326Sharti	SSCOP_SET_MAXCC		= 0x0080,
138121326Sharti	SSCOP_SET_MAXPD		= 0x0100,
139121326Sharti	SSCOP_SET_MAXSTAT	= 0x0200,
140121326Sharti	SSCOP_SET_MR		= 0x0400,
141121326Sharti	SSCOP_SET_ROBUST	= 0x0800,
142121326Sharti	SSCOP_SET_POLLREX	= 0x1000,
143121326Sharti
144121326Sharti	SSCOP_SET_ALLMASK	= 0x1fff,
145121326Sharti};
146121326Sharti
147121326Shartienum {
148121326Sharti	SSCOP_DBG_USIG	= 0x0001,
149121326Sharti	SSCOP_DBG_TIMER	= 0x0002,
150121326Sharti	SSCOP_DBG_BUG	= 0x0004,
151121326Sharti	SSCOP_DBG_INSIG	= 0x0008,
152121326Sharti	SSCOP_DBG_STATE	= 0x0010,
153121326Sharti	SSCOP_DBG_PDU	= 0x0020,
154121326Sharti	SSCOP_DBG_ERR	= 0x0040,
155121326Sharti	SSCOP_DBG_EXEC	= 0x0080,
156121326Sharti	SSCOP_DBG_FLOW	= 0x0100,
157121326Sharti};
158121326Sharti
159121326Sharti#endif
160