cbcp.c (54912) | cbcp.c (55146) |
---|---|
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 54912 1999-12-20 20:29:47Z brian $ | 26 * $FreeBSD: head/usr.sbin/ppp/cbcp.c 55146 1999-12-27 11:54:57Z brian $ |
27 */ 28 29#include <sys/param.h> 30 31#include <sys/un.h> 32 33#include <string.h> 34#include <termios.h> --- 102 unchanged lines hidden (view full) --- 137} 138 139#define CBCP_CLOSED (0) /* Not in use */ 140#define CBCP_STOPPED (1) /* Waiting for a REQ */ 141#define CBCP_REQSENT (2) /* Waiting for a RESP */ 142#define CBCP_RESPSENT (3) /* Waiting for an ACK */ 143#define CBCP_ACKSENT (4) /* Waiting for an LCP Term REQ */ 144 | 27 */ 28 29#include <sys/param.h> 30 31#include <sys/un.h> 32 33#include <string.h> 34#include <termios.h> --- 102 unchanged lines hidden (view full) --- 137} 138 139#define CBCP_CLOSED (0) /* Not in use */ 140#define CBCP_STOPPED (1) /* Waiting for a REQ */ 141#define CBCP_REQSENT (2) /* Waiting for a RESP */ 142#define CBCP_RESPSENT (3) /* Waiting for an ACK */ 143#define CBCP_ACKSENT (4) /* Waiting for an LCP Term REQ */ 144 |
145static const char *cbcpname[] = { | 145static const char * const cbcpname[] = { |
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]; --- 50 unchanged lines hidden (view full) --- 204 log_DumpBp(LogDEBUG, "cbcp_Output", bp); 205 link_PushPacket(&cbcp->p->link, bp, cbcp->p->dl->bundle, 206 LINK_QUEUES(&cbcp->p->link) - 1, PROTO_CBCP); 207} 208 209static const char * 210cbcp_data_Type(int type) 211{ | 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]; --- 50 unchanged lines hidden (view full) --- 204 log_DumpBp(LogDEBUG, "cbcp_Output", bp); 205 link_PushPacket(&cbcp->p->link, bp, cbcp->p->dl->bundle, 206 LINK_QUEUES(&cbcp->p->link) - 1, PROTO_CBCP); 207} 208 209static const char * 210cbcp_data_Type(int type) 211{ |
212 static const char *types[] = { | 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 "???"; 218 return types[type-1]; 219} 220 --- 536 unchanged lines hidden --- | 213 "No callback", "User-spec", "Server-spec", "list" 214 }; 215 216 if (type < 1 || type > sizeof types / sizeof types[0]) 217 return "???"; 218 return types[type-1]; 219} 220 --- 536 unchanged lines hidden --- |