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 * @(#)pk_var.h 7.2 (Berkeley) 05/15/90 13 */ 14 15 /* 16 * Protocol-Protocol Packet Buffer. 17 * (Eventually will be replace by system-wide structure). 18 */ 19 20 struct pq { 21 int (*pq_put)(); /* How to process data */ 22 struct mbuf *pq_data; /* Queued data */ 23 int pq_space; /* For accounting */ 24 int pq_flags; 25 int (*pq_unblock)();/* called & cleared when unblocking */ 26 caddr_t pq_proto; /* for other service entries */ 27 caddr_t pq_next; /* next q, or route, or pcb */ 28 }; 29 30 /* 31 * 32 * X.25 Logical Channel Descriptor 33 * 34 */ 35 36 struct pklcd { 37 struct pq lcd_downq, lcd_upq; /* protocol glue for datagram service */ 38 short lcd_lcn; /* Logical channel number */ 39 short lcd_state; /* Logical Channel state */ 40 bool lcd_intrconf_pending; /* Interrupt confirmation pending */ 41 octet lcd_intrdata; /* Octet of incoming intr data */ 42 short lcd_timer; /* Various timer values */ 43 char lcd_retry; /* Timer retry count */ 44 char lcd_rsn; /* Seq no of last received packet */ 45 char lcd_ssn; /* Seq no of next packet to send */ 46 char lcd_output_window; /* Output flow control window */ 47 char lcd_input_window; /* Input flow control window */ 48 char lcd_last_transmitted_pr;/* Last Pr value transmitted */ 49 bool lcd_rnr_condition; /* Remote in busy condition */ 50 bool lcd_window_condition; /* Output window size exceeded */ 51 bool lcd_reset_condition; /* True, if waiting reset confirm */ 52 char lcd_packetsize; /* Maximum packet size */ 53 char lcd_windowsize; /* Window size - both directions */ 54 octet lcd_closed_user_group; /* Closed user group specification */ 55 char lcd_flags; /* copy of sockaddr_x25 op_flags */ 56 struct x25_packet *lcd_template;/* Address of current packet */ 57 struct socket *lcd_so; /* Socket addr for connection */ 58 struct sockaddr_x25 *lcd_craddr;/* Calling address */ 59 struct sockaddr_x25 *lcd_ceaddr;/* Called address */ 60 time_t lcd_stime; /* time circuit established */ 61 long lcd_txcnt; /* Data packet transmit count */ 62 long lcd_rxcnt; /* Data packet receive count */ 63 short lcd_intrcnt; /* Interrupt packet transmit count */ 64 struct pklcd *lcd_listen; /* Next lcd on listen queue */ 65 struct ifaddr *lcd_ifa; /* network this lcd is attached to */ 66 }; 67 68 69 /* 70 * Interface address, x25 version. Exactly one of these structures is 71 * allocated for each interface with an x25 address. 72 * 73 * The ifaddr structure conatins the protocol-independent part 74 * of the structure, and is assumed to be first. 75 */ 76 struct x25_ifaddr { 77 struct ifaddr ia_ifa; /* protocol-independent info */ 78 #define ia_ifp ia_ifa.ifa_ifp 79 #define ia_flags ia_ifa.ifa_flags 80 struct x25_ifaddr *ia_next; /* next in list of x25 addresses */ 81 struct sockaddr_x25 ia_addr; /* reserve space for interface name */ 82 struct sockaddr_x25 ia_sockmask; /* reserve space for netmask */ 83 struct x25config *ia_xcp; /* network specific configuration */ 84 struct x25config *ia_xc; /* network specific configuration */ 85 short ia_state; /* packet level status */ 86 #define ia_maxlcn ia->ia_xc.xc_maxlcn /* local copy of xc_maxlcn */ 87 struct pklcd **ia_chan; /* dispatch vector for ciruits */ 88 }; 89 90 /* 91 * ``Link-Level'' extension to Routing Entry for upper level 92 * packet switching via X.25 virtual circuits. 93 */ 94 struct rtext_x25 { 95 struct pklcd *rtx_lcd; 96 int rtx_state; 97 struct rtentry *rtx_rt; 98 }; 99 100 #ifdef KERNEL 101 struct x25_ifaddr *x25_ifaddr; /* head of linked list of networks */ 102 struct pklcd *pk_listenhead; 103 104 char *pk_name[], *pk_state[]; 105 int pk_t20, pk_t21, pk_t22, pk_t23; 106 #endif 107