xref: /csrg-svn/sys/netccitt/ccitt_proto.c (revision 41585)
1 /* Copyright (c) University of British Columbia, 1984 */
2 
3 #include "../h/param.h"
4 #include "../h/socket.h"
5 #include "../h/protosw.h"
6 #include "../h/domain.h"
7 #include "../netccitt/x25.h"
8 
9 /*
10  *	Definitions of protocols supported in the CCITT domain.
11  */
12 
13 #ifdef BSD4_3
14 extern	struct domain ccittdomain;
15 #endif
16 
17 #ifdef XE
18 int	xe_output (), xe_ctlinput (), xe_init(), xe_timer();
19 #endif
20 #ifdef HDLC
21 int	hd_output (), hd_ctlinput (), hd_init (), hd_timer ();
22 #endif
23 int	pk_usrreq (), pk_timer ();
24 
25 struct protosw ccittsw[] = {
26 #ifdef XE
27 #ifdef BSD4_3
28  {	0,		&ccittdomain,	IEEEPROTO_802LLC,0,
29 #else
30  {	0,		PF_CCITT,	IEEEPROTO_802LLC,0,
31 #endif
32 	0,		xe_output,	xe_ctlinput,	0,
33 	0,
34 	xe_init,	0,	 	xe_timer,	0,
35  },
36 #endif
37 #ifdef HDLC
38 #ifdef BSD4_3
39  {	0,		&ccittdomain,	CCITTPROTO_HDLC,0,
40 #else
41  {	0,		PF_CCITT,	CCITTPROTO_HDLC,0,
42 #endif
43 	0,		hd_output,	hd_ctlinput,	0,
44 	0,
45 	hd_init,	0,	 	hd_timer,	0,
46  },
47 #endif
48 #ifdef BSD4_3
49  {	SOCK_STREAM,	&ccittdomain,	CCITTPROTO_X25,	PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD,
50 #else
51  {	SOCK_STREAM,	PF_CCITT,	CCITTPROTO_X25,	PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD,
52 #endif
53 	0,		0,		0,		0,
54 	pk_usrreq,
55 	0,		0,		pk_timer,	0,
56  }
57 };
58 
59 struct domain ccittdomain =
60 #ifdef BSD4_3
61 	{ AF_CCITT, "ccitt", 0, 0, 0, ccittsw,
62 		&ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])] };
63 #else
64 	{ AF_CCITT, "ccitt", ccittsw, &ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])] };
65 #endif
66 
67