Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

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 "ppp_opts.h"
00046 #if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in ppp_opts.h */
00047 
00048 #ifndef IPCP_H
00049 #define IPCP_H
00050 
00051 #ifdef __cplusplus
00052 extern "C" {
00053 #endif
00054 
00055 /*
00056  * Options.
00057  */
00058 #define CI_ADDRS    1   /* IP Addresses */
00059 #if VJ_SUPPORT
00060 #define CI_COMPRESSTYPE 2   /* Compression Type */
00061 #endif /* VJ_SUPPORT */
00062 #define CI_ADDR     3
00063 
00064 #if PPP_DNS
00065 #define CI_MS_DNS1      129 /* Primary DNS value */
00066 #define CI_MS_DNS2      131     /* Secondary DNS value */
00067 #endif /* PPP_DNS */
00068 #if 0 /* UNUSED - WINS */
00069 #define CI_MS_WINS1     130     /* Primary WINS value */
00070 #define CI_MS_WINS2     132 /* Secondary WINS value */
00071 #endif /* UNUSED - WINS */
00072 
00073 #if VJ_SUPPORT
00074 #define MAX_STATES 16       /* from slcompress.h */
00075 
00076 #define IPCP_VJMODE_OLD 1   /* "old" mode (option # = 0x0037) */
00077 #define IPCP_VJMODE_RFC1172 2   /* "old-rfc"mode (option # = 0x002d) */
00078 #define IPCP_VJMODE_RFC1332 3   /* "new-rfc"mode (option # = 0x002d, */
00079                                 /*  maxslot and slot number compression) */
00080 
00081 #define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/
00082 #define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */
00083                 /* compression option*/ 
00084 #endif /* VJ_SUPPORT */
00085 
00086 typedef struct ipcp_options {
00087     unsigned int neg_addr               :1; /* Negotiate IP Address? */
00088     unsigned int old_addrs              :1; /* Use old (IP-Addresses) option? */
00089     unsigned int req_addr               :1; /* Ask peer to send IP address? */
00090 #if 0 /* UNUSED */
00091     unsigned int default_route          :1; /* Assign default route through interface? */
00092     unsigned int replace_default_route  :1; /* Replace default route through interface? */
00093 #endif /* UNUSED */
00094 #if 0 /* UNUSED - PROXY ARP */
00095     unsigned int proxy_arp              :1; /* Make proxy ARP entry for peer? */
00096 #endif /* UNUSED - PROXY ARP */
00097 #if VJ_SUPPORT
00098     unsigned int neg_vj                 :1; /* Van Jacobson Compression? */
00099     unsigned int old_vj                 :1; /* use old (short) form of VJ option? */
00100     unsigned int cflag                  :1;
00101 #endif /* VJ_SUPPORT */
00102     unsigned int accept_local           :1; /* accept peer's value for ouraddr */
00103     unsigned int accept_remote          :1; /* accept peer's value for hisaddr */
00104 #if PPP_DNS
00105     unsigned int req_dns1               :1; /* Ask peer to send primary DNS address? */
00106     unsigned int req_dns2               :1; /* Ask peer to send secondary DNS address? */
00107 #endif /* PPP_DNS */
00108 
00109     u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
00110 #if PPP_DNS
00111     u32_t dnsaddr[2];   /* Primary and secondary MS DNS entries */
00112 #endif /* PPP_DNS */
00113 #if 0 /* UNUSED - WINS */
00114     u32_t winsaddr[2];  /* Primary and secondary MS WINS entries */
00115 #endif /* UNUSED - WINS */
00116 
00117 #if VJ_SUPPORT
00118     u16_t vj_protocol;      /* protocol value to use in VJ option */
00119     u8_t  maxslotindex;     /* values for RFC1332 VJ compression neg. */
00120 #endif /* VJ_SUPPORT */
00121 } ipcp_options;
00122 
00123 #if 0 /* UNUSED, already defined */
00124 char *ip_ntoa (u32_t);
00125 #endif /* UNUSED, already defined */
00126 
00127 extern const struct protent ipcp_protent;
00128 
00129 #ifdef __cplusplus
00130 }
00131 #endif
00132 
00133 #endif /* IPCP_H */
00134 #endif /* PPP_SUPPORT && PPP_IPV4_SUPPORT */