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 #if !(NS_TARGET >= 40)
24 #import <kernserv/prototypes.h>
25 #endif /* NS_TARGET */
28 * Supported network protocols. These values are used for
31 #define NP_IP 0 /* Internet Protocol */
32 #define NUM_NP 1 /* Number of NPs. */
37 /* only defined in the posix universe... */
38 /*typedef int pid_t; */
41 netif_t sc_if; /* network-visible interface */
42 u_int sc_flags; /* control/status bits; see if_ppp.h */
43 struct tty *sc_devp; /* pointer to device-dep structure */
44 void (*sc_start) __P((struct ppp_softc *)); /* start output proc */
45 void (*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
46 void (*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
47 u_int16_t sc_mru; /* max receive unit */
48 pid_t sc_xfer; /* used in transferring unit */
49 NETBUF_T sc_m; /* Current TTY input netbuf */
50 struct nb_queue sc_freeq; /* reserve netbufs */
51 struct nb_queue sc_rawq; /* Raw input buffers */
52 struct nb_queue sc_fastq; /* For telnet, rlogin, and ftp control */
53 struct nb_queue sc_slowq; /* Everything else */
54 struct nb_queue sc_inq; /* Input available to user ppp */
55 struct nb_queue sc_npq; /* output packets not to be sent yet */
56 struct nb_queue sc_compq; /* Cache of compressed bufs to be sent */
58 struct vjcompress sc_comp;
60 u_int sc_bytessent; /* count of octets sent */
61 u_int sc_bytesrcvd; /* count of octets received */
62 enum NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
64 struct compressor *sc_xcomp; /* transmit compressor */
65 void *sc_xc_state; /* transmit compressor state */
66 struct compressor *sc_rcomp; /* receive decompressor */
67 void *sc_rc_state; /* receive decompressor state */
69 time_t sc_last_sent; /* time (secs) last NP pkt sent */
70 time_t sc_last_recv; /* time (secs) last NP pkt rcvd */
72 short sc_compsched; /* synchronize compression callouts */
73 short sc_decompsched; /* synchronize decompression callouts */
75 /* Device-dependent part for async lines. */
76 ext_accm sc_asyncmap; /* async control character map */
77 u_int32_t sc_rasyncmap; /* receive async control char map */
78 NETBUF_T sc_outm; /* netbuf currently being output */
79 char *sc_mp; /* ptr to next char in input netbuf */
80 u_int16_t sc_ilen; /* length of input packet so far */
81 u_int16_t sc_fcs; /* FCS so far (input) */
82 u_int16_t sc_outfcs; /* FCS so far for output packet */
83 u_char sc_rawin[16]; /* chars as received */
84 int sc_rawin_count; /* # in sc_rawin */
87 extern struct ppp_softc ppp_softc[];
89 struct ppp_softc *pppalloc __P((pid_t pid));
90 void pppdealloc __P((struct ppp_softc *sc));
91 int pppioctl __P((struct ppp_softc *sc, u_long cmd, void *data, int flag));
92 void ppppktin __P((struct ppp_softc *sc, NETBUF_T m, int lost));
93 NETBUF_T ppp_dequeue __P((struct ppp_softc *sc));
97 #define incr_cnt(ifp,field) field##_set(ifp, field(ifp) + 1)
100 #define VJ_HDRLEN 128