/*****************************************************************************
 * 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.5 1996/10/24 20:24:20 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 {
    uint8     all_snworks;		/* Trace on all subnetworks	*/
    uint8     spare[3];			/* for alignment		*/
    uint32    snid;			/* Subnetwork			*/
    uint8     level;			/* Level of tracing required	*/
    uint8     spare2[3];		/* for alignment		*/
    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 {
    uint8           trc_prim;	 /* Trace msg identifier     */
    uint8           trc_mid;     /* Id of protocol module    */
    uint16          trc_spare;   /* for alignment	     */
    uint32          trc_snid;    /* Subnetwork Id            */
    uint8           trc_rcv;     /* Message tx or rx         */
    uint8           trc_spare2[3]; /* for alignment	     */
    uint32          trc_time;    /* Time stamp               */
    uint16          trc_seq;     /* Message seq number       */
};

struct trc_llc2_dat {
    uint8           trc_prim;	 /* Trace msg identifier     */
    uint8           trc_mid;     /* Id of protocol module    */
    uint16          trc_spare;   /* for alignment	     */
    uint32          trc_snid;    /* Subnetwork Id            */
    uint8           trc_rcv;     /* Message tx or rx         */
    uint8           trc_spare2[3];/* for alignment           */
    uint32          trc_time;    /* Time stamp               */
    uint16          trc_seq;     /* Message seq number       */
    uint8           trc_rmt[6];  /* Remote address           */
};

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