xref: /csrg-svn/sys/netccitt/x25_var.h (revision 41599)
1*41599Ssklower /*
2*41599Ssklower  * Copyright (c) 1989 Regents of the University of California.
3*41599Ssklower  * All rights reserved.
4*41599Ssklower  *
5*41599Ssklower  * Redistribution and use in source and binary forms are permitted
6*41599Ssklower  * provided that the above copyright notice and this paragraph are
7*41599Ssklower  * duplicated in all such forms and that any documentation,
8*41599Ssklower  * advertising materials, and other materials related to such
9*41599Ssklower  * distribution and use acknowledge that the software was developed
10*41599Ssklower  * by the University of California, Berkeley.  The name of the
11*41599Ssklower  * University may not be used to endorse or promote products derived
12*41599Ssklower  * from this software without specific prior written permission.
13*41599Ssklower  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*41599Ssklower  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*41599Ssklower  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16*41599Ssklower  *
17*41599Ssklower  *	@(#)x25_var.h	7.1 (Berkeley) 05/11/90
18*41599Ssklower  */
19*41599Ssklower 
20*41599Ssklower 
21*41599Ssklower /*
22*41599Ssklower  * Device-independent x25 driver data.
23*41599Ssklower  */
24*41599Ssklower struct	x25com {
25*41599Ssklower 	struct 	ifnet xc_if;		/* network-visible interface */
26*41599Ssklower /*	int	(*xc_if.if_start)()	/* connect, confirm procedure */
27*41599Ssklower 	u_char	xc_addrlen;		/* length of X.121 address */
28*41599Ssklower 	u_char	xc_addr[16];		/* X.121 address */
29*41599Ssklower 	u_short xc_flags;		/* X.25 specific flags */
30*41599Ssklower 	u_short	xc_nchan;		/* number of logical channels */
31*41599Ssklower 	u_short xc_nactive;		/* number of live logical channels */
32*41599Ssklower 	u_short xc_npvc;		/* # of permanent virt. circuits */
33*41599Ssklower 	u_short xc_pvcx;		/* index of first pcv */
34*41599Ssklower 	u_short xc_svcx;		/* index of first svc */
35*41599Ssklower 	u_short xc_dg_idletimo;		/* timeout to close idle dg channel */
36*41599Ssklower 	u_short xc_rslvtimo;		/* if name translation fails, rid */
37*41599Ssklower 	struct	x25lcb **xc_lcbvec;	/* where to dispatch data */
38*41599Ssklower 	int	(*xc_disconnect)();	/* to delete idle dg circuits */
39*41599Ssklower };
40*41599Ssklower #define	XCF_HSL3	0x1		/* Hardware support for level 3 */
41*41599Ssklower #define XCF_HSL2	0x2		/* Hardware support for level 2 */
42*41599Ssklower 
43*41599Ssklower 
44*41599Ssklower /*
45*41599Ssklower  * Local Connection Block.
46*41599Ssklower  */
47*41599Ssklower 
48*41599Ssklower struct x25lcb {
49*41599Ssklower 	struct	xq	{
50*41599Ssklower 		int	(*xq_put)();	/* How to process data */
51*41599Ssklower 		struct	mbuf *xq_data;	/* Queued data */
52*41599Ssklower 		int	xq_space;	/* For accounting */
53*41599Ssklower 		int	xq_flags;
54*41599Ssklower 		int	(*xq_unblock)();/* called & cleared when unblocking */
55*41599Ssklower 		caddr_t xq_proto;	/* for other service entries */
56*41599Ssklower 		caddr_t xq_next;	/* next q, or route, or pcb */
57*41599Ssklower 	}	xl_downq, xl_upq;
58*41599Ssklower /*	(*xl_downq.xq_next->xq_put)()	/* LAPB put when using pk_output() */
59*41599Ssklower 	int	xl_flags;		/* valid, c-o versus dg */
60*41599Ssklower 	int	xl_timer;		/* figure out what to close */
61*41599Ssklower 	int	xl_state;		/* connecting, connected, resolving */
62*41599Ssklower 	int	xl_index;		/* which entry we are in device table */
63*41599Ssklower 	struct	x25com *xl_xc;		/* back pointer to device */
64*41599Ssklower 	/*
65*41599Ssklower 	 * x25pkb (packet-level control block) would follow immediately
66*41599Ssklower 	 * for devices only supplying LAPB or less.
67*41599Ssklower 	 */
68*41599Ssklower };
69*41599Ssklower /* flags */
70*41599Ssklower #define XL_VALID	0x1		/* Circuit is live, etc. */
71*41599Ssklower #define XL_DGRAM	0x2		/* not connection oriented, can close */
72*41599Ssklower #define XL_RTHELD	0x4		/* this lcb references rtentry */
73*41599Ssklower 
74*41599Ssklower #define XQ_UP		0x1		/* I am an up queue */
75*41599Ssklower #define XQ_DOWN		0x2		/* I am a down queue */
76*41599Ssklower 
77*41599Ssklower /* states for LCB */
78*41599Ssklower #define XLS_NEWBORN	0x0
79*41599Ssklower #define XLS_CONNECTED	0x1
80*41599Ssklower #define XLS_CONNECTING	0x2
81*41599Ssklower #define XLS_RESOLVING	0x3
82*41599Ssklower #define XLS_DISCONNECTING 0x4
83*41599Ssklower #define XLS_FREE	0x5
84*41599Ssklower 
85*41599Ssklower #ifdef KERNEL
86*41599Ssklower int	x25_ifinput();
87*41599Ssklower #endif
88