Blame misc/i4b_acct.txt

Packit d37888
To get ISDN statistics with the I4B package do the following:
Packit d37888
Packit d37888
* Look at the declaration of `struct i4bisppp_softc' in
Packit d37888
  /usr/src/i4b/driver/i4b_isppp.c.
Packit d37888
Packit d37888
  It is looking like this:
Packit d37888
Packit d37888
	struct i4bisppp_softc {
Packit d37888
		/*
Packit d37888
		 * struct sppp starts with a struct ifnet, but we gotta allocate
Packit d37888
		 * more space for it.  NB: do not relocate this union, it must
Packit d37888
		 * be first in isppp_softc.  The tls and tlf hooks below want to
Packit d37888
		 * convert a ``struct sppp *'' into a ``struct isppp_softc *''.
Packit d37888
		 */
Packit d37888
		union {
Packit d37888
			struct ifnet scu_if;
Packit d37888
			struct sppp scu_sp;
Packit d37888
		} sc_if_un;
Packit d37888
	#define sc_if sc_if_un.scu_if
Packit d37888
		int	sc_state;	/* state of the interface	*/
Packit d37888
	#ifndef __FreeBSD__
Packit d37888
		int	sc_unit;	/* unit number for Net/OpenBSD	*/
Packit d37888
	#endif
Packit d37888
		call_desc_t *sc_cdp;	/* ptr to call descriptor	*/
Packit d37888
	
Packit d37888
	#ifdef I4BISPPPACCT
Packit d37888
		int sc_iinb;		/* isdn driver # of inbytes	*/
Packit d37888
		int sc_ioutb;		/* isdn driver # of outbytes	*/
Packit d37888
		int sc_inb;		/* # of bytes rx'd		*/
Packit d37888
		int sc_outb;		/* # of bytes tx'd	 	*/
Packit d37888
		int sc_linb;		/* last # of bytes rx'd		*/
Packit d37888
		int sc_loutb;		/* last # of bytes tx'd 	*/
Packit d37888
		int sc_fn;		/* flag, first null acct	*/
Packit d37888
	#endif
Packit d37888
	
Packit d37888
	#if defined(__FreeBSD__) && __FreeBSD__ >= 3
Packit d37888
		struct callout_handle sc_ch;
Packit d37888
	#endif
Packit d37888
	} i4bisppp_softc[NI4BISPPP];
Packit d37888
Packit d37888
* Create a new file /usr/include/machine/i4b_acct.h and put the declaration
Packit d37888
  of this structure in this file.
Packit d37888
Packit d37888
* Replace `call_desc_t *' with `void *' in it.
Packit d37888
Packit d37888
* The result should look like this:
Packit d37888
Packit d37888
	struct i4bisppp_softc {
Packit d37888
		/*
Packit d37888
		 * struct sppp starts with a struct ifnet, but we gotta allocate
Packit d37888
		 * more space for it.  NB: do not relocate this union, it must
Packit d37888
		 * be first in isppp_softc.  The tls and tlf hooks below want to
Packit d37888
		 * convert a ``struct sppp *'' into a ``struct isppp_softc *''.
Packit d37888
		 */
Packit d37888
		union {
Packit d37888
			struct ifnet scu_if;
Packit d37888
			struct sppp scu_sp;
Packit d37888
		} sc_if_un;
Packit d37888
	#define sc_if sc_if_un.scu_if
Packit d37888
		int	sc_state;	/* state of the interface	*/
Packit d37888
	#ifndef __FreeBSD__
Packit d37888
		int	sc_unit;	/* unit number for Net/OpenBSD	*/
Packit d37888
	#endif
Packit d37888
		void *sc_cdp;		/* ptr to call descriptor	*/
Packit d37888
	
Packit d37888
	#ifdef I4BISPPPACCT
Packit d37888
		int sc_iinb;		/* isdn driver # of inbytes	*/
Packit d37888
		int sc_ioutb;		/* isdn driver # of outbytes	*/
Packit d37888
		int sc_inb;		/* # of bytes rx'd		*/
Packit d37888
		int sc_outb;		/* # of bytes tx'd	 	*/
Packit d37888
		int sc_linb;		/* last # of bytes rx'd		*/
Packit d37888
		int sc_loutb;		/* last # of bytes tx'd 	*/
Packit d37888
		int sc_fn;		/* flag, first null acct	*/
Packit d37888
	#endif
Packit d37888
	
Packit d37888
	#if defined(__FreeBSD__) && __FreeBSD__ >= 3
Packit d37888
		struct callout_handle sc_ch;
Packit d37888
	#endif
Packit d37888
	};
Packit d37888
Packit d37888
* Put a
Packit d37888
Packit d37888
	#define I4BISPPPACCT	1	/* enable accounting messages */
Packit d37888
Packit d37888
  at the top of your /usr/include/machine/i4b_acct.h
Packit d37888
Packit d37888
* This file should now look about like `misc/i4b_acct.h' in the LibGTop
Packit d37888
  source directory.
Packit d37888
Packit d37888
* Done.
Packit d37888
Packit d37888
This is necessary since LibGTop reads its data directly out of the kernel
Packit d37888
and the `struct i4bisppp_softc' is only defined there and in no header file
Packit d37888
(someone can tell the I4B people to put it in some header file ?).
Packit d37888
Packit d37888
Martin <martin@home-of-linux.org>