Make the kernel side of PPP compile.
This commit is contained in:
parent
2980d1306a
commit
45d17740c2
@ -78,6 +78,7 @@
|
|||||||
#define VJC
|
#define VJC
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <sys/systm.h>
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
#include <sys/mbuf.h>
|
#include <sys/mbuf.h>
|
||||||
#include <sys/buf.h>
|
#include <sys/buf.h>
|
||||||
@ -89,6 +90,7 @@
|
|||||||
#include <sys/kernel.h>
|
#include <sys/kernel.h>
|
||||||
#include <sys/conf.h>
|
#include <sys/conf.h>
|
||||||
#include <sys/vnode.h>
|
#include <sys/vnode.h>
|
||||||
|
#include <sys/kernel.h>
|
||||||
|
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <net/if_types.h>
|
#include <net/if_types.h>
|
||||||
@ -109,7 +111,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VJC
|
#ifdef VJC
|
||||||
#include <net/slcompress.h>
|
#include <net/pppcompress.h>
|
||||||
#define HDROFF MAX_HDR
|
#define HDROFF MAX_HDR
|
||||||
/* HDROFF should really be 128, but other parts of the system will
|
/* HDROFF should really be 128, but other parts of the system will
|
||||||
panic on TCP+IP headers bigger than MAX_HDR = MHLEN (100). */
|
panic on TCP+IP headers bigger than MAX_HDR = MHLEN (100). */
|
||||||
@ -121,7 +123,7 @@
|
|||||||
#include <net/if_ppp.h>
|
#include <net/if_ppp.h>
|
||||||
#include <machine/cpu.h>
|
#include <machine/cpu.h>
|
||||||
|
|
||||||
/* This is a NetBSD-current kernel. */
|
/* This is a FreeBSD-2.x kernel. */
|
||||||
#define CCOUNT(q) ((q)->c_cc)
|
#define CCOUNT(q) ((q)->c_cc)
|
||||||
|
|
||||||
#define PPP_HIWAT 400 /* Don't start a new packet if HIWAT on que */
|
#define PPP_HIWAT 400 /* Don't start a new packet if HIWAT on que */
|
||||||
@ -135,8 +137,8 @@ int pppread __P((struct tty *tp, struct uio *uio, int flag));
|
|||||||
int pppwrite __P((struct tty *tp, struct uio *uio, int flag));
|
int pppwrite __P((struct tty *tp, struct uio *uio, int flag));
|
||||||
int ppptioctl __P((struct tty *tp, int cmd, caddr_t data, int flag,
|
int ppptioctl __P((struct tty *tp, int cmd, caddr_t data, int flag,
|
||||||
struct proc *));
|
struct proc *));
|
||||||
int pppoutput __P((struct ifnet *ifp, struct mbuf *m0,
|
int pppoutput __P((struct ifnet *, struct mbuf *,
|
||||||
struct sockaddr *dst));
|
struct sockaddr *, struct rtentry *));
|
||||||
void pppinput __P((int c, struct tty *tp));
|
void pppinput __P((int c, struct tty *tp));
|
||||||
int pppioctl __P((struct ifnet *ifp, int cmd, caddr_t data));
|
int pppioctl __P((struct ifnet *ifp, int cmd, caddr_t data));
|
||||||
void pppstart __P((struct tty *tp));
|
void pppstart __P((struct tty *tp));
|
||||||
@ -240,8 +242,9 @@ pppalloc(pid)
|
|||||||
/*
|
/*
|
||||||
* Deallocate a ppp unit.
|
* Deallocate a ppp unit.
|
||||||
*/
|
*/
|
||||||
|
void
|
||||||
pppdealloc(sc)
|
pppdealloc(sc)
|
||||||
struct ppp_softc *sc;
|
struct ppp_softc *sc;
|
||||||
{
|
{
|
||||||
struct mbuf *m;
|
struct mbuf *m;
|
||||||
|
|
||||||
@ -438,7 +441,7 @@ pppwrite(tp, uio, flag)
|
|||||||
*ph1 = *ph2;
|
*ph1 = *ph2;
|
||||||
m0->m_data += PPP_HDRLEN;
|
m0->m_data += PPP_HDRLEN;
|
||||||
m0->m_len -= PPP_HDRLEN;
|
m0->m_len -= PPP_HDRLEN;
|
||||||
return (pppoutput(&sc->sc_if, m0, &dst));
|
return (pppoutput(&sc->sc_if, m0, &dst, (struct rtentry *)0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -612,10 +615,11 @@ pppfcs(fcs, cp, len)
|
|||||||
* Packet is placed in Information field of PPP frame.
|
* Packet is placed in Information field of PPP frame.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
pppoutput(ifp, m0, dst)
|
pppoutput(ifp, m0, dst, rt)
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
struct mbuf *m0;
|
struct mbuf *m0;
|
||||||
struct sockaddr *dst;
|
struct sockaddr *dst;
|
||||||
|
struct rtentry *rt;
|
||||||
{
|
{
|
||||||
register struct ppp_softc *sc = &ppp_softc[ifp->if_unit];
|
register struct ppp_softc *sc = &ppp_softc[ifp->if_unit];
|
||||||
struct ppp_header *ph;
|
struct ppp_header *ph;
|
||||||
@ -832,13 +836,14 @@ ppp_dequeue(sc)
|
|||||||
* This gets called from pppoutput when a new packet is
|
* This gets called from pppoutput when a new packet is
|
||||||
* put on a queue.
|
* put on a queue.
|
||||||
*/
|
*/
|
||||||
static
|
static int
|
||||||
pppasyncstart(sc)
|
pppasyncstart(sc)
|
||||||
register struct ppp_softc *sc;
|
register struct ppp_softc *sc;
|
||||||
{
|
{
|
||||||
register struct tty *tp = (struct tty *) sc->sc_devp;
|
register struct tty *tp = (struct tty *) sc->sc_devp;
|
||||||
|
|
||||||
pppstart(tp);
|
pppstart(tp);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1446,6 +1451,7 @@ pppinput(c, tp)
|
|||||||
/*
|
/*
|
||||||
* Process an ioctl request to interface.
|
* Process an ioctl request to interface.
|
||||||
*/
|
*/
|
||||||
|
int
|
||||||
pppioctl(ifp, cmd, data)
|
pppioctl(ifp, cmd, data)
|
||||||
register struct ifnet *ifp;
|
register struct ifnet *ifp;
|
||||||
int cmd;
|
int cmd;
|
||||||
@ -1571,5 +1577,6 @@ pppdumpb(b, l)
|
|||||||
printf("%s\n", buf);
|
printf("%s\n", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEXT_SET(pseudo_set, pppattach);
|
||||||
|
|
||||||
#endif /* NPPP > 0 */
|
#endif /* NPPP > 0 */
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <sys/systm.h>
|
||||||
#include <sys/mbuf.h>
|
#include <sys/mbuf.h>
|
||||||
#include <sys/socketvar.h>
|
#include <sys/socketvar.h>
|
||||||
|
|
||||||
@ -57,7 +58,7 @@
|
|||||||
#include <netinet/ip.h>
|
#include <netinet/ip.h>
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
|
|
||||||
#include <net/slcompress.h>
|
#include <net/pppcompress.h>
|
||||||
|
|
||||||
#ifndef SL_NO_STATS
|
#ifndef SL_NO_STATS
|
||||||
#define INCR(counter) ++comp->counter;
|
#define INCR(counter) ++comp->counter;
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
* $Id: slcompress.h,v 1.5 1994/01/15 20:13:16 deraadt Exp $
|
* $Id: slcompress.h,v 1.5 1994/01/15 20:13:16 deraadt Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SLCOMPRESS_H_
|
#ifndef _NET_PPPCOMPRESS_H_
|
||||||
#define _SLCOMPRESS_H_
|
#define _NET_PPPCOMPRESS_H_
|
||||||
|
|
||||||
#define MAX_STATES 16 /* must be > 2 and < 256 */
|
#define MAX_STATES 16 /* must be > 2 and < 256 */
|
||||||
#define MAX_HDR MLEN /* XXX 4bsd-ism: should really be 128 */
|
#define MAX_HDR MLEN /* XXX 4bsd-ism: should really be 128 */
|
||||||
@ -136,6 +136,8 @@ struct cstate {
|
|||||||
* all the state data for one serial line (we need one of these
|
* all the state data for one serial line (we need one of these
|
||||||
* per line).
|
* per line).
|
||||||
*/
|
*/
|
||||||
|
#define slcompress pppcompress
|
||||||
|
|
||||||
struct slcompress {
|
struct slcompress {
|
||||||
struct cstate *last_cs; /* most recently used tstate */
|
struct cstate *last_cs; /* most recently used tstate */
|
||||||
u_char last_recv; /* last rcvd conn. id */
|
u_char last_recv; /* last rcvd conn. id */
|
||||||
@ -157,6 +159,12 @@ struct slcompress {
|
|||||||
/* flag values */
|
/* flag values */
|
||||||
#define SLF_TOSS 1 /* tossing rcvd frames because of input err */
|
#define SLF_TOSS 1 /* tossing rcvd frames because of input err */
|
||||||
|
|
||||||
|
#define sl_compress_init ppp_compress_init
|
||||||
|
#define sl_compress_setup ppp_compress_setup
|
||||||
|
#define sl_compress_tcp ppp_compress_tcp
|
||||||
|
#define sl_uncompress_tcp ppp_uncompress_tcp
|
||||||
|
#define sl_uncompress_tcp_part ppp_uncompress_tcp_part
|
||||||
|
|
||||||
extern void sl_compress_init __P((struct slcompress *));
|
extern void sl_compress_init __P((struct slcompress *));
|
||||||
extern void sl_compress_setup __P((struct slcompress *, int maxslot));
|
extern void sl_compress_setup __P((struct slcompress *, int maxslot));
|
||||||
extern u_char sl_compress_tcp __P((struct mbuf *m, struct ip *ip,
|
extern u_char sl_compress_tcp __P((struct mbuf *m, struct ip *ip,
|
||||||
@ -167,4 +175,4 @@ extern int sl_uncompress_tcp_part __P((u_char **bufp, int buflen,
|
|||||||
int total_len, u_int type,
|
int total_len, u_int type,
|
||||||
struct slcompress *));
|
struct slcompress *));
|
||||||
|
|
||||||
#endif /* _SLCOMPRESS_H_ */
|
#endif /* _NET_PPPCOMPRESS_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user