hattori&ide

Dependencies:   mbed

Committer:
hattori_atsushi
Date:
Sun Dec 18 08:16:01 2022 +0000
Revision:
0:f77369cabd75
hattori

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hattori_atsushi 0:f77369cabd75 1 /*****************************************************************************
hattori_atsushi 0:f77369cabd75 2 * ipcp.h - PPP IP NCP: Internet Protocol Network Control Protocol header file.
hattori_atsushi 0:f77369cabd75 3 *
hattori_atsushi 0:f77369cabd75 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
hattori_atsushi 0:f77369cabd75 5 * portions Copyright (c) 1997 Global Election Systems Inc.
hattori_atsushi 0:f77369cabd75 6 *
hattori_atsushi 0:f77369cabd75 7 * The authors hereby grant permission to use, copy, modify, distribute,
hattori_atsushi 0:f77369cabd75 8 * and license this software and its documentation for any purpose, provided
hattori_atsushi 0:f77369cabd75 9 * that existing copyright notices are retained in all copies and that this
hattori_atsushi 0:f77369cabd75 10 * notice and the following disclaimer are included verbatim in any
hattori_atsushi 0:f77369cabd75 11 * distributions. No written agreement, license, or royalty fee is required
hattori_atsushi 0:f77369cabd75 12 * for any of the authorized uses.
hattori_atsushi 0:f77369cabd75 13 *
hattori_atsushi 0:f77369cabd75 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
hattori_atsushi 0:f77369cabd75 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
hattori_atsushi 0:f77369cabd75 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
hattori_atsushi 0:f77369cabd75 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
hattori_atsushi 0:f77369cabd75 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
hattori_atsushi 0:f77369cabd75 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
hattori_atsushi 0:f77369cabd75 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
hattori_atsushi 0:f77369cabd75 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
hattori_atsushi 0:f77369cabd75 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
hattori_atsushi 0:f77369cabd75 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
hattori_atsushi 0:f77369cabd75 24 *
hattori_atsushi 0:f77369cabd75 25 ******************************************************************************
hattori_atsushi 0:f77369cabd75 26 * REVISION HISTORY
hattori_atsushi 0:f77369cabd75 27 *
hattori_atsushi 0:f77369cabd75 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
hattori_atsushi 0:f77369cabd75 29 * Ported to lwIP.
hattori_atsushi 0:f77369cabd75 30 * 97-12-04 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
hattori_atsushi 0:f77369cabd75 31 * Original derived from BSD codes.
hattori_atsushi 0:f77369cabd75 32 *****************************************************************************/
hattori_atsushi 0:f77369cabd75 33 /*
hattori_atsushi 0:f77369cabd75 34 * ipcp.h - IP Control Protocol definitions.
hattori_atsushi 0:f77369cabd75 35 *
hattori_atsushi 0:f77369cabd75 36 * Copyright (c) 1989 Carnegie Mellon University.
hattori_atsushi 0:f77369cabd75 37 * All rights reserved.
hattori_atsushi 0:f77369cabd75 38 *
hattori_atsushi 0:f77369cabd75 39 * Redistribution and use in source and binary forms are permitted
hattori_atsushi 0:f77369cabd75 40 * provided that the above copyright notice and this paragraph are
hattori_atsushi 0:f77369cabd75 41 * duplicated in all such forms and that any documentation,
hattori_atsushi 0:f77369cabd75 42 * advertising materials, and other materials related to such
hattori_atsushi 0:f77369cabd75 43 * distribution and use acknowledge that the software was developed
hattori_atsushi 0:f77369cabd75 44 * by Carnegie Mellon University. The name of the
hattori_atsushi 0:f77369cabd75 45 * University may not be used to endorse or promote products derived
hattori_atsushi 0:f77369cabd75 46 * from this software without specific prior written permission.
hattori_atsushi 0:f77369cabd75 47 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
hattori_atsushi 0:f77369cabd75 48 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
hattori_atsushi 0:f77369cabd75 49 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
hattori_atsushi 0:f77369cabd75 50 *
hattori_atsushi 0:f77369cabd75 51 * $Id: ipcp.h,v 1.4 2010/01/18 20:49:43 goldsimon Exp $
hattori_atsushi 0:f77369cabd75 52 */
hattori_atsushi 0:f77369cabd75 53
hattori_atsushi 0:f77369cabd75 54 #ifndef IPCP_H
hattori_atsushi 0:f77369cabd75 55 #define IPCP_H
hattori_atsushi 0:f77369cabd75 56
hattori_atsushi 0:f77369cabd75 57 /*
hattori_atsushi 0:f77369cabd75 58 * Options.
hattori_atsushi 0:f77369cabd75 59 */
hattori_atsushi 0:f77369cabd75 60 #define CI_ADDRS 1 /* IP Addresses */
hattori_atsushi 0:f77369cabd75 61 #define CI_COMPRESSTYPE 2 /* Compression Type */
hattori_atsushi 0:f77369cabd75 62 #define CI_ADDR 3
hattori_atsushi 0:f77369cabd75 63
hattori_atsushi 0:f77369cabd75 64 #define CI_MS_DNS1 129 /* Primary DNS value */
hattori_atsushi 0:f77369cabd75 65 #define CI_MS_WINS1 128 /* Primary WINS value */
hattori_atsushi 0:f77369cabd75 66 #define CI_MS_DNS2 131 /* Secondary DNS value */
hattori_atsushi 0:f77369cabd75 67 #define CI_MS_WINS2 130 /* Secondary WINS value */
hattori_atsushi 0:f77369cabd75 68
hattori_atsushi 0:f77369cabd75 69 #define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */
hattori_atsushi 0:f77369cabd75 70 #define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */
hattori_atsushi 0:f77369cabd75 71 #define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */
hattori_atsushi 0:f77369cabd75 72 /* maxslot and slot number compression) */
hattori_atsushi 0:f77369cabd75 73
hattori_atsushi 0:f77369cabd75 74 #define IPCP_VJ_COMP 0x002d /* current value for VJ compression option */
hattori_atsushi 0:f77369cabd75 75 #define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */
hattori_atsushi 0:f77369cabd75 76 /* compression option */
hattori_atsushi 0:f77369cabd75 77
hattori_atsushi 0:f77369cabd75 78 typedef struct ipcp_options {
hattori_atsushi 0:f77369cabd75 79 u_int neg_addr : 1; /* Negotiate IP Address? */
hattori_atsushi 0:f77369cabd75 80 u_int old_addrs : 1; /* Use old (IP-Addresses) option? */
hattori_atsushi 0:f77369cabd75 81 u_int req_addr : 1; /* Ask peer to send IP address? */
hattori_atsushi 0:f77369cabd75 82 u_int default_route : 1; /* Assign default route through interface? */
hattori_atsushi 0:f77369cabd75 83 u_int proxy_arp : 1; /* Make proxy ARP entry for peer? */
hattori_atsushi 0:f77369cabd75 84 u_int neg_vj : 1; /* Van Jacobson Compression? */
hattori_atsushi 0:f77369cabd75 85 u_int old_vj : 1; /* use old (short) form of VJ option? */
hattori_atsushi 0:f77369cabd75 86 u_int accept_local : 1; /* accept peer's value for ouraddr */
hattori_atsushi 0:f77369cabd75 87 u_int accept_remote : 1; /* accept peer's value for hisaddr */
hattori_atsushi 0:f77369cabd75 88 u_int req_dns1 : 1; /* Ask peer to send primary DNS address? */
hattori_atsushi 0:f77369cabd75 89 u_int req_dns2 : 1; /* Ask peer to send secondary DNS address? */
hattori_atsushi 0:f77369cabd75 90 u_short vj_protocol; /* protocol value to use in VJ option */
hattori_atsushi 0:f77369cabd75 91 u_char maxslotindex; /* VJ slots - 1. */
hattori_atsushi 0:f77369cabd75 92 u_char cflag; /* VJ slot compression flag. */
hattori_atsushi 0:f77369cabd75 93 u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
hattori_atsushi 0:f77369cabd75 94 u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */
hattori_atsushi 0:f77369cabd75 95 u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */
hattori_atsushi 0:f77369cabd75 96 } ipcp_options;
hattori_atsushi 0:f77369cabd75 97
hattori_atsushi 0:f77369cabd75 98 extern fsm ipcp_fsm[];
hattori_atsushi 0:f77369cabd75 99 extern ipcp_options ipcp_wantoptions[];
hattori_atsushi 0:f77369cabd75 100 extern ipcp_options ipcp_gotoptions[];
hattori_atsushi 0:f77369cabd75 101 extern ipcp_options ipcp_allowoptions[];
hattori_atsushi 0:f77369cabd75 102 extern ipcp_options ipcp_hisoptions[];
hattori_atsushi 0:f77369cabd75 103
hattori_atsushi 0:f77369cabd75 104 extern struct protent ipcp_protent;
hattori_atsushi 0:f77369cabd75 105
hattori_atsushi 0:f77369cabd75 106 #endif /* IPCP_H */