#ident "$Id: struct.c,v 1.2 1997/10/21 20:48:44 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.
 * 
 *****************************************************************************/

#define MAXIOCBSZ  1024  /* max ioctl data block size */

#include <stdio.h>
#define  FAR
typedef  unsigned char FAR * bufp_t;
#include "types.h"
#include "stream.h"
#include "ll_proto.h"
#include "x25_proto.h"
#include "x25_control.h"
#include "x25db.h"


#define NM(x,y,z) printf("%d %s\n", (int)&(y) - (int)&(z),(x))

main()
{
   struct   xcallf 	cf ;
   struct   xccnff 	cc ;
   struct   xdataf 	dt ;
   struct   xdatacf dta ;
   struct   xedataf	dte ; 
   struct   xedatacf dtea ;
   struct   xrstf	xr ;
   struct   xrscf	xrc ;
   struct   xdiscf	df ; 
   struct   xdcnff	dsc ; 
   struct   xabortf	ab ;
   struct   xlistenf ls ;
   struct   xcanlisf lscan ;
   struct   pvcattf	 pa ; 
   struct   pvcdetf	 pd ;
            
   struct   extraformat	exr ;
   struct   qosformat 	qoss ;
   struct   lsapformat	lsap ;
   struct   xaddrf		xf ;
   struct   wlcfg		wl ;
            
   struct   snoptformat sf ;


   printf( "sizeof(struct xdataf) = %d (0x%x)\n", sizeof(struct xdataf), sizeof(struct xdataf) );
   NM("xdataf xl_type",dt.xl_type, dt) ;
   NM("xdataf xl_command",dt.xl_command, dt) ;
   NM("xdataf More",dt.More, dt) ;
   NM("xdataf setDbit",dt.setDbit, dt) ;
   NM("xdataf setQbit",dt.setQbit, dt) ;
   printf("\n") ;

   printf( "sizeof(struct xdatacf) = %d (0x%x)\n", sizeof(struct xdatacf), sizeof(struct xdatacf) );
   NM("xdatacf xl_type",dta.xl_type, dta) ;
   NM("xdatacf xl_command",dta.xl_command, dta) ;
   printf("\n") ;

   printf( "sizeof(struct xedataf) = %d (0x%x)\n", sizeof(struct xedataf), sizeof(struct xedataf) );
   NM("xedataf xl_type",dte.xl_type, dte) ;
   NM("xedataf xl_command",dte.xl_command, dte) ;
   printf("\n") ;

   printf( "sizeof(struct xedataf) = %d (0x%x)\n", sizeof(struct xedataf), sizeof(struct xedataf) );
   NM("xedataf xl_type",dtea.xl_type, dtea) ;
   NM("xedataf xl_command",dtea.xl_command, dtea) ;
   printf("\n") ;

   printf( "sizeof(struct xrstf) = %d (0x%x)\n", sizeof(struct xrstf), sizeof(struct xrstf) );
   NM("xrstf xl_type",xr.xl_type, xr) ;
   NM("xrstf xl_command",xr.xl_command, xr) ;
   NM("xrstf originator",xr.originator, xr) ;
   NM("xrstf reason",xr.reason, xr) ;
   NM("xrstf cause",xr.cause, xr) ;
   NM("xrstf diag",xr.diag, xr) ;
   printf("\n") ;

   printf( "sizeof(struct xrscf) = %d (0x%x)\n", sizeof(struct xrscf), sizeof(struct xrscf) );
   NM("xrscf xl_type",xrc.xl_type, xrc) ;
   NM("xrscf xl_command",xrc.xl_command, xrc) ;
   printf("\n") ;

   printf( "sizeof(struct xdiscf) = %d (0x%x)\n", sizeof(struct xdiscf), sizeof(struct xdiscf) );
   NM("xdiscf xl_type",df.xl_type, df) ;
   NM("xdiscf xl_command",df.xl_command, df) ;
   NM("xdiscf originator",df.originator, df) ;
   NM("xdiscf reason",df.reason, df) ;
   NM("xdiscf diag",df.diag, df) ;
   NM("xdiscf conn_id",df.conn_id, df) ;
   NM("xdiscf indicated_qos",df.indicated_qos, df) ;
   NM("xdiscf responder",df.responder, df) ;
   NM("xdiscf deflected",df.deflected, df) ;
   NM("xdiscf qos",df.qos, df) ;
   printf("\n") ;

   printf( "sizeof(struct xdcnff) = %d (0x%x)\n", sizeof(struct xdcnff), sizeof(struct xdcnff) );
   NM("xdcnff xl_type",dsc.xl_type, dsc) ;
   NM("xdcnff xl_command",dsc.xl_command, dsc) ;
   NM("xdcnff indicated_qos",dsc.indicated_qos, dsc) ;
   NM("xdcnff rqos",dsc.rqos, dsc) ;
   printf("\n") ;

   printf( "sizeof(struct xcallf) = %d (0x%x)\n", sizeof(struct xcallf), sizeof(struct xcallf) );
   NM("xcallf xl_type",cf.xl_type, cf) ;
   NM("xcallf xl_command",cf.xl_command, cf) ;
   NM("xcallf conn_id",cf.conn_id, cf) ;
   NM("xcallf CONS_call",cf.CONS_call, cf) ;
   NM("xcallf negotiate_qos",cf.negotiate_qos, cf) ;
   NM("xcallf calledaddr",cf.calledaddr, cf) ;
   NM("xcallf callingaddr",cf.callingaddr, cf) ;
   NM("xcallf qos",cf.qos, cf) ;
   printf("Sizeof xcallf = %x %d\n", sizeof(struct xcallf),
   				  sizeof(struct xcallf)) ;
   printf("\n") ;

   printf( "sizeof(struct xccnff) = %d (0x%x)\n", sizeof(struct xccnff), sizeof(struct xccnff) );
   NM("xccnff xl_type",cc.xl_type, cc) ;
   NM("xccnff xl_command",cc.xl_command, cc) ;
   NM("xccnff conn_id",cc.conn_id, cc) ;
   NM("xccnff CONS_call",cc.CONS_call, cc) ;
   NM("xccnff negotiate_qos",cc.negotiate_qos, cc) ;
   NM("xccnff responder",cc.responder, cc) ;
   NM("xccnff rqos",cc.rqos, cc) ;
   printf("\n") ;

   printf( "sizeof(struct xabortf) = %d (0x%x)\n", sizeof(struct xabortf), sizeof(struct xabortf) );
   NM("xabortf xl_type",ab.xl_type, ab) ;
   NM("xabortf xl_command",ab.xl_command, ab) ;
   printf("\n") ;

   printf( "sizeof(struct xlistenf) = %d (0x%x)\n", sizeof(struct xlistenf), sizeof(struct xlistenf) );
   NM("xlistenf xl_type",ls.xl_type, ls) ;
   NM("xlistenf xl_command",ls.xl_command, ls) ;
   NM("xlistenf lmax",ls.lmax, ls) ;
   NM("xlistenf l_result",ls.l_result, ls) ;
   printf("\n") ;

   printf( "sizeof(struct xcanlisf) = %d (0x%x)\n", sizeof(struct xcanlisf), sizeof(struct xcanlisf) );
   NM("xcanlisf xl_type",lscan.xl_type, lscan) ;
   NM("xcanlisf xl_command",lscan.xl_command, lscan) ;
   NM("xcanlisf c_result",lscan.c_result, lscan) ;
   printf("\n") ;

   printf( "sizeof(struct pvcattf) = %d (0x%x)\n", sizeof(struct pvcattf), sizeof(struct pvcattf) );
   NM("pvcattf xl_type",pa.xl_type, pa) ;
   NM("pvcattf xl_command",pa.xl_command, pa) ;
   NM("pvcattf lci",pa.lci, pa) ;
   NM("pvcattf sn_id",pa.sn_id, pa) ;
   NM("pvcattf reqackservice",pa.reqackservice, pa) ;
   NM("pvcattf reqnsdulimit",pa.reqnsdulimit, pa) ;
   NM("pvcattf nsdulimit",pa.nsdulimit, pa) ;
   NM("pvcattf result_code",pa.result_code, pa) ;
   printf("\n") ;

   printf( "sizeof(struct pvcdetf) = %d (0x%x)\n", sizeof(struct pvcdetf), sizeof(struct pvcdetf) );
   NM("pvcdetf xl_type",pd.xl_type, pd) ;
   NM("pvcdetf xl_command",pd.xl_command, pd) ;
   NM("pvcdetf reason_code",pd.reason_code, pd) ;
   printf("\n") ;

   printf( "sizeof(struct extraformat) = %d (0x%x)\n", sizeof(struct extraformat), sizeof(struct extraformat) );
   NM("extraformat fastselreq",exr.fastselreq,exr) ;
   NM("extraformat restrictresponse",exr.restrictresponse,exr) ;
   NM("extraformat reversecharges",exr.reversecharges,exr) ;
   NM("extraformat pwoptions",exr.pwoptions,exr) ;
   NM("extraformat locpacket",exr.locpacket,exr) ;
   NM("extraformat rempacket",exr.rempacket,exr) ;
   NM("extraformat locwsize",exr.locwsize,exr) ;
   NM("extraformat remwsize",exr.remwsize,exr) ;
   NM("extraformat nsdulimit",exr.nsdulimit,exr) ;
   NM("extraformat nui_len",exr.nui_len,exr) ;
   NM("extraformat nui_field",exr.nui_field,exr) ;
   NM("extraformat rpoa_len",exr.rpoa_len,exr) ;
   NM("extraformat rpoa_field",exr.rpoa_field,exr) ;
   NM("extraformat cug_type",exr.cug_type,exr) ;
   NM("extraformat cug_field",exr.cug_field,exr) ;
   NM("extraformat reqcharging",exr.reqcharging,exr) ;
   NM("extraformat chg_cd_len",exr.chg_cd_len,exr) ;
   NM("extraformat chg_cd_field",exr.chg_cd_field,exr) ;
   NM("extraformat chg_sc_len",exr.chg_sc_len,exr) ;
   NM("extraformat chg_sc_field",exr.chg_sc_field,exr) ;
   NM("extraformat chg_mu_len",exr.chg_mu_len,exr) ;
   NM("extraformat chg_mu_field",exr.chg_mu_field,exr) ;
   NM("extraformat called_add_mod",exr.called_add_mod,exr) ;
   NM("extraformat call_redirect",exr.call_redirect,exr) ;
   NM("extraformat called",exr.called,exr) ;
   NM("extraformat call_deflect",exr.call_deflect,exr) ;
   NM("extraformat x_fac_len",exr.x_fac_len,exr) ;
   NM("extraformat cg_fac_len",exr.cg_fac_len,exr) ;
   NM("extraformat cd_fac_len",exr.cd_fac_len,exr) ;
   NM("extraformat fac_field",exr.fac_field,exr) ;
   printf("\n") ;

   printf( "sizeof(struct qosformat) = %d (0x%x)\n", sizeof(struct qosformat), sizeof(struct qosformat) );
   NM("qosformat reqtclass",qoss.reqtclass, qoss) ; 
   NM("qosformat locthroughput",qoss.locthroughput, qoss) ; 
   NM("qosformat remthroughput",qoss.remthroughput, qoss) ; 
   NM("qosformat reqminthruput",qoss.reqminthruput, qoss) ; 
   NM("qosformat locminthru",qoss.locminthru, qoss) ; 
   NM("qosformat remminthru",qoss.remminthru, qoss) ; 
   NM("qosformat reqtransitdelay",qoss.reqtransitdelay, qoss) ; 
   NM("qosformat transitdelay",qoss.transitdelay, qoss) ; 
   NM("qosformat reqmaxtransitdelay",qoss.reqmaxtransitdelay, qoss) ; 
   NM("qosformat acceptable",qoss.acceptable, qoss) ; 
   NM("qosformat reqpriority",qoss.reqpriority, qoss) ; 
   NM("qosformat reqprtygain",qoss.reqprtygain, qoss) ; 
   NM("qosformat reqprtykeep",qoss.reqprtykeep, qoss) ; 
   NM("qosformat prtydata",qoss.prtydata, qoss) ; 
   NM("qosformat prtygain",qoss.prtygain, qoss) ; 
   NM("qosformat prtykeep",qoss.prtykeep, qoss) ; 
   NM("qosformat reqlowprtydata",qoss.reqlowprtydata, qoss) ; 
   NM("qosformat reqlowprtygain",qoss.reqlowprtygain, qoss) ; 
   NM("qosformat reqlowprtykeep",qoss.reqlowprtykeep, qoss) ; 
   NM("qosformat lowprtydata",qoss.lowprtydata, qoss) ; 
   NM("qosformat lowprtygain",qoss.lowprtygain, qoss) ; 
   NM("qosformat lowprtykeep",qoss.lowprtykeep, qoss) ; 
   NM("qosformat protection_type",qoss.protection_type, qoss) ; 
   NM("qosformat prot_len",qoss.prot_len, qoss) ; 
   NM("qosformat lowprot_len",qoss.lowprot_len, qoss) ; 
   NM("qosformat protection",qoss.protection, qoss) ; 
   NM("qosformat lowprotection",qoss.lowprotection, qoss) ; 
   NM("qosformat reqexpedited",qoss.reqexpedited, qoss) ; 
   NM("qosformat reqackservice",qoss.reqackservice, qoss) ; 
   NM("qosformat xtras",qoss.xtras, qoss) ; 
   printf("\n") ;

   printf( "sizeof(struct xaddrf) = %d (0x%x)\n", sizeof(struct xaddrf), sizeof(struct xaddrf) );
   NM("xaddrf sn_id",xf.sn_id,xf ) ;
   NM("xaddrf aflags",xf.aflags, xf) ;
   NM("xaddrf DTE_MAC",xf.DTE_MAC, xf );
   NM("xaddrf DTE_MAC.lsap_len",xf.DTE_MAC.lsap_len, xf );
   NM("xaddrf DTE_MAC.lsap_add",xf.DTE_MAC.lsap_add, xf );
   NM("xaddrf nsap_len",xf.nsap_len, xf) ;
   NM("xaddrf NSAP",xf.NSAP, xf) ;
   printf("\n") ;

   printf( "sizeof(struct wlcfg) = %d (0x%x)\n", sizeof(struct wlcfg), sizeof(struct wlcfg) );
   NM("wlcfg U_SN_ID",wl.U_SN_ID, wl) ;
   NM("wlcfg NET_MODE",wl.NET_MODE, wl) ;
   NM("wlcfg X25_VSN",wl.X25_VSN, wl) ;
   NM("wlcfg L3PLPMODE",wl.L3PLPMODE, wl) ;
   NM("wlcfg LPC",wl.LPC, wl) ;
   NM("wlcfg HPC",wl.HPC, wl) ;
   NM("wlcfg LIC",wl.LIC, wl) ;
   NM("wlcfg HIC",wl.HIC, wl) ;
   NM("wlcfg LTC",wl.LTC, wl) ;
   NM("wlcfg HTC",wl.HTC, wl) ;
   NM("wlcfg LOC",wl.LOC, wl) ;
   NM("wlcfg HOC",wl.HOC, wl) ;
   NM("wlcfg NPCchannels",wl.NPCchannels, wl) ;
   NM("wlcfg NICchannels",wl.NICchannels, wl) ;
   NM("wlcfg NTCchannels",wl.NTCchannels, wl) ;
   NM("wlcfg NOCchannels",wl.NOCchannels, wl) ;
   NM("wlcfg Nochnls",wl.Nochnls, wl) ;
   NM("wlcfg THISGFI",wl.THISGFI, wl) ;
   NM("wlcfg LOCMAXPKTSIZE",wl.LOCMAXPKTSIZE, wl) ;
   NM("wlcfg REMMAXPKTSIZE",wl.REMMAXPKTSIZE, wl) ;
   NM("wlcfg LOCDEFPKTSIZE",wl.LOCDEFPKTSIZE, wl) ;
   NM("wlcfg REMDEFPKTSIZE",wl.REMDEFPKTSIZE, wl) ;
   NM("wlcfg LOCMAXWSIZE",wl.LOCMAXWSIZE, wl) ;
   NM("wlcfg REMMAXWSIZE",wl.REMMAXWSIZE, wl) ;
   NM("wlcfg LOCDEFWSIZE",wl.LOCDEFWSIZE, wl) ;
   NM("wlcfg REMDEFWSIZE",wl.REMDEFWSIZE, wl) ;
   NM("wlcfg MAXNSDULEN",wl.MAXNSDULEN, wl) ;
   NM("wlcfg ACKDELAY",wl.ACKDELAY, wl) ;
   NM("wlcfg T20value",wl.T20value, wl) ;
   NM("wlcfg T21value",wl.T21value, wl) ;
   NM("wlcfg T22value",wl.T22value, wl) ;
   NM("wlcfg T23value",wl.T23value, wl) ;
   NM("wlcfg Tvalue",wl.Tvalue, wl) ;
   NM("wlcfg T25value",wl.T25value, wl) ;
   NM("wlcfg T26value",wl.T26value, wl) ;
   NM("wlcfg idlevalue",wl.idlevalue, wl) ;
   NM("wlcfg connectvalue",wl.connectvalue, wl) ;
   NM("wlcfg R20value",wl.R20value, wl) ;
   NM("wlcfg R22value",wl.R22value, wl) ;
   NM("wlcfg R23value",wl.R23value, wl) ;
   NM("wlcfg localdelay",wl.localdelay, wl) ;
   NM("wlcfg accessdelay",wl.accessdelay, wl) ;
   NM("wlcfg locmaxthclass",wl.locmaxthclass, wl) ;
   NM("wlcfg remmaxthclass",wl.remmaxthclass, wl) ;
   NM("wlcfg locdefthclass",wl.locdefthclass, wl) ;
   NM("wlcfg remdefthclass",wl.remdefthclass, wl) ;
   NM("wlcfg locminthclass",wl.locminthclass, wl) ;
   NM("wlcfg remminthclass",wl.remminthclass, wl) ;
   NM("wlcfg CUG_CONTROL",wl.CUG_CONTROL, wl) ;
   NM("wlcfg SUB_MODES",wl.SUB_MODES, wl) ;
   NM("wlcfg psdn_local.SNMODES",wl.psdn_local.SNMODES, wl) ;
   NM("wlcfg psdn_local.intl_addr_recogn ",wl.psdn_local.intl_addr_recogn , wl) ;
   NM("wlcfg psdn_local.intl_prioritised ",wl.psdn_local.intl_prioritised , wl) ;
   NM("wlcfg psdn_local.dnic1",wl.psdn_local.dnic1, wl) ;
   NM("wlcfg psdn_local.dnic2",wl.psdn_local.dnic2, wl) ;
   NM("wlcfg psdn_local.prty_encode_control",wl.psdn_local.prty_encode_control, wl) ;
   NM("wlcfg psdn_local.prty_pkt_forced_value",wl.psdn_local.prty_pkt_forced_value, wl) ;
   NM("wlcfg psdn_local.src_addr_control",wl.psdn_local.src_addr_control, wl) ;
   NM("wlcfg psdn_local.thclass_neg_to_def",wl.psdn_local.thclass_neg_to_def, wl) ;
   NM("wlcfg psdn_local.thclass_type ",wl.psdn_local.thclass_type , wl) ;
   NM("wlcfg psdn_local.thclass_wmap ",wl.psdn_local.thclass_wmap , wl) ;
   NM("wlcfg psdn_local.thclass_pmap",wl.psdn_local.thclass_pmap, wl) ;
   NM("wlcfg local_address.lsap_len",wl.local_address.lsap_len , wl) ;
   NM("wlcfg local_address.lsap_add",wl.local_address.lsap_add , wl) ;
   printf("\n") ;
   
   printf("sizeof(struct snoptformat) = %d (0x%x)\n",sizeof(struct snoptformat), sizeof(struct snoptformat));
   
   NM("rd_wr",sf.rd_wr,sf);
   
   
   printf("&sf.U_SN_ID =%d\n",(int)&sf.U_SN_ID - (int)&sf) ;
   printf("&sf.newSUB_MODES =%d\n",(int)&sf.newSUB_MODES - (int)&sf) ;
   printf("&sf.rd_wr =%d\n",(int)&sf.rd_wr - (int)&sf) ;

}

