oliverschmidt | 3396e9a | 2004-08-20 12:29:54 +0000 | [diff] [blame] | 1 | #ifndef __IPCP_H__ |
| 2 | #define __IPCP_H__ |
| 3 | /* www.mycal.com |
| 4 | --------------------------------------------------------------------------- |
| 5 | IPCP.h - Internet Protocol Control Protocol 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: ipcp.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 | #include "uip.h" |
| 50 | #include "ppp-conf.h" |
| 51 | |
| 52 | /* Config options (move to pppconfig) |
| 53 | #define IPCP_RETRY_COUNT 5 |
| 54 | #define IPCP_TIMEOUT 5 |
| 55 | */ |
| 56 | |
| 57 | /* IPCP Option Types */ |
| 58 | #define IPCP_IPADDRESS 0x03 |
| 59 | #define IPCP_PRIMARY_DNS 0x81 |
| 60 | #define IPCP_SECONDARY_DNS 0x83 |
| 61 | |
| 62 | /* IPCP state machine flags */ |
| 63 | #define IPCP_TX_UP 0x01 |
| 64 | #define IPCP_RX_UP 0x02 |
| 65 | #define IPCP_IP_BIT 0x04 |
| 66 | #define IPCP_TX_TIMEOUT 0x08 |
| 67 | #define IPCP_PRI_DNS_BIT 0x08 |
| 68 | #define IPCP_SEC_DNS_BIT 0x10 |
| 69 | |
| 70 | typedef struct _ipcp |
| 71 | { |
| 72 | u8_t code; |
| 73 | u8_t id; |
| 74 | u16_t len; |
| 75 | u8_t data[0]; |
| 76 | } IPCPPKT; |
| 77 | |
| 78 | /* |
| 79 | * Export IP addresses. |
| 80 | */ |
| 81 | #if 0 /* moved to mip.c */ |
| 82 | extern IPAddr our_ipaddr; |
| 83 | extern IPAddr peer_ip_addr; |
| 84 | extern IPAddr pri_dns_addr; |
| 85 | extern IPAddr sec_dns_addr; |
| 86 | #endif |
| 87 | |
| 88 | extern u8_t ipcp_state; |
| 89 | |
| 90 | void ipcp_init(void); |
| 91 | void ipcp_task(u8_t *buffer); |
| 92 | void ipcp_rx(u8_t *, u16_t); |
| 93 | |
oliverschmidt | e9a3257 | 2004-08-22 12:35:12 +0000 | [diff] [blame] | 94 | #endif /* __IPCP_H__ */ |
oliverschmidt | 3396e9a | 2004-08-20 12:29:54 +0000 | [diff] [blame] | 95 | |