xref: /csrg-svn/sys/netiso/tp_sizes.c (revision 37469)
1*37469Ssklower /************************************************************
236411Ssklower 		Copyright IBM Corporation 1987
336411Ssklower 
436411Ssklower                       All Rights Reserved
536411Ssklower 
636411Ssklower Permission to use, copy, modify, and distribute this software and its
736411Ssklower documentation for any purpose and without fee is hereby granted,
836411Ssklower provided that the above copyright notice appear in all copies and that
936411Ssklower both that copyright notice and this permission notice appear in
1036411Ssklower supporting documentation, and that the name of IBM not be
1136411Ssklower used in advertising or publicity pertaining to distribution of the
1236411Ssklower software without specific, written prior permission.
1336411Ssklower 
1436411Ssklower IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
1536411Ssklower ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
1636411Ssklower IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
1736411Ssklower ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
1836411Ssklower WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
1936411Ssklower ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
2036411Ssklower SOFTWARE.
2136411Ssklower 
2236411Ssklower ******************************************************************/
2336411Ssklower 
2436411Ssklower /*
2536411Ssklower  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
2636411Ssklower  */
2736411Ssklower 
2836411Ssklower #define KERNEL
2936411Ssklower #define MERGED
3036411Ssklower #define IBMRTPC
3136411Ssklower #define CLNPECHO
32*37469Ssklower /* #define TP_PERF_MEAS */
3336411Ssklower #define CONS
3436411Ssklower #define TPPT
3536411Ssklower #define ARGO_TP
3636411Ssklower #define ARGO_DEBUG
3736411Ssklower #define ISO
3836411Ssklower #define RDB
3936411Ssklower #define SHOW_LOAD
4036411Ssklower #define DEBUG
4136411Ssklower #define INET
4236411Ssklower #define MAXUSERS 32
4336411Ssklower #define DST 1
4436411Ssklower #define TIMEZONE 360
4536411Ssklower 
4636411Ssklower /*
4736411Ssklower  * ARGO TP
4836411Ssklower  *
4936411Ssklower  * $Header: tp_sizes.c,v 5.1 88/10/12 12:21:03 root Exp $
5036411Ssklower  * $Source: /usr/argo/sys/netiso/RCS/tp_sizes.c,v $
5136411Ssklower  *
5236411Ssklower  *
5336411Ssklower  * This is the initialization and cleanup stuff -
5436411Ssklower  * for the tp machine in general as well as  for the individual pcbs.
5536411Ssklower  * tp_init() is called at system startup.  tp_attach() and tp_getref() are
5636411Ssklower  * called when a socket is created.  tp_detach() and tp_freeref()
5736411Ssklower  * are called during the closing stage and/or when the reference timer
5836411Ssklower  * goes off.
5936411Ssklower  * tp_soisdisconnecting() and tp_soisdisconnected() are tp-specific
6036411Ssklower  * versions of soisconnect*
6136411Ssklower  * and are called (obviously) during the closing phase.
6236411Ssklower  *
6336411Ssklower  */
6436411Ssklower 
6536411Ssklower #ifndef lint
6636411Ssklower static char *rcsid = "$Header: tp_sizes.c,v 5.1 88/10/12 12:21:03 root Exp $";
6736411Ssklower #endif lint
6836411Ssklower 
6936411Ssklower #include "argoxtwentyfive.h"
7036411Ssklower #include "types.h"
7136411Ssklower #include "param.h"
7236411Ssklower #include "mbuf.h"
7336411Ssklower #include "socket.h"
7436411Ssklower #include "socketvar.h"
7536411Ssklower #include "protosw.h"
7636411Ssklower #include "errno.h"
7736411Ssklower #include "time.h"
78*37469Ssklower #include "tp_param.h"
79*37469Ssklower #include "tp_timer.h"
80*37469Ssklower #include "tp_ip.h"
81*37469Ssklower #include "tp_stat.h"
82*37469Ssklower #include "tp_pcb.h"
83*37469Ssklower #include "tp_tpdu.h"
84*37469Ssklower #include "tp_trace.h"
85*37469Ssklower #include "tp_meas.h"
86*37469Ssklower #include "tp_seq.h"
87*37469Ssklower #include "tp_clnp.h"
8836411Ssklower 
89*37469Ssklower #include "iso_errno.h"
90*37469Ssklower #include "cons.h"
91*37469Ssklower #undef IncStat
92*37469Ssklower #include "cons_pcb.h"
9336411Ssklower 
94*37469Ssklower #define DUP(x) x, x
95*37469Ssklower #define SIZE(P) printf("Size of %s: 0x%x %d\n", "P", DUP(sizeof(struct P)))
96*37469Ssklower #define OFF(P, Q) printf("\toffset of %s in %s: 0x%x %d\n", "P", "Q", \
97*37469Ssklower 		DUP(_offsetof(struct Q, P)))
9836411Ssklower main()
9936411Ssklower {
10036411Ssklower 	printf( "TP struct sizes:\n");
101*37469Ssklower 	SIZE(tp_pcb);
102*37469Ssklower #define O(y) OFF(tp_/**/y,tp_pcb);
103*37469Ssklower 	O(state) O(retrans) O(snduna)
104*37469Ssklower 	O(lref) O(fref) O(fsuffix)
105*37469Ssklower 	O(fsuffixlen) O(lsuffix) O(lsuffixlen)
106*37469Ssklower 	O(Xsnd) O(Xuna)
107*37469Ssklower 	SIZE(tp_ref); OFF(tpr_pcb,tp_ref);OFF(tpr_calltodo,tp_ref);
108*37469Ssklower 	SIZE(tp_stat); SIZE(tp_param);
109*37469Ssklower 	SIZE(tp_conn_param); SIZE(tp_rtc); SIZE(nl_protosw);
11036411Ssklower #ifdef TP_PERF_MEAS
111*37469Ssklower 	SIZE(tp_Meas);
112*37469Ssklower #endif
11336411Ssklower 	printf( "ISO struct sizes:\n");
114*37469Ssklower 	SIZE(socket);
115*37469Ssklower 	OFF(so_timeo,socket); OFF(so_rcv,socket); OFF(so_snd,socket);
116*37469Ssklower 	OFF(so_tpcb,socket); OFF(so_pcb,socket); OFF(so_qlen,socket);
117*37469Ssklower 	OFF(so_error,socket); OFF(so_state,socket);
118*37469Ssklower 	SIZE(sockbuf);
119*37469Ssklower 	OFF(sb_flags,sockbuf); OFF(sb_cc,sockbuf);
120*37469Ssklower 	OFF(sb_mb,sockbuf); OFF(sb_mbcnt,sockbuf);
121*37469Ssklower 	SIZE(isopcb);
122*37469Ssklower 	 SIZE(cons_pcb); OFF(co_state,cons_pcb);
12336411Ssklower }
124