xref: /csrg-svn/sys/netiso/tp_sizes.c (revision 49342)
137469Ssklower /************************************************************
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
3237469Ssklower /* #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 $
51*49342Ssklower  *	@(#)tp_sizes.c	7.4 (Berkeley) 05/07/91 *
5236411Ssklower  *
5336411Ssklower  *
5436411Ssklower  * This is the initialization and cleanup stuff -
5536411Ssklower  * for the tp machine in general as well as  for the individual pcbs.
5636411Ssklower  * tp_init() is called at system startup.  tp_attach() and tp_getref() are
5736411Ssklower  * called when a socket is created.  tp_detach() and tp_freeref()
5836411Ssklower  * are called during the closing stage and/or when the reference timer
5936411Ssklower  * goes off.
6036411Ssklower  * tp_soisdisconnecting() and tp_soisdisconnected() are tp-specific
6136411Ssklower  * versions of soisconnect*
6236411Ssklower  * and are called (obviously) during the closing phase.
6336411Ssklower  *
6436411Ssklower  */
6536411Ssklower 
6636411Ssklower #ifndef lint
6736411Ssklower static char *rcsid = "$Header: tp_sizes.c,v 5.1 88/10/12 12:21:03 root Exp $";
6836411Ssklower #endif lint
6936411Ssklower 
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"
7837469Ssklower #include "tp_param.h"
7937469Ssklower #include "tp_stat.h"
8037469Ssklower #include "tp_pcb.h"
8137469Ssklower #include "tp_tpdu.h"
8237469Ssklower #include "tp_trace.h"
8337469Ssklower #include "tp_meas.h"
8437469Ssklower #include "tp_seq.h"
8537469Ssklower #include "tp_clnp.h"
8636411Ssklower 
8737469Ssklower #include "iso_errno.h"
8837469Ssklower #include "cons.h"
8937469Ssklower #undef IncStat
9037469Ssklower #include "cons_pcb.h"
9136411Ssklower 
9237469Ssklower #define DUP(x) x, x
9338841Ssklower #define SIZE(P) printf("  Size of %s: 0x%x %d\n", "P", DUP(sizeof(struct P)))
9437469Ssklower #define OFF(P, Q) printf("\toffset of %s in %s: 0x%x %d\n", "P", "Q", \
9537469Ssklower 		DUP(_offsetof(struct Q, P)))
main()9636411Ssklower main()
9736411Ssklower {
9836411Ssklower 	printf( "TP struct sizes:\n");
9937469Ssklower 	SIZE(tp_pcb);
10037469Ssklower #define O(y) OFF(tp_/**/y,tp_pcb);
10138841Ssklower 	O(state) O(retrans) O(snduna) O(lref) O(fref)
10238841Ssklower 	O(fsuffix) O(fsuffixlen) O(lsuffix) O(lsuffixlen) O(Xsnd) O(Xuna)
10338841Ssklower 	SIZE(tp_ref);
10438841Ssklower #undef O
10538841Ssklower #define O(y) OFF(tpr_/**/y,tp_ref);
10638841Ssklower 	O(pcb) O(calltodo)
10738841Ssklower 	SIZE(tp_stat);
10838841Ssklower 	SIZE(tp_param); SIZE(tp_conn_param);
10938841Ssklower 	SIZE(tp_rtc); SIZE(nl_protosw);
11038841Ssklower #undef O
11138841Ssklower #define O(y) OFF(so_/**/y,socket);
11238841Ssklower 	printf( "socket struct sizes:\n");
11337469Ssklower 	SIZE(socket);
11438841Ssklower 	O(timeo) O(rcv) O(snd) O(tpcb) O(pcb) O(qlen) O(error) O(state)
11537469Ssklower 	SIZE(sockbuf);
11638841Ssklower #undef O
11738841Ssklower #define O(y) OFF(sb_/**/y,sockbuf);
11838841Ssklower 	O(flags) O(cc) O(mb) O(mbcnt)
11938841Ssklower 	SIZE(isopcb); SIZE(cons_pcb);
12038841Ssklower 	OFF(co_state,cons_pcb);
12136411Ssklower }
122