ccp.c (85985) | ccp.c (93418) |
---|---|
1/*- 2 * Copyright (c) 1996 - 2001 Brian Somers <brian@Awfulhak.org> 3 * based on work by Toshiharu OHNO <tony-o@iij.ad.jp> 4 * Internet Initiative Japan, Inc (IIJ) 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 1996 - 2001 Brian Somers <brian@Awfulhak.org> 3 * based on work by Toshiharu OHNO <tony-o@iij.ad.jp> 4 * Internet Initiative Japan, Inc (IIJ) 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/usr.sbin/ppp/ccp.c 85985 2001-11-03 19:29:30Z brian $ | 28 * $FreeBSD: head/usr.sbin/ppp/ccp.c 93418 2002-03-30 12:30:09Z brian $ |
29 */ 30 31#include <sys/param.h> 32#include <netinet/in.h> 33#include <netinet/in_systm.h> 34#include <netinet/ip.h> 35#include <sys/socket.h> 36#include <sys/un.h> --- 28 unchanged lines hidden (view full) --- 65#include "prompt.h" 66#include "link.h" 67#include "mp.h" 68#include "async.h" 69#include "physical.h" 70#ifndef NORADIUS 71#include "radius.h" 72#endif | 29 */ 30 31#include <sys/param.h> 32#include <netinet/in.h> 33#include <netinet/in_systm.h> 34#include <netinet/ip.h> 35#include <sys/socket.h> 36#include <sys/un.h> --- 28 unchanged lines hidden (view full) --- 65#include "prompt.h" 66#include "link.h" 67#include "mp.h" 68#include "async.h" 69#include "physical.h" 70#ifndef NORADIUS 71#include "radius.h" 72#endif |
73#ifdef HAVE_DES | 73#ifndef NODES |
74#include "mppe.h" 75#endif 76#include "ipv6cp.h" 77#include "ncp.h" 78#include "bundle.h" 79 80static void CcpSendConfigReq(struct fsm *); 81static void CcpSentTerminateReq(struct fsm *); --- 61 unchanged lines hidden (view full) --- 143 return cftypes[proto]; 144} 145 146/* We support these algorithms, and Req them in the given order */ 147static const struct ccp_algorithm * const algorithm[] = { 148 &DeflateAlgorithm, 149 &Pred1Algorithm, 150 &PppdDeflateAlgorithm | 74#include "mppe.h" 75#endif 76#include "ipv6cp.h" 77#include "ncp.h" 78#include "bundle.h" 79 80static void CcpSendConfigReq(struct fsm *); 81static void CcpSentTerminateReq(struct fsm *); --- 61 unchanged lines hidden (view full) --- 143 return cftypes[proto]; 144} 145 146/* We support these algorithms, and Req them in the given order */ 147static const struct ccp_algorithm * const algorithm[] = { 148 &DeflateAlgorithm, 149 &Pred1Algorithm, 150 &PppdDeflateAlgorithm |
151#ifdef HAVE_DES | 151#ifndef NODES |
152 , &MPPEAlgorithm 153#endif 154}; 155 156#define NALGORITHMS (sizeof algorithm/sizeof algorithm[0]) 157 158int 159ccp_ReportStatus(struct cmdargs const *arg) --- 32 unchanged lines hidden (view full) --- 192 prompt_Printf(arg->prompt, "\n Defaults: "); 193 prompt_Printf(arg->prompt, "FSM retry = %us, max %u Config" 194 " REQ%s, %u Term REQ%s\n", ccp->cfg.fsm.timeout, 195 ccp->cfg.fsm.maxreq, ccp->cfg.fsm.maxreq == 1 ? "" : "s", 196 ccp->cfg.fsm.maxtrm, ccp->cfg.fsm.maxtrm == 1 ? "" : "s"); 197 prompt_Printf(arg->prompt, " deflate windows: "); 198 prompt_Printf(arg->prompt, "incoming = %d, ", ccp->cfg.deflate.in.winsize); 199 prompt_Printf(arg->prompt, "outgoing = %d\n", ccp->cfg.deflate.out.winsize); | 152 , &MPPEAlgorithm 153#endif 154}; 155 156#define NALGORITHMS (sizeof algorithm/sizeof algorithm[0]) 157 158int 159ccp_ReportStatus(struct cmdargs const *arg) --- 32 unchanged lines hidden (view full) --- 192 prompt_Printf(arg->prompt, "\n Defaults: "); 193 prompt_Printf(arg->prompt, "FSM retry = %us, max %u Config" 194 " REQ%s, %u Term REQ%s\n", ccp->cfg.fsm.timeout, 195 ccp->cfg.fsm.maxreq, ccp->cfg.fsm.maxreq == 1 ? "" : "s", 196 ccp->cfg.fsm.maxtrm, ccp->cfg.fsm.maxtrm == 1 ? "" : "s"); 197 prompt_Printf(arg->prompt, " deflate windows: "); 198 prompt_Printf(arg->prompt, "incoming = %d, ", ccp->cfg.deflate.in.winsize); 199 prompt_Printf(arg->prompt, "outgoing = %d\n", ccp->cfg.deflate.out.winsize); |
200#ifdef HAVE_DES | 200#ifndef NODES |
201 prompt_Printf(arg->prompt, " MPPE: "); 202 if (ccp->cfg.mppe.keybits) 203 prompt_Printf(arg->prompt, "%d bits, ", ccp->cfg.mppe.keybits); 204 else 205 prompt_Printf(arg->prompt, "any bits, "); 206 switch (ccp->cfg.mppe.state) { 207 case MPPE_STATEFUL: 208 prompt_Printf(arg->prompt, "stateful"); --- 10 unchanged lines hidden (view full) --- 219#endif 220 221 prompt_Printf(arg->prompt, "\n DEFLATE: %s\n", 222 command_ShowNegval(ccp->cfg.neg[CCP_NEG_DEFLATE])); 223 prompt_Printf(arg->prompt, " PREDICTOR1: %s\n", 224 command_ShowNegval(ccp->cfg.neg[CCP_NEG_PRED1])); 225 prompt_Printf(arg->prompt, " DEFLATE24: %s\n", 226 command_ShowNegval(ccp->cfg.neg[CCP_NEG_DEFLATE24])); | 201 prompt_Printf(arg->prompt, " MPPE: "); 202 if (ccp->cfg.mppe.keybits) 203 prompt_Printf(arg->prompt, "%d bits, ", ccp->cfg.mppe.keybits); 204 else 205 prompt_Printf(arg->prompt, "any bits, "); 206 switch (ccp->cfg.mppe.state) { 207 case MPPE_STATEFUL: 208 prompt_Printf(arg->prompt, "stateful"); --- 10 unchanged lines hidden (view full) --- 219#endif 220 221 prompt_Printf(arg->prompt, "\n DEFLATE: %s\n", 222 command_ShowNegval(ccp->cfg.neg[CCP_NEG_DEFLATE])); 223 prompt_Printf(arg->prompt, " PREDICTOR1: %s\n", 224 command_ShowNegval(ccp->cfg.neg[CCP_NEG_PRED1])); 225 prompt_Printf(arg->prompt, " DEFLATE24: %s\n", 226 command_ShowNegval(ccp->cfg.neg[CCP_NEG_DEFLATE24])); |
227#ifdef HAVE_DES | 227#ifndef NODES |
228 prompt_Printf(arg->prompt, " MPPE: %s\n", 229 command_ShowNegval(ccp->cfg.neg[CCP_NEG_MPPE])); 230#endif 231 return 0; 232} 233 234void 235ccp_SetupCallbacks(struct ccp *ccp) --- 16 unchanged lines hidden (view full) --- 252 ccp->cfg.deflate.in.winsize = 0; 253 ccp->cfg.deflate.out.winsize = 15; 254 ccp->cfg.fsm.timeout = DEF_FSMRETRY; 255 ccp->cfg.fsm.maxreq = DEF_FSMTRIES; 256 ccp->cfg.fsm.maxtrm = DEF_FSMTRIES; 257 ccp->cfg.neg[CCP_NEG_DEFLATE] = NEG_ENABLED|NEG_ACCEPTED; 258 ccp->cfg.neg[CCP_NEG_PRED1] = NEG_ENABLED|NEG_ACCEPTED; 259 ccp->cfg.neg[CCP_NEG_DEFLATE24] = 0; | 228 prompt_Printf(arg->prompt, " MPPE: %s\n", 229 command_ShowNegval(ccp->cfg.neg[CCP_NEG_MPPE])); 230#endif 231 return 0; 232} 233 234void 235ccp_SetupCallbacks(struct ccp *ccp) --- 16 unchanged lines hidden (view full) --- 252 ccp->cfg.deflate.in.winsize = 0; 253 ccp->cfg.deflate.out.winsize = 15; 254 ccp->cfg.fsm.timeout = DEF_FSMRETRY; 255 ccp->cfg.fsm.maxreq = DEF_FSMTRIES; 256 ccp->cfg.fsm.maxtrm = DEF_FSMTRIES; 257 ccp->cfg.neg[CCP_NEG_DEFLATE] = NEG_ENABLED|NEG_ACCEPTED; 258 ccp->cfg.neg[CCP_NEG_PRED1] = NEG_ENABLED|NEG_ACCEPTED; 259 ccp->cfg.neg[CCP_NEG_DEFLATE24] = 0; |
260#ifdef HAVE_DES | 260#ifndef NODES |
261 ccp->cfg.mppe.keybits = 0; 262 ccp->cfg.mppe.state = MPPE_ANYSTATE; 263 ccp->cfg.mppe.required = 0; 264 ccp->cfg.neg[CCP_NEG_MPPE] = NEG_ENABLED|NEG_ACCEPTED; 265#endif 266 267 ccp_Setup(ccp); 268} --- 578 unchanged lines hidden --- | 261 ccp->cfg.mppe.keybits = 0; 262 ccp->cfg.mppe.state = MPPE_ANYSTATE; 263 ccp->cfg.mppe.required = 0; 264 ccp->cfg.neg[CCP_NEG_MPPE] = NEG_ENABLED|NEG_ACCEPTED; 265#endif 266 267 ccp_Setup(ccp); 268} --- 578 unchanged lines hidden --- |