Commit | Line | Data |
---|---|---|
9104a31b KS |
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 | * | |
45a83555 | 12 | * @(#)ccitt_proto.c 7.9 (Berkeley) %G% |
9104a31b | 13 | */ |
74eec871 | 14 | |
6170c909 KB |
15 | #include <sys/param.h> |
16 | #include <sys/socket.h> | |
17 | #include <sys/protosw.h> | |
18 | #include <sys/domain.h> | |
19 | ||
20 | #include <netccitt/x25.h> | |
21 | ||
22 | #include <net/radix.h> | |
74eec871 KS |
23 | |
24 | /* | |
6170c909 | 25 | * Definitions of protocols supported in the CCITT domain. |
74eec871 KS |
26 | */ |
27 | ||
74eec871 | 28 | extern struct domain ccittdomain; |
e3921cae | 29 | #define DOMAIN &ccittdomain |
74eec871 | 30 | |
e932ad58 | 31 | #ifdef LLC |
45a83555 KS |
32 | int llc_output(); |
33 | void llc_ctlinput(), llc_init(), llc_timer(); | |
e932ad58 KS |
34 | #endif |
35 | #ifdef HDLC | |
45a83555 KS |
36 | int hd_output(); |
37 | void hd_ctlinput(), hd_init(), hd_timer(); | |
e932ad58 | 38 | #endif |
45a83555 KS |
39 | int pk_usrreq(), pk_ctloutput(); |
40 | void pk_timer(), pk_init(), pk_input(), pk_ctlinput(); | |
74eec871 KS |
41 | |
42 | struct protosw ccittsw[] = { | |
e932ad58 KS |
43 | #ifdef LLC |
44 | { 0, DOMAIN, IEEEPROTO_802LLC,0, | |
45 | 0, llc_output, llc_ctlinput, 0, | |
46 | 0, | |
47 | llc_init, 0, llc_timer, 0, | |
48 | }, | |
49 | #endif | |
74eec871 | 50 | #ifdef HDLC |
e3921cae | 51 | { 0, DOMAIN, CCITTPROTO_HDLC,0, |
74eec871 KS |
52 | 0, hd_output, hd_ctlinput, 0, |
53 | 0, | |
54 | hd_init, 0, hd_timer, 0, | |
55 | }, | |
56 | #endif | |
e3921cae | 57 | { SOCK_STREAM, DOMAIN, CCITTPROTO_X25, PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD, |
e932ad58 | 58 | pk_input, 0, pk_ctlinput, pk_ctloutput, |
74eec871 | 59 | pk_usrreq, |
b84e7ca8 | 60 | pk_init, 0, pk_timer, 0, |
74eec871 KS |
61 | } |
62 | }; | |
63 | ||
64 | struct domain ccittdomain = | |
74eec871 | 65 | { AF_CCITT, "ccitt", 0, 0, 0, ccittsw, |
5c48f39f KS |
66 | &ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])], 0, |
67 | rn_inithead, 32, sizeof (struct sockaddr_x25) }; |