ppp.h

Go to the documentation of this file.
00001 #ifndef _DEV_PPP_H_
00002 #define _DEV_PPP_H_
00003 
00004 /*
00005  * Copyright (C) 2001-2003 by egnite Software GmbH. All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holders nor the names of
00017  *    contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00024  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00026  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00027  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00028  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00030  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  * For additional information see http://www.ethernut.de/
00034  * -
00035  *
00036  * Copyright (C) 2002 by Call Direct Cellular Solutions Pty. Ltd. All rights reserved.
00037  *
00038  * Redistribution and use in source and binary forms, with or without
00039  * modification, are permitted provided that the following conditions
00040  * are met:
00041  *
00042  * 1. Redistributions of source code must retain the above copyright
00043  *    notice, this list of conditions and the following disclaimer.
00044  * 2. Redistributions in binary form must reproduce the above copyright
00045  *    notice, this list of conditions and the following disclaimer in the
00046  *    documentation and/or other materials provided with the distribution.
00047  * 3. Neither the name of the copyright holders nor the names of
00048  *    contributors may be used to endorse or promote products derived
00049  *    from this software without specific prior written permission.
00050  *
00051  * THIS SOFTWARE IS PROVIDED BY CALL DIRECT CELLULAR SOLUTIONS AND CONTRIBUTORS
00052  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00053  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00054  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CALL DIRECT
00055  * CELLULAR SOLUTIONS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00056  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00057  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00058  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00059  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00060  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00061  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00062  * SUCH DAMAGE.
00063  *
00064  * For additional information see http://www.calldirect.com.au/
00065  */
00066 
00067 /*
00068  * $Log: ppp.h,v $
00069  * Revision 1.5  2005/08/02 17:46:48  haraldkipp
00070  * Major API documentation update.
00071  *
00072  * Revision 1.4  2004/03/14 10:14:42  haraldkipp
00073  * Unused prototypes removed
00074  *
00075  * Revision 1.3  2003/08/14 15:05:55  haraldkipp
00076  * Distinguish negotiated and final magic
00077  *
00078  * Revision 1.2  2003/07/24 16:13:58  haraldkipp
00079  * Never request a rejected DNS
00080  *
00081  * Revision 1.1.1.1  2003/05/09 14:41:08  haraldkipp
00082  * Initial using 3.2.1
00083  *
00084  * Revision 1.2  2003/05/06 18:43:30  harald
00085  * Cleanup
00086  *
00087  * Revision 1.1  2003/03/31 14:53:23  harald
00088  * Prepare release 3.1
00089  *
00090  */
00091 
00092 #include <sys/device.h>
00093 #include <dev/netbuf.h>
00094 
00100 /*
00101  * Reject flags. Not completed, more will follow.
00102  */
00103 #define REJ_IPCP_DNS1       0x00000100
00104 #define REJ_IPCP_DNS2       0x00000200
00105 
00106 #ifdef __cplusplus
00107 extern "C" {
00108 #endif
00109 
00114 
00115 #define PPP_PFC     0x01
00116 #define PPP_ACFC    0x02
00117 
00118 #define LCP_DEFOPT_ASYNCMAP 0x000A0000UL
00119 
00123 typedef struct _PPPDCB PPPDCB;
00124 
00131 struct _PPPDCB {
00136     HANDLE dcb_state_chg;   
00137 
00140     u_char dcb_lcp_state;
00141     
00144     u_char dcb_reqid;
00145 
00148     u_char dcb_rejid;
00149 
00152     u_char dcb_acked;
00153 
00156     u_short dcb_loc_mru;
00157 
00160     u_short dcb_rem_mru;
00161 
00165     u_long dcb_accm;
00166 
00170     u_char dcb_compr;
00171     
00174     u_short dcb_auth;
00175 
00178     u_long dcb_neg_magic;
00179 
00183     u_long dcb_loc_magic;
00184 
00188     u_long dcb_rem_magic;
00189 
00192     u_char *dcb_user;
00193 
00196     u_char *dcb_pass;
00197 
00200     u_long dcb_local_ip;
00201 
00204     u_long dcb_remote_ip;
00205 
00208     u_long dcb_ip_mask;
00209 
00212     u_long dcb_ip_dns1;
00213 
00216     u_long dcb_ip_dns2;
00217 
00220     u_long dcb_rejects;
00221 
00224     u_char dcb_retries;
00225 
00228     u_char dcb_lcp_naks;
00229 
00232     u_char dcb_lcp_reqid;
00233 
00236     u_char dcb_ipcp_state;
00237     
00240     u_char dcb_ipcp_naks;
00241 
00244     u_char dcb_auth_state;
00245 
00248     int dcb_fd;
00249 };
00250 
00251 /*
00252  * Available devices.
00253  */
00254 extern NUTDEVICE devPpp;
00255 
00256 #define LCP_OPEN        1
00257 #define LCP_CLOSE       2
00258 #define LCP_LOWERUP     3
00259 #define LCP_LOWERDOWN   4
00260 
00263 #ifdef __cplusplus
00264 }
00265 #endif
00266 
00267 #endif

© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/