xref: /csrg-svn/sys/netiso/tp_sizes.c (revision 36411)
1 /***********************************************************
2 		Copyright IBM Corporation 1987
3 
4                       All Rights Reserved
5 
6 Permission to use, copy, modify, and distribute this software and its
7 documentation for any purpose and without fee is hereby granted,
8 provided that the above copyright notice appear in all copies and that
9 both that copyright notice and this permission notice appear in
10 supporting documentation, and that the name of IBM not be
11 used in advertising or publicity pertaining to distribution of the
12 software without specific, written prior permission.
13 
14 IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16 IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20 SOFTWARE.
21 
22 ******************************************************************/
23 
24 /*
25  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
26  */
27 
28 #define KERNEL
29 #define MERGED
30 #define IBMRTPC
31 #define CLNPECHO
32 #define TP_PERF_MEAS
33 #define CONS
34 #define TPPT
35 #define ARGO_TP
36 #define ARGO_DEBUG
37 #define ISO
38 #define RDB
39 #define SHOW_LOAD
40 #define DEBUG
41 #define INET
42 #define MAXUSERS 32
43 #define DST 1
44 #define TIMEZONE 360
45 
46 /*
47  * ARGO TP
48  *
49  * $Header: tp_sizes.c,v 5.1 88/10/12 12:21:03 root Exp $
50  * $Source: /usr/argo/sys/netiso/RCS/tp_sizes.c,v $
51  *
52  *
53  * This is the initialization and cleanup stuff -
54  * for the tp machine in general as well as  for the individual pcbs.
55  * tp_init() is called at system startup.  tp_attach() and tp_getref() are
56  * called when a socket is created.  tp_detach() and tp_freeref()
57  * are called during the closing stage and/or when the reference timer
58  * goes off.
59  * tp_soisdisconnecting() and tp_soisdisconnected() are tp-specific
60  * versions of soisconnect*
61  * and are called (obviously) during the closing phase.
62  *
63  */
64 
65 #ifndef lint
66 static char *rcsid = "$Header: tp_sizes.c,v 5.1 88/10/12 12:21:03 root Exp $";
67 #endif lint
68 
69 #include "argoxtwentyfive.h"
70 #include "types.h"
71 #include "param.h"
72 #include "mbuf.h"
73 #include "socket.h"
74 #include "socketvar.h"
75 #include "protosw.h"
76 #include "errno.h"
77 #include "time.h"
78 #include "../netiso/tp_param.h"
79 #include "../netiso/tp_timer.h"
80 #include "../netiso/tp_ip.h"
81 #include "../netiso/tp_stat.h"
82 #include "../netiso/tp_pcb.h"
83 #include "../netiso/tp_tpdu.h"
84 #include "../netiso/tp_trace.h"
85 #include "../netiso/tp_meas.h"
86 #include "../netiso/tp_seq.h"
87 #include "../netiso/tp_clnp.h"
88 
89 #include "../netiso/iso_errno.h"
90 #include "../netiso/cons.h"
91 #include "../netiso/cons_pcb.h"
92 
93 main()
94 {
95 	printf( "TP struct sizes:\n");
96 	printf( "tpcb 0x%x %d\n", sizeof(struct tp_pcb), sizeof(struct tp_pcb));
97 	printf( "aux 0x%x %d\n",
98 		sizeof(struct tp_pcb_aux), sizeof(struct tp_pcb_aux));
99 	printf( "ref 0x%x %d\n", sizeof(struct tp_ref), sizeof(struct tp_ref));
100 	printf( "tp_stat  0x%x %d\n",
101 		sizeof(struct tp_stat), sizeof(struct tp_stat));
102 	printf( "tp_param  0x%x %d\n",
103 		sizeof(struct tp_param), sizeof(struct tp_param));
104 	printf( "tp_conn_param  0x%x %d\n",
105 		sizeof(struct tp_conn_param), sizeof(struct tp_conn_param));
106 	printf( "tp_rtc  0x%x %d\n",
107 		sizeof(struct tp_rtc), sizeof(struct tp_rtc));
108 	printf( "nl_protosw  0x%x %d\n",
109 		sizeof(struct nl_protosw), sizeof(struct nl_protosw));
110 
111 #ifdef TP_PERF_MEAS
112 		printf( "\tpmeas 0x%x %d\n", sizeof(struct tp_pmeas),
113 			sizeof(struct tp_pmeas));
114 #else
115 		printf("perf meas NOT configured\n");
116 #endif TP_PERF_MEAS
117 
118 	printf( "ISO struct sizes:\n");
119 	printf( "socket  0x%x %d\n",
120 		sizeof(struct socket), sizeof(struct socket));
121 	printf( "\t offset of so_timeo 0x%x %d\n",
122 		_offsetof( struct socket, so_timeo ),
123 		_offsetof( struct socket, so_timeo ));
124 	printf( "\t offset of so_rcv 0x%x %d\n",
125 		_offsetof(  struct socket, so_rcv ),
126 		_offsetof(  struct socket, so_rcv ));
127 	printf( "\t offset of so_snd 0x%x %d\n",
128 		_offsetof(  struct socket, so_snd ),
129 		_offsetof( struct socket, so_snd ));
130 	printf( "\t offset of sb_flags in sockbuf 0x%x %d\n",
131 		_offsetof( struct sockbuf, sb_flags ),
132 		_offsetof( struct sockbuf, sb_flags ));
133 	printf( "\t offset of sb_cc in sockbuf 0x%x %d\n",
134 		_offsetof( struct sockbuf, sb_cc ),
135 		_offsetof( struct sockbuf, sb_cc ));
136 	printf( "\t offset of so_qlen in sockbuf 0x%x %d\n",
137 		_offsetof( struct socket, so_qlen ),
138 		_offsetof( struct socket, so_qlen ));
139 	printf( "\t offset of so_error in sockbuf 0x%x %d\n",
140 		_offsetof( struct socket, so_error ),
141 		_offsetof( struct socket, so_error ));
142 	printf( "\t offset of so_state in sockbuf 0x%x %d\n",
143 		_offsetof( struct socket, so_state ),
144 		_offsetof( struct socket, so_state ));
145 
146 	printf( "SIZE OF isopcb  0x%x %d\n",
147 		sizeof(struct isopcb), sizeof(struct isopcb));
148 	printf( "SIZE OF cons_pcb  0x%x %d\n",
149 		sizeof(struct cons_pcb), sizeof(struct cons_pcb));
150 	printf( "\t offset of co_state in cons_pcb 0x%x %d\n",
151 		_offsetof( struct cons_pcb, co_state ),
152 		_offsetof( struct cons_pcb, co_state ));
153 
154 #include "../h/types.h"
155 #include "../h/ioctl.h"
156 #include "../h/tty.h"
157 	printf( "SIZE OF tty  0x%x %d\n",
158 		sizeof(struct tty), sizeof(struct tty));
159 	printf( "\t offset of t_outq in tty 0x%x %d\n",
160 		_offsetof( struct tty, t_outq ),
161 		_offsetof( struct tty, t_outq ));
162 	printf( "\t offset of t_canq in tty 0 0\n");
163 	printf( "\t offset of t_rawq in tty 0 0\n");
164 	printf( "SIZE OF clist  0x%x %d\n",
165 		sizeof(struct clist), sizeof(struct clist));
166 	printf( "\t offset of c_cf in clist 0x%x %d\n",
167 		_offsetof( struct clist, c_cf ),
168 		_offsetof( struct clist, c_cf ));
169 
170 	{
171 		unsigned x;
172 
173 		if( x<0 ) {
174 			printf("x");
175 		}
176 	}
177 }
178