xref: /original-bsd/sys/netccitt/ccitt_proto.c (revision 5f03794f)
1 /*
2  * Copyright (c) University of British Columbia, 1984
3  * Copyright (c) 1990 The Regents of the University of California.
4  * All rights reserved.
5  *
6  * This code is derived from software contributed to Berkeley by
7  * the Laboratory for Computation Vision and the Computer Science Department
8  * of the University of British Columbia.
9  *
10  * %sccs.include.redist.c%
11  *
12  *	@(#)ccitt_proto.c	7.3 (Berkeley) 05/22/90
13  */
14 
15 #include "../h/param.h"
16 #include "../h/socket.h"
17 #include "../h/protosw.h"
18 #include "../h/domain.h"
19 #include "../netccitt/x25.h"
20 
21 /*
22  *	Definitions of protocols supported in the CCITT domain.
23  */
24 
25 #ifdef BSD4_3
26 extern	struct domain ccittdomain;
27 #define DOMAIN &ccittdomain
28 #else
29 #define DOMAIN PF_CCITT
30 #endif
31 
32 #ifdef XE
33 int	xe_output (), xe_ctlinput (), xe_init(), xe_timer();
34 #endif
35 #ifdef HDLC
36 int	hd_output (), hd_ctlinput (), hd_init (), hd_timer ();
37 #endif
38 int	pk_usrreq (), pk_timer ();
39 
40 struct protosw ccittsw[] = {
41 #ifdef XE
42  {	0,		DOMAIN,		IEEEPROTO_802LLC,0,
43 	0,		xe_output,	xe_ctlinput,	0,
44 	0,
45 	xe_init,	0,	 	xe_timer,	0,
46  },
47 #endif
48 #ifdef HDLC
49  {	0,		DOMAIN,		CCITTPROTO_HDLC,0,
50 	0,		hd_output,	hd_ctlinput,	0,
51 	0,
52 	hd_init,	0,	 	hd_timer,	0,
53  },
54 #endif
55  {	SOCK_STREAM,	DOMAIN,		CCITTPROTO_X25,	PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD,
56 	0,		0,		0,		0,
57 	pk_usrreq,
58 	0,		0,		pk_timer,	0,
59  }
60 };
61 
62 struct domain ccittdomain =
63 #ifdef BSD4_3
64 	{ AF_CCITT, "ccitt", 0, 0, 0, ccittsw,
65 		&ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])] };
66 #else
67 	{ AF_CCITT, "ccitt", ccittsw, &ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])] };
68 #endif
69