summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-03-27 18:01:58 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-03-27 18:01:58 +0000
commitb89da14c193fa9a3467b37cf13ae4c8368729726 (patch)
tree36993d97cd77232567e2397f008d32facb3ce187 /sbin
parent27cd18bb62c171d560bf6daa11f2a1fa2ee9b29c (diff)
lotsa const char *
from David Hill <david at phobia.ms> a while ago
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y10
-rw-r--r--sbin/pfctl/pfctl.c24
-rw-r--r--sbin/pfctl/pfctl.h4
-rw-r--r--sbin/pfctl/pfctl_parser.c10
-rw-r--r--sbin/pfctl/pfctl_parser.h6
-rw-r--r--sbin/pfctl/pfctl_table.c14
6 files changed, 34 insertions, 34 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 54dd40c5835..eed5e41d8d0 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.347 2003/03/27 16:17:37 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.348 2003/03/27 18:01:57 henning Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -215,8 +215,8 @@ struct table_opts {
int init_addr;
} table_opts;
-int yyerror(char *, ...);
-int disallow_table(struct node_host *, char *);
+int yyerror(const char *, ...);
+int disallow_table(struct node_host *, const char *);
int rule_consistent(struct pf_rule *);
int filter_consistent(struct pf_rule *);
int nat_consistent(struct pf_rule *);
@@ -2690,7 +2690,7 @@ yesno : NO { $$ = 0; }
%%
int
-yyerror(char *fmt, ...)
+yyerror(const char *fmt, ...)
{
va_list ap;
extern char *infile;
@@ -2705,7 +2705,7 @@ yyerror(char *fmt, ...)
}
int
-disallow_table(struct node_host *h, char *fmt)
+disallow_table(struct node_host *h, const char *fmt)
{
for (; h != NULL; h = h->next)
if (h->addr.type == PF_ADDR_TABLE) {
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index bff5d5bff5e..785c0f83c6e 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.161 2003/03/11 13:20:17 dhartmei Exp $ */
+/* $OpenBSD: pfctl.c,v 1.162 2003/03/27 18:01:57 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -76,15 +76,15 @@ int pfctl_debug(int, u_int32_t, int);
int pfctl_clear_rule_counters(int, int);
int pfctl_test_altqsupport(int, int);
int pfctl_show_anchors(int, int);
-char *pfctl_lookup_option(char *, char **);
+const char *pfctl_lookup_option(char *, const char **);
-char *clearopt;
+const char *clearopt;
char *rulesopt;
-char *showopt;
-char *debugopt;
+const char *showopt;
+const char *debugopt;
char *anchoropt;
char *tableopt;
-char *tblcmdopt;
+const char *tblcmdopt;
int state_killers;
char *state_kill[2];
int loadopt = PFCTL_FLAG_ALL;
@@ -158,21 +158,21 @@ static const struct {
{ NULL, NULL }
};
-static char *clearopt_list[] = {
+static const char *clearopt_list[] = {
"nat", "queue", "rules", "state", "info", "Tables", "all", NULL
};
-static char *showopt_list[] = {
+static const char *showopt_list[] = {
"nat", "queue", "rules", "Anchors", "state", "info", "labels",
"timeouts", "memory", "Tables", "all", NULL
};
-static char *tblcmdopt_list[] = {
+static const char *tblcmdopt_list[] = {
"kill", "flush", "add", "delete", "load", "replace", "show",
"test", "zero", NULL
};
-static char *debugopt_list[] = {
+static const char *debugopt_list[] = {
"none", "urgent", "misc", NULL
};
@@ -1291,8 +1291,8 @@ pfctl_show_anchors(int dev, int opts)
return (0);
}
-char *
-pfctl_lookup_option(char *cmd, char **list)
+const char *
+pfctl_lookup_option(char *cmd, const char **list)
{
if (cmd != NULL && *cmd)
for (; *list; list++)
diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h
index e5ee5a68c2f..4a155da3dac 100644
--- a/sbin/pfctl/pfctl.h
+++ b/sbin/pfctl/pfctl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.h,v 1.12 2003/03/06 12:50:40 henning Exp $ */
+/* $OpenBSD: pfctl.h,v 1.13 2003/03/27 18:01:57 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -57,7 +57,7 @@ int pfr_ina_define(struct pfr_table *, struct pfr_addr *, int, int *,
int *, int, int);
int pfctl_clear_tables(int);
int pfctl_show_tables(int);
-int pfctl_command_tables(int, char *[], char *, char *, char *, int);
+int pfctl_command_tables(int, char *[], char *, const char *, char *, int);
int pfctl_show_altq(int, int, int);
#ifndef DEFAULT_PRIORITY
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index ead3eea931e..4cbf19a7548 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.146 2003/03/19 15:56:08 henning Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.147 2003/03/27 18:01:57 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -55,7 +55,7 @@
#include "pfctl.h"
void print_op (u_int8_t, const char *, const char *);
-void print_port (u_int8_t, u_int16_t, u_int16_t, char *);
+void print_port (u_int8_t, u_int16_t, u_int16_t, const char *);
void print_uid (u_int8_t, uid_t, uid_t, const char *);
void print_gid (u_int8_t, gid_t, gid_t, const char *);
void print_flags (u_int8_t);
@@ -306,7 +306,7 @@ print_op(u_int8_t op, const char *a1, const char *a2)
}
void
-print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, char *proto)
+print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto)
{
char a1[6], a2[6];
struct servent *s;
@@ -629,8 +629,8 @@ print_rdr(struct pf_rule *r, int verbose)
printf("\n");
}
-char *pf_reasons[PFRES_MAX+1] = PFRES_NAMES;
-char *pf_fcounters[FCNT_MAX+1] = FCNT_NAMES;
+const char *pf_reasons[PFRES_MAX+1] = PFRES_NAMES;
+const char *pf_fcounters[FCNT_MAX+1] = FCNT_NAMES;
void
print_status(struct pf_status *s)
diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h
index a223fa1d13c..6004ed99074 100644
--- a/sbin/pfctl/pfctl_parser.h
+++ b/sbin/pfctl/pfctl_parser.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.h,v 1.50 2003/03/07 12:55:37 henning Exp $ */
+/* $OpenBSD: pfctl_parser.h,v 1.51 2003/03/27 18:01:57 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -124,12 +124,12 @@ void pfctl_define_table(char *, int, int, int);
void pfctl_commit_table(void);
struct icmptypeent {
- char *name;
+ const char *name;
u_int8_t type;
};
struct icmpcodeent {
- char *name;
+ const char *name;
u_int8_t type;
u_int8_t code;
};
diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c
index 7973167211b..fed78f2e500 100644
--- a/sbin/pfctl/pfctl_table.c
+++ b/sbin/pfctl/pfctl_table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_table.c,v 1.36 2003/03/07 15:16:33 cedric Exp $ */
+/* $OpenBSD: pfctl_table.c,v 1.37 2003/03/27 18:01:57 henning Exp $ */
/*
* Copyright (c) 2002 Cedric Berger
@@ -55,7 +55,7 @@
#define BUF_SIZE 256
extern void usage(void);
-static int pfctl_table(int, char *[], char *, char *, char *, int);
+static int pfctl_table(int, char *[], char *, const char *, char *, int);
static void grow_buffer(size_t, int);
static void print_table(struct pfr_table *, int, int);
static void print_tstats(struct pfr_tstats *, int);
@@ -66,7 +66,7 @@ static void print_addrx(struct pfr_addr *, struct pfr_addr *, int);
static void print_astats(struct pfr_astats *, int);
static void radix_perror(void);
static void inactive_cleanup(void);
-static void xprintf(int, char *, ...);
+static void xprintf(int, const char *, ...);
static union {
caddr_t caddr;
@@ -79,7 +79,7 @@ static union {
static int size, msize, ticket, inactive;
extern char *__progname;
-static char *stats_text[PFR_DIR_MAX][PFR_OP_TABLE_MAX] = {
+static const char *stats_text[PFR_DIR_MAX][PFR_OP_TABLE_MAX] = {
{ "In/Block:", "In/Pass:", "In/XPass:" },
{ "Out/Block:", "Out/Pass:", "Out/XPass:" }
};
@@ -118,7 +118,7 @@ pfctl_show_tables(int opts)
int
pfctl_command_tables(int argc, char *argv[], char *tname,
- char *command, char *file, int opts)
+ const char *command, char *file, int opts)
{
if (tname == NULL || command == NULL)
usage();
@@ -126,7 +126,7 @@ pfctl_command_tables(int argc, char *argv[], char *tname,
}
int
-pfctl_table(int argc, char *argv[], char *tname, char *command,
+pfctl_table(int argc, char *argv[], char *tname, const char *command,
char *file, int opts)
{
struct pfr_table table;
@@ -637,7 +637,7 @@ inactive_cleanup(void)
}
void
-xprintf(int opts, char *fmt, ...)
+xprintf(int opts, const char *fmt, ...)
{
va_list args;