#ident "$Id: ixe.h,v 1.2 1996/10/25 19:00:06 gary Exp $"
/*****************************************************************************
 * Copyright (c) 1988-95 Digi International Inc., All Rights Reserved
 * 
 * This  software  contains  proprietary  and  confidential   information   of
 * Digi International  Inc.   By  accepting  transfer  of this copy, Recipient
 * agrees to retain this software in  confidence,  to  prevent  disclosure  to
 * others,  and  to make no  use of this software other than that for which it
 * was delivered.  This is an unpublished copyright work  Digi   International
 * Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is
 * strictly prohibited.
 * 
 * Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc.
 * Confidential  when   combined   with   the   aggregated  modules  for  this
 * product) OBJECT CODE ONLY SOURCE MATERIALS
 * 
 * (C) COPYRIGHT Digi International Inc. 1995
 * 
 * All Rights Reserved
 * 
 * US   Government   Users   Restricted   Rights   -   Use,   duplication   or
 * disclosure  restricted by GSA ADP Schedule Contract with Digi International
 * Inc.
 * 
 *****************************************************************************/

/******************************************************************
 *
 *  Spider-X25 IXE Driver
 *
 *  Copyright 1991 Spider Systems Limited
 *
 *  IXE.H
 *
 *  Internal Definitions for IP-to-X.25 driver
 *
 ******************************************************************/

/*
 *	 /projects/common/PBRAIN/SCCS/pbrainF/dev/sys/ixe/0/s.ixe.h
 *	@(#)ixe.h	1.16
 *
 *	Last delta created	14:44:32 12/1/92
 *	This file extracted	12:38:45 2/16/93
 *
 */


/******************************************************************
 * Network table entry structure
 */

typedef struct ix_netent {
	Q_PTR		q_ref;		/* STREAMS write queue for this net */
	int     	muxid;		/* STREAMS upper mux identifier */
	long		my_inaddr;
	int		held_count;	/* Count of messages held */
	int		blocked;	/* Upper stream is blocked */
	int		reg_ok;		/* Set when registration complete */
	struct ixe_sninfo sn_info;	/* Per-network config values	*/
} IX_NETENT;

/******************************************************************
 * Connection Table Definitions
 */

/*
 * Circuit State Values
 */

#define	IX_LISTEN		0
#define IX_FREE			1
#define	IX_CLAIMED		2
#define	IX_OPENED		3
#define	IX_OPEN			4
#define	IX_RELEASED		5
#define IX_PVCWAIT              6

/*
 *  Table entry structure
 */

typedef struct ix_con {
	int		ix_state;	/* Connection State		*/
	Q_PTR   	l_qbot;		/* STREAMS lower write Q ptr	*/
	int     	l_index;	/* STREAMS lower mux id         */
	int		xconn_id;	/* X.25 conn id.		*/
	IX_NETENT	*net_ref;	/* Pointer to net table entry	*/
	struct xaddrf	rem_xaddr;	/* Remote X.25 address		*/
	long		rem_ipaddr;	/* Remote IP address		*/
	long		new_ipaddr;	/* Pre-empting IP address	*/
	unsigned int	idle_clock;	/* Idle clock counter 		*/
	unsigned int	durn_clock;	/* Min conn. duration counter	*/
	unsigned char	pkt_siz;	/* (loc) X.25 packet size in use*/
	unsigned char	win_siz;	/* (loc) X.25 window size in use*/
	struct ix_con	*link;		/* (Link field to other VCs)	*/
	mblk_t		*snreg_ioctl;	/* Ptr to SNREG ioctl for ACK	*/
	char		NSDUseq;	/* (Current NSDU fragment list)	*/
	unsigned char	discard_dg;	/* Discard this DG's frags	*/
	unsigned char	queueing;	/* Queueing in progress		*/
	unsigned char	precedence;	/* DDN precedence		*/
	unsigned char   is_pvc;         /* Non-zero indicates a PVC     */
} IX_CON;

#define	IX_HELD_HWM	20		/* Held datagram HWM		*/
#define	IX_HELD_LWM	 5		/* Held datagram LWM		*/

#define	IX_CUD_VAL	0xCC		/* Value in CUDF of IP/X25 calls    */

#define	IX_REQ_TO	60		/* Request timeout (secs)	*/

#define ESUBNET         152
#define ENETNOLNK       153
#define ERESOURCE       154
#define EBADIOCTL       155

