oliverschmidt | e9a3257 | 2004-08-22 12:35:12 +0000 | [diff] [blame] | 1 | #ifndef __LCP_H__ |
| 2 | #define __LCP_H__ |
oliverschmidt | 3396e9a | 2004-08-20 12:29:54 +0000 | [diff] [blame] | 3 | /* www.mycal.com |
| 4 | --------------------------------------------------------------------------- |
| 5 | LCP.h - LCP header file |
| 6 | --------------------------------------------------------------------------- |
| 7 | Version - |
| 8 | 0.1 Original Version June 3, 2000 |
| 9 | (c)2000 Mycal Labs, All Rights Reserved |
| 10 | --------------------------------------------------------------------------- |
| 11 | */ |
| 12 | /* |
| 13 | * Copyright (c) 2003, Mike Johnson, Mycal Labs, www.mycal.net |
| 14 | * All rights reserved. |
| 15 | * |
| 16 | * Redistribution and use in source and binary forms, with or without |
| 17 | * modification, are permitted provided that the following conditions |
| 18 | * are met: |
| 19 | * 1. Redistributions of source code must retain the above copyright |
| 20 | * notice, this list of conditions and the following disclaimer. |
| 21 | * 2. Redistributions in binary form must reproduce the above copyright |
| 22 | * notice, this list of conditions and the following disclaimer in the |
| 23 | * documentation and/or other materials provided with the distribution. |
| 24 | * 3. All advertising materials mentioning features or use of this software |
| 25 | * must display the following acknowledgement: |
| 26 | * This product includes software developed by Mike Johnson/Mycal Labs |
| 27 | * www.mycal.net. |
| 28 | * 4. The name of the author may not be used to endorse or promote |
| 29 | * products derived from this software without specific prior |
| 30 | * written permission. |
| 31 | * |
| 32 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS |
| 33 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 35 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
| 36 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 37 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 38 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 39 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 40 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 41 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 42 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 43 | * |
| 44 | * This file is part of the Mycal Modified uIP TCP/IP stack. |
| 45 | * |
oliverschmidt | e9a3257 | 2004-08-22 12:35:12 +0000 | [diff] [blame] | 46 | * $Id: lcp.h,v 1.2 2004/08/22 12:37:00 oliverschmidt Exp $ |
oliverschmidt | 3396e9a | 2004-08-20 12:29:54 +0000 | [diff] [blame] | 47 | * |
| 48 | */ |
| 49 | |
| 50 | #include "uip.h" |
| 51 | #include "ppp-conf.h" |
| 52 | |
| 53 | /* LCP Option Types */ |
| 54 | #define LPC_VENDERX 0x0 |
| 55 | #define LPC_MRU 0x1 |
| 56 | #define LPC_ACCM 0x2 |
| 57 | #define LPC_AUTH 0x3 |
| 58 | #define LPC_QUALITY 0x4 |
| 59 | #define LPC_MAGICNUMBER 0x5 |
| 60 | #define LPC_PFC 0x7 |
| 61 | #define LPC_ACFC 0x8 |
| 62 | |
| 63 | /* LCP Negotiated options flag equates */ |
| 64 | #define LCP_OPT_ACCM 0x1 |
| 65 | #define LCP_OPT_AUTH 0x2 |
| 66 | #define LCP_OPT_PFC 0x4 |
| 67 | #define LCP_OPT_ACFC 0x4 |
| 68 | |
| 69 | /* LCP state machine flags */ |
| 70 | #define LCP_TX_UP 0x1 |
| 71 | #define LCP_RX_UP 0x2 |
| 72 | |
| 73 | #define LCP_RX_AUTH 0x10 |
| 74 | /* LCP request for auth */ |
| 75 | #define LCP_TERM_PEER 0x20 |
| 76 | /* LCP Terminated by peer */ |
| 77 | #define LCP_RX_TIMEOUT 0x40 |
| 78 | #define LCP_TX_TIMEOUT 0x80 |
| 79 | |
| 80 | typedef struct _lcppkt |
| 81 | { |
| 82 | u8_t code; |
| 83 | u8_t id; |
| 84 | u16_t len; |
| 85 | u8_t data[0]; |
| 86 | } LCPPKT; |
| 87 | |
| 88 | /* Exported Vars */ |
| 89 | extern u8_t lcp_state; |
| 90 | |
| 91 | void lcp_init(void); |
| 92 | void lcp_rx(u8_t *, u16_t); |
| 93 | void lcp_task(u8_t *buffer); |
| 94 | |
oliverschmidt | e9a3257 | 2004-08-22 12:35:12 +0000 | [diff] [blame] | 95 | #endif /* __LCP_H__ */ |