summaryrefslogtreecommitdiff
path: root/misc/i4b_acct.txt
blob: 4fd7d0246af24fa1c88a718c9f8f7f99b05482eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
To get ISDN statistics with the I4B package do the following:

* Look at the declaration of `struct i4bisppp_softc' in
  /usr/src/i4b/driver/i4b_isppp.c.

  It is looking like this:

	struct i4bisppp_softc {
		/*
		 * struct sppp starts with a struct ifnet, but we gotta allocate
		 * more space for it.  NB: do not relocate this union, it must
		 * be first in isppp_softc.  The tls and tlf hooks below want to
		 * convert a ``struct sppp *'' into a ``struct isppp_softc *''.
		 */
		union {
			struct ifnet scu_if;
			struct sppp scu_sp;
		} sc_if_un;
	#define sc_if sc_if_un.scu_if
		int	sc_state;	/* state of the interface	*/
	#ifndef __FreeBSD__
		int	sc_unit;	/* unit number for Net/OpenBSD	*/
	#endif
		call_desc_t *sc_cdp;	/* ptr to call descriptor	*/
	
	#ifdef I4BISPPPACCT
		int sc_iinb;		/* isdn driver # of inbytes	*/
		int sc_ioutb;		/* isdn driver # of outbytes	*/
		int sc_inb;		/* # of bytes rx'd		*/
		int sc_outb;		/* # of bytes tx'd	 	*/
		int sc_linb;		/* last # of bytes rx'd		*/
		int sc_loutb;		/* last # of bytes tx'd 	*/
		int sc_fn;		/* flag, first null acct	*/
	#endif
	
	#if defined(__FreeBSD__) && __FreeBSD__ >= 3
		struct callout_handle sc_ch;
	#endif
	} i4bisppp_softc[NI4BISPPP];

* Create a new file /usr/include/machine/i4b_acct.h and put the declaration
  of this structure in this file.

* Replace `call_desc_t *' with `void *' in it.

* The result should look like this:

	struct i4bisppp_softc {
		/*
		 * struct sppp starts with a struct ifnet, but we gotta allocate
		 * more space for it.  NB: do not relocate this union, it must
		 * be first in isppp_softc.  The tls and tlf hooks below want to
		 * convert a ``struct sppp *'' into a ``struct isppp_softc *''.
		 */
		union {
			struct ifnet scu_if;
			struct sppp scu_sp;
		} sc_if_un;
	#define sc_if sc_if_un.scu_if
		int	sc_state;	/* state of the interface	*/
	#ifndef __FreeBSD__
		int	sc_unit;	/* unit number for Net/OpenBSD	*/
	#endif
		void *sc_cdp;		/* ptr to call descriptor	*/
	
	#ifdef I4BISPPPACCT
		int sc_iinb;		/* isdn driver # of inbytes	*/
		int sc_ioutb;		/* isdn driver # of outbytes	*/
		int sc_inb;		/* # of bytes rx'd		*/
		int sc_outb;		/* # of bytes tx'd	 	*/
		int sc_linb;		/* last # of bytes rx'd		*/
		int sc_loutb;		/* last # of bytes tx'd 	*/
		int sc_fn;		/* flag, first null acct	*/
	#endif
	
	#if defined(__FreeBSD__) && __FreeBSD__ >= 3
		struct callout_handle sc_ch;
	#endif
	};

* Put a

	#define I4BISPPPACCT	1	/* enable accounting messages */

  at the top of your /usr/include/machine/i4b_acct.h

* This file should now look about like `misc/i4b_acct.h' in the LibGTop
  source directory.

* Done.

This is necessary since LibGTop reads its data directly out of the kernel
and the `struct i4bisppp_softc' is only defined there and in no header file
(someone can tell the I4B people to put it in some header file ?).

Martin <martin@home-of-linux.org>