* optional
*/
-static char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] =
+static const char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] =
/* Well, it's better than "Re: Linux vs FreeBSD" */
{
/* -n -s -d -p -j -v -x -i -o --line -c */
/*LIST_RULES*/{'x','x','x','x','x',' ','x','x','x','x','x'}
};
-static int inverse_for_options[NUMBER_OF_OPT] =
+static const unsigned int inverse_for_options[NUMBER_OF_OPT] =
{
/* -n */ 0,
/* -s */ IP6T_INV_SRCIP,
/* A few hardcoded protocols for 'all' and in case the user has no
/etc/protocols */
struct pprot {
- char *name;
+ const char *name;
u_int8_t num;
};
unsigned int i;
if (proto && !nolookup) {
- struct protoent *pent = getprotobynumber(proto);
+ const struct protoent *pent = getprotobynumber(proto);
if (pent)
return pent->p_name;
}
}
static void
-exit_printhelp(struct xtables_rule_match *matches)
+exit_printhelp(const struct xtables_rule_match *matches)
{
printf("%s v%s\n\n"
"Usage: %s -[AD] chain rule-specification [options]\n"
const struct ip6t_ip6 *ip,
int numeric)
{
- struct xtables_match *match =
+ const struct xtables_match *match =
xtables_find_match(m->u.user.name, XTF_TRY_LOAD, NULL);
if (match) {
unsigned int format,
struct ip6tc_handle *const handle)
{
- struct xtables_target *target = NULL;
+ const struct xtables_target *target = NULL;
const struct ip6t_entry_target *t;
u_int8_t flags;
char buf[BUFSIZ];
}
static unsigned char *
-make_delete_mask(struct xtables_rule_match *matches,
+make_delete_mask(const struct xtables_rule_match *matches,
const struct xtables_target *target)
{
/* Establish mask for comparison */
unsigned int size;
- struct xtables_rule_match *matchp;
+ const struct xtables_rule_match *matchp;
unsigned char *mask, *mptr;
size = sizeof(struct ip6t_entry);
unsigned int i;
const char *invertstr = invert ? "! " : "";
- struct protoent *pent = getprotobynumber(proto);
+ const struct protoent *pent = getprotobynumber(proto);
if (pent) {
printf("%s-p %s ",
invertstr, pent->p_name);
static int print_match_save(const struct ip6t_entry_match *e,
const struct ip6t_ip6 *ip)
{
- struct xtables_match *match =
+ const struct xtables_match *match =
xtables_find_match(e->u.user.name, XTF_TRY_LOAD, NULL);
if (match) {
}
/* print a given ip including mask if neccessary */
-static void print_ip(char *prefix, const struct in6_addr *ip, const struct in6_addr *mask, int invert)
+static void print_ip(const char *prefix, const struct in6_addr *ip,
+ const struct in6_addr *mask, int invert)
{
char buf[51];
int l = ipv6_prefix_length(mask);
void print_rule(const struct ip6t_entry *e,
struct ip6tc_handle *h, const char *chain, int counters)
{
- struct ip6t_entry_target *t;
+ const struct ip6t_entry_target *t;
const char *target_name;
/* print counters for iptables-save */
* optional
*/
-static char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] =
+static const char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] =
/* Well, it's better than "Re: Linux vs FreeBSD" */
{
/* -n -s -d -p -j -v -x -i -o -f --line -c */
/*LIST_RULES*/{'x','x','x','x','x',' ','x','x','x','x','x','x'}
};
-static int inverse_for_options[NUMBER_OF_OPT] =
+static const int inverse_for_options[NUMBER_OF_OPT] =
{
/* -n */ 0,
/* -s */ IPT_INV_SRCIP,
}
static void
-exit_printhelp(struct xtables_rule_match *matches)
+exit_printhelp(const struct xtables_rule_match *matches)
{
printf("%s v%s\n\n"
"Usage: %s -[AD] chain rule-specification [options]\n"
const struct ipt_ip *ip,
int numeric)
{
- struct xtables_match *match =
+ const struct xtables_match *match =
xtables_find_match(m->u.user.name, XTF_TRY_LOAD, NULL);
if (match) {
unsigned int format,
struct iptc_handle *const handle)
{
- struct xtables_target *target = NULL;
+ const struct xtables_target *target = NULL;
const struct ipt_entry_target *t;
u_int8_t flags;
char buf[BUFSIZ];
}
static unsigned char *
-make_delete_mask(struct xtables_rule_match *matches,
+make_delete_mask(const struct xtables_rule_match *matches,
const struct xtables_target *target)
{
/* Establish mask for comparison */
unsigned int size;
- struct xtables_rule_match *matchp;
+ const struct xtables_rule_match *matchp;
unsigned char *mask, *mptr;
size = sizeof(struct ipt_entry);
unsigned int i;
const char *invertstr = invert ? "! " : "";
- struct protoent *pent = getprotobynumber(proto);
+ const struct protoent *pent = getprotobynumber(proto);
if (pent) {
printf("%s-p %s ", invertstr, pent->p_name);
return;
static int print_match_save(const struct ipt_entry_match *e,
const struct ipt_ip *ip)
{
- struct xtables_match *match =
+ const struct xtables_match *match =
xtables_find_match(e->u.user.name, XTF_TRY_LOAD, NULL);
if (match) {
}
/* print a given ip including mask if neccessary */
-static void print_ip(char *prefix, u_int32_t ip, u_int32_t mask, int invert)
+static void print_ip(const char *prefix, u_int32_t ip,
+ u_int32_t mask, int invert)
{
u_int32_t bits, hmask = ntohl(mask);
int i;
void print_rule(const struct ipt_entry *e,
struct iptc_handle *h, const char *chain, int counters)
{
- struct ipt_entry_target *t;
+ const struct ipt_entry_target *t;
const char *target_name;
/* print counters for iptables-save */
/* Print targinfo part */
t = ipt_get_target((struct ipt_entry *)e);
if (t->u.user.name[0]) {
- struct xtables_target *target =
+ const struct xtables_target *target =
xtables_find_target(t->u.user.name, XTF_TRY_LOAD);
if (!target) {