Nut/OS  4.10.3
API Reference
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$
00069  * Revision 1.6  2008/08/11 06:59:59  haraldkipp
00070  * BSD types replaced by stdint types (feature request #1282721).
00071  *
00072  * Revision 1.5  2005/08/02 17:46:48  haraldkipp
00073  * Major API documentation update.
00074  *
00075  * Revision 1.4  2004/03/14 10:14:42  haraldkipp
00076  * Unused prototypes removed
00077  *
00078  * Revision 1.3  2003/08/14 15:05:55  haraldkipp
00079  * Distinguish negotiated and final magic
00080  *
00081  * Revision 1.2  2003/07/24 16:13:58  haraldkipp
00082  * Never request a rejected DNS
00083  *
00084  * Revision 1.1.1.1  2003/05/09 14:41:08  haraldkipp
00085  * Initial using 3.2.1
00086  *
00087  * Revision 1.2  2003/05/06 18:43:30  harald
00088  * Cleanup
00089  *
00090  * Revision 1.1  2003/03/31 14:53:23  harald
00091  * Prepare release 3.1
00092  *
00093  */
00094 
00095 #include <sys/device.h>
00096 #include <dev/netbuf.h>
00097 
00103 /*
00104  * Reject flags. Not completed, more will follow.
00105  */
00106 #define REJ_IPCP_DNS1       0x00000100
00107 #define REJ_IPCP_DNS2       0x00000200
00108 
00109 #ifdef __cplusplus
00110 extern "C" {
00111 #endif
00112 
00117 
00118 #define PPP_PFC     0x01
00119 #define PPP_ACFC    0x02
00120 
00121 #define LCP_DEFOPT_ASYNCMAP 0x000A0000UL
00122 
00126 typedef struct _PPPDCB PPPDCB;
00127 
00134 struct _PPPDCB {
00139     HANDLE dcb_state_chg;       
00140 
00143     uint8_t dcb_lcp_state;
00144     
00147     uint8_t dcb_reqid;
00148 
00151     uint8_t dcb_rejid;
00152 
00155     uint8_t dcb_acked;
00156 
00159     uint16_t dcb_loc_mru;
00160 
00163     uint16_t dcb_rem_mru;
00164 
00168     uint32_t dcb_accm;
00169 
00173     uint8_t dcb_compr;
00174     
00177     uint16_t dcb_auth;
00178 
00181     uint32_t dcb_neg_magic;
00182 
00186     uint32_t dcb_loc_magic;
00187 
00191     uint32_t dcb_rem_magic;
00192 
00195     uint8_t *dcb_user;
00196 
00199     uint8_t *dcb_pass;
00200 
00203     uint32_t dcb_local_ip;
00204 
00207     uint32_t dcb_remote_ip;
00208 
00211     uint32_t dcb_ip_mask;
00212 
00215     uint32_t dcb_ip_dns1;
00216 
00219     uint32_t dcb_ip_dns2;
00220 
00223     uint32_t dcb_rejects;
00224 
00227     uint8_t dcb_retries;
00228 
00231     uint8_t dcb_lcp_naks;
00232 
00235     uint8_t dcb_lcp_reqid;
00236 
00239     uint8_t dcb_ipcp_state;
00240     
00243     uint8_t dcb_ipcp_naks;
00244 
00247     uint8_t dcb_auth_state;
00248 
00251     int dcb_fd;
00252 };
00253 
00254 /*
00255  * Available devices.
00256  */
00257 extern NUTDEVICE devPpp;
00258 
00259 #define LCP_OPEN        1
00260 #define LCP_CLOSE       2
00261 #define LCP_LOWERUP     3
00262 #define LCP_LOWERDOWN   4
00263 
00266 #ifdef __cplusplus
00267 }
00268 #endif
00269 
00270 #endif