NetServices Stack source

Dependents:   HelloWorld ServoInterfaceBoardExample1 4180_Lab4

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ipcp.h Source File

ipcp.h

00001 /*****************************************************************************
00002 * ipcp.h -  PPP IP NCP: Internet Protocol Network Control Protocol header file.
00003 *
00004 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
00005 * portions Copyright (c) 1997 Global Election Systems Inc.
00006 *
00007 * The authors hereby grant permission to use, copy, modify, distribute,
00008 * and license this software and its documentation for any purpose, provided
00009 * that existing copyright notices are retained in all copies and that this
00010 * notice and the following disclaimer are included verbatim in any 
00011 * distributions. No written agreement, license, or royalty fee is required
00012 * for any of the authorized uses.
00013 *
00014 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
00015 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00016 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
00017 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00018 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00019 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00020 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00021 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00022 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00023 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00024 *
00025 ******************************************************************************
00026 * REVISION HISTORY
00027 *
00028 * 03-01-01 Marc Boucher <marc@mbsi.ca>
00029 *   Ported to lwIP.
00030 * 97-12-04 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
00031 *   Original derived from BSD codes.
00032 *****************************************************************************/
00033 /*
00034  * ipcp.h - IP Control Protocol definitions.
00035  *
00036  * Copyright (c) 1989 Carnegie Mellon University.
00037  * All rights reserved.
00038  *
00039  * Redistribution and use in source and binary forms are permitted
00040  * provided that the above copyright notice and this paragraph are
00041  * duplicated in all such forms and that any documentation,
00042  * advertising materials, and other materials related to such
00043  * distribution and use acknowledge that the software was developed
00044  * by Carnegie Mellon University.  The name of the
00045  * University may not be used to endorse or promote products derived
00046  * from this software without specific prior written permission.
00047  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
00048  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
00049  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00050  *
00051  * $Id: ipcp.h,v 1.4 2010/01/18 20:49:43 goldsimon Exp $
00052  */
00053 
00054 #ifndef IPCP_H
00055 #define IPCP_H
00056 
00057 /*
00058  * Options.
00059  */
00060 #define CI_ADDRS            1      /* IP Addresses */
00061 #define CI_COMPRESSTYPE     2      /* Compression Type */
00062 #define CI_ADDR             3
00063 
00064 #define CI_MS_DNS1          129    /* Primary DNS value */
00065 #define CI_MS_WINS1         128    /* Primary WINS value */
00066 #define CI_MS_DNS2          131    /* Secondary DNS value */
00067 #define CI_MS_WINS2         130    /* Secondary WINS value */
00068 
00069 #define IPCP_VJMODE_OLD     1      /* "old" mode (option # = 0x0037) */
00070 #define IPCP_VJMODE_RFC1172 2      /* "old-rfc"mode (option # = 0x002d) */
00071 #define IPCP_VJMODE_RFC1332 3      /* "new-rfc"mode (option # = 0x002d, */
00072                                    /*  maxslot and slot number compression) */
00073 
00074 #define IPCP_VJ_COMP        0x002d /* current value for VJ compression option */
00075 #define IPCP_VJ_COMP_OLD    0x0037 /* "old" (i.e, broken) value for VJ */
00076                                    /* compression option */ 
00077 
00078 typedef struct ipcp_options {
00079   u_int   neg_addr      : 1; /* Negotiate IP Address? */
00080   u_int   old_addrs     : 1; /* Use old (IP-Addresses) option? */
00081   u_int   req_addr      : 1; /* Ask peer to send IP address? */
00082   u_int   default_route : 1; /* Assign default route through interface? */
00083   u_int   proxy_arp     : 1; /* Make proxy ARP entry for peer? */
00084   u_int   neg_vj        : 1; /* Van Jacobson Compression? */
00085   u_int   old_vj        : 1; /* use old (short) form of VJ option? */
00086   u_int   accept_local  : 1; /* accept peer's value for ouraddr */
00087   u_int   accept_remote : 1; /* accept peer's value for hisaddr */
00088   u_int   req_dns1      : 1; /* Ask peer to send primary DNS address? */
00089   u_int   req_dns2      : 1; /* Ask peer to send secondary DNS address? */
00090   u_short vj_protocol;       /* protocol value to use in VJ option */
00091   u_char  maxslotindex;      /* VJ slots - 1. */
00092   u_char  cflag;             /* VJ slot compression flag. */
00093   u32_t   ouraddr, hisaddr;  /* Addresses in NETWORK BYTE ORDER */
00094   u32_t   dnsaddr[2];        /* Primary and secondary MS DNS entries */
00095   u32_t   winsaddr[2];       /* Primary and secondary MS WINS entries */
00096 } ipcp_options;
00097 
00098 extern fsm ipcp_fsm[];
00099 extern ipcp_options ipcp_wantoptions[];
00100 extern ipcp_options ipcp_gotoptions[];
00101 extern ipcp_options ipcp_allowoptions[];
00102 extern ipcp_options ipcp_hisoptions[];
00103 
00104 extern struct protent ipcp_protent;
00105 
00106 #endif /* IPCP_H */