cbcp.c (55146) | cbcp.c (58034) |
---|---|
1/*- 2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/usr.sbin/ppp/cbcp.c 55146 1999-12-27 11:54:57Z brian $ | 26 * $FreeBSD: head/usr.sbin/ppp/cbcp.c 58034 2000-03-14 01:46:54Z brian $ |
27 */ 28 29#include <sys/param.h> 30 31#include <sys/un.h> 32 33#include <string.h> 34#include <termios.h> --- 111 unchanged lines hidden (view full) --- 146 "closed", "stopped", "req-sent", "resp-sent", "ack-sent" 147}; 148 149static const char * 150cbcpstate(int s) 151{ 152 if (s < sizeof cbcpname / sizeof cbcpname[0]) 153 return cbcpname[s]; | 27 */ 28 29#include <sys/param.h> 30 31#include <sys/un.h> 32 33#include <string.h> 34#include <termios.h> --- 111 unchanged lines hidden (view full) --- 146 "closed", "stopped", "req-sent", "resp-sent", "ack-sent" 147}; 148 149static const char * 150cbcpstate(int s) 151{ 152 if (s < sizeof cbcpname / sizeof cbcpname[0]) 153 return cbcpname[s]; |
154 return "???"; | 154 return HexStr(s, NULL, 0); |
155} 156 157static void 158cbcp_NewPhase(struct cbcp *cbcp, int new) 159{ 160 if (cbcp->fsm.state != new) { 161 log_Printf(LogCBCP, "%s: State change %s --> %s\n", cbcp->p->dl->name, 162 cbcpstate(cbcp->fsm.state), cbcpstate(new)); --- 46 unchanged lines hidden (view full) --- 209static const char * 210cbcp_data_Type(int type) 211{ 212 static const char * const types[] = { 213 "No callback", "User-spec", "Server-spec", "list" 214 }; 215 216 if (type < 1 || type > sizeof types / sizeof types[0]) | 155} 156 157static void 158cbcp_NewPhase(struct cbcp *cbcp, int new) 159{ 160 if (cbcp->fsm.state != new) { 161 log_Printf(LogCBCP, "%s: State change %s --> %s\n", cbcp->p->dl->name, 162 cbcpstate(cbcp->fsm.state), cbcpstate(new)); --- 46 unchanged lines hidden (view full) --- 209static const char * 210cbcp_data_Type(int type) 211{ 212 static const char * const types[] = { 213 "No callback", "User-spec", "Server-spec", "list" 214 }; 215 216 if (type < 1 || type > sizeof types / sizeof types[0]) |
217 return "???"; | 217 return HexStr(type, NULL, 0); |
218 return types[type-1]; 219} 220 221struct cbcp_addr { 222 u_char type; 223 char addr[1]; /* Really ASCIIZ */ 224}; 225 --- 531 unchanged lines hidden --- | 218 return types[type-1]; 219} 220 221struct cbcp_addr { 222 u_char type; 223 char addr[1]; /* Really ASCIIZ */ 224}; 225 --- 531 unchanged lines hidden --- |