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.2 (Berkeley) 05/11/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 #endif 28 29 #ifdef XE 30 int xe_output (), xe_ctlinput (), xe_init(), xe_timer(); 31 #endif 32 #ifdef HDLC 33 int hd_output (), hd_ctlinput (), hd_init (), hd_timer (); 34 #endif 35 int pk_usrreq (), pk_timer (); 36 37 struct protosw ccittsw[] = { 38 #ifdef XE 39 #ifdef BSD4_3 40 { 0, &ccittdomain, IEEEPROTO_802LLC,0, 41 #else 42 { 0, PF_CCITT, IEEEPROTO_802LLC,0, 43 #endif 44 0, xe_output, xe_ctlinput, 0, 45 0, 46 xe_init, 0, xe_timer, 0, 47 }, 48 #endif 49 #ifdef HDLC 50 #ifdef BSD4_3 51 { 0, &ccittdomain, CCITTPROTO_HDLC,0, 52 #else 53 { 0, PF_CCITT, CCITTPROTO_HDLC,0, 54 #endif 55 0, hd_output, hd_ctlinput, 0, 56 0, 57 hd_init, 0, hd_timer, 0, 58 }, 59 #endif 60 #ifdef BSD4_3 61 { SOCK_STREAM, &ccittdomain, CCITTPROTO_X25, PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD, 62 #else 63 { SOCK_STREAM, PF_CCITT, CCITTPROTO_X25, PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD, 64 #endif 65 0, 0, 0, 0, 66 pk_usrreq, 67 0, 0, pk_timer, 0, 68 } 69 }; 70 71 struct domain ccittdomain = 72 #ifdef BSD4_3 73 { AF_CCITT, "ccitt", 0, 0, 0, ccittsw, 74 &ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])] }; 75 #else 76 { AF_CCITT, "ccitt", ccittsw, &ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])] }; 77 #endif 78 79