diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/filter.c | 9 | ||||
| -rw-r--r-- | lib/filter.h | 3 | ||||
| -rw-r--r-- | lib/plist.c | 13 | ||||
| -rw-r--r-- | lib/plist.h | 5 | ||||
| -rw-r--r-- | lib/routemap.c | 5 | ||||
| -rw-r--r-- | lib/routemap.h | 8 | ||||
| -rw-r--r-- | lib/zclient.h | 2 |
7 files changed, 27 insertions, 18 deletions
diff --git a/lib/filter.c b/lib/filter.c index 670c65374a..0528b0f2ad 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -157,7 +157,7 @@ static const char *filter_type_str(struct filter *filter) } /* If filter match to the prefix then return 1. */ -static int filter_match_cisco(struct filter *mfilter, struct prefix *p) +static int filter_match_cisco(struct filter *mfilter, const struct prefix *p) { struct filter_cisco *filter; struct in_addr mask; @@ -181,7 +181,7 @@ static int filter_match_cisco(struct filter *mfilter, struct prefix *p) } /* If filter match to the prefix then return 1. */ -static int filter_match_zebra(struct filter *mfilter, struct prefix *p) +static int filter_match_zebra(struct filter *mfilter, const struct prefix *p) { struct filter_zebra *filter = NULL; @@ -372,10 +372,11 @@ static struct access_list *access_list_get(afi_t afi, const char *name) } /* Apply access list to object (which should be struct prefix *). */ -enum filter_type access_list_apply(struct access_list *access, void *object) +enum filter_type access_list_apply(struct access_list *access, + const void *object) { struct filter *filter; - struct prefix *p = (struct prefix *)object; + const struct prefix *p = (const struct prefix *)object; if (access == NULL) return FILTER_DENY; diff --git a/lib/filter.h b/lib/filter.h index c02516409b..97854b1e97 100644 --- a/lib/filter.h +++ b/lib/filter.h @@ -59,6 +59,7 @@ extern void access_list_reset(void); extern void access_list_add_hook(void (*func)(struct access_list *)); extern void access_list_delete_hook(void (*func)(struct access_list *)); extern struct access_list *access_list_lookup(afi_t, const char *); -extern enum filter_type access_list_apply(struct access_list *, void *); +extern enum filter_type access_list_apply(struct access_list *access, + const void *object); #endif /* _ZEBRA_FILTER_H */ diff --git a/lib/plist.c b/lib/plist.c index 056b737f54..2b666f256f 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -656,7 +656,7 @@ static const char *prefix_list_type_str(struct prefix_list_entry *pentry) } static int prefix_list_entry_match(struct prefix_list_entry *pentry, - struct prefix *p) + const struct prefix *p) { int ret; @@ -683,14 +683,15 @@ static int prefix_list_entry_match(struct prefix_list_entry *pentry, return 1; } -enum prefix_list_type prefix_list_apply_which_prefix(struct prefix_list *plist, - struct prefix **which, - void *object) +enum prefix_list_type prefix_list_apply_which_prefix( + struct prefix_list *plist, + const struct prefix **which, + const void *object) { struct prefix_list_entry *pentry, *pbest = NULL; - struct prefix *p = (struct prefix *)object; - uint8_t *byte = p->u.val; + const struct prefix *p = (const struct prefix *)object; + const uint8_t *byte = p->u.val; size_t depth; size_t validbits = p->prefixlen; struct pltrie_table *table; diff --git a/lib/plist.h b/lib/plist.h index 67e345a485..fecbe0e2ce 100644 --- a/lib/plist.h +++ b/lib/plist.h @@ -61,8 +61,9 @@ extern struct prefix_list *prefix_list_lookup(afi_t, const char *); * If it is a empty plist return a NULL pointer. */ extern enum prefix_list_type -prefix_list_apply_which_prefix(struct prefix_list *plist, struct prefix **which, - void *object); +prefix_list_apply_which_prefix(struct prefix_list *plist, + const struct prefix **which, + const void *object); #define prefix_list_apply(A, B) prefix_list_apply_which_prefix((A), NULL, (B)) extern struct prefix_list *prefix_bgp_orf_lookup(afi_t, const char *); diff --git a/lib/routemap.c b/lib/routemap.c index 056c793454..6c4585365a 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1387,7 +1387,7 @@ int route_map_delete_set(struct route_map_index *index, const char *set_name, static route_map_result_t route_map_apply_match(struct route_map_rule_list *match_list, - struct prefix *prefix, route_map_object_t type, + const struct prefix *prefix, route_map_object_t type, void *object) { route_map_result_t ret = RMAP_NOMATCH; @@ -1417,7 +1417,8 @@ route_map_apply_match(struct route_map_rule_list *match_list, } /* Apply route map to the object. */ -route_map_result_t route_map_apply(struct route_map *map, struct prefix *prefix, +route_map_result_t route_map_apply(struct route_map *map, + const struct prefix *prefix, route_map_object_t type, void *object) { static int recursion = 0; diff --git a/lib/routemap.h b/lib/routemap.h index 0aeba7e1f6..0f7c391f84 100644 --- a/lib/routemap.h +++ b/lib/routemap.h @@ -87,8 +87,10 @@ struct route_map_rule_cmd { const char *str; /* Function for value set or match. */ - route_map_result_t (*func_apply)(void *, struct prefix *, - route_map_object_t, void *); + route_map_result_t (*func_apply)(void *rule, + const struct prefix *prefix, + route_map_object_t type, + void *object); /* Compile argument and return result as void *. */ void *(*func_compile)(const char *); @@ -208,7 +210,7 @@ extern struct route_map *route_map_lookup_by_name(const char *name); /* Apply route map to the object. */ extern route_map_result_t route_map_apply(struct route_map *map, - struct prefix *, + const struct prefix *prefix, route_map_object_t object_type, void *object); diff --git a/lib/zclient.h b/lib/zclient.h index 10a1723010..49419b3df3 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -448,6 +448,8 @@ enum zapi_iptable_notify_owner { /* Zebra MAC types */ #define ZEBRA_MACIP_TYPE_STICKY 0x01 /* Sticky MAC*/ #define ZEBRA_MACIP_TYPE_GW 0x02 /* gateway (SVI) mac*/ +#define ZEBRA_MACIP_TYPE_ROUTER_FLAG 0x04 /* Router Flag - proxy NA */ +#define ZEBRA_MACIP_TYPE_OVERRIDE_FLAG 0x08 /* Override Flag */ struct zclient_options { bool receive_notify; |
