1 /* 2 * Copyright (c) University of British Columbia, 1984 3 * Copyright (c) 1990, 1993 4 * The Regents of the University of California. 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 8.1 (Berkeley) 06/10/93 13 */ 14 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> 23 24 /* 25 * Definitions of protocols supported in the CCITT domain. 26 */ 27 28 extern struct domain ccittdomain; 29 #define DOMAIN &ccittdomain 30 31 #ifdef LLC 32 int llc_output(); 33 void llc_ctlinput(), llc_init(), llc_timer(); 34 #endif 35 #ifdef HDLC 36 int hd_output(); 37 void hd_ctlinput(), hd_init(), hd_timer(); 38 #endif 39 int pk_usrreq(), pk_ctloutput(); 40 void pk_timer(), pk_init(), pk_input(), pk_ctlinput(); 41 42 struct protosw ccittsw[] = { 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 50 #ifdef HDLC 51 { 0, DOMAIN, CCITTPROTO_HDLC,0, 52 0, hd_output, hd_ctlinput, 0, 53 0, 54 hd_init, 0, hd_timer, 0, 55 }, 56 #endif 57 { SOCK_STREAM, DOMAIN, CCITTPROTO_X25, PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD, 58 pk_input, 0, pk_ctlinput, pk_ctloutput, 59 pk_usrreq, 60 pk_init, 0, pk_timer, 0, 61 } 62 }; 63 64 struct domain ccittdomain = 65 { AF_CCITT, "ccitt", 0, 0, 0, ccittsw, 66 &ccittsw[sizeof(ccittsw)/sizeof(ccittsw[0])], 0, 67 rn_inithead, 32, sizeof (struct sockaddr_x25) }; 68