aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-12-27 11:54:57 +0000
committerBrian Somers <brian@FreeBSD.org>1999-12-27 11:54:57 +0000
commit182c898a22f7c1d2ff8a1cf8e123e079ea549e80 (patch)
tree0fd8c5842f6a904e51d96744a667232930c5fc7d
parent5b78bdf8aaee25d85b587df12983b3764cb47977 (diff)
downloadsrc-182c898a22f7c1d2ff8a1cf8e123e079ea549e80.tar.gz
src-182c898a22f7c1d2ff8a1cf8e123e079ea549e80.zip
Add a bunch of `const's and fix a typo.
Submitted by: Rich Neswold <rneswold@MCS.Net>
Notes
Notes: svn path=/head/; revision=55146
-rw-r--r--usr.sbin/ppp/bundle.c2
-rw-r--r--usr.sbin/ppp/cbcp.c4
-rw-r--r--usr.sbin/ppp/ccp.c6
-rw-r--r--usr.sbin/ppp/chap.c2
-rw-r--r--usr.sbin/ppp/datalink.c2
-rw-r--r--usr.sbin/ppp/filter.c8
-rw-r--r--usr.sbin/ppp/fsm.c4
-rw-r--r--usr.sbin/ppp/fsm.h2
-rw-r--r--usr.sbin/ppp/ip.c4
-rw-r--r--usr.sbin/ppp/ipcp.c6
-rw-r--r--usr.sbin/ppp/lcp.c4
-rw-r--r--usr.sbin/ppp/log.c2
-rw-r--r--usr.sbin/ppp/main.c2
-rw-r--r--usr.sbin/ppp/mbuf.c2
-rw-r--r--usr.sbin/ppp/pap.c4
-rw-r--r--usr.sbin/ppp/timer.c2
16 files changed, 30 insertions, 26 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c
index d55172d1b940..ebacb5ab8932 100644
--- a/usr.sbin/ppp/bundle.c
+++ b/usr.sbin/ppp/bundle.c
@@ -103,7 +103,7 @@
static int bundle_RemainingIdleTime(struct bundle *);
-static const char *PhaseNames[] = {
+static const char * const PhaseNames[] = {
"Dead", "Establish", "Authenticate", "Network", "Terminate"
};
diff --git a/usr.sbin/ppp/cbcp.c b/usr.sbin/ppp/cbcp.c
index d04e127f7f74..1ff5fe3f43c6 100644
--- a/usr.sbin/ppp/cbcp.c
+++ b/usr.sbin/ppp/cbcp.c
@@ -142,7 +142,7 @@ cbcp_StartTimer(struct cbcp *cbcp, int timeout)
#define CBCP_RESPSENT (3) /* Waiting for an ACK */
#define CBCP_ACKSENT (4) /* Waiting for an LCP Term REQ */
-static const char *cbcpname[] = {
+static const char * const cbcpname[] = {
"closed", "stopped", "req-sent", "resp-sent", "ack-sent"
};
@@ -209,7 +209,7 @@ cbcp_Output(struct cbcp *cbcp, u_char code, struct cbcp_data *data)
static const char *
cbcp_data_Type(int type)
{
- static const char *types[] = {
+ static const char * const types[] = {
"No callback", "User-spec", "Server-spec", "list"
};
diff --git a/usr.sbin/ppp/ccp.c b/usr.sbin/ppp/ccp.c
index a1b5e61e2e72..ce45a09ba896 100644
--- a/usr.sbin/ppp/ccp.c
+++ b/usr.sbin/ppp/ccp.c
@@ -90,10 +90,10 @@ static struct fsm_callbacks ccp_Callbacks = {
CcpRecvResetAck
};
-static const char *ccp_TimerNames[] =
+static const char * const ccp_TimerNames[] =
{"CCP restart", "CCP openmode", "CCP stopped"};
-static char const *cftypes[] = {
+static char const * const cftypes[] = {
/* Check out the latest ``Compression Control Protocol'' rfc (rfc1962.txt) */
"OUI", /* 0: OUI */
"PRED1", /* 1: Predictor type 1 */
@@ -126,7 +126,7 @@ protoname(int proto)
}
/* We support these algorithms, and Req them in the given order */
-static const struct ccp_algorithm *algorithm[] = {
+static const struct ccp_algorithm * const algorithm[] = {
&DeflateAlgorithm,
&Pred1Algorithm,
&PppdDeflateAlgorithm
diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c
index 8101413eb568..b0d874218311 100644
--- a/usr.sbin/ppp/chap.c
+++ b/usr.sbin/ppp/chap.c
@@ -77,7 +77,7 @@
#include "chap_ms.h"
#endif
-static const char *chapcodes[] = {
+static const char * const chapcodes[] = {
"???", "CHALLENGE", "RESPONSE", "SUCCESS", "FAILURE"
};
#define MAXCHAPCODE (sizeof chapcodes / sizeof chapcodes[0] - 1)
diff --git a/usr.sbin/ppp/datalink.c b/usr.sbin/ppp/datalink.c
index 673de85c8692..e984540618ce 100644
--- a/usr.sbin/ppp/datalink.c
+++ b/usr.sbin/ppp/datalink.c
@@ -1219,7 +1219,7 @@ datalink_SetRedial(struct cmdargs const *arg)
return -1;
}
-static const char *states[] = {
+static const char * const states[] = {
"closed",
"opening",
"hangup",
diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c
index 217c177fbf78..ade48a52d499 100644
--- a/usr.sbin/ppp/filter.c
+++ b/usr.sbin/ppp/filter.c
@@ -19,7 +19,7 @@
*
* $FreeBSD$
*
- * TODO: Shoud send ICMP error message when we discard packets.
+ * TODO: Should send ICMP error message when we discard packets.
*/
#include <sys/param.h>
@@ -533,7 +533,7 @@ filter_Set(struct cmdargs const *arg)
const char *
filter_Action2Nam(int act)
{
- static const char *actname[] = { " none ", "permit ", " deny " };
+ static const char * const actname[] = { " none ", "permit ", " deny " };
static char buf[8];
if (act >= 0 && act < MAXFILTERS) {
@@ -618,7 +618,7 @@ filter_Show(struct cmdargs const *arg)
return 0;
}
-static const char *protoname[] = {
+static const char * const protoname[] = {
"none", "tcp", "udp", "icmp", "ospf", "igmp", "gre"
};
@@ -645,7 +645,7 @@ filter_Nam2Proto(int argc, char const *const *argv)
return proto;
}
-static const char *opname[] = {"none", "eq", "gt", "lt"};
+static const char * const opname[] = {"none", "eq", "gt", "lt"};
const char *
filter_Op2Nam(int op)
diff --git a/usr.sbin/ppp/fsm.c b/usr.sbin/ppp/fsm.c
index 8d974450f1dc..f1124b51f8a6 100644
--- a/usr.sbin/ppp/fsm.c
+++ b/usr.sbin/ppp/fsm.c
@@ -103,7 +103,7 @@ Code2Nam(u_int code)
const char *
State2Nam(u_int state)
{
- static const char *StateNames[] = {
+ static const char * const StateNames[] = {
"Initial", "Starting", "Closed", "Stopped", "Closing", "Stopping",
"Req-Sent", "Ack-Rcvd", "Ack-Sent", "Opened",
};
@@ -132,7 +132,7 @@ void
fsm_Init(struct fsm *fp, const char *name, u_short proto, int mincode,
int maxcode, int LogLevel, struct bundle *bundle,
struct link *l, const struct fsm_parent *parent,
- struct fsm_callbacks *fn, const char *timer_names[3])
+ struct fsm_callbacks *fn, const char * const timer_names[3])
{
fp->name = name;
fp->proto = proto;
diff --git a/usr.sbin/ppp/fsm.h b/usr.sbin/ppp/fsm.h
index b11693816dae..996f2af565df 100644
--- a/usr.sbin/ppp/fsm.h
+++ b/usr.sbin/ppp/fsm.h
@@ -159,7 +159,7 @@ struct fsmconfig {
extern void fsm_Init(struct fsm *, const char *, u_short, int, int, int,
struct bundle *, struct link *, const struct fsm_parent *,
- struct fsm_callbacks *, const char *[3]);
+ struct fsm_callbacks *, const char * const [3]);
extern void fsm_Output(struct fsm *, u_int, u_int, u_char *, int, int);
extern void fsm_Open(struct fsm *);
extern void fsm_Up(struct fsm *);
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c
index 793103341d11..efd096dd6c4b 100644
--- a/usr.sbin/ppp/ip.c
+++ b/usr.sbin/ppp/ip.c
@@ -68,7 +68,9 @@
#include "tun.h"
#include "ip.h"
-static const char *TcpFlags[] = { "FIN", "SYN", "RST", "PSH", "ACK", "URG" };
+static const char * const TcpFlags[] = {
+ "FIN", "SYN", "RST", "PSH", "ACK", "URG"
+};
static __inline int
PortMatch(int op, u_short pport, u_short rport)
diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c
index ba2473fec197..917d5778ebab 100644
--- a/usr.sbin/ppp/ipcp.c
+++ b/usr.sbin/ppp/ipcp.c
@@ -208,7 +208,7 @@ static struct fsm_callbacks ipcp_Callbacks = {
fsm_NullRecvResetAck
};
-static const char *cftypes[] = {
+static const char * const cftypes[] = {
/* Check out the latest ``Assigned numbers'' rfc (rfc1700.txt) */
"???",
"IPADDRS", /* 1: IP-Addresses */ /* deprecated */
@@ -218,7 +218,7 @@ static const char *cftypes[] = {
#define NCFTYPES (sizeof cftypes/sizeof cftypes[0])
-static const char *cftypes128[] = {
+static const char * const cftypes128[] = {
/* Check out the latest ``Assigned numbers'' rfc (rfc1700.txt) */
"???",
"PRIDNS", /* 129: Primary DNS Server Address */
@@ -463,7 +463,7 @@ ipcp_Init(struct ipcp *ipcp, struct bundle *bundle, struct link *l,
{
struct hostent *hp;
char name[MAXHOSTNAMELEN];
- static const char *timer_names[] =
+ static const char * const timer_names[] =
{"IPCP restart", "IPCP openmode", "IPCP stopped"};
fsm_Init(&ipcp->fsm, "IPCP", PROTO_IPCP, 1, IPCP_MAXCODE, LogIPCP,
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index 0c2bc081d24c..8df2061abdb9 100644
--- a/usr.sbin/ppp/lcp.c
+++ b/usr.sbin/ppp/lcp.c
@@ -101,10 +101,10 @@ static struct fsm_callbacks lcp_Callbacks = {
fsm_NullRecvResetAck
};
-static const char *lcp_TimerNames[] =
+static const char * const lcp_TimerNames[] =
{"LCP restart", "LCP openmode", "LCP stopped"};
-static const char *cftypes[] = {
+static const char * const cftypes[] = {
/* Check out the latest ``Assigned numbers'' rfc (rfc1700.txt) */
"???",
"MRU", /* 1: Maximum-Receive-Unit */
diff --git a/usr.sbin/ppp/log.c b/usr.sbin/ppp/log.c
index 2756a32879d1..5fdcdf6b703b 100644
--- a/usr.sbin/ppp/log.c
+++ b/usr.sbin/ppp/log.c
@@ -42,7 +42,7 @@
#include "descriptor.h"
#include "prompt.h"
-static const char *LogNames[] = {
+static const char * const LogNames[] = {
"Async",
"CBCP",
"CCP",
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 5972f0cdbfc8..18c752912eca 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/ppp/main.c
@@ -167,7 +167,7 @@ static const char *
ex_desc(int ex)
{
static char num[12]; /* Used immediately if returned */
- static const char *desc[] = {
+ static const char * const desc[] = {
"normal", "start", "sock", "modem", "dial", "dead", "done",
"reboot", "errdead", "hangup", "term", "nodial", "nologin"
};
diff --git a/usr.sbin/ppp/mbuf.c b/usr.sbin/ppp/mbuf.c
index ac42742ee5b6..2d1df62d270b 100644
--- a/usr.sbin/ppp/mbuf.c
+++ b/usr.sbin/ppp/mbuf.c
@@ -292,7 +292,7 @@ int
mbuf_Show(struct cmdargs const *arg)
{
int i;
- static const char *mbuftype[] = {
+ static const char * const mbuftype[] = {
"ip in", "ip out", "nat in", "nat out", "mp in", "mp out",
"vj in", "vj out", "icompd in", "icompd out", "compd in", "compd out",
"lqr in", "lqr out", "echo in", "echo out", "proto in", "proto out",
diff --git a/usr.sbin/ppp/pap.c b/usr.sbin/ppp/pap.c
index a25962ca1cd3..7a7071d7b232 100644
--- a/usr.sbin/ppp/pap.c
+++ b/usr.sbin/ppp/pap.c
@@ -64,7 +64,9 @@
#include "cbcp.h"
#include "datalink.h"
-static const char *papcodes[] = { "???", "REQUEST", "SUCCESS", "FAILURE" };
+static const char * const papcodes[] = {
+ "???", "REQUEST", "SUCCESS", "FAILURE"
+};
#define MAXPAPCODE (sizeof papcodes / sizeof papcodes[0] - 1)
static void
diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c
index 7a7d592fdfaa..144c306fa740 100644
--- a/usr.sbin/ppp/timer.c
+++ b/usr.sbin/ppp/timer.c
@@ -42,7 +42,7 @@ static void StopTimerNoBlock(struct pppTimer *);
static const char *
tState2Nam(u_int state)
{
- static const char *StateNames[] = { "stopped", "running", "expired" };
+ static const char * const StateNames[] = { "stopped", "running", "expired" };
if (state >= sizeof StateNames / sizeof StateNames[0])
return "unknown";