diff options
| author | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 | 
|---|---|---|
| committer | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 | 
| commit | 76b5366091f76c9bc73570149ef5055648fc2c39 (patch) | |
| tree | 590d020e0f2a5bea6e09d66d951a674443b21d67 /share/examples | |
| parent | 4b4d01da6f07f7754ff6a6e4f5223e9f0984d1a6 (diff) | |
Diffstat (limited to 'share/examples')
33 files changed, 24 insertions, 3230 deletions
| diff --git a/share/examples/atm/atm-sockets.txt b/share/examples/atm/atm-sockets.txt index 17436f14492f3..258a565f84877 100644 --- a/share/examples/atm/atm-sockets.txt +++ b/share/examples/atm/atm-sockets.txt @@ -148,17 +148,15 @@ o Multipoint connections  Example ATM Socket Application  ------------------------------ -The following are simple example client and server applications using the ATM  -socket API. +The following is a simple example application using the ATM socket API.  /* - * ATM API sample client application + * ATM API sample application   * - * This application will open an ATM socket to a server, send a text string  - * in a PDU and then read one PDU from the socket and print its contents. + * This application will open an ATM socket, send a text string in a PDU + * and then read one PDU from the socket and print its contents.   *   */ -#include <stdio.h>  #include <sys/param.h>  #include <sys/types.h>  #include <sys/socket.h> @@ -167,35 +165,17 @@ socket API.  #define	MAX_LEN		4096	/* Maximum PDU length */  #define	MY_ID		11	/* BLLI Layer 2 protocol */ -#define MY_APPL		"Client" +#define MY_APPL		"SAMPLE"  Atm_addr_nsap	dst_addr = {  	0x47, -#error FIX ME: Replace the 2 lines below with your nsap prefix and esi address  	{0x00,0x05,0x80,0xff,0xdc,0x00,0x00,0x00,0x00,0x02,0xff,0xff},  	{0x11,0x22,0x33,0x44,0x55,0x66},  	0x00  }; -static char	message[] = "A message from the client"; +static char	message[] = "Test message to send on connection"; -void -print_cause(int s) -{ -	struct	t_atm_cause	cause; -	int	optlen; - -	optlen = sizeof(cause); -	if (getsockopt(s, T_ATM_SIGNALING, T_ATM_CAUSE, &cause, &optlen) < 0) { -		perror("getsockopt(cause)"); -		return; -	} -	 -	fprintf(stderr, "Cause: coding=%d loc=%d cause=%d diag=(%d,%d,%d,%d)\n", -		cause.coding_standard, cause.location, cause.cause_value, -		cause.diagnostics[0], cause.diagnostics[1],  -		cause.diagnostics[2], cause.diagnostics[3]); -}  main(argc, argv)  	int	argc; @@ -305,8 +285,6 @@ main(argc, argv)  		exit(1);  	} -#ifdef REMOVE_TO_USE_NET_INTF -#error FIX ME: Replace the ni0 below with the local atm network interface name  	strncpy(netintf.net_intf, "ni0", IFNAMSIZ);  	optlen = sizeof(netintf);  	if (setsockopt(s, T_ATM_SIGNALING, T_ATM_NET_INTF, (caddr_t)&netintf, @@ -314,7 +292,6 @@ main(argc, argv)  		perror("setsockopt(net_intf)");  		exit(1);  	} -#endif  	strncpy(appname.app_name, MY_APPL, T_ATM_APP_NAME_LEN);  	optlen = sizeof(appname); @@ -329,7 +306,6 @@ main(argc, argv)  	 */  	if (connect(s, (struct sockaddr *) &satm, sizeof(satm)) < 0) {  		perror("connect"); -		print_cause(s);  		exit(1);  	} @@ -341,7 +317,7 @@ main(argc, argv)  		exit(1);  	} -	if ((n = read(s, buffer, MAX_LEN)) < 0) { +	if ((n = read(s, buffer, MAX_LEN) < 0)) {  		perror("read");  		exit(1);  	} @@ -360,213 +336,5 @@ main(argc, argv)  	exit(0);  } - - -/* - * ATM API sample server application - * - * This application will loop forever listening for connections on an ATM  - * socket.  When a new connection arrives, it will send a string in a PDU, - * read one PDU from the socket and print its contents. - * - */ -#include <stdio.h> -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <net/if.h> -#include <netatm/atm.h> - -#define	MAX_LEN		4096	/* Maximum PDU length */ -#define	MY_ID		11	/* BLLI Layer 2 protocol */ -#define MY_APPL		"Server" - -static char	message[] = "A message from the server"; - -void -print_cause(int s) -{ -	struct	t_atm_cause	cause; -	int	optlen; - -	optlen = sizeof(cause); -	if (getsockopt(s, T_ATM_SIGNALING, T_ATM_CAUSE, &cause, &optlen) < 0) { -		perror("getsockopt(cause)"); -		return; -	} -	 -	fprintf(stderr, "Cause: coding=%d loc=%d cause=%d diag=(%d,%d,%d,%d)\n", -		cause.coding_standard, cause.location, cause.cause_value, -		cause.diagnostics[0], cause.diagnostics[1],  -		cause.diagnostics[2], cause.diagnostics[3]); -} - -main(argc, argv) -	int	argc; -	char	**argv; -{ -	struct sockaddr_atm	satm; -	struct t_atm_aal5	aal5; -	struct t_atm_traffic	traffic; -	struct t_atm_bearer	bearer; -	struct t_atm_qos	qos; -	struct t_atm_net_intf	netintf; -	struct t_atm_app_name	appname; -	char	buffer[MAX_LEN+1]; -	int	s, n, optlen; - -	/* -	 * Create socket -	 */ -	s = socket(AF_ATM, SOCK_SEQPACKET, ATM_PROTO_AAL5); -	if (s < 0) { -		perror("socket"); -		exit(1); -	} - -	/* -	 * Set up destination SAP -	 */ -	bzero((caddr_t) &satm, sizeof(satm)); -	satm.satm_family = AF_ATM; -#if (defined(BSD) && (BSD >= 199103)) -	satm.satm_len = sizeof(satm); -#endif -	/* Destination ATM address */ -	satm.satm_addr.t_atm_sap_addr.SVE_tag_addr = T_ATM_ANY; -	satm.satm_addr.t_atm_sap_addr.SVE_tag_selector = T_ATM_ANY; - -	/* BLLI Layer-2 protocol */ -	satm.satm_addr.t_atm_sap_layer2.SVE_tag = T_ATM_PRESENT; -	satm.satm_addr.t_atm_sap_layer2.ID_type = T_ATM_USER_ID;  -	satm.satm_addr.t_atm_sap_layer2.ID.user_defined_ID = MY_ID;  - -	/* BLLI Layer-3 protocol */ -	satm.satm_addr.t_atm_sap_layer3.SVE_tag = T_ATM_ABSENT; - -	/* BHLI protocol */ -	satm.satm_addr.t_atm_sap_appl.SVE_tag = T_ATM_ABSENT; - -	/* -	 * Set up connection parameters -	 */ -	aal5.forward_max_SDU_size = MAX_LEN; -	aal5.backward_max_SDU_size = MAX_LEN; -	aal5.SSCS_type = T_ATM_NULL; -	optlen = sizeof(aal5); -	if (setsockopt(s, T_ATM_SIGNALING, T_ATM_AAL5, (caddr_t)&aal5, -			optlen) < 0) { -		perror("setsockopt(aal5)"); -		exit(1); -	} - -	traffic.forward.PCR_high_priority = T_ATM_ABSENT; -	traffic.forward.PCR_all_traffic = 100000; -	traffic.forward.SCR_high_priority = T_ATM_ABSENT; -	traffic.forward.SCR_all_traffic = T_ATM_ABSENT; -	traffic.forward.MBS_high_priority = T_ATM_ABSENT; -	traffic.forward.MBS_all_traffic = T_ATM_ABSENT; -	traffic.forward.tagging = T_NO; -	traffic.backward.PCR_high_priority = T_ATM_ABSENT; -	traffic.backward.PCR_all_traffic = 100000; -	traffic.backward.SCR_high_priority = T_ATM_ABSENT; -	traffic.backward.SCR_all_traffic = T_ATM_ABSENT; -	traffic.backward.MBS_high_priority = T_ATM_ABSENT; -	traffic.backward.MBS_all_traffic = T_ATM_ABSENT; -	traffic.backward.tagging = T_NO; -	traffic.best_effort = T_YES; -	optlen = sizeof(traffic); -	if (setsockopt(s, T_ATM_SIGNALING, T_ATM_TRAFFIC, (caddr_t)&traffic, -			optlen) < 0) { -		perror("setsockopt(traffic)"); -		exit(1); -	} - -	bearer.bearer_class = T_ATM_CLASS_X; -	bearer.traffic_type = T_ATM_NULL; -	bearer.timing_requirements = T_ATM_NULL; -	bearer.clipping_susceptibility = T_NO; -	bearer.connection_configuration = T_ATM_1_TO_1; -	optlen = sizeof(bearer); -	if (setsockopt(s, T_ATM_SIGNALING, T_ATM_BEARER_CAP, (caddr_t)&bearer, -			optlen) < 0) { -		perror("setsockopt(bearer)"); -		exit(1); -	} - -	qos.coding_standard = T_ATM_NETWORK_CODING; -	qos.forward.qos_class = T_ATM_QOS_CLASS_0; -	qos.backward.qos_class = T_ATM_QOS_CLASS_0; -	optlen = sizeof(qos); -	if (setsockopt(s, T_ATM_SIGNALING, T_ATM_QOS, (caddr_t)&qos, -			optlen) < 0) { -		perror("setsockopt(qos)"); -		exit(1); -	} - -	strncpy(appname.app_name, MY_APPL, T_ATM_APP_NAME_LEN); -	optlen = sizeof(appname); -	if (setsockopt(s, T_ATM_SIGNALING, T_ATM_APP_NAME, (caddr_t)&appname, -			optlen) < 0) { -		perror("setsockopt(app_name)"); -		exit(1); -	} - -	/* -	 * Now try to bind/listen -	 */ -	if (bind(s, (struct sockaddr *) &satm, sizeof(satm)) < 0) { -		perror("bind"); -		exit(1); -	} -	if (listen(s, 4) < 0) { -		perror("listen"); -		exit(1); -	} - -	for (; ; ) { -		struct sockaddr_atm	claddr; -		int	clsock, cllen; - -		/* Wait for incoming call */ -		cllen = sizeof(claddr); -		clsock = accept(s, (struct sockaddr *) &claddr, &cllen); -		if (clsock < 0) { -			perror("accept"); -			exit(1); -		} -		printf("Server: new connection\n"); -		 -		/* -		 * Exchange message with peer -		 */ -		if (write(clsock, message, sizeof(message)) != sizeof(message)) { -			perror("write"); -			exit(1); -		} - -		if ((n = read(clsock, buffer, MAX_LEN)) < 0) { -			perror("read"); -			exit(1); -		} - -		buffer[n] = '\0'; -		printf("received %d bytes: <%s>\n", n, buffer); - -		sleep(1); - -		/* -		 * Finish up -		 */ -		if (close(clsock) < 0) { -			perror("close"); -			exit(1); -		} -	} - -	close(s); -	exit(0); -} - -	@(#) $Id: atm-sockets.txt,v 1.1 1998/09/15 08:22:49 phk Exp $ +	@(#) $Id: atm_sockets,v 1.1 1998/08/26 21:52:01 mks Exp $ diff --git a/share/examples/bootforth/README b/share/examples/bootforth/README deleted file mode 100644 index d86251bcf512d..0000000000000 --- a/share/examples/bootforth/README +++ /dev/null @@ -1,22 +0,0 @@ -Here you can find some simple examples how to use BootFORTH (part of the -new bootloader) together with terminal emulation code (available when -compiling /sys/boot/i386/libi386 with -DTERM_EMU). - -Normally, you can place the files in /boot as they are here, and they will be -automatically loaded by /boot/loader. - -The files are: - -boot.4th	example of file which is always loaded by /boot/loader, if -		present in /boot/ -screen.4th	helpful words for screen manipulation. -frames.4th	basic frame drawing primitives. Requires screen.4th. -menu.4th	example of simple startup menu. - -You're encouraged to add more features to these files - I'm not a Forth -hacker, unfortunately... - -Andrzej Bialecki -<abial@freebsd.org> - -$Id$ diff --git a/share/examples/bootforth/boot.4th b/share/examples/bootforth/boot.4th deleted file mode 100644 index 467e968f962a0..0000000000000 --- a/share/examples/bootforth/boot.4th +++ /dev/null @@ -1,22 +0,0 @@ -\ Example of the file which is automatically loaded by /boot/loader -\ on startup. -\ $Id$ - -\ Load the screen manipulation words - -cr .( Loading Forth extensions:) - -cr .( - screen.4th...) -s" /boot/screen.4th" fopen dup fload fclose - -\ Load frame support -cr .( - frames.4th...) -s" /boot/frames.4th" fopen dup fload fclose - -\ Load our little menu -cr .( - menu.4th...) -s" /boot/menu.4th" fopen dup fload fclose - -\ Show it -cr -main_menu diff --git a/share/examples/bootforth/frames.4th b/share/examples/bootforth/frames.4th deleted file mode 100644 index 9895a74466be4..0000000000000 --- a/share/examples/bootforth/frames.4th +++ /dev/null @@ -1,90 +0,0 @@ -\ Words implementing frame drawing -\ XXX Filled boxes are left as an exercise for the reader... ;-/ -\ $Id$ - -marker task-frames.4th - -variable h_el -variable v_el -variable lt_el -variable lb_el -variable rt_el -variable rb_el -variable fill - -\ Single frames -196 constant sh_el -179 constant sv_el -218 constant slt_el -192 constant slb_el -191 constant srt_el -217 constant srb_el -\ Double frames -205 constant dh_el -186 constant dv_el -201 constant dlt_el -200 constant dlb_el -187 constant drt_el -188 constant drb_el -\ Fillings -0 constant fill_none -32 constant fill_blank -176 constant fill_dark -177 constant fill_med -178 constant fill_bright - - -: hline	( len x y -- )	\ Draw horizontal single line -	at-xy		\ move cursor -	0 do -		h_el @ emit -	loop -; - -: f_single	( -- )	\ set frames to single -	sh_el h_el ! -	sv_el v_el ! -	slt_el lt_el ! -	slb_el lb_el ! -	srt_el rt_el ! -	srb_el rb_el ! -; - -: f_double	( -- )	\ set frames to double -	dh_el h_el ! -	dv_el v_el ! -	dlt_el lt_el ! -	dlb_el lb_el ! -	drt_el rt_el ! -	drb_el rb_el ! -; - -: vline	( len x y -- )	\ Draw vertical single line -	2dup 4 pick -	0 do -		at-xy -		v_el @ emit -		1+ -		2dup -	loop -	2drop 2drop drop -; - -: box	( w h x y -- )	\ Draw a box -	2dup 1+ 4 pick 1- -rot -	vline		\ Draw left vert line -	2dup 1+ swap 5 pick + swap 4 pick 1- -rot -	vline		\ Draw right vert line -	2dup swap 1+ swap 5 pick 1- -rot -	hline		\ Draw top horiz line -	2dup swap 1+ swap 4 pick + 5 pick 1- -rot -	hline		\ Draw bottom horiz line -	2dup at-xy lt_el @ emit	\ Draw left-top corner -	2dup 4 pick + at-xy lb_el @ emit	\ Draw left bottom corner -	2dup swap 5 pick + swap at-xy rt_el @ emit	\ Draw right top corner -	2 pick + swap 3 pick + swap at-xy rb_el @ emit -	2drop -; - -f_single -fill_none fill ! diff --git a/share/examples/bootforth/menu.4th b/share/examples/bootforth/menu.4th deleted file mode 100644 index 06493c53f14b6..0000000000000 --- a/share/examples/bootforth/menu.4th +++ /dev/null @@ -1,96 +0,0 @@ -\ Simple greeting screen, presenting basic options. -\ XXX This is far too trivial - I don't have time now to think -\ XXX about something more fancy... :-/ -\ $Id: menu.4th,v 1.1 1998/12/22 12:15:45 abial Exp $ - -: title -	f_single -	60 11 10 4 box -	29 4 at-xy 15 fg 7 bg -	." Welcome to BootFORTH!" -	me -; - -: menu -	2 fg -	20 7 at-xy  -	." 1.  Start FreeBSD /kernel." -	20 8 at-xy -	." 2.  Interact with BootFORTH." -	20 9 at-xy -	." 3.  Reboot." -	me -; - -: tkey	( d -- flag | char ) -	seconds + -	begin 1 while -	    dup seconds u< if -		drop -		-1 -		exit -	    then -	    key? if -		drop -		key -		exit -	    then -	repeat -; - -: prompt -	14 fg -	20 11 at-xy -	." Enter your option (1,2,3): " -	10 tkey -	dup 32 = if -	    drop key -	then -	dup 0< if -	    drop 49 -	then -	dup emit -	me -; - -: help_text -	10 18 at-xy ." * Choose 1 if you just want to run FreeBSD." -	10 19 at-xy ." * Choose 2 if you want to use bootloader facilities." -	12 20 at-xy ." See '?' for available commands, and 'words' for" -	12 21 at-xy ." complete list of Forth words." -	10 22 at-xy ." * Choose 3 in order to warm boot your machine." -; - -: main_menu -	begin 1 while -		clear -		f_double -		79 23 1 1 box -		title -		menu -		help_text -		prompt -		cr cr cr -		dup 49 = if -			drop -			1 25 at-xy cr -			." Loading kernel. Please wait..." cr -			boot -		then -		dup 50 = if -			drop -			1 25 at-xy cr -			exit -		then -		dup 51 = if -			drop -			1 25 at-xy cr -			reboot -		then -		20 12 at-xy -		." Key " emit ."  is not a valid option!" -		20 13 at-xy -		." Press any key to continue..." -		key drop -	repeat -; diff --git a/share/examples/bootforth/screen.4th b/share/examples/bootforth/screen.4th deleted file mode 100644 index 4b0a01e7c982d..0000000000000 --- a/share/examples/bootforth/screen.4th +++ /dev/null @@ -1,36 +0,0 @@ -\ Screen manipulation related words. -\ $Id$ - -marker task-screen.4th - -: escc	( -- )	\ emit Esc-[ -	91 27 emit emit -; - -: ho	( -- )	\ Home cursor -	escc 72 emit	\ Esc-[H -; - -: cld	( -- )	\ Clear from current position to end of display -	escc 74 emit	\ Esc-[J -; - -: clear	( -- )	\ clear screen -	ho cld -; - -: at-xy	( x y -- )	\ move cursor to x rows, y cols (1-based coords) -	escc .# 59 emit .# 72 emit	\ Esc-[%d;%dH -; - -: fg	( x -- )	\ Set foreground color -	escc 3 .# .# 109 emit	\ Esc-[3%dm -; - -: bg	( x -- )	\ Set background color -	escc 4 .# .# 109 emit	\ Esc-[4%dm -; - -: me	( -- )	\ Mode end (clear attributes) -	escc 109 emit -; diff --git a/share/examples/drivers/make_device_driver.sh b/share/examples/drivers/make_device_driver.sh index e2bc74c304f4a..e8249770a07ab 100755 --- a/share/examples/drivers/make_device_driver.sh +++ b/share/examples/drivers/make_device_driver.sh @@ -29,7 +29,7 @@ DONE  cat >${UPPER} <<DONE  # Configuration file for kernel type: ${UPPER}  ident	${UPPER} -# \$Id: make_device_driver.sh,v 1.3 1998/01/12 07:47:03 julian Exp $" +# \$Id: make_device_driver.sh,v 1.2 1997/12/30 03:23:12 julian Exp $"  DONE  grep -v GENERIC < GENERIC >>${UPPER} @@ -37,7 +37,7 @@ grep -v GENERIC < GENERIC >>${UPPER}  cat >>${UPPER} <<DONE  # trust me, you'll need this  options	DDB		 -device ${1}0 at isa? port 0x234 bio irq 5 +device ${1}0 at isa? port 0x234 bio irq 5 vector ${1}intr  DONE  cat >../isa/${1}.c <<DONE @@ -45,7 +45,7 @@ cat >../isa/${1}.c <<DONE   * Copyright ME   *   * ${1} driver - * \$Id: make_device_driver.sh,v 1.3 1998/01/12 07:47:03 julian Exp $ + * \$Id: make_device_driver.sh,v 1.2 1997/12/30 03:23:12 julian Exp $   */ @@ -65,7 +65,7 @@ cat >../isa/${1}.c <<DONE -/* Function prototypes (these should all be static) */ +/* Function prototypes (these should all be static  except for ${1}intr()) */  static  d_open_t	${1}open;  static  d_close_t	${1}close;  static  d_read_t	${1}read; @@ -76,7 +76,7 @@ static  d_poll_t	${1}poll;  static	int		${1}probe (struct isa_device *);  static	int		${1}attach (struct isa_device *);  #ifdef ${UPPER}_MODULE -static	ointhand2_t	${1}intr; /* should actually have type inthand2_t */ +void ${1}intr(int unit); /* actually defined in ioconf.h (generated file) */  #endif  #define CDEV_MAJOR 20 @@ -172,13 +172,7 @@ ${1}attach (struct isa_device *dev)  {  	int unit = dev->id_unit;  	sc_p scp  = sca[unit]; - -	/* -	 * Attach our interrupt handler to the device struct.  Our caller -	 * will attach it to the hardware soon after we return. -	 */ -	dev->id_ointr = ${1}intr; - +	  	/*   	 * Allocate storage for this instance .  	 */ @@ -225,7 +219,7 @@ do { /* the do-while is a safe way to do this grouping */	\  #define	CHECKUNIT_DIAG(RETVAL)  #endif 	/* DIAGNOSTIC */ -static void +void  ${1}intr(int unit)  {  	sc_p scp  = sca[unit]; diff --git a/share/examples/drivers/make_pseudo_driver.sh b/share/examples/drivers/make_pseudo_driver.sh index a68bc7eeaf712..f6fc34248865b 100644 --- a/share/examples/drivers/make_pseudo_driver.sh +++ b/share/examples/drivers/make_pseudo_driver.sh @@ -21,7 +21,7 @@ DONE  cat >${UPPER} <<DONE  # Configuration file for kernel type: ${UPPER}  ident	${UPPER} -# \$Id: make_pseudo_driver.sh,v 1.2 1997/12/30 03:23:13 julian Exp $" +# \$Id: make_pseudo_driver.sh,v 1.1 1997/02/02 07:19:30 julian Exp $"  DONE  grep -v GENERIC < GENERIC >>${UPPER} @@ -37,7 +37,7 @@ cat >../../dev/${1}.c <<DONE   * Copyright ME   *   * ${1} driver - * \$Id: make_pseudo_driver.sh,v 1.2 1997/12/30 03:23:13 julian Exp $ + * \$Id: make_pseudo_driver.sh,v 1.1 1997/02/02 07:19:30 julian Exp $   */ @@ -55,7 +55,7 @@ cat >../../dev/${1}.c <<DONE -/* Function prototypes (these should all be static) */ +/* Function prototypes (these should all be static  except for ${1}intr()) */  static  d_open_t	${1}open;  static  d_close_t	${1}close;  static  d_read_t	${1}read; diff --git a/share/examples/isdn/FAQ b/share/examples/isdn/FAQ deleted file mode 100644 index 8dd1d71c33ace..0000000000000 --- a/share/examples/isdn/FAQ +++ /dev/null @@ -1,517 +0,0 @@ --------------------------------------------------------------------------------- - -                   ISDN4BSD Frequently Asked Questions -                   =================================== - -                last edit-date: [Fri Dec 25 19:59:21 1998] - --------------------------------------------------------------------------------- - -Contents: -========= - -	 1. How do I get started with synchronous PPP (sPPP) ? -	 2. does anyone know a software that can receive/send fax over ISDN ? -	 3. does i4b callback only work with setups where the remote end  -		returns a busy ? -	 4. trouble with kernel options IPFIREWALL and IPDIVERT and natd -	 5. I want to use -r with isdnd but it does not work -	 6. How do I configure and run the answering machine ? -	 7. Teles S0/16.3 ... unknown ? -	 8. How do i integrate a new lowlevel driver into i4b ? -	 9. Why it always says "no Space in TX FIFO - State F4 awaiting" ? -	10. Incoming alert - what does it mean ? -	11. How do i change irq's on my teles 16.3 card ? - - - -1. How do I get started with synchronous PPP (sPPP) ? -================================================================================ - -  Of course you first have to have sPPP interfaces in your kernel. If -  you installed everything using FreeBSD/install.sh then the correct -  entries should have been automatically made in /sys/conf/files for you. -  For NetBSD it isn't quite as simple since NetBSD/install-netbsd.sh does -  not do it for you. -   -  Then all you need to do is put an entry like this: -   -  	pseudo-device   "i4bisppp"      4 -   -  into your kernel configuration file (if it's not already there) and -  generate and boot the new kernel. The above line will give you 4 -  sPPP interfaces - isp0 to isp3. -   -  Then just modify /etc/isdn/isdnd.rc (see the example in etc-isdn/isdnd.rc) -  to suit your needs (telephone numbers, etc). -   -  The next step is to read the spppcontrol man page and then to look at -  etc/rc.isdn-PPP. spppcontrol is a very important component in getting -  sPPP working correctly and the spppcontrol lines in your /etc/rc.isdn -  must be correct. -   -  In my experience there are two things which can cause problems: -   -  1) the authproto line has to agree with what your ISP desires. In -     general I've found that it's best to have something like this - -   -  	spppcontrol <interface> myauthproto={pap,chap} myauthname=<AuthName> -  		myauthsecret=<AuthSecret> hisauthproto=none callin -   -     The "hisauthproto=none" is usually needed because the ISP does not want -     to authorise himself to you; he expects you to authorize yourself to him ! -     I once forgot to set hisauthproto and it took me quite a while to figure -     out why I couldn't connect. -   -  2) the IP address at your ISP's end must be correct. -   -  How can I find out (1) whether my ISP wants pap or chap and (2) what his -  IP address is ? you might ask. Generally, your ISP should have provide -  this information to you. But, if he didn't, or you've mislayed the -  documentation (as I did), there's still hope. -   -  Fortunately, J"org Wunsch implemented the sPPP kernel code so that it -  provides all the information required if the interface is configured -  with the debug flag set (e.g. ``ifconfig isp0 debug''). It's just a -  little cryptic. -   -  By the way, I suggest turning the debug flag on until you have things -  working and then turning it off. The debug output is rather voluminous -  and could fill up your /var partition, otherwise. -   -  The debug output will appear on the console and also be logged to -  /var/log/messages (under FreeBSD) unless you changed /etc/syslog.conf. -   -  A. How to figure out the authproto -  ---------------------------------- -   -  Here is an example where I configured isp0 with myauthproto=pap, my -  ISP wanted chap, but was willing to accept pap: -   -  /kernel: isp0: lcp up(starting) -  /kernel: isp0: lcp output <conf-req id=0x7 len=10 5-6-34-e4-30-5a> -  /kernel: isp0: lcp input(req-sent): <conf-req id=0x1 len=30 0-4-0-0-1-4-5- -  f4-3-5-c2-23-5-11-4-5-f4-13-9-3-0-c0-7b-6e-fe-b5> -         ^^^^^ -             |___ c223 is chap, it's what the ISP wants to use -   -  /kernel: isp0: lcp parse opts:  0x0 [rej]  mru  auth-proto  0x11 [rej] -  x13 [rej]  send conf-rej (I didn't agree) -  /kernel: isp0: lcp output <conf-rej id=0x1 len=21 0-4-0-0-11-4-5-f4-13-9-3- -  0-c0-7b-6e-fe-b5> -  /kernel: isp0: lcp input(req-sent): <conf-ack id=0x7 len=10 5-6-34-e4-30-5a> -  /kernel: isp0: lcp input(ack-rcvd): <conf-req id=0x2 len=13 1-4-5-f4-3-5- -  c2-23-5> -  /kernel: isp0: lcp parse opts:  mru  auth-proto -  /kernel: isp0: lcp parse opt values:  mru 1524  auth-proto [mine 0x0 != -  his chap]  send conf-nak (we want to use pap, not chap) -  /kernel: isp0: lcp output <conf-nak id=0x2 len=9 3-5-c0-23-5> -                                                         ^^^^^ -                                                             |___ c023 is pap -   -  /kernel: isp0: lcp input(ack-rcvd): <conf-req id=0x3 len=12 1-4-5-f4-3-4- -  c0-23> (he agrees to use pap) -  /kernel: isp0: lcp parse opts:  mru  auth-proto -  /kernel: isp0: lcp parse opt values:  mru 1524  auth-proto  send conf-ack -  /kernel: isp0: lcp output <conf-ack id=0x3 len=12 1-4-5-f4-3-4-c0-23> -  					he agrees to use pap ___|^^^^^ -   -  so, if you have problems in the lcp phase, check which authentication method -  your ISP wants to use. Usually chap is prefered, but pap will be accepted. -   -  B. How to figure out the ISP's IP address -  ----------------------------------------- -   -  I also intentionally configured the interface with the wrong address for -  my ISP, like this: -   -  	ifconfig isp0 0.0.0.0 10.0.0.1 debug link1 -   -  this means that I want the ISP to assign me an address (the 0.0.0.0) and -  that I expect him to use 10.0.0.1 (which is wrong). Here's the result: -  (note that these addresses have been changed by me) -   -  /kernel: isp0: phase network -  /kernel: isp0: ipcp open(initial) -  /kernel: isp0: ipcp up(starting) -  /kernel: isp0: ipcp output <conf-req id=0x9 len=10 3-6-0-0-0-0> -  /kernel: isp0: ipcp input(req-sent): <conf-req id=0x1 len=16 2-6-0-2d-f-1- -  3-6-c-22-38-4e> -  /kernel: isp0: ipcp parse opts:  compression [rej]  address  send conf-rej -  /kernel: isp0: ipcp output <conf-rej id=0x1 len=10 2-6-0-2d-f-1> -  /kernel: isp0: ipcp input(req-sent): <conf-nak id=0x9 len=10 3-6-c-22-38-4e> -  /kernel: isp0: ipcp nak opts:  address [wantaddr 12.34.56.78] [agree] -                                                     ^^^^^ -                                                         |___ he assigns me this -   -  /kernel: isp0: ipcp output <conf-req id=0xa len=10 3-6-c3-b4-eb-63> -  /kernel: isp0: ipcp input(req-sent): <conf-req id=0x2 len=10 3-6-62-4c-36-20> -  /kernel: isp0: ipcp parse opts:  address -  /kernel: isp0: ipcp parse opt values:  address 98.76.54.32 [not agreed] -                                                   ^^^^^ -                                                        |_this is *his* address -  send conf-nak -  /kernel: isp0: ipcp output <conf-nak id=0x2 len=10 3-6-a-0-0-1> -  	I expect a different address and (incorrectly) reject what he wants. -  	I tell him that I expect 10.0.0.1. After this the connection fails. -   -  Anyway, I now know that his address is really 98.76.54.32 and can use -  it to correctly configure the interface. -   -  With the correct IP address I shoulkd now be able to connect with no -  problems. As stated above, the authorization protocol is normally not -  so important since most ISPs are willing to use pap, although chap is -  more secure. Generally, I'd try chap first and only switch to pap if -  the ISP doesn't accept it. -   -  (by Gary Jennejohn, Home - garyj@muc.de, Work - garyj@fkr.dec.com) - - - -2. does anyone know a software that can receive/send fax over ISDN ? -================================================================================ - - > Hi, - >  - > does anyone know a software that can receive/send fax over ISDN? I am - > using a Fritz!Card, which can handle group 3 (analogous) fax, but I - > can't find any hint in the i4b software that this is supported in any - > way. -  -This is probably not implemented. - -Implementing G3 fax in ISDN would mean simulating an analog modem -on the digital link. This means having to generate the right waveforms -for the modulated data, and receive analog data from the other end -which you had to run FFT analysis on and then interpret. - -In addition you have to do this in realtime, to be able to deal with -the timing involved in the fax protocol, something neither -FreeBSD or Linux is good at in their native form..  - -A third point is that a software simulated faxmodem usually does not -work well. I tested Teles software faxmodem in Win-95 towards an Ericsson V34 -HE modem, and was able to send faxes from the ISDN card at 4800 baud -only, and receive faxes ad 9600 baud only(!) (And it is not the -Ericsson modems fault, it works flawlessly towards other fax machines.) - -My point is that the best thing to do is to use an ordinary faxmodem -to handle faxes with Hylafax of mgetty+sendfax or efax, or you may use -a combined ISDN card with an analog part. - -Of course, if you are crazy enough, you may try to implement a -software simulated modem in e.g. RT-linux, or a similar realtime -extension for FreeBSD. - -Best regards, -Nils Ulltveit-Moe	(etonumo@eto.ericsson.se) - - - -3. does i4b callback only work with setups where the remote end returns a busy ? -================================================================================ - -> Is my assumption correct, does i4b callback only work with setups where -> the remote end returns a busy on the dialin? - -Yes - otherwise you'll pay for the connection, at least here in Germany. - -Most routers support two kind of callbacks - the one that i4b supports -means: the called system rejects (so no charge for this connection), waits -a configurable time and the calls back. Information on who has called and -who is to be called back relies on the ISDN calling party number information -and stuff statically configured in the routers (or isnd's) configuration. - -The other type of callback (not supported by i4b right now) means: the  -called system accepts the connection and starts ppp negotiation. During this -the ppp's aggree to do a callback. Information on who called in and who is  -going to be called back is subject to the authentication/negotiation already -done by the two ppp's. Then ppp closes down, the connection is disconnected -and the called system calls back. - -I've never seen someone actually use the second type due to its obvious  -disadvantages. It may be usefull if you travel, call in from an unknown -number and want to be called back at that number. - -Martin Husemann <martin@rumolt.teuto.de> - - -4. trouble with kernel options IPFIREWALL and IPDIVERT and natd -================================================================================ - -   NOTICE: section obsolete since IP address changes are handled properly now! -   =========================================================================== - -This section -> Trying to build a router/gateway between my privat Ethernet and -> the Internet (via my ISP), I have problems with I4B or NAT (I think:). ->  -> The 2.2.5-R kernel with options IPFIREWALL and IPDIVERT works fine -> with ISDN4BSD 0.50-alpha and firewall rule 'pass all from any to any'. -> However, when I add 'divert natd all from any to any via isp0' -> and start natd, name server lookups to the ISP's NS don't work. ->  -> Also, ping and nslookup fails from any other internal host. - -I had exactly the same problems. natd doesn't seem to get a message if -the IP address of the interface changes (after successful dialout). -I have to manually send a HUP signal to natd. I do this via the following -(ugly?!) hack: - -I added the following two lines to the system section of isdnd.rc: -regexpr         = "call active"         # look for matches in log messages -regprog         = hup_natd              # execute program whan match is found - -The small script "hup_natd", located in /etc/isdn, looks like: -#!/bin/sh -pid=`cat /var/run/natd.pid` -kill -HUP $pid -sleep 3 -kill -HUP $pid -sleep 5 -kill -HUP $pid - -It looks ugly, but at least for me it works. The two sleeps are necessary -since I have to wait for ppp negotiation to complete (I don't get a message  -from isdnd for that). If I'm lucky I have my connection after 3 seconds,  -but 8 seconds should suffice for worst case (the first HUP without a sleep  -sometimes even succeeded on an slow 486/33 with 8MB RAM, more HUPs don't hurt). - -I'm really interested in some more elegant method. - -Daniel		(rock@cs.uni-sb.de) - - -Arve Ronning replied: -===================== - -> I had exactly the same problems. natd doesn't seem to get a message if -> the IP address of the interface changes (after successful dialout). - -Well, it (natd) _does_ pick up the dynamic address supplied for isp0. -Try 'natd -verbose ...' and you'll see it. Otherwise I agree, there is -certainly something missing in natd's functionality, or maybe sppp -does'nt -supply what it's supposed to ?? - -> I have to manually send a HUP signal to natd. I do this via the following -> (ugly?!) hack: - -YES...super; strange but correct. It works when I send natd a -HUP after -sppp is up. Thanx for the tip. However, natd must be -HUPed _every_ time -sppp has been down (idle timeout) and comes back up! - -> I'm really interested in some more elegant method. - -So am I, let's see what may come out of the discussion on the list. - - - -5. I want to use -r with isdnd but it does not work -================================================================================ - -> > Use isdnd in fullscreen mode. ->  -> I tried that already, but got an error when I start isdnd that way: ->  ->       /usr/local/bin/isdnd -d 0xf9 -f -r /dev/ttyv1 -t cons25 ->  -> root is logged in on device /dev/ttyv1, the message in /var/log/messages looks like: ->  -> "May 22 11:52:28 asterix isdnd[4160]: ERR ERROR, cannot setup tty as controlling terminal: Operation not permitted" ->  -> How can I give this device permission ? -   - -In case you want to use switch "-r" noone else _must_ use the tty you redirect -to, you have to remove the getty from the virtual terminal in /etc/ttys and  -restart the init process. - - -6. How do I configure and run the answering machine (under FreeBSD 2.2.x) ? -================================================================================ - -The answering machine will be activated, when isdnd executes the program -that has been named in "/etc/isdn/isdnd.rc" in the section "telephone -answering" at entry "answerprog = ". If the program is executed -without a pathname, the answer program is expected in "/etc/isdn". -Examples of such programs can be found in "/etc/isdn/samples". They -are named: - -	"answer"	answers only, no recording -	"record"	answers, and records messages -	"tell"		the number of the calling person is told, -			no recording. -	"tell-record"	calling number as answer, message is recorded -	"isdntel.sh"	answers and records messages; by using the -			program "isdntel", one has the control over -			the recorded messages in the directory  -			"/var/isdn". Look at "man isdntel" and -			"man isdntelctl". - -These programs have to be altered to suit your needs. Unfortunately there -is no program with which you can record your answer message. This is not -really bad, because you only have to alter the above mentioned program -"record" a bit (comment out the "if ... fi" statements for the beep -and msg messages). You have to create the directory "/var/isdn" first in -order to record messages. They will be stored in this location then. - -Stefan Herrmann <stefan@asterix.webaffairs.net> - - -7. Teles S0/16.3 ... unknown ? -================================================================================ -Hi, - -I have just purchased a Teles S0/16.3 card. -But it's not what i4b is looking for .... I mean, it's a different card. - -The docs  (and sources)of i4b talks about a Telws S0/16.3 card with 3 -address: d80 etc. - -This one (is not PnP) has jumpers for 0x180 0x280 0x380. - -It has the SIemens Chips numbered PSB 21525 N (HSCX TE V2.1) and PSB -2186N V1.1 (ISAC-S TE). - -I undestand that the 16.3c is not supported, but over this board is -written "TELES.S0/16.3 Revision 1.3" - -Can anybody tell me what is this card ??? - -answer: -------- - -It's not a different card. The jumpers are documented to select -IO-address 0x180, 0x280 or 0x380 in some TELES manuals. -But in fact they select the addresses 0xd80, 0xe80 or 0xf80. - -Wolfgang - - -And an additional note from Poul-Henning Kamp: ----------------------------------------------- -There is an intricate story behind this, in short some ISA cards -only decode the first 10 address bits (0x3ff), which over the years -has resulted in a mutation the "de-facto-spec" such that addressbits -10-15 can be used by the card for selecting various stuff.  This -is extensively used on obscure cards with massive IO needs, sound, -IEEE488 and ISDN cards often belong in this category. - - - -8. How do i integrate a new lowlevel driver into i4b ? -================================================================================ - -1) Request a flag value from me -2) add an entry for the card into FreeBSD/CONFIG -3) add driver filename to FreeBSD/files.i386.cat -4) add entry for the card to FreeBSD/options.i386.cat -5) add support to print type of card to diehl/diehlctl/main.c -6) add support to print type of card to isdnd/support.c, name_of_controller() -7) place your file as named in 3) into directory layer1 -8) add the flag value and function prototypes to layer1/i4b_l1.h -9) add support for NetBSD to layer1/isa_isic.c -10) add support for attach/probe to layer1/i4b_isic.c -11) add card type to machine/i4b_ioctl.h and update CARD_TYPEP_MAX -12) add an entry to the man page man/isic.4 - -Produce diffs (please use context diffs, flag "-c" for diff) and send them in. - - -9. Why it always says "no Space in TX FIFO - State F4 awaiting" ? -================================================================================ - -as I wrote about two weeks ago I had massive problems concerning this -"no space in TX FIFO"-thing, - -/kernel: i4b-L1-ph_data_req: No Space in TX FIFO, state = F4 Awaiting Signal - -Even though I used a correctly recognized Teles S0/16.3 nonpnp isdncard, -nothing worked, errormsgs were flooding the console until I rebooted the box. - -I decided to play around in the BIOS-settings, I first just set them all -to default, which didn't work, and then changed lots of things - unfortunately -I can't remember them. After about hundreds of trial 'n errors I gave up. - -A few days ago I just made another attempt, booted the box and to my surprise -it all worked without the smallest problem, great data rates :) - -I tried hard to found what the something special was I changed in the BIOS -settings, but I just couldnt get isdnd back to its stupid behaviour it -showed all the time before, but I would recommend everybody who has this -kind of problem to look into his BIOS.  - -			(from Meike Aulbach, strange@stoned.rhein-main.de) - - -i4b now works for me, I had a USB-device interfering on IRQ 9, -which was supposed to be only for my Creatix Card. -(NetBSD 1.3, Creatix) -	 -Strange enough, my DOS s0-test worked, are they just polling the card? -	 -Even when the testsoftware under DOS is working, don't be shure, that -your hw-setup is correct for xxx(x)BSD. Triplecheck all your IRQ and -enable and disable PNP to triple-verify. Even unconfigured devices can -block your card. ..... -	 -And that took me more than 2 months to discover :-(((( -	 -			(from Andreas Lohrum, andreas.lohrum@consol.de) - - -when i changed the mainboard of a box that ran i4b alright, i forgot to -set 'used by isa' in the pnp-bios-settings for the irq of my teles -isdn-card. because of that some pci-card got the interrupt that the -isdn-card should have gotten. -i then also got this error: 'No space in TX FIFO'. - -The reason occurred to my rather quick, but i would think, that this would -be a nice hint in a FAQ :) - -			(from Heiko Schaefer, hschaefer@fto.de) - - -after my huge amount of problems, Meike's hint (changing the -ISA/PNP-settings in the BIOS) finally fixed things. -I have only tried out this stuff with my Creatix-card, I'll check -out the PNP-stuff with my Sedlbauer-card soon too though. - -			(from Harold Gutch, logix@foobar.franken.de) - - -10. Incoming alert - what does it mean ? -================================================================================ - -In the log on vty6 (isdnd full screen log) I'm seeing  - -16.07.98 11:42:35 CHD 00001 rwth rate 90 sec/unit (rate) -16.07.98 11:42:35 CHD 00001 rwth dialing from 4191236 to 441291234 -16.07.98 11:42:35 CHD 00001 rwth outgoing call proceeding (ctl 0, ch 0) -16.07.98 11:42:35 CHD 00001 rwth incoming alert  <<<<<<<<<<<<<<< -16.07.98 11:42:35 CHD 00001 rwth outgoing call active (ctl 0, ch 0) - -What does this 'incoming alert' mean? - - -It means that it is "ringing" at the remote end. - - -11. How do i change irq's on my teles 16.3 card ? -================================================================================ - -Question: - -So how do you change irq's on your teles 16.3 card (under FBSD or DOS, -I don't have and don't want to have Windows running on that computer) ? - -Answer: - -The irq is configured into the card each time the driver under whatever -OS you currently boot initializes the card. Thus, change the irq for the -isic driver in your kernel config file to one of the supported (!) irqs -for this card (hint: read "man isic") which is currently unused in your -machine and generate a new kernel. - - diff --git a/share/examples/isdn/Overview b/share/examples/isdn/Overview deleted file mode 100644 index 2f2fc181a81dc..0000000000000 --- a/share/examples/isdn/Overview +++ /dev/null @@ -1,307 +0,0 @@ - -        Short technical overview of isdn4bsd -        ==================================== - -	Copyright (c) 1998 Hellmuth Michaelis. All rights reserved. - -	$Id: Overview,v 1.3 1998/10/27 10:28:54 hm Exp $ - -	Last edit-date: [Tue Oct 27 11:26:03 1998] - -	-hm	starting an overview ... - - -Contents: ---------- -	Functional block diagram -	Layer 1 -	Layer 2 -	Layer 3 -	Debugging control -	Layer 4     -	ISDN protocol trace - - -Functional block diagram -======================== - - isdndebug                         isdnd                             isdntrace - +-------+  +----------------------------------------------------+   +--------+ - |       |  |                                                    |   |        | - |       |  |                                                    |   |        | - +-------+  +----------------------------------------------------+   +--------+ -     |                               |                                    | -     |                               |                                    | -     | /dev/i4bctl    Userland       | /dev/i4b            /dev/i4btrc<n> | -=============================================================================== -     |                Kernel         |                                    | -     |                               |                                    | - +-------+  +----------------------------------------------------+   +--------+ - |       |  |                                                    |   |        | - |i4bctl |  |                       i4b                          |   | i4btrc | - |  (6)  |  |                       (7)                          |   |   (8)  | - | debug |  |     Layer 4 - common call control interface        |   |  ISDN  | - |control|  |                                                    |   | trace  | - +:-:-:--+  +----------------------------------------------------+   +--------+ -  : : :          ^                                          ^              ^  -  : : :     Call |           various ptr arrays             | Call         % -  . . .  Control |             in i4b_l3l4.h                | Control      % -                 V                                          V              % - +----------------------+                       +----------------------+   % - |                      |                       |                      |   % - |       i4bq931        |                  ISDN |     active card      |   % - |         (5)          |                   #####                      |   % - |    Layer 3 (Q.931)   |                   #   |       driver         |   % - |                      |                   #   |                      |   % - +----------------------+                   #   +----------------------+   % -            ^                               #   B +                        % -            |  i4b_l2l3_func function       #   | +   +------------+       % -            |  ptr array in i4b_l2l3.h      #   C +++++    isp     |---->  % -            V                               #   h +   +------------+ IP    % - +----------------------+                   #   a +                Subsys  % - |                      |                   #   n +   +------------+       % - |       i4bq921        |                   #   n +++++    ipr     |---->  % - |         (4)          |                   #   e +   +------------+ IP    % - |    Layer 2 (Q.921)   |                   #   l +                Subsys  % - |                      |                   #     +   +------------+       % - +----------------------+                   #   D +++++  tel/rbch  |---->  % -            ^                               #   a +   +------------+ to    % -            |  i4b_l1l2_func function       #   t +         /dev/i4btel<n> % -            |  ptr array in i4b_l1l2.h      #   a +      or /dev/i4brbch<n>% -            V                               #     +                        % - +----------------------+                   #   +---------------------+    % - |                      |                   #   |                     |    % - |    isic (ISAC part)  |  D-ch trace       #   |   isic (HSCX part)  |B-ch% - |         (2)          |%%%%%%%%%%%%       #   |        (3)          |%%%%% - |    Layer 1 (I.430)   |           %       #   |   non-HDLC / HDLC   |trc % - |                      |           %       #   |                     |    % - +----------------------+           %       #   +---------------------+    % -            ^                       %       #               ^              % - D-channel  |                       %       #    B-channels |              % -            +-----------------------------------------------+              % -            |  function ptr in      %       #                              % -            |  in isic_softc in     %%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -            V  i4b_l1.h                     # - +----------------------+                   # - |                      |                   # - |         isic         |                   # - |         (1)          |                   # - | Card hardware driver |                   # - | for Teles, AVM, USR  |                   # - |                      |                   # - +----------#-----------+                   # -            #                               # -            #                               # -            #                               # -            #                               # -  |=========#===============================#============================| -        ISDN S0 bus - - -Layer 1 -======= - -(1) A driver for a special card hardware consists of a -	- probe routine -	- attach routine -	- FIFO read -	- FIFO write -	- register read -	- register write -   routines. These routines handle the card/manufacturer specific stuff -   required to talk to a particular card. - -   This addresses of the read/write routines are put into a arrays found -   in struct isic_softc and they are later called by the macros: - -   ISAC_READ(r), ISAC_WRITE(r,v), ISAC_RDFIFO(b,s), ISAC_WRFIFO(b,s), -   HSCX_READ(n,r), HSCX_WRITE(n,r,v), HSCX_RDFIFO(n,b,s), HSCX_WRFIFO(n,b,s) - -   (see file layer1/i4b_l1.h) -    -   Files currently used for this purpose are -   	- i4b_avm_a1.c    AVM A1 and AVM Fritz!Card drivers -   	- i4b_ctx_s0P.c   Creatix S0 PnP (experimental!) -   	- i4b_tel_s016.c  Teles S0/16 and clones -   	- i4b_tel_s0163.c Teles S0/16.3 -   	- i4b_tel_s08.c   Teles S0/8 and clones -   	- i4b_tel_s0P.c   Teles S0/16 PnP (experimental!) -   	- i4b_usr_sti.c   3Com USRobotics Sportster - - -(2) The files i4b_isac.c and i4b_isac.h contain the code to control the -    ISAC chip by using the above mentioned macros. - -    Files i4b_l1.c and i4b_l1.h handle stuff used to access layer 1 -    functions from layer 2. - -    Layer 1 and layer 2 access functionality of each other by using -    a well known function pointer array, which contains addresses of -    "primitives" functions which are defined in I.430 and Q.921. The -    function pointer array for layer 1/2 communication is defined in -    file include/i4b_l1l2.h and is initialized i4b_l1.c at the very -    beginning. - -    File i4b_isic.c contains the main code for the "isic" device driver. - -    i4b_l1fsm.c is the heart of layer 1 containing the state machine which -    implements the protocol described in I.430 and the ISAC data book. - - -(3) All above code is used for handling of the D channel, the files -    i4b_bchan.c, i4b_hscx.c and i4b_hscx.h contain the code for handling -    the B-channel, the HSCX is used to interface the userland drivers -    isp, ipr, tel and rbch to one of the B-channels and i4b_hscx.c and -    i4b_hscx.h contain the code to handle it (also by using the above -    mentioned macros). i4b_bchan.c contains various maintenance code for -    interfacing to the upper layers. - - -Layer 2 -======= - -(4) Layer 2 implements the LAPD protocol described in Q.920/Q.921. Layer 2 -    interfaces to layer 1 by the above described function pointer array, -    where layer 1 calls layer 2 functions to provide input to layer 2 and -    layer 2 calls layer 1 functions to feed data to layer 1. - -    The same mechanism is used for layer 2 / layer 3 communication, the -    pointer array interface is defined in include/i4b_l2l3.h ad the array -    is initialized at the very beginning of i4b_l2.c which also contains -    some layer 1 and some layer 3 interface routines. As with l1/l2, the -    l2/l3 array also contains addresses for "primitives" functions which -    are specified in Q.920/Q.921 and Q.931. - -    i4b_l2.h contains the definition of l2_softc_t, which describes the -    complete state of a layer 2 link between the exchange and the local -    terminal equipment. - -    i4b_l2.c contains the entrance of data from layer 1 into the system, -    which is split up in i4b_ph_data_ind() into the 3 classes of layer 2 -    frames called S-frame, I-frame and U-frame. They are handled in files -    i4b_sframe.c, i4b_iframe.c and i4b_uframe.c together with the respective -    routines to send data with each ones frame type. - -    i4b_l2timer.c implements the timers required by Q.921. - -    i4b_tei.c contains the TEI handling routines. - -    i4b_lme.c implements a rudimentary layer management entity. - -    i4b_util.c implements the many utility functions specified -    in Q.921 together wit some misc routines required for overall -    functionality. - -    i4b_mbuf.c handles all (!) requests for mbufs and frees all mbufs used -    by the whole isdn4bsd kernel part. It should probably be moved else- -    where. - -    i4b_l2fsm.c and i4b_l2fsm.h contain the heart of layer 2, the state- -    machine implementing the protocol as specified in Q.921. - -Layer 3 -======= - -(5) i4b_l2if.c and i4b_l4if.c contain the interface routines to communicate -    to layer 2 and layer 4 respectively. - -    i4b_l3timer.c implements the timers required by layer 3. - -    i4b_q931.c and i4b_q931.h implement the message and information element -    decoding of the Q.931 protocol. - -    i4b_q932fac.c and i4b_q932fac.h implement a partial decoding of facility -    messages and/or information elements; the only decoding done here is -    the decoding of AOCD and AOCE, advice of charge during and at end of -    call. - -    As usual, i4b_l3fsm.c and i4b_l3fsm.h contain the state machine required -    to handle the protocol as specified in Q.931. - -    Layer 3 uses a structure defined in include/i4b_l3l4.h to store and -    request information about one particular isdncontroller, it is called -    ctrl_desc_t (controller descriptor). It contains information on the -    state of a controller (controller ready/down and which B channels are -    used or idle) as well as a pointer array used for communication of -    layer 4 with layer 3: layer 3 "knows" the routines to call within -    layer 4 by name, but in case layer 4 has to call layer 3, several -    possibilities exist (i.e. active / passive cards) so it has to call -    the routines which the ISDN controller had put into the the function -    pointer array (N_CONNECT_REQUEST, N_CONNECT_RESPONSE etc) at init time. - -    Layer 3 shares a structure called call_desc_t (call descriptor) with -    layer 4. This structure is used to describe the state of one call. The -    reference to layer 3 is the Q.931 call reference value, the reference to -    layer 4 (and the isdn daemon, isdnd) is the cdid, an unique integer -    value uniquely describing one call, the call descriptor id. -              This structure is used to build an array of this structures -    (call_desc[N_CALL_DESC]), which must be large enough to hold as many -    calls as there are B channels in the system PLUS a reserve to be able -    to handle incoming SETUP messages although all channels are in use. - -    More, this structure contains the so called "link table pointers" -    (isdn_link_t *ilt and drvr_link_t *dlt) which contain function pointers -    to "link" a B-channel (better the addresses of functions each participant -    needs to access each others functionality) after a successful call setup -    to a userland driver (such as isp, ipr, rbch or tel) to exchange user -    data in the desired protocol and format. - -Debugging control -================= - -(6) the device driver for /dev/i4bctl in conjunction with the userland -    program isdndebug(8) is used to set the debug level for each of the -    layers and several other parts of the system, information how to use -    this is contained in machine/i4b_debug.h and all parts of the kernel -    sources. It is only usable for passive cards. - - -Layer 4     -======= - -(7) Layer 4 is "just" an abstraction layer used to shield the differences -    of the various possible Layer 3 interfaces (passive cards based on -    Siemens chip-sets, passive cards based on other chip-sets, active cards -    from different manufacturers using manufacturer-specific interfaces) -    and to provide a uniform interface to the isdnd userland daemon, which -    is used to handle all the required actions to setup and close calls -    and to the necessary retry handling and management functionality. - -    Layer 4 communicates with the userland by using a well defined protocol -    consisting of "messages" sent to userland and which are read(2) by the -    isdnd. The isdnd in turn sends "messages" to the kernel by using the -    ioctl(2) call. This protocol and the required messages for both -    directions are documented in the machine/i4b_ioctl.h file and are -    implemented in files i4b_i4bdrv.c and i4b_l4.c, the latter also -    containing much of the Layer 4 interface to the lower layers. - -    i4b_l4mgmt.c contains all the required routines to manage the above -    mentioned call descriptor id (cdid) in conjunction with the call -    descriptor (array) and the call reference seen from layer 3. - -    i4b_l4timer.c implements a timeout timer for Layer 4. - - -ISDN protocol trace -=================== - -(8) ISDN D-channel protocol trace for layers 2 and 3 is possible by using -    hooks in the ISAC handling routines. - -    In case D-channel trace is enabled, every frame is prepended with a -    header containing further data such as a time stamp and sent via the -    i4btrc driver found in driver/i4b_trace.c to one of the /dev/i4btrc<n> -    devices, where <n> corresponds to a passive controller unit number. - -    If desired, B-channel data can be made available using the same -    mechanism - hooks in the HSCX handler send data up to the i4btrc -    device. - -    The raw data is then read by the isdntrace userland program which -    decodes the layer 2 and/or layer 3 protocol and formats it to be -    easily readable by the user. - -    B-channel data is not interpreted but dumped as a hex-dump. - - -/* EOF */ diff --git a/share/examples/isdn/README b/share/examples/isdn/README deleted file mode 100644 index 6a84fe84eaa1a..0000000000000 --- a/share/examples/isdn/README +++ /dev/null @@ -1,457 +0,0 @@ - - -Note: This is the README from the isdn4bsd 0.70.00 ftp-distribution. Shortly -      after release, i4b was integrated into the FreeBSD sourcetree and so -      the following parts about FreeBSD may not apply anymore.  - -      For information of how isdn4bsd is integrated into FreeBSD now, please -      read the file ROADMAP in this directory. - - --------------------------------------------------------------------------------- - -                                  ISDN4BSD -                                  ======== - -                    beta Version 0.70.00 / December 1998 - -                                 written by: - -			     Hellmuth Michaelis -                               Hallstrasse 20 -                             D-25462 Rellingen - -                           voice: +49 4101 473574 -                            fax: +49 4101 473575 -                             email: hm@kts.org - -                                    ----- - -                          The isdn4bsd package is: - -     Copyright (c) 1997, 1998 by Hellmuth Michaelis. All rights reserved.  - -                      For details see the file LICENSE. - -                                    ----- - -                   ISDN4BSD would not be what it is without -                      the help and support of many people, -                           see file ACKNOWLEDGMENTS ! - -                                    ----- - -        Vote with your wallet: in case you want to buy new ISDN hardware, -          buy it from manufacturers who support the development of i4b, -         for a list of supporters have a look at file ACKNOWLEDGMENTS! - -                                    ----- - -                       This package is postcard-ware: -                       ============================== - -        The license fee for using isdn4bsd is sending a picture postcard -       of your home town. My address can be found at the top of this file. - - --------------------------------------------------------------------------------- - -Contents: ---------- -	1.  Disclaimer -	2.  What is ISDN4BSD ? -        3.  Which BSD's are supported ? -	4.  Which ISDN cards are supported ? -	5.  Where do i find documentation for ISDN4BSD ? -	6.  How do i install ISDN4BSD ? -	7.  Where do i get support for ISDN4BSD ? -	8.  Where do i get commercial support for ISDN4BSD ? -	9.  How can i help and/or support ISDN4BSD ? -	10. How do i report bugs ? -	11. Is there a mailing-list available for ISDN4BSD ? -	12. Where can i get ISDN4BSD ? -	13. What is the reward for reading everything in this file ? - - -1. Disclaimer: --------------- - -  It may be illegal in your country to connect an ISDN4BSD based machine  -  using a passive ISDN card to the ISDN at your site because the protocol  -  stack of ISDN4BSD, which is necessary to run passive cards, has not been  -  approved by the telecommunication certification authority of your country.  -  If in doubt, please contact your local ISDN provider ! - - -  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -  SUCH DAMAGE. - - -2. What is ISDN4BSD ? ---------------------- - -ISDN4BSD (or in short i4b) is a package for interfacing a computer running -FreeBSD, NetBSD or OpenBSD to the ISDN. - -The only ISDN protocol currently supported is the BRI protocol specified in -I.430, Q.921 and Q.931; better known as DSS1 or Euro-ISDN.   - -ISDN4BSD allows you to make IP network connections by using either IP packets -sent in raw HDLC frames on the B channel or by using synchronous PPP.  - -For telephony, ISDN4BSD can answer incoming phone calls like an answering  -machine. - - -3. Which BSD's are supported ? ------------------------------- - -FreeBSD: -	You need FreeBSD 2.2.6 and higher to run i4b out-of-the-box. - -	This is because PnP support is now available in i4b and  -	FreeBSD 2.2.6 was the first version which included PnP support -	in the base OS.  - -	In case you want to install i4b on FreeBSD < 2.2.6, you have to -	patch your system with the PnP patches from Luigi Rizzo (available -	from his home page at http://www.iet.unipi.it/~luigi). - -	The install/uninstall script in the FreeBSD directory was tested -	with 2.2.7 (it should run with 2.2.n, where n >= 6), 3.0-RELEASE -	and 3.0-CURRENT as of Dec 22, 1998. - -	Please take the time to read the file FreeBSD/INSTALLATION (and  -	the other available documentation) carefully. Thank you! - - -NetBSD/i386: - -	Important note for i4b users on NetBSD/i386: -	============================================ - -	While the previous releases of i4b mainly supported the latest -	official releases, this new release now depends on NetBSD-current -	(1.3G or newer). The old stuff is still there, just in case you -	are running an older version, but you need to read the installation -	instructions in NetBSD/INSTALLATION carefully! -	This step was necessary as installation now differs a lot since i4b -	has some prerequisites officially included in -current. - -	--------- - -	The NetBSD specific support and the Diehl driver was written by  -	Martin Husemann, (martin@rumolt.teuto.de). Since i do not intend -	to run NetBSD and/or Diehl cards, i suggest contacting him in  -	case of problems in this two areas.  -	Martin has NetBSD/i386 1.3 running and is supporting ISDN4BSD for -	that platform as his time permits it. - -NetBSD/Amiga: -	The NetBSD/Atari 1.3F specific support was done by Ignatios Souvatzis, -	(is@netbsd.org). - -NetBSD/Atari: -	The NetBSD/Atari 1.3 specific support was done by Leo Weppelman, -	(leo@wau.mis.ah.nl). - -OpenBSD/i386: -	The OpenBSD/i386 2.2 specific support was done by Bas Oude Nijeweme -	(bon@serious.xs4all.nl). He reports that it is also running fine  -	under OpenBSD 2.3. Known to work under OpenBSD is currently the  -	Teles 16.3 and the Teles S0/16, reports for other cards welcome! - -	NOTICE: -	Isdn4bsd version 0.70 has not been tested with OpenBSD at all, -	it would be great to have someone who likes to work on i4b under -	OpenBSD regularly and takes over the maintenance for that OS! - - -4. Which ISDN cards are supported ? ------------------------------------ - -  Type (passive, ISA)	FreeBSD		NetBSD/OpenBSD	Notes -  --------------------- -------		--------------	----------------------- -  AVM A1		full		full -  AVM Fritz!Card	full		full		(Note 1) -  Creatix ISDN-S0/8	full		full		( = Teles S0/8 ) -  Creatix ISDN-S0/16	full		full		( = Teles S0/16 ) -  Dr.Neuhaus Niccy 1008	full		full		( = Teles S0/8 ) -  Dr.Neuhaus Niccy 1016	full		full		( = Teles S0/16 ) -  ITK ix1 micro		full		full		(Note 13) -  Stollmann Tina-pp	full		full -  Teles S0/8		full		full -  Teles S0/16		full		full -  Teles S0/16.3		full		full		(Note 4) -  3Com/USR SportsterInt	full		full		( = Stollmann Tina-pp ) - -  Type (passive, PnP)	FreeBSD		NetBSD/OpenBSD	Notes -  --------------------- -------		--------------	----------------------- -  Asuscom I-IN100-ST-DV experimental	unsupported	( = Dynalink IS64PH ) -  Creatix ISDN-S0 PnP	full		full		(Note 2) -  Dr.Neuhaus Niccy GO@	full		full		(Note 2) -  Dynalink IS64PH	full		full		(Note 11) -  ELSA 1000pro ISA	full		full		(Note 3) -  Sagem Cybermod	full		full		( = Niccy GO@ ) -  Sedlbauer Win Speed	full		full		(Note 9) -  Teles S0 PnP		experimental	full		(Note 5) -  3Com USR PnP internal unsupported	unsupported	(under development) - -  Type (passive, PnP)	FreeBSD		NetBSD/OpenBSD	Notes -  --------------------- -------		--------------	----------------------- -  ELSA 1000pro PCI	full		full - -  Type (passive, PCMCIA)FreeBSD		NetBSD/OpenBSD	Notes -  --------------------- -------		--------------	----------------------- -  AVM Fritz!Card PCMCIA	full		experimental	(Note 10) -  ELSA PCMCIA		unsupported	unsupported	(under development) - -  Type (passive, Amiga)	FreeBSD		NetBSD/OpenBSD	Notes -  --------------------- -------		--------------	----------------------- -  ISDN Blaster		unsupported	experimental	(Note 12, Amiga/NetBSD) -  ISDN Master		unsupported	experimental	(Note 12, Amiga/NetBSD) - -  Type (active)		FreeBSD		NetBSD/OpenBSD	Notes -  --------------------- -------		--------------	----------------------- -  AVM B1		unsupported	unsupported	(Note 6) -  DiehlS,SX,SCOM,QUATRO	unsupported	unsupported	(Note 7) -  Miro P1		unsupported	unsupported	( = Tina-dd ) -  Stollmann Tina-dd	unsupported	unsupported	(Note 8) - - -Note 1:	Only the ISA, non-PnP AVM Fritz!Card is supported; the PnP and PCI -	versions are unsupported! The "Teledat 150" sold by the german -	Telekom seems to be an AVM Fritz!Card. - -Note 2:	FreeBSD -		This is a PnP card. To run it under FreeBSD, you need -		FreeBSD 2.2.6 RELEASE or higher. -	NetBSD -		The NetBSD version has not been verified to work yet. - -Note 3: Due to its design, this card produces 128 IRQs/sec. This can be -	reportedly stopped by disconnecting pin 12 of the 7474 and wiring -	it to pin 15 of the 74175. Be careful! This procedure has not been -	verified and doing this will immediately terminate your warranty !! -	The card will not function anymore with drivers for other OSes and -	you may not get any further support from the manufacturer! YMMV! - -Note 4: Only the 16.3 is supported; the 16.3c and the 16.3 PnP are currently -	unsupported ! - -Note 5: The card has not been verified to work yet. - -Note 6: This driver is currently under development by Gary Jennejohn who -	develops under FreeBSD only. - -Note 7: This driver is currently under construction by Martin Husemann who -	develops under NetBSD only. - -Note 8: This driver is currently under development by Hellmuth Michaelis who -	develops under FreeBSD only. - -Note 9: This driver was developed by German Tischler, tanis@gaspode.franken.de. -	Please contact him in case of trouble. The "Teledat 100" sold by the  -	german Telekom is identical with this card. -	 -Note 10: This driver is developed by Matthias Apitz, matthias.apitz@sisis.de. -	FreeBSD -		Please contact him in case of trouble. -		Please read the file README.PCCARD in the i4b distribution for -		additional installation instructions. -	NetBSD -		Experimental driver support by Martin Husemann. - -Note 11: This driver was developed by Martijn Plak (tigrfhur@xs4all.nl) -	Please contact him in case of trouble. This driver might also work  -	for Asuscom cards. (Andrew Gordon wrote: Just to let you know that -	I've now tried the i4b "dynalink" driver with the ASUSCOM  -	I-IN100-ST-DV card, and it appears to work fine.) - -Note 12: This driver was developed by Ignatios Souvatzis (is@netbsd.org) -	Please contact him in case of trouble. -	This driver is supposed to work on the ISDN Master versions and -	lookalikes, like the ISDN Blaster. - -Note 13: This driver was developed by Martin Husemann under NetBSD and has -	not been tested under FreeBSD yet. Feedback welcome! - - -5. Where do i find documentation for ISDN4BSD ? ------------------------------------------------ - -- For installation instructions have a look under the the FreeBSD, NetBSD -  and OpenBSD directories, each of these contains a file "INSTALLATION" -  which describes the installation procedure for isdn4bsd on those operating -  systems. - -- Every program has a man page in the respective subdirectory and every  -  driver has a man page in the "man" subdirectory. All the man pages are  -  installed by running "make install" so its very easy to access them -  (hint: try "apropos isdn4bsd" after you installed isdn4bsd, it displays -   all available manual pages). - -- misc/Overview contains a short technical overview of the inner workings  -  of isdn4bsd. - -- misc/Resources contains URL's and ISBN's to more interesting ISDN related -  stuff. - -- handbook/i4b.ps is the start of a handbook for isdn4bsd. - - -6. How do i install ISDN4BSD ? ------------------------------- - -Read the instructions in the file {FreeBSD|NetBSD|OpenBSD}/INSTALLATION.  - -In case they are incomplete, unclear, wrong or outdated, please send me an  -update for inclusion into a future distribution! - - -7. Where do i get support for ISDN4BSD ? ----------------------------------------- - -I will support and help with ISDN4BSD as my time permits it. Please  -keep in mind that in this case support is given on a voluntary basis -and your questions might not be answered immediately. - -Also, i recommend subscribing to the mailing list mentioned below. - -Due to the experience gained supporting the predecessor of ISDN4BSD, let -me please clearly state that there is no guarantee that your bug will be -fixed within some specific amount of time, in fact there is no guarantee  -that your bug will be fixed at all; i'll do my best but there might be -more important things going on in my life than giving free support for -ISDN4BSD. Some bugs seem to occur only in certain environments and are -not reproduceable here without access to the equipment you are connected -to or other equipment like ISDN simulators (which i don't get access to -for free): in this case you are the only person being able to trace down -the bug and fix it. - - -8.  Where do i get commercial support for ISDN4BSD ? ----------------------------------------------------- - -In case you want to pay for support, maintenance, enhancements, extensions -to isdn4bsd or whatever else you may need, it is possible to hire me for -reasonable rates through my employer HCS GmbH; in this case please contact  -me for details at hm@hcs.de or look at http://www.freebsd-support.de. - - -9. How can i help and/or support ISDN4BSD ? -------------------------------------------- - -I would really like to hear from you! (even if it runs out of the box :-) - -I'm open for suggestions, bugreports, fixes, patches, enhancements and  -comments to improve ISDN4BSD.  - -Please send flames to /dev/null and/or start writing your own ISDN package. - -ISDN4BSD is a project on a voluntary basis and writing and supporting -communication systems like ISDN4BSD costs much money and much time. - -Any contribution in terms of equipment, cards, documentation, cash -and/or daytime payed work on ISDN4BSD would be highly appreciated. - -You can help by not only reporting bugs, but by sending in a patch for -the problem together with a bugreport. - -In case you cannot fix something yourself, please describe your problem -as detailed as possible, include information which version of an operating -system you are running, which ISDN board you are using, to which kind -of ISDN equipment (like the brand of PBX) you are connected etc. etc. - -In case you want to get a currently unsupported card supported, write a -low level driver for it yourself and submit it. In case you can't write -it yourself there is a good chance to get it supported if you can donate -one of those cards and - if at all possible - docs for it. - - -10. How do i report bugs ? --------------------------- - -Please submit patches ONLY as context diffs (diff -c)! - -I vastly prefer receiving bug fixes and enhancements that are clearly -differentiated. I don't always know what to do with large patches that -contain many bugs and enhances folded into the same context diffs.  - -Please keep it to one fix or enhancement per patch! - -If your change modifies the external interface of an ISDN4BSD program, -i.e. more config options, command-line switches, new programs, etc.,  -then please also include patches for the manual pages and documentation. - -Thank you! - - -11. Is there a mailing-list available for ISDN4BSD ? ---------------------------------------------------- - -There is a mailing list available at - -        freebsd-isdn@freebsd.org - -The list is maintained by majordomo, so i.e. to subscribe, -send a mail with the text - -        subscribe freebsd-isdn -         -in the message body sent to - -        majordomo@freebsd.org - -This mailing list is NOT (!) FreeBSD specific, everyone is welcome there! - - -12. Where can i get ISDN4BSD ? ------------------------------- - -The ISDN4BSD package is available from: - -	isdn4bsd@ftp.consol.de/pub -	-------------------------- - -you have to log in as user - -	isdn4bsd -	-------- - -and give your mail address as the password. Then change to the "pub"  -directory. You will find the latest available ISDN4BSD package. - -Anonymous ftp as user "ftp" or "anonymous" will NOT (!) give the desired -result ! - -This is a sample session: - -	$ ftp ftp.consol.de -	Connected to stage.consol.de. -	220 ProFTPD 1.0.0 Server (ConSol* Data Exchange) [stage] -	Name (ftp.consol.de:root): isdn4bsd -	331 Anonymous login ok, send your complete e-mail address as password. -	Password: -	230 Anonymous access granted, restrictions apply. -	Remote system type is UNIX. -	Using binary mode to transfer files. -	ftp> cd pub -	250 CWD command successful. -	ftp> - - -13. What is the reward for reading everything in this file ? ------------------------------------------------------------- - -Have fun! -hellmuth diff --git a/share/examples/isdn/ROADMAP b/share/examples/isdn/ROADMAP deleted file mode 100644 index 54f6721b5fb85..0000000000000 --- a/share/examples/isdn/ROADMAP +++ /dev/null @@ -1,75 +0,0 @@ - -	Roadmap of isdn4bsd as integrated into FreeBSD -	============================================== - -	$Id:$ - -	last edit-date: [Mon Jan 18 14:47:09 1999] - - -1.	Documentation ---------------------- - -	The command "apropos isdn" will list all manpages available for  -	isdn4bsd. Two more manual pages of interest to syncronous PPP  -	over ISDN users are the pages for sppp and spppcontrol. - -	Under directory /usr/share/examples/isdn, you will find: - -	FAQ		- isdn4bsd Frequently Asked Questions -	Overview	- short technical overview (a bit outdated) -	README		- the original isdn4bsd README file -	ROADMAP		- this file -	Resources	- some more information about ISDN -	isdnd_acct	- perl script to produce accounting reports - - -2.	Configuration ---------------------- - -	Configuration of the isdn4bsd package consists of: - -	- configuring a kernel suitable for running isdn4bsd. An -	  example kernel configuration can be found in the file -	  /usr/src/sys/i386/conf/LINT. The options available for -	  isic device driver in the kernel configuration file are -	  described in the output of "man isic". - -	- configuring the network interfaces iprX and/or ispX; the -	  former are used for "IP over raw HDLC" and the latter are -	  used for "sync PPP over ISDN". To configure the ipr- -	  interfaces, read the output of "man i4bipr", to configure -	  the isp-interfaces, read the output of "man i4bisppp", -	  "man sppp" and "man spppcontrol" carefully. -	  Most of this configuration is now available thru the ISDN -	  and spppcontrol sections in /etc/rc.conf. - -	- writing a configuration file /etc/isdn/isdnd.rc for the -	  isdn daemon isdnd(8) which is responsible for the ISDN -	  call control mechanisms such as: dial on demand, dial -	  retry, dial recovery, timeout and short hold operation. -	  A sample (!) file can be found in /etc/isdn. Please read -	  the output of "man isdnd" and "man isdnd.rc" carefully. - - -2.	Userland programs -------------------------- - -	The userland programs can be found in the sourcetree under -	/usr/src/usr.sbin/i4b and get installed under /usr/sbin. - -	Isdntest will not be installed by default. - - -3.	Kernel part -------------------- - -	The kernel part of isdn4bsd can be found at /usr/src/sys/i4b. - - -4.	Answering machine messages ----------------------------------- - -	Messages to be used by the answering machine can be found in -	/usr/share/isdn, you'll find the numbers 0 to 9, a beep and -	a short announcement message here. diff --git a/share/examples/isdn/Resources b/share/examples/isdn/Resources deleted file mode 100644 index 97296d2325319..0000000000000 --- a/share/examples/isdn/Resources +++ /dev/null @@ -1,90 +0,0 @@ - -Doku: Anwahl von T-Offline mittels i4b und FreeBSD (german) -=========================================================== - -	http://www.de.freebsd.org/de/i4b-t-error.html - - -ISDN Information: -================= - -	http://www.alumni.caltech.edu/~dank/isdn/ - - -ITU Standards: -============== - -	http://www-library.itsi.disa.mil/org/ituccitt.html -	ftp://ftp.leo.org/pub/comp/doc/standards/itu - - -SunShine Project - Implementation of the ISDN recommendations Q.921 & Q.931 -=========================================================================== - -	http://www.tcm.hut.fi/~bos/ISDN/sunshine/SunShine.html - - -CAPI 2.0 documentation -====================== - -	http://www.capi.org - - -Siemens ISDN chips Databooks (ISAC/HSCX) -======================================== - -	general: -	-------- -	http://w2.siemens.de/semiconductor/products/ICs/33/33.htm -	http://www.smi.siemens.com/applications/comm/isdnte/index.html - -	ISAC: -	----- -	http://w2.siemens.de/semiconductor/products/ICs/33/isac_ste/iste_11m.pdf -	http://www.smi.siemens.com/pdf/comm/peb2085_6um.pdf -	http://www.smi.siemens.com/pdf/comm/psb2186um.pdf - -	HSCX: -	----- -	http://w2.siemens.de/semiconductor/products/ICs/33/hscx/sab82525.pdf -	http://www.smi.siemens.com/pdf/comm/SAB82526_5.pdf -	http://www.smi.siemens.com/pdf/comm/psb21525um.pdf - - -CD's: -===== -	The Infomagic Standards CDROM: -	http://www.infomagic.com/catalog5.htm#standards - -Books: -====== - -	"ISDN: concepts, facilities and services", -		Gary C. Kessler, McGraw-Hill 1993, -		ISBN 0-07-034247-4 -	 -	"Integrated services digital networks: architectures, protocols, standards", -		Herman J. Helgert, Addison-Wesley 1991, -		ISBN 0-201-52501-1 -	 -	"ISDN and Broadband ISDN with Frame Relay and ATM", -		William Stallings, Prentice Hall 1995, -		ISBN 0-02-415513-6 - -	"Technik der Netze", -		Gerd Siegmund, R. v. Decker's Verlag 1996, -		ISBN 3-7685-2495-7 -	 -	"Euro-ISDN fuer Anwender und Techniker" -		Reinhard Heermeyer und Maria Spath, Festo DIDACTIC 1996, -		ISBN 3-8127-4334-5 - -	"ISDN implementors guide: standards, protocols & services", -		Charles K. Summers, McGraw-Hill 1995, -		ISBN 0-07-069416-8 -	 -	"PPP Design and Debugging", -		James Carlson, Addison-Wesley 1998, -		ISBN 0-0201-18539-3 - --- EOF ----------------------------------------------------------------------- diff --git a/share/examples/isdn/isdnd_acct b/share/examples/isdn/isdnd_acct deleted file mode 100644 index faefaa55f85b7..0000000000000 --- a/share/examples/isdn/isdnd_acct +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/perl -#--------------------------------------------------------------------------- -# -# Copyright (c) 1996, 1998 Hellmuth Michaelis. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. - -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -#--------------------------------------------------------------------------- -# -#	accounting report script for the isdnd daemon accounting info -#	------------------------------------------------------------- -# -#	$Id: isdnd_acct,v 1.1 1998/01/23 13:38:53 hm Exp $ -# -#	last edit-date: [Mon Jan 18 14:08:10 1999] -# -#--------------------------------------------------------------------------- - -# where the isdnd accounting file resides -$ACCT_FILE = "/var/log/isdnd.acct"; - -# the charge for a unit, currently 0,12 DM -$UNIT_PRICE = 0.12; - -# open accounting file -open(IN, $ACCT_FILE) || -	die "ERROR, cannot open $ACCT_FILE !\n"; - -# set first thru flag -$first = 1; - -# process file line by line -while (<IN>) -{ -	# remove ( and ) from length and bytecounts -	tr/()//d; - -	# split line into pieces -	($from_d, $from_h, $dash, $to_d, $to_h, $name, $units, $secs, $byte) -		= split(/ /, $_); - -	# get starting date -	if($first) -	{ -		$from = "$from_d $from_h"; -		$first = 0; -	} -		 -	# split bytecount -	($inb, $outb) = split(/\//, $byte); - -	# process fields -	$a_secs{$name} += $secs; -	$a_calls{$name}++; -	$a_units{$name} += $units; -	$a_charge{$name} += $units * $UNIT_PRICE; -	$a_inbytes{$name} += $inb; -	$a_outbytes{$name} += $outb; -	$a_bytes{$name} = $a_bytes{$name} + $inb + $outb; -} - -# close accouting file -close(IN); - -# write header -print "\n"; -print "     ISDN Accounting Report   ($from -> $to_d $to_h)\n"; -print "     ==================================================================\n"; - -#write the sum for each interface/name -foreach $name (sort(keys %a_secs)) -{ -	$o_secs = $a_secs{$name}; -	$gt_secs += $o_secs; -	$o_calls = $a_calls{$name}; -	$gt_calls += $o_calls; -	$o_units = $a_units{$name}; -	$gt_units += $o_units; -	$o_charge = $a_charge{$name}; -	$gt_charge += $o_charge; -	$o_inbytes = $a_inbytes{$name}; -	$gt_inbytes += $o_inbytes; -	$o_outbytes = $a_outbytes{$name}; -	$gt_outbytes += $o_outbytes; -	$o_bytes = $a_bytes{$name}; -	$gt_bytes += $o_bytes; -	write; -} - -$o_secs = $gt_secs; -$o_calls = $gt_calls; -$o_units = $gt_units; -$o_charge = $gt_charge; -$o_inbytes = $gt_inbytes; -$o_outbytes = $gt_outbytes; -$o_bytes = $gt_bytes; -$name = "Total"; - -print "======= ====== ===== ===== ======== ============ ============ ============\n"; -write; - -print "\n\n"; -exit; - -# top of page header -format top = - -Name    charge units calls     secs      inbytes     outbytes        bytes -------- ------ ----- ----- -------- ------------ ------------ ------------ -. - -# record template -format STDOUT = -@<<<<<< @##.## @#### @#### @####### @########### @########### @########### -$name,  $o_charge, $o_units, $o_calls, $o_secs, $o_inbytes, $o_outbytes, $o_bytes -. - -# EOF diff --git a/share/examples/kld/Makefile b/share/examples/kld/Makefile deleted file mode 100644 index 68504bdbeb847..0000000000000 --- a/share/examples/kld/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# 08 Nov 1998 -# -# Makefile for sample programs for kld modules package -# -# 08 Nov 1998	Rajesh Vaidheeswarran - adapted from lkm Makefile -# -# Copyright (c) 1998 Rajesh Vaidheeswarran -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -#    must display the following acknowledgement: -#      This product includes software developed by Rajesh Vaidheeswarran. -# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote -#    products derived from this software without specific prior written -#    permission. -# -# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE RAJESH VAIDHEESWARRAN BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# Copyright (c) 1993 Terrence R. Lambert. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -#    must display the following acknowledgement: -#      This product includes software developed by Terrence R. Lambert. -# 4. The name Terrence R. Lambert may not be used to endorse or promote -#    products derived from this software without specific prior written -#    permission. -# -# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# - -SUBDIR=	cdev syscall - -.include <bsd.subdir.mk> diff --git a/share/examples/kld/cdev/Makefile b/share/examples/kld/cdev/Makefile deleted file mode 100644 index 8acbdf991feae..0000000000000 --- a/share/examples/kld/cdev/Makefile +++ /dev/null @@ -1,74 +0,0 @@ -# 08 Nov 1998 -# -# Makefile for sample kld device driver.. -# -#  May 93	Rajesh Vaidheeswarran -# -# Copyright (c) 1998 Rajesh Vaidheeswarran -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -#    must display the following acknowledgement: -#      This product includes software developed by Rajesh Vaidheeswarran. -# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote -#    products derived from this software without specific prior written -#    permission. -# -# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE RAJESH VAIDHEESWARRAN BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# Copyright (c) 1993 Terrence R. Lambert. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -#    must display the following acknowledgement: -#      This product includes software developed by Terrence R. Lambert. -# 4. The name Terrence R. Lambert may not be used to endorse or promote -#    products derived from this software without specific prior written -#    permission. -# -# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# - -SUBDIR=	module test - -load: _SUBDIRUSE - -unload: _SUBDIRUSE - -.include <bsd.subdir.mk> diff --git a/share/examples/kld/cdev/README b/share/examples/kld/cdev/README deleted file mode 100644 index 2f1114c6bf365..0000000000000 --- a/share/examples/kld/cdev/README +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) 1998 Rajesh Vaidheeswarran -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -#    must display the following acknowledgement: -#      This product includes software developed by Rajesh Vaidheeswarran -# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote -#    products derived from this software without specific prior written -#    permission. -# -# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE RAJESH VAIDHEESWARRAN BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# Copyright (c) 1993 Terrence R. Lambert. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -#    must display the following acknowledgement: -#      This product includes software developed by Terrence R. Lambert. -# 4. The name Terrence R. Lambert may not be used to endorse or promote -#    products derived from this software without specific prior written -#    permission. -# -# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# - -1.0	Overview - -	This is the README file for the sample kld module -	that mimics a character device driver. - -	A kld module may be used to load any data or -	program into the kernel that can be made available by -	modifying a table, pointer, or other kernel data to inform -	the kernel that the module should be used instead of the -	previous code/data path. - -	Generally, it is assumed that a loadable module is one of -	a set of similar modules (such as a file system or console -	terminal emulation), and that the reference is through a -	table (such as vfssw[]), and that a "special" value is -	assigned to the slots which are allowed to be replaced. -	This is not enforced, so you may use the kld module  -	any way you see fit. - -	As with the loadable system calls, it may be desirable to -	allow the module loader to replace an *existing* entry to -	try out changes to kernel code without rebuilding and -	booting from the new kernel. - - -2.0	Directions - -	To test the module, do the following: - -		cd module -		make load - -	A load message (the copyright) will be printed on the console. - -		cd ../test -		make load - -	The system call prints a message on the console when called. -	This message will be printed when running "make load" in -	the "test" subdirectory. - - -3.0	Recovering resources - -	The module consumes memory when loaded; it can be freed up by -	unloading it.  To unload it, type the following from the directory -	this file is in: - -		cd module -		make unload - -	The miscellaneous module will be unloaded by name. - - -4.0	END OF DOCUMENT diff --git a/share/examples/kld/cdev/module/Makefile b/share/examples/kld/cdev/module/Makefile deleted file mode 100644 index aa07686853d25..0000000000000 --- a/share/examples/kld/cdev/module/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -# 08 Nov 1998 -# -# Makefile for kld char device driver. -# -# 08 Nov 1998 Rajesh Vaidheeswarran -# -# Copyright (c) 1998 Rajesh Vaidheeswarran -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -#    must display the following acknowledgement: -#      This product includes software developed by Rajesh Vaidheeswarran. -# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote -#    products derived from this software without specific prior written -#    permission. -# -# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE RAJESH VAIDHEESWARRAN BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# $Id: Makefile,v 1.5 1998/11/08 22:31:00 rv Exp $ -# -# Copyright (c) 1993 Terrence R. Lambert. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -#    must display the following acknowledgement: -#      This product includes software developed by Terrence R. Lambert. -# 4. The name Terrence R. Lambert may not be used to endorse or promote -#    products derived from this software without specific prior written -#    permission. -# -# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# - -BINDIR	= /tmp -SRCS	= cdev.c cdevmod.c -KMOD	= cdev_mod -NOMAN	= t -KLDMOD	= t - -KLDLOAD		= /sbin/kldload -KLDUNLOAD	= /sbin/kldunload - -CLEANFILES+= ${KMOD} - -load: /dev/cdev -	${KLDLOAD} -v ./${KMOD} - -unload: -	rm -f /dev/cdev -	${KLDUNLOAD} -v -n ${KMOD} - -/dev/cdev: -	mknod /dev/cdev c 32 0 - -.include <bsd.kmod.mk> diff --git a/share/examples/kld/cdev/module/cdev.c b/share/examples/kld/cdev/module/cdev.c deleted file mode 100644 index 4c9e1397d26bb..0000000000000 --- a/share/examples/kld/cdev/module/cdev.c +++ /dev/null @@ -1,124 +0,0 @@ -/* 08 Nov 1998*/ -/* - * cdev.c - * - * 08 Nov 1998	Rajesh Vaidheeswarran - * - * Copyright (c) 1998 Rajesh Vaidheeswarran - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *    must display the following acknowledgement: - *      This product includes software developed by Rajesh Vaidheeswarran. - * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote - *    products derived from this software without specific prior written - *    permission. - * - * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE RAJESH VAIDHEESWARRAN BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * -  * Copyright (c) 1993 Terrence R. Lambert. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *    must display the following acknowledgement: - *      This product includes software developed by Terrence R. Lambert. - * 4. The name Terrence R. Lambert may not be used to endorse or promote - *    products derived from this software without specific prior written - *    permission. - * - * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/ioccom.h> -#include "cdev.h" - -/* - * This is the actual code for the system call... it can't be static because - * it is exported to another part of the module... the only place it needs - * to be referenced is the sysent we are interested in. - * - * To write your own system call using this as a template, you could strip - * out this code and use the rest as a prototype module, changing only the - * function names and the number of arguments to the call in the module - * specific "sysent". - * - * You would have to use the "-R" option of "ld" to ensure a linkable file - * if you were to do this, since you would need to combine multiple ".o" - * files into a single ".o" file for use by "modload". - */ - -#define CDEV_IOCTL1         _IOR('C', 1, u_int) - -int -mydev_open(dev_t dev, int flag, int otyp, struct proc *procp) -{ -    printf("mydev_open: dev_t=%d, flag=%x, otyp=%x, procp=%p\n", -	   dev, flag, otyp, procp); -    return (0); -} - -int -mydev_close(dev_t dev, int flag, int otyp, struct proc *procp) -{ -    printf("mydev_close: dev_t=%d, flag=%x, otyp=%x, procp=%p\n", -	      dev, flag, otyp, procp); -    return (0); -} - -int -mydev_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc *procp) -{ -    int error = 0; - -    printf("mydev_ioctl: dev_t=%d, cmd=%lx, arg=%p, mode=%x procp=%p\n", -	   dev, cmd, arg, mode, procp); - -    switch(cmd) { -    case CDEV_IOCTL1: -	printf("you called mydev_ioctl CDEV_IOCTL1\n"); -	break; -    default: -	printf("No such ioctl for me!\n"); -	error = EINVAL; -	break; -    } -    return error; -} diff --git a/share/examples/kld/cdev/module/cdev.h b/share/examples/kld/cdev/module/cdev.h deleted file mode 100644 index ae07c342e65d6..0000000000000 --- a/share/examples/kld/cdev/module/cdev.h +++ /dev/null @@ -1,98 +0,0 @@ -/* 08 Nov 1998*/ -/* - * cdev.h - header for sample kld module implementing a character device - *          driver. - * - * 08 Nov 1998  Rajesh Vaidheeswarran - * - * Copyright (c) 1998 Rajesh Vaidheeswarran - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *    must display the following acknowledgement: - *      This product includes software developed by Rajesh Vaidheeswarran. - * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote - *    products derived from this software without specific prior written - *    permission. - * - * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE RAJESH VAIDHEESWARRAN BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Copyright (c) 1993 Terrence R. Lambert. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *    must display the following acknowledgement: - *      This product includes software developed by Terrence R. Lambert. - * 4. The name Terrence R. Lambert may not be used to endorse or promote - *    products derived from this software without specific prior written - *    permission. - * - * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#ifndef __CDEV_H_ -#define __CDEV_H_ - -#include <sys/conf.h> - -d_open_t mydev_open; -d_close_t mydev_close; -d_ioctl_t mydev_ioctl; - -#define CDEV_MAJOR 32 - -static struct cdevsw my_devsw = { -    mydev_open, -    mydev_close, -    noread, -    nowrite, -    mydev_ioctl, -    nostop, -    nullreset, -    nodevtotty, -    NULL, -    nommap, -    NULL, -    "cdev", -    NULL, -    CDEV_MAJOR -}; - -#endif  diff --git a/share/examples/kld/cdev/module/cdevmod.c b/share/examples/kld/cdev/module/cdevmod.c deleted file mode 100644 index f8440924c2e4b..0000000000000 --- a/share/examples/kld/cdev/module/cdevmod.c +++ /dev/null @@ -1,122 +0,0 @@ -/* 08 Nov 1998*/ -/* - * cdevmod.c - a sample kld module implementing a character device driver. - * - * 08 Nov 1998  Rajesh Vaidheeswarran - * - * Copyright (c) 1998 Rajesh Vaidheeswarran - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *    must display the following acknowledgement: - *      This product includes software developed by Rajesh Vaidheeswarran. - * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote - *    products derived from this software without specific prior written - *    permission. - * - * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE RAJESH VAIDHEESWARRAN BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Copyright (c) 1993 Terrence R. Lambert. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *    must display the following acknowledgement: - *      This product includes software developed by Terrence R. Lambert. - * 4. The name Terrence R. Lambert may not be used to endorse or promote - *    products derived from this software without specific prior written - *    permission. - * - * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/module.h> - -#include "cdev.h" - -static int cdev_load(module_t,   modeventtype_t, void *); - -/* - * This function is called each time the module is loaded or unloaded. - * Since we are a miscellaneous module, we have to provide whatever - * code is necessary to patch ourselves into the area we are being - * loaded to change. - * - * The stat information is basically common to all modules, so there - * is no real issue involved with stat; we will leave it lkm_nullcmd(), - * since we don't have to do anything about it. - */ - -static int -cdev_load(mod, cmd, arg) -    module_t	mod; -    modeventtype_t cmd; -    void * arg; -{ -    int  err = 0; - -    switch (cmd) { -    case MOD_LOAD: -	 -	/* Do any initialization that you should do with the kernel */ -	 -	/* if we make it to here, print copyright on console*/ -	printf("\nSample Loaded kld character device driver\n"); -	printf("Copyright (c) 1998\n"); -	printf("Rajesh Vaidheeswarran\n"); -	printf("All rights reserved\n"); -	break;		/* Success*/ - -    case MOD_UNLOAD: -	printf("Unloaded kld character device driver\n"); -	break;		/* Success*/ - -    default:	/* we only understand load/unload*/ -	err = EINVAL; -	break; -    } - -    return(err); -} - -/* Now declare the module to the system */ - -CDEV_MODULE(cdev_mod, CDEV_MAJOR, my_devsw, cdev_load, 0); diff --git a/share/examples/kld/cdev/test/Makefile b/share/examples/kld/cdev/test/Makefile deleted file mode 100644 index fa3f9f83a267b..0000000000000 --- a/share/examples/kld/cdev/test/Makefile +++ /dev/null @@ -1,92 +0,0 @@ -# 05 Jun 93 -# -# Makefile for testmisc -# -# 05 Jun 93	Rajesh Vaidheeswarran		Original -# -# Copyright (c) 1993 Rajesh Vaidheeswarran. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -#    must display the following acknowledgement: -#      This product includes software developed by Rajesh Vaidheeswarran. -# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote -#    products derived from this software without specific prior written -#    permission. -# -# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE RAJESH VAIDHEESWARRAN BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# Copyright (c) 1993 Terrence R. Lambert. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -#    notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -#    notice, this list of conditions and the following disclaimer in the -#    documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -#    must display the following acknowledgement: -#      This product includes software developed by Terrence R. Lambert. -# 4. The name Terrence R. Lambert may not be used to endorse or promote -#    products derived from this software without specific prior written -#    permission. -# -# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED.  IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# -# $Id: Makefile,v 1.5 1997/02/22 13:55:56 peter Exp $ -# -PROG=	testcdev -NOMAN= - -MODSTAT= /sbin/kldstat - -load: -	@echo "This test program will call the sample kld characer device "; -	@echo "driver." -	@echo -	@echo "The sample driver will display a message on the" -	@echo "system console each time an ioctl is sent to it." -	@echo -	@echo -	@echo -	@./testcdev - -unload: -	@echo "This test program will cause an error if the driver" -	@echo "has been successfully unloaded by building 'unload' in" -	@echo "the 'module' subdirectory." -	@echo -	${MODSTAT} -n misc_mod - -.include <bsd.prog.mk> diff --git a/share/examples/kld/cdev/test/testcdev.c b/share/examples/kld/cdev/test/testcdev.c deleted file mode 100644 index c1aeeba3889cf..0000000000000 --- a/share/examples/kld/cdev/test/testcdev.c +++ /dev/null @@ -1,95 +0,0 @@ -/* 08 Nov 1998*/ -/* - * testmisc.c - * - * Test program to call the sample loaded kld device driver. - * - * 05 Jun 93	Rajesh Vaidheeswarran		Original - * - * - * Copyright (c) 1993 Rajesh Vaidheeswarran. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *    must display the following acknowledgement: - *      This product includes software developed by Rajesh Vaidheeswarran. - * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote - *    products derived from this software without specific prior written - *    permission. - * - * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE RAJESH VAIDHEESWARRAN BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Copyright (c) 1993 Terrence R. Lambert. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *    must display the following acknowledgement: - *      This product includes software developed by Terrence R. Lambert. - * 4. The name Terrence R. Lambert may not be used to endorse or promote - *    products derived from this software without specific prior written - *    permission. - * - * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE TERRENCE R. LAMBERT BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ -#include <stdio.h> -#include <fcntl.h> -#include <sys/ioccom.h> - -#define CDEV_IOCTL1     _IOR('C', 1, u_int) -#define CDEV_DEVICE	"cdev" -int -main() -{ -    int kernel_fd; -    int one; - -    if ((kernel_fd = open("/dev/" CDEV_DEVICE, O_RDONLY)) == -1) { -	perror("/dev/" CDEV_DEVICE); -	exit(1); -    } - -    /* Send ioctl */ -    if (ioctl(kernel_fd, CDEV_IOCTL1, &one) == -1) { -	perror("CDEV_IOCTL1"); -    } else { -	printf( "Sent ioctl CDEV_IOCTL1 to device /dev/" CDEV_DEVICE "\n"); -    } -    exit(0); -} diff --git a/share/examples/kld/syscall/Makefile b/share/examples/kld/syscall/Makefile deleted file mode 100644 index 7ea17df276386..0000000000000 --- a/share/examples/kld/syscall/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# Makefile for sample syscall module - -SUBDIR=	module test - -load: _SUBDIRUSE - -unload: _SUBDIRUSE - -.include <bsd.subdir.mk> diff --git a/share/examples/kld/syscall/module/Makefile b/share/examples/kld/syscall/module/Makefile deleted file mode 100644 index 44406f429f3c6..0000000000000 --- a/share/examples/kld/syscall/module/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Makefile for building the sample syscall module - -SRCS	= syscall.c -KMOD	= syscall -KO	= ${KMOD}.ko -KLDMOD	= t - -KLDLOAD		= /sbin/kldload -KLDUNLOAD	= /sbin/kldunload - -load: ${KO} -	${KLDLOAD} -v ./${KO} - -unload: ${KO} -	${KLDUNLOAD} -v -n ${KO} - -.include <bsd.kmod.mk> diff --git a/share/examples/kld/syscall/module/syscall.c b/share/examples/kld/syscall/module/syscall.c deleted file mode 100644 index 1bfb4823fd8c0..0000000000000 --- a/share/examples/kld/syscall/module/syscall.c +++ /dev/null @@ -1,86 +0,0 @@ -/*- - * Copyright (c) 1999 Assar Westerlund - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - *     $Id$ - */ - -#include <sys/types.h> -#include <sys/param.h> -#include <sys/proc.h> -#include <sys/module.h> -#include <sys/sysent.h> -#include <sys/kernel.h> -#include <sys/systm.h> - -/* - * The function for implementing the syscall. - */ - -static int -hello (struct proc *p, void *arg) -{ -	printf ("hello kernel\n"); -	return 0; -} - -/* - * The `sysent' for the new syscall - */ - -static struct sysent hello_sysent = { -	0,			/* sy_narg */ -	hello			/* sy_call */ -}; - -/* - * The offset in sysent where the syscall is allocated. - */ - -static int offset = NO_SYSCALL; - -/* - * The function called at load/unload. - */ - -static int -load (struct module *module, int cmd, void *arg) -{ -	int error = 0; - -	switch (cmd) { -	case MOD_LOAD : -		printf ("syscall loaded at %d\n", offset); -		break; -	case MOD_UNLOAD : -		printf ("syscall unloaded from %d\n", offset); -		break; -	default : -		error = EINVAL; -		break; -	} -	return error; -} - -SYSCALL_MODULE(syscall, &offset, &hello_sysent, load, NULL); diff --git a/share/examples/kld/syscall/test/Makefile b/share/examples/kld/syscall/test/Makefile deleted file mode 100644 index 5968689e31de2..0000000000000 --- a/share/examples/kld/syscall/test/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# Makefile for simple caller of syscall - -PROG  = call -NOMAN = noman - -.include <bsd.prog.mk> diff --git a/share/examples/kld/syscall/test/call.c b/share/examples/kld/syscall/test/call.c deleted file mode 100644 index 0e4b70e1fa60a..0000000000000 --- a/share/examples/kld/syscall/test/call.c +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * Copyright (c) 1999 Assar Westerlund - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - *     $Id: call.c,v 1.1 1999/01/09 14:26:22 dfr Exp $ - */ - -#include <stdio.h> -#include <sys/syscall.h> -#include <sys/types.h> -#include <sys/module.h> - -static void usage (void); - -static void -usage (void) -{ -	fprintf (stderr, "call syscall-number\n"); -	exit (1); -} - -int -main(int argc, char **argv) -{ -	char *endptr; -	int syscall_num; -	struct module_stat stat; - -	stat.version = sizeof(stat); -	modstat(modfind("syscall"), &stat); -	syscall_num = stat.data.intval; -	return syscall (syscall_num); -} diff --git a/share/examples/portal/README b/share/examples/portal/README deleted file mode 100644 index f3a26909d3f63..0000000000000 --- a/share/examples/portal/README +++ /dev/null @@ -1,64 +0,0 @@ - -This contains a couple of examples for using the portal filing system. - -The portal file system provides a way of obtaining a file descriptor -to a filesystem object (i.e. something that is accessed by open(2), -pipe(2), socket(2) or socketpair(2)) via the filesystem namespace. -At present the only file descriptor supported are TCP sockets and -files. - -NOTE!!!! The portal file system is experimental in nature and should -not be considered secure, use with caution. - -First off mount the filesystem using something like: - -# mount_portal /usr/share/examples/portal/portal.conf /p - -Then you should be able to do things like -# cat /p/tcp/localhost/daytime -Sun Nov 22 17:50:09 1998 -(assuming inetd is running the daytime service, by default it is off) - -Welcome to FreeBSD! - -# mkdir -p /tmp/root -# cd /tmp/root -# mkdir bin p -# cp /bin/sh /bin/cat bin -# mount_portal /usr/share/examples/portal/portal.conf /tmp/root/p -# chroot /tmp/root -# pwd -/ -# echo * -bin p -# cat /etc/motd -cat: /etc/motd: No such file or directory -# cat /p/fs/etc/motd -FreeBSD 2.2.6-RELEASE (COMPUTER) #0: Sat Aug 22 17:11:37 BST 1998 - -Welcome to FreeBSD! - -Finally, a very simple example of the listening server is available, -fire up two xterms. In the first - -xterm-1$ cat /p/tcplisten/ANY/6666 -(the ANY is a wildcard just like using INADDR_ANY, any resolvable host -can be used). - -In the second xterm -xterm-2$ echo "hello there" >/p/tcp/localhost/6666 - -You should see the "hello there" string appear on the first terminal. - -Unprivilged users can't create servers on privalged ports. -xterm-1$ cat /p/tcplisten/ANY/666 -cat: /p/tcplisten/ANY/666: Operation not permitted - -but root can -xterm-1# cat /p/tcplisten/ANY/666 - -In the second -xterm-2$ echo "hello there" >/p/tcp/localhost/666 -should produce the expected response. - -You can also swap the client/server read and write commands etc. diff --git a/share/examples/portal/portal.conf b/share/examples/portal/portal.conf deleted file mode 100644 index aa7e282d59caf..0000000000000 --- a/share/examples/portal/portal.conf +++ /dev/null @@ -1,3 +0,0 @@ -tcp/           tcp tcp/ -tcplisten/     tcplisten tcplisten/ -fs/            file fs/ diff --git a/share/examples/printing/ifhp b/share/examples/printing/ifhp index 373325b0e285a..21e6643473e37 100644 --- a/share/examples/printing/ifhp +++ b/share/examples/printing/ifhp @@ -26,7 +26,7 @@ else      #  Plain text or HP/PCL, so just print it directly; print a form      #  at the end to eject the last page.      # -    echo "$first_line" && cat && printf "\f" && exit 2 +    echo $first_line && cat && printf "\f" && exit 2  fi  exit 2 diff --git a/share/examples/printing/psif b/share/examples/printing/psif index 1a816f64888bd..2a657e01aae71 100644 --- a/share/examples/printing/psif +++ b/share/examples/printing/psif @@ -12,12 +12,12 @@ if [ "$first_two_chars" = "%!" ]; then     #     #  PostScript job, print it.     # -   echo "$first_line" && cat && printf "\004" && exit 0 +   echo $first_line && cat && printf "\004" && exit 0     exit 2  else     #     #  Plain text, convert it, then print it.     # -   ( echo "$first_line"; cat ) | /usr/local/bin/textps && printf "\004" && exit 0 +   ( echo $first_line; cat ) | /usr/local/bin/textps && printf "\004" && exit 0     exit 2  fi diff --git a/share/examples/scsi_target/scsi_target.c b/share/examples/scsi_target/scsi_target.c index c2a0f0290eb59..dab474bf1c193 100644 --- a/share/examples/scsi_target/scsi_target.c +++ b/share/examples/scsi_target/scsi_target.c @@ -26,7 +26,7 @@   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF   * SUCH DAMAGE.   * - *      $Id: scsi_target.c,v 1.1 1998/09/15 06:46:32 gibbs Exp $ + *      $Id$   */  #include <sys/types.h> @@ -147,6 +147,7 @@ pump_events()  		}  		if ((targpoll.revents & POLLRDNORM) != 0) { +			printf("Read Poll event came true\n");  			retval = read(targfd, buf, bufsize);  			if (retval == -1) { @@ -162,6 +163,7 @@ pump_events()  		if ((targpoll.revents & POLLWRNORM) != 0) {  			int amount_read; +			printf("Write Poll event came true\n");  			retval = read(ifd, buf, bufsize);  			if (retval == -1) {  				perror("Read from file failed"); | 
