2 * if_ppp.h - Point-to-Point Protocol definitions.
4 * Copyright (c) 1989 Carnegie Mellon University.
7 * Redistribution and use in source and binary forms are permitted
8 * provided that the above copyright notice and this paragraph are
9 * duplicated in all such forms and that any documentation,
10 * advertising materials, and other materials related to such
11 * distribution and use acknowledge that the software was developed
12 * by Carnegie Mellon University. The name of the
13 * University may not be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 /* Portions Copyright (C) 1990 Brad K. Clements (streams support)
23 #import <kernserv/prototypes.h>
26 * Supported network protocols. These values are used for
29 #define NP_IP 0 /* Internet Protocol */
30 #define NUM_NP 1 /* Number of NPs. */
35 /* only defined in the posix universe... */
37 typedef unsigned short u_int16_t;
40 netif_t sc_if; /* network-visible interface */
41 u_int sc_flags; /* control/status bits; see if_ppp.h */
42 struct tty *sc_devp; /* pointer to device-dep structure */
43 void (*sc_start) __P((struct ppp_softc *)); /* start output proc */
44 void (*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
45 void (*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
46 u_int16_t sc_mru; /* max receive unit */
47 pid_t sc_xfer; /* used in transferring unit */
48 netbuf_t sc_m; /* Current TTY input netbuf */
49 struct nb_queue sc_freeq; /* reserve netbufs */
50 struct nb_queue sc_rawq; /* Raw input buffers */
51 struct nb_queue sc_fastq; /* For telnet, rlogin, and ftp control */
52 struct nb_queue sc_slowq; /* Everything else */
53 struct nb_queue sc_inq; /* Input available to user ppp */
54 struct nb_queue sc_npq; /* output packets not to be sent yet */
55 struct nb_queue sc_compq; /* Cache of compressed bufs to be sent */
57 struct vjcompress sc_comp;
59 u_int sc_bytessent; /* count of octets sent */
60 u_int sc_bytesrcvd; /* count of octets received */
62 caddr_t sc_bpf; /* hook for BPF */
63 int if_pcount; /* Really belongs in ifnet_t */
65 enum NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
67 struct compressor *sc_xcomp; /* transmit compressor */
68 void *sc_xc_state; /* transmit compressor state */
69 struct compressor *sc_rcomp; /* receive decompressor */
70 void *sc_rc_state; /* receive decompressor state */
72 time_t sc_last_sent; /* time (secs) last NP pkt sent */
73 time_t sc_last_recv; /* time (secs) last NP pkt rcvd */
75 short sc_compsched; /* synchronize compression callouts */
76 short sc_decompsched; /* synchronize decompression callouts */
78 /* Device-dependent part for async lines. */
79 ext_accm sc_asyncmap; /* async control character map */
80 u_int32_t sc_rasyncmap; /* receive async control char map */
81 netbuf_t sc_outm; /* netbuf currently being output */
82 char *sc_mp; /* ptr to next char in input netbuf */
83 u_int16_t sc_ilen; /* length of input packet so far */
84 u_int16_t sc_fcs; /* FCS so far (input) */
85 u_int16_t sc_outfcs; /* FCS so far for output packet */
86 u_char sc_rawin[16]; /* chars as received */
87 int sc_rawin_count; /* # in sc_rawin */
90 extern struct ppp_softc ppp_softc[];
92 struct ppp_softc *pppalloc __P((pid_t pid));
93 void pppdealloc __P((struct ppp_softc *sc));
94 int pppioctl __P((struct ppp_softc *sc, u_long cmd, void *data, int flag));
95 void ppppktin __P((struct ppp_softc *sc, netbuf_t m, int lost));
96 netbuf_t ppp_dequeue __P((struct ppp_softc *sc));
100 #define incr_cnt(ifp,field) field##_set(ifp, field(ifp) + 1)
103 #define VJ_HDRLEN 128