switch (filter->type) {
case FILTER_PERMIT:
return "permit";
- break;
case FILTER_DENY:
return "deny";
- break;
case FILTER_DYNAMIC:
return "dynamic";
- break;
default:
return "";
- break;
}
}
/* If name is made by all digit character. We treat it as
number. */
for (number = 0, i = 0; i < strlen(name); i++) {
- if (isdigit((int)name[i]))
+ if (isdigit((unsigned char)name[i]))
number = (number * 10) + (name[i] - '0');
else
break;
int64_t newseq;
struct filter *filter;
- maxseq = newseq = 0;
+ maxseq = 0;
for (filter = access->head; filter; filter = filter->next) {
if (maxseq < filter->seq)
return CMD_WARNING_CONFIG_FAILED;
}
- if (access->remark) {
- XFREE(MTYPE_TMP, access->remark);
- access->remark = NULL;
- }
+ XFREE(MTYPE_TMP, access->remark);
if (access->head == NULL && access->tail == NULL)
access_list_delete(access);
argv_find(argv, argc, "X:X:X:X:X:X", &idx);
if (idx)
mac = argv[idx]->arg;
+ assert(mac);
return filter_set_zebra(vty, argv[2]->arg, seq, permit_deny, AFI_L2VPN,
mac, 0, 1);
argv_find(argv, argc, "X:X:X:X:X:X", &idx);
if (idx)
mac = argv[idx]->arg;
+ assert(mac);
return filter_set_zebra(vty, argv[2]->arg, seq, permit_deny, AFI_L2VPN,
mac, 0, 0);
argv_find(argv, argc, "A.B.C.D/M", &idx);
if (idx)
prefix = argv[idx]->arg;
+ assert(prefix);
idx = 0;
if (argv_find(argv, argc, "exact-match", &idx))
argv_find(argv, argc, "A.B.C.D/M", &idx);
if (idx)
prefix = argv[idx]->arg;
+ assert(prefix);
idx = 0;
if (argv_find(argv, argc, "exact-match", &idx))
"Specify packets to forward\n"
"Prefix to match. e.g. 10.0.0.0/8\n")
{
- int idx_word = 1;
+ int idx_word = 2;
int idx = 0;
char *seq = NULL;
char *permit_deny = NULL;
{
int idx = 0;
int exact = 0;
- int idx_word = 2;
+ int idx_word = 3;
char *seq = NULL;
char *permit_deny = NULL;
char *prefix = NULL;
argv_find(argv, argc, "X:X::X:X/M", &idx);
if (idx)
prefix = argv[idx]->arg;
+ assert(prefix);
idx = 0;
if (argv_find(argv, argc, "exact-match", &idx))
"Specify packets to forward\n"
"Any prefixi to match\n")
{
- int idx_word = 2;
+ int idx_word = 3;
int idx = 0;
char *seq = NULL;
char *permit_deny = NULL;
return no_ipv6_access_list_remark(self, vty, argc, argv);
}
-void config_write_access_zebra(struct vty *, struct filter *);
-void config_write_access_cisco(struct vty *, struct filter *);
+static void config_write_access_zebra(struct vty *, struct filter *);
+static void config_write_access_cisco(struct vty *, struct filter *);
/* show access-list command. */
static int filter_show(struct vty *vty, const char *name, afi_t afi)
else {
vty_out(vty, " %s",
inet_ntoa(filter->addr));
- if (filter->addr_mask.s_addr != 0)
+ if (filter->addr_mask.s_addr
+ != INADDR_ANY)
vty_out(vty,
", wildcard bits %s",
inet_ntoa(
else {
vty_out(vty, " %s",
inet_ntoa(filter->addr));
- if (filter->addr_mask.s_addr != 0)
+ if (filter->addr_mask.s_addr
+ != INADDR_ANY)
vty_out(vty,
", wildcard bits %s",
inet_ntoa(
return filter_show(vty, argv[idx_word]->arg, AFI_IP6);
}
-void config_write_access_cisco(struct vty *vty, struct filter *mfilter)
+static void config_write_access_cisco(struct vty *vty, struct filter *mfilter)
{
struct filter_cisco *filter;
vty_out(vty, " ip");
if (filter->addr_mask.s_addr == 0xffffffff)
vty_out(vty, " any");
- else if (filter->addr_mask.s_addr == 0)
+ else if (filter->addr_mask.s_addr == INADDR_ANY)
vty_out(vty, " host %s", inet_ntoa(filter->addr));
else {
vty_out(vty, " %s", inet_ntoa(filter->addr));
if (filter->mask_mask.s_addr == 0xffffffff)
vty_out(vty, " any");
- else if (filter->mask_mask.s_addr == 0)
+ else if (filter->mask_mask.s_addr == INADDR_ANY)
vty_out(vty, " host %s", inet_ntoa(filter->mask));
else {
vty_out(vty, " %s", inet_ntoa(filter->mask));
vty_out(vty, " any\n");
else {
vty_out(vty, " %s", inet_ntoa(filter->addr));
- if (filter->addr_mask.s_addr != 0)
+ if (filter->addr_mask.s_addr != INADDR_ANY)
vty_out(vty, " %s",
inet_ntoa(filter->addr_mask));
vty_out(vty, "\n");
}
}
-void config_write_access_zebra(struct vty *vty, struct filter *mfilter)
+static void config_write_access_zebra(struct vty *vty, struct filter *mfilter)
{
struct filter_zebra *filter;
struct prefix *p;
}
static struct cmd_node access_mac_node = {
- ACCESS_MAC_NODE, "", /* Access list has no interface. */
- 1};
+ .node = ACCESS_MAC_NODE,
+ .prompt = "",
+ .vtysh = 1,
+};
static int config_write_access_mac(struct vty *vty)
{
}
/* Access-list node. */
-static struct cmd_node access_node = {ACCESS_NODE,
- "", /* Access list has no interface. */
- 1};
+static struct cmd_node access_node = {
+ .node = ACCESS_NODE,
+ .prompt = "",
+ .vtysh = 1,
+};
static int config_write_access_ipv4(struct vty *vty)
{
install_element(CONFIG_NODE, &no_access_list_remark_comment_cmd);
}
-static struct cmd_node access_ipv6_node = {ACCESS_IPV6_NODE, "", 1};
+static struct cmd_node access_ipv6_node = {
+ .node = ACCESS_IPV6_NODE,
+ .prompt = "",
+ .vtysh = 1,
+};
static int config_write_access_ipv6(struct vty *vty)
{