physical.c (53684) | physical.c (53733) |
---|---|
1/* 2 * Written by Eivind Eklund <eivind@yes.no> 3 * for Yes Interactive 4 * 5 * Copyright (C) 1998, Yes Interactive. All rights reserved. 6 * 7 * Redistribution and use in any form is permitted. Redistribution in 8 * source form should include the above copyright and this set of 9 * conditions, because large sections american law seems to have been 10 * created by a bunch of jerks on drugs that are now illegal, forcing 11 * me to include this copyright-stuff instead of placing this in the 12 * public domain. The name of of 'Yes Interactive' or 'Eivind Eklund' 13 * may not be used to endorse or promote products derived from this 14 * software without specific prior written permission. 15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 * | 1/* 2 * Written by Eivind Eklund <eivind@yes.no> 3 * for Yes Interactive 4 * 5 * Copyright (C) 1998, Yes Interactive. All rights reserved. 6 * 7 * Redistribution and use in any form is permitted. Redistribution in 8 * source form should include the above copyright and this set of 9 * conditions, because large sections american law seems to have been 10 * created by a bunch of jerks on drugs that are now illegal, forcing 11 * me to include this copyright-stuff instead of placing this in the 12 * public domain. The name of of 'Yes Interactive' or 'Eivind Eklund' 13 * may not be used to endorse or promote products derived from this 14 * software without specific prior written permission. 15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18 * |
19 * $FreeBSD: head/usr.sbin/ppp/physical.c 53684 1999-11-25 02:47:04Z brian $ | 19 * $FreeBSD: head/usr.sbin/ppp/physical.c 53733 1999-11-26 22:44:33Z brian $ |
20 * 21 */ 22 23#include <sys/param.h> 24#include <netinet/in.h> 25#include <netinet/in_systm.h> 26#include <netinet/ip.h> 27#include <sys/un.h> --- 155 unchanged lines hidden (view full) --- 183 p->Utmp = 0; 184 p->session_owner = (pid_t)-1; 185 186 p->cfg.rts_cts = MODEM_CTSRTS; 187 p->cfg.speed = MODEM_SPEED; 188 p->cfg.parity = CS8; 189 memcpy(p->cfg.devlist, MODEM_LIST, sizeof MODEM_LIST); 190 p->cfg.ndev = NMODEMS; | 20 * 21 */ 22 23#include <sys/param.h> 24#include <netinet/in.h> 25#include <netinet/in_systm.h> 26#include <netinet/ip.h> 27#include <sys/un.h> --- 155 unchanged lines hidden (view full) --- 183 p->Utmp = 0; 184 p->session_owner = (pid_t)-1; 185 186 p->cfg.rts_cts = MODEM_CTSRTS; 187 p->cfg.speed = MODEM_SPEED; 188 p->cfg.parity = CS8; 189 memcpy(p->cfg.devlist, MODEM_LIST, sizeof MODEM_LIST); 190 p->cfg.ndev = NMODEMS; |
191 p->cfg.cd.necessity = CD_VARIABLE; 192 p->cfg.cd.delay = DEF_CDDELAY; | 191 p->cfg.cd.necessity = CD_DEFAULT; 192 p->cfg.cd.delay = 0; /* reconfigured or device specific default */ |
193 194 lcp_Init(&p->link.lcp, dl->bundle, &p->link, &dl->fsmp); 195 ccp_Init(&p->link.ccp, dl->bundle, &p->link, &dl->fsmp); 196 197 return p; 198} 199 200static const struct parity { --- 205 unchanged lines hidden (view full) --- 406 407 return result; 408} 409 410int 411physical_ShowStatus(struct cmdargs const *arg) 412{ 413 struct physical *p = arg->cx->physical; | 193 194 lcp_Init(&p->link.lcp, dl->bundle, &p->link, &dl->fsmp); 195 ccp_Init(&p->link.ccp, dl->bundle, &p->link, &dl->fsmp); 196 197 return p; 198} 199 200static const struct parity { --- 205 unchanged lines hidden (view full) --- 406 407 return result; 408} 409 410int 411physical_ShowStatus(struct cmdargs const *arg) 412{ 413 struct physical *p = arg->cx->physical; |
414 struct cd *cd; |
|
414 const char *dev; 415 int n; 416 417 prompt_Printf(arg->prompt, "Name: %s\n", p->link.name); 418 prompt_Printf(arg->prompt, " State: "); 419 if (p->fd < 0) 420 prompt_Printf(arg->prompt, "closed\n"); 421 else if (p->handler && p->handler->openinfo) --- 49 unchanged lines hidden (view full) --- 471 else 472 prompt_Printf(arg->prompt, ", even parity"); 473 } else 474 prompt_Printf(arg->prompt, ", no parity"); 475 476 prompt_Printf(arg->prompt, ", CTS/RTS %s\n", (p->cfg.rts_cts ? "on" : "off")); 477 478 prompt_Printf(arg->prompt, " CD check delay: "); | 415 const char *dev; 416 int n; 417 418 prompt_Printf(arg->prompt, "Name: %s\n", p->link.name); 419 prompt_Printf(arg->prompt, " State: "); 420 if (p->fd < 0) 421 prompt_Printf(arg->prompt, "closed\n"); 422 else if (p->handler && p->handler->openinfo) --- 49 unchanged lines hidden (view full) --- 472 else 473 prompt_Printf(arg->prompt, ", even parity"); 474 } else 475 prompt_Printf(arg->prompt, ", no parity"); 476 477 prompt_Printf(arg->prompt, ", CTS/RTS %s\n", (p->cfg.rts_cts ? "on" : "off")); 478 479 prompt_Printf(arg->prompt, " CD check delay: "); |
479 if (p->cfg.cd.necessity == CD_NOTREQUIRED) | 480 cd = p->handler ? &p->handler->cd : &p->cfg.cd; 481 if (cd->necessity == CD_NOTREQUIRED) |
480 prompt_Printf(arg->prompt, "no cd"); | 482 prompt_Printf(arg->prompt, "no cd"); |
481 else { | 483 else if (p->cfg.cd.necessity == CD_DEFAULT) { 484 prompt_Printf(arg->prompt, "device specific"); 485 } else { |
482 prompt_Printf(arg->prompt, "%d second%s", p->cfg.cd.delay, 483 p->cfg.cd.delay == 1 ? "" : "s"); 484 if (p->cfg.cd.necessity == CD_REQUIRED) 485 prompt_Printf(arg->prompt, " (required!)"); 486 } 487 prompt_Printf(arg->prompt, "\n\n"); 488 489 throughput_disp(&p->link.throughput, arg->prompt); --- 566 unchanged lines hidden --- | 486 prompt_Printf(arg->prompt, "%d second%s", p->cfg.cd.delay, 487 p->cfg.cd.delay == 1 ? "" : "s"); 488 if (p->cfg.cd.necessity == CD_REQUIRED) 489 prompt_Printf(arg->prompt, " (required!)"); 490 } 491 prompt_Printf(arg->prompt, "\n\n"); 492 493 throughput_disp(&p->link.throughput, arg->prompt); --- 566 unchanged lines hidden --- |