home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / darwin / darwinx86.iso / usr / include / net / if_pppvar.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-30  |  5.8 KB  |  132 lines

  1. /*
  2.  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  3.  *
  4.  * @APPLE_LICENSE_HEADER_START@
  5.  * 
  6.  * The contents of this file constitute Original Code as defined in and
  7.  * are subject to the Apple Public Source License Version 1.1 (the
  8.  * "License").  You may not use this file except in compliance with the
  9.  * License.  Please obtain a copy of the License at
  10.  * http://www.apple.com/publicsource and read it before using this file.
  11.  * 
  12.  * This Original Code and all software distributed under the License are
  13.  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  14.  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  15.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  16.  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
  17.  * License for the specific language governing rights and limitations
  18.  * under the License.
  19.  * 
  20.  * @APPLE_LICENSE_HEADER_END@
  21.  */
  22. /*
  23.  * if_pppvar.h - private structures and declarations for PPP.
  24.  *
  25.  * Copyright (c) 1994 The Australian National University.
  26.  * All rights reserved.
  27.  *
  28.  * Permission to use, copy, modify, and distribute this software and its
  29.  * documentation is hereby granted, provided that the above copyright
  30.  * notice appears in all copies.  This software is provided without any
  31.  * warranty, express or implied. The Australian National University
  32.  * makes no representations about the suitability of this software for
  33.  * any purpose.
  34.  *
  35.  * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
  36.  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  37.  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
  38.  * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
  39.  * OF SUCH DAMAGE.
  40.  *
  41.  * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  42.  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  43.  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  44.  * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
  45.  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
  46.  * OR MODIFICATIONS.
  47.  *
  48.  * Copyright (c) 1989 Carnegie Mellon University.
  49.  * All rights reserved.
  50.  *
  51.  * Redistribution and use in source and binary forms are permitted
  52.  * provided that the above copyright notice and this paragraph are
  53.  * duplicated in all such forms and that any documentation,
  54.  * advertising materials, and other materials related to such
  55.  * distribution and use acknowledge that the software was developed
  56.  * by Carnegie Mellon University.  The name of the
  57.  * University may not be used to endorse or promote products derived
  58.  * from this software without specific prior written permission.
  59.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  60.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  61.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  62.  *
  63.  */
  64.  
  65. /*
  66.  * Supported network protocols.  These values are used for
  67.  * indexing sc_npmode.
  68.  */
  69. #define NP_IP    0        /* Internet Protocol */
  70. #define NUM_NP    1        /* Number of NPs. */
  71.  
  72. /*
  73.  * Structure describing each ppp unit.
  74.  */
  75. struct ppp_softc {
  76.     struct    ifnet sc_if;        /* network-visible interface */
  77. /*hi*/    u_int    sc_flags;        /* control/status bits; see if_ppp.h */
  78.     struct    callout_handle sc_ch;    /* Used for scheduling timeouts */
  79.     void    *sc_devp;        /* pointer to device-dep structure */
  80.     void    (*sc_start) __P((struct ppp_softc *));    /* start output proc */
  81.     void    (*sc_ctlp) __P((struct ppp_softc *)); /* rcvd control pkt */
  82.     void    (*sc_relinq) __P((struct ppp_softc *)); /* relinquish ifunit */
  83.     void    (*sc_setmtu) __P((struct ppp_softc *)); /* set mtu */
  84.     short    sc_mru;            /* max receive unit */
  85.     pid_t    sc_xfer;        /* used in transferring unit */
  86. /*hi*/    struct    ifqueue sc_rawq;    /* received packets */
  87. /*net*/    struct    ifqueue sc_inq;        /* queue of input packets for daemon */
  88. /*net*/    struct    ifqueue sc_fastq;    /* interactive output packet q */
  89.     struct    mbuf *sc_npqueue;    /* output packets not to be sent yet */
  90.     struct    mbuf **sc_npqtail;    /* ptr to last next ptr in npqueue */
  91.     struct    pppstat sc_stats;    /* count of bytes/pkts sent/rcvd */
  92.     enum    NPmode sc_npmode[NUM_NP]; /* what to do with each NP */
  93.     struct    compressor *sc_xcomp;    /* transmit compressor */
  94.     void    *sc_xc_state;        /* transmit compressor state */
  95.     struct    compressor *sc_rcomp;    /* receive decompressor */
  96.     void    *sc_rc_state;        /* receive decompressor state */
  97.     time_t    sc_last_sent;        /* time (secs) last NP pkt sent */
  98.     time_t    sc_last_recv;        /* time (secs) last NP pkt rcvd */
  99. #if PPP_FILTER
  100.     struct    bpf_program sc_pass_filt;   /* filter for packets to pass */
  101.     struct    bpf_program sc_active_filt; /* filter for "non-idle" packets */
  102. #endif /* PPP_FILTER */
  103. #if    VJC
  104.     struct    slcompress *sc_comp;     /* vjc control buffer */
  105. #endif
  106.  
  107.     /* Device-dependent part for async lines. */
  108.     ext_accm sc_asyncmap;        /* async control character map */
  109.     u_long    sc_rasyncmap;        /* receive async control char map */
  110.     struct    mbuf *sc_outm;        /* mbuf chain currently being output */
  111.     struct    mbuf *sc_m;        /* pointer to input mbuf chain */
  112.     struct    mbuf *sc_mc;        /* pointer to current input mbuf */
  113.     char    *sc_mp;            /* ptr to next char in input mbuf */
  114.     short    sc_ilen;        /* length of input packet so far */
  115.     u_short    sc_fcs;            /* FCS so far (input) */
  116.     u_short    sc_outfcs;        /* FCS so far for output packet */
  117.     u_char    sc_rawin[16];        /* chars as received */
  118.     int    sc_rawin_count;        /* # in sc_rawin */
  119. };
  120.  
  121. extern struct ppp_softc ppp_softc[NPPP];
  122.  
  123. struct    ppp_softc *pppalloc __P((pid_t pid));
  124. void    pppdealloc __P((struct ppp_softc *sc));
  125. int    pppioctl __P((struct ppp_softc *sc, u_long cmd, caddr_t data,
  126.               int flag, struct proc *p));
  127. int    pppoutput __P((struct ifnet *ifp, struct mbuf *m0,
  128.                struct sockaddr *dst, struct rtentry *rtp));
  129. void    ppp_restart __P((struct ppp_softc *sc));
  130. void    ppppktin __P((struct ppp_softc *sc, struct mbuf *m, int lost));
  131. struct    mbuf *ppp_dequeue __P((struct ppp_softc *sc));
  132.