xref: /original-bsd/sys/netccitt/ccitt_proto.c (revision 9d1db70c)
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.5 (Berkeley) 08/30/90
13  */
14 #define HDLC
15 #include "param.h"
16 #include "socket.h"
17 #include "protosw.h"
18 #include "domain.h"
19 
20 #include "x25.h"
21 
22 /*
23  *	Definitions of protocols supported in the CCITT domain.
24  */
25 
26 #ifdef BSD4_3
27 extern	struct domain ccittdomain;
28 #define DOMAIN &ccittdomain
29 #else
30 #define DOMAIN PF_CCITT
31 #endif
32 
33 #ifdef XE
34 int	xe_output (), xe_ctlinput (), xe_init(), xe_timer();
35 #endif
36 #ifdef HDLC
37 int	hd_output (), hd_ctlinput (), hd_init (), hd_timer ();
38 #endif
39 int	pk_usrreq (), pk_timer (), pk_init (), pk_ctloutput ();
40 
41 struct protosw ccittsw[] = {
42 #ifdef XE
43  {	0,		DOMAIN,		IEEEPROTO_802LLC,0,
44 	0,		xe_output,	xe_ctlinput,	0,
45 	0,
46 	xe_init,	0,	 	xe_timer,	0,
47  },
48 #endif
49 #ifdef HDLC
50  {	0,		DOMAIN,		CCITTPROTO_HDLC,0,
51 	0,		hd_output,	hd_ctlinput,	0,
52 	0,
53 	hd_init,	0,	 	hd_timer,	0,
54  },
55 #endif
56  {	SOCK_STREAM,	DOMAIN,		CCITTPROTO_X25,	PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD,
57 	0,		0,		0,		pk_ctloutput,
58 	pk_usrreq,
59 	pk_init,	0,		pk_timer,	0,
60  }
61 };
62 
63 struct domain ccittdomain =
64 #ifdef BSD4_3
65 	{ AF_CCITT, "ccitt", 0, 0, 0, ccittsw,
66 		&ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])] };
67 #else
68 	{ AF_CCITT, "ccitt", ccittsw, &ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])] };
69 #endif
70