oliverschmidt | 3396e9a | 2004-08-20 12:29:54 +0000 | [diff] [blame] | 1 | #ifndef __PAP_H__ |
| 2 | #define __PAP_H__ |
| 3 | /* |
| 4 | www.mycal.com |
| 5 | --------------------------------------------------------------------------- |
| 6 | pap.h - pap header file |
| 7 | --------------------------------------------------------------------------- |
| 8 | Version |
| 9 | 0.1 Original Version June 3, 2000 |
| 10 | (c)2000 Mycal Labs, All Rights Reserved |
| 11 | --------------------------------------------------------------------------- |
| 12 | */ |
| 13 | /* |
| 14 | * Copyright (c) 2003, Mike Johnson, Mycal Labs, www.mycal.net |
| 15 | * All rights reserved. |
| 16 | * |
| 17 | * Redistribution and use in source and binary forms, with or without |
| 18 | * modification, are permitted provided that the following conditions |
| 19 | * are met: |
| 20 | * 1. Redistributions of source code must retain the above copyright |
| 21 | * notice, this list of conditions and the following disclaimer. |
| 22 | * 2. Redistributions in binary form must reproduce the above copyright |
| 23 | * notice, this list of conditions and the following disclaimer in the |
| 24 | * documentation and/or other materials provided with the distribution. |
| 25 | * 3. All advertising materials mentioning features or use of this software |
| 26 | * must display the following acknowledgement: |
| 27 | * This product includes software developed by Mike Johnson/Mycal Labs |
| 28 | * www.mycal.net. |
| 29 | * 4. The name of the author may not be used to endorse or promote |
| 30 | * products derived from this software without specific prior |
| 31 | * written permission. |
| 32 | * |
| 33 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS |
| 34 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 35 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 36 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
| 37 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 38 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 39 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 40 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 41 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 42 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 43 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 44 | * |
| 45 | * This file is part of the Mycal Modified uIP TCP/IP stack. |
| 46 | * |
oliverschmidt | a0f331a | 2004-08-22 21:10:02 +0000 | [diff] [blame] | 47 | * $Id: pap.h,v 1.3 2004/08/22 21:10:02 oliverschmidt Exp $ |
oliverschmidt | 3396e9a | 2004-08-20 12:29:54 +0000 | [diff] [blame] | 48 | * |
| 49 | */ |
| 50 | |
| 51 | #include "uip.h" |
| 52 | |
| 53 | /* PAP state machine flags */ |
| 54 | /* client only */ |
| 55 | #define PAP_TX_UP 0x01 |
| 56 | /* server only */ |
| 57 | #define PAP_RX_UP 0x02 |
| 58 | |
| 59 | #define PAP_RX_AUTH_FAIL 0x10 |
| 60 | #define PAP_TX_AUTH_FAIL 0x20 |
| 61 | #define PAP_RX_TIMEOUT 0x80 |
| 62 | #define PAP_TX_TIMEOUT 0x80 |
| 63 | |
| 64 | typedef struct _pappkt { |
| 65 | u8_t code; |
| 66 | u8_t id; |
| 67 | u16_t len; |
| 68 | u8_t data[0]; |
| 69 | } PAPPKT; |
| 70 | |
| 71 | /* Export pap_state */ |
| 72 | extern u8_t pap_state; |
| 73 | |
oliverschmidt | a0f331a | 2004-08-22 21:10:02 +0000 | [diff] [blame] | 74 | extern u8_t pap_username[]; |
| 75 | extern u8_t pap_password[]; |
| 76 | |
oliverschmidt | 3396e9a | 2004-08-20 12:29:54 +0000 | [diff] [blame] | 77 | /* Function prototypes */ |
| 78 | void pap_init(void); |
| 79 | void pap_rx(u8_t *, u16_t); |
oliverschmidt | a0f331a | 2004-08-22 21:10:02 +0000 | [diff] [blame] | 80 | void pap_task(u8_t *buffer); |
oliverschmidt | 3396e9a | 2004-08-20 12:29:54 +0000 | [diff] [blame] | 81 | |
oliverschmidt | e9a3257 | 2004-08-22 12:35:12 +0000 | [diff] [blame] | 82 | #endif /* __PAP_H__ */ |
oliverschmidt | 3396e9a | 2004-08-20 12:29:54 +0000 | [diff] [blame] | 83 | |