Knight KE / Mbed OS Game_Master
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ipcp.h Source File

ipcp.h

00001 /*
00002  * ipcp.h - IP Control Protocol definitions.
00003  *
00004  * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  *
00010  * 1. Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer.
00012  *
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in
00015  *    the documentation and/or other materials provided with the
00016  *    distribution.
00017  *
00018  * 3. The name "Carnegie Mellon University" must not be used to
00019  *    endorse or promote products derived from this software without
00020  *    prior written permission. For permission or any legal
00021  *    details, please contact
00022  *      Office of Technology Transfer
00023  *      Carnegie Mellon University
00024  *      5000 Forbes Avenue
00025  *      Pittsburgh, PA  15213-3890
00026  *      (412) 268-4387, fax: (412) 268-7395
00027  *      tech-transfer@andrew.cmu.edu
00028  *
00029  * 4. Redistributions of any form whatsoever must retain the following
00030  *    acknowledgment:
00031  *    "This product includes software developed by Computing Services
00032  *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
00033  *
00034  * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
00035  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00036  * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
00037  * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00038  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
00039  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
00040  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00041  *
00042  * $Id: ipcp.h,v 1.14 2002/12/04 23:03:32 paulus Exp $
00043  */
00044 
00045 #include "netif/ppp/ppp_opts.h"
00046 #if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in lwipopts.h */
00047 
00048 #ifndef IPCP_H
00049 #define IPCP_H
00050 
00051 /*
00052  * Options.
00053  */
00054 #define CI_ADDRS    1   /* IP Addresses */
00055 #if VJ_SUPPORT
00056 #define CI_COMPRESSTYPE 2   /* Compression Type */
00057 #endif /* VJ_SUPPORT */
00058 #define CI_ADDR     3
00059 
00060 #if LWIP_DNS
00061 #define CI_MS_DNS1      129 /* Primary DNS value */
00062 #define CI_MS_DNS2      131     /* Secondary DNS value */
00063 #endif /* LWIP_DNS */
00064 #if 0 /* UNUSED - WINS */
00065 #define CI_MS_WINS1     130     /* Primary WINS value */
00066 #define CI_MS_WINS2     132 /* Secondary WINS value */
00067 #endif /* UNUSED - WINS */
00068 
00069 #if VJ_SUPPORT
00070 #define MAX_STATES 16       /* from slcompress.h */
00071 
00072 #define IPCP_VJMODE_OLD 1   /* "old" mode (option # = 0x0037) */
00073 #define IPCP_VJMODE_RFC1172 2   /* "old-rfc"mode (option # = 0x002d) */
00074 #define IPCP_VJMODE_RFC1332 3   /* "new-rfc"mode (option # = 0x002d, */
00075                                 /*  maxslot and slot number compression) */
00076 
00077 #define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/
00078 #define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */
00079                 /* compression option*/ 
00080 #endif /* VJ_SUPPORT */
00081 
00082 typedef struct ipcp_options {
00083     unsigned int neg_addr               :1; /* Negotiate IP Address? */
00084     unsigned int old_addrs              :1; /* Use old (IP-Addresses) option? */
00085     unsigned int req_addr               :1; /* Ask peer to send IP address? */
00086 #if 0 /* UNUSED */
00087     unsigned int default_route          :1; /* Assign default route through interface? */
00088     unsigned int replace_default_route  :1; /* Replace default route through interface? */
00089 #endif /* UNUSED */
00090 #if 0 /* UNUSED - PROXY ARP */
00091     unsigned int proxy_arp              :1; /* Make proxy ARP entry for peer? */
00092 #endif /* UNUSED - PROXY ARP */
00093 #if VJ_SUPPORT
00094     unsigned int neg_vj                 :1; /* Van Jacobson Compression? */
00095     unsigned int old_vj                 :1; /* use old (short) form of VJ option? */
00096     unsigned int cflag                  :1;
00097 #endif /* VJ_SUPPORT */
00098     unsigned int accept_local           :1; /* accept peer's value for ouraddr */
00099     unsigned int accept_remote          :1; /* accept peer's value for hisaddr */
00100 #if LWIP_DNS
00101     unsigned int req_dns1               :1; /* Ask peer to send primary DNS address? */
00102     unsigned int req_dns2               :1; /* Ask peer to send secondary DNS address? */
00103 #endif /* LWIP_DNS */
00104 
00105     u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
00106 #if LWIP_DNS
00107     u32_t dnsaddr[2];   /* Primary and secondary MS DNS entries */
00108 #endif /* LWIP_DNS */
00109 #if 0 /* UNUSED - WINS */
00110     u32_t winsaddr[2];  /* Primary and secondary MS WINS entries */
00111 #endif /* UNUSED - WINS */
00112 
00113 #if VJ_SUPPORT
00114     u16_t vj_protocol;      /* protocol value to use in VJ option */
00115     u8_t  maxslotindex;     /* values for RFC1332 VJ compression neg. */
00116 #endif /* VJ_SUPPORT */
00117 } ipcp_options;
00118 
00119 #if 0 /* UNUSED, already defined by lwIP */
00120 char *ip_ntoa (u32_t);
00121 #endif /* UNUSED, already defined by lwIP */
00122 
00123 extern const struct protent ipcp_protent;
00124 
00125 #endif /* IPCP_H */
00126 #endif /* PPP_SUPPORT && PPP_IPV4_SUPPORT */