/*****************************************************************************
 * 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.
 * 
 *****************************************************************************/

/*
 * $Id: x25trace.h,v 1.6 1997/09/23 16:38:03 gary Exp $
 */

/*******************************************************************
 *
 *  SpiderX25 Tracing Control
 *
 *  Copyright 1991  Spider Systems Limited
 *
 *  TRACE.H
 *
 *******************************************************************/

/*
    IOCTL commands
*/
#define T_TRACEON   ('T'<<8 | 1)
#define T_TRACEOFF  ('T'<<8 | 2)

#ifndef NULL
#define	NULL	0
#endif
#ifndef FALSE
#define	FALSE	0
#endif
#ifndef TRUE
#define	TRUE	1
#endif

/*
    M_IOCTL message type definitions 
*/

#define MAX_X25_SUBNETS   10

struct trc_regioc {
    uint32    all_snworks;		/* Trace on all subnetworks	*/
    uint32    snid;			/* Subnetwork			*/
    uint32    level;			/* Level of tracing required	*/
    uint32    active[MAX_X25_SUBNETS+1];/* tracing actively on 		*/
};

/*
    Types of tracing message
*/
#define TR_CTL       100            /* Basic                   */
#define TR_LLC2_DAT  101            /* Basic + LLC2 parameters */
#define TR_LAPB_DAT  TR_CTL         /* Basic for now           */
#define TR_X25_DAT   TR_CTL         /* Basic for now           */

/*
    Format for control part of trace messages
*/
struct trc_ctl {
    uint32          trc_prim;	 /* Trace msg identifier     */
    uint32          trc_mid;     /* Id of protocol module    */
    uint32          trc_snid;    /* Subnetwork Id            */
    uint32          trc_rcv;     /* Message tx or rx         */
    uint32          trc_time;    /* Time stamp               */
    uint32          trc_seq;     /* Message seq number       */
};

struct trc_llc2_dat {
    uint32          trc_prim;	 /* Trace msg identifier     */
    uint32          trc_mid;     /* Id of protocol module    */
    uint32          trc_snid;    /* Subnetwork Id            */
    uint32          trc_rcv;     /* Message tx or rx         */
    uint32          trc_time;    /* Time stamp               */
    uint32          trc_seq;     /* Message seq number       */
    uint8           trc_rmt[6];  /* Remote address           */
	uint8			trc_resv[2] ; /* 32-bit padding			 */
};

/*
    Generic trace protocol primitive
*/
typedef union trc_union {
    uint32                  trc_prim;	      /* Trace msg identifier        */
    struct trc_ctl	    trc_hdr;          /* Basic trace data            */
    struct trc_llc2_dat	    trc_llc2dat;      /* LLC2  trace data            */
} trc_types;
