summaryrefslogtreecommitdiffstats
path: root/lib/if.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-08-08 01:00:58 +0200
committerOlivier Dugeon <olivier.dugeon@orange.com>2020-04-30 11:27:20 +0200
commit0b7005375f37efe712820b283bc8677fc93ab57b (patch)
treecdbd35d4b9c947ea1cc6e9ae71d050531242f126 /lib/if.h
parentMerge pull request #6241 from volta-networks/fix_ldp_acl (diff)
downloadfrr-0b7005375f37efe712820b283bc8677fc93ab57b.tar.xz
frr-0b7005375f37efe712820b283bc8677fc93ab57b.zip
lib: constify a few parameters of helper functions
Parameters should be const whenever possible to improve code readability and remove the need to cast away the constness of const arguments. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/if.h')
-rw-r--r--lib/if.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/if.h b/lib/if.h
index ac8d8e70b..6a3680656 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -512,11 +512,11 @@ extern struct interface *if_create_name(const char *name, vrf_id_t vrf_id);
extern struct interface *if_create_ifindex(ifindex_t ifindex, vrf_id_t vrf_id);
extern struct interface *if_lookup_by_index(ifindex_t, vrf_id_t vrf_id);
extern struct interface *if_lookup_by_index_all_vrf(ifindex_t);
-extern struct interface *if_lookup_exact_address(void *matchaddr, int family,
- vrf_id_t vrf_id);
-extern struct connected *if_lookup_address(void *matchaddr, int family,
+extern struct interface *if_lookup_exact_address(const void *matchaddr,
+ int family, vrf_id_t vrf_id);
+extern struct connected *if_lookup_address(const void *matchaddr, int family,
vrf_id_t vrf_id);
-extern struct interface *if_lookup_prefix(struct prefix *prefix,
+extern struct interface *if_lookup_prefix(const struct prefix *prefix,
vrf_id_t vrf_id);
size_t if_lookup_by_hwaddr(const uint8_t *hw_addr, size_t addrsz,
struct interface ***result, vrf_id_t vrf_id);
@@ -575,9 +575,9 @@ connected_add_by_prefix(struct interface *, struct prefix *, struct prefix *);
extern struct connected *connected_delete_by_prefix(struct interface *,
struct prefix *);
extern struct connected *connected_lookup_prefix(struct interface *,
- struct prefix *);
+ const struct prefix *);
extern struct connected *connected_lookup_prefix_exact(struct interface *,
- struct prefix *);
+ const struct prefix *);
extern unsigned int connected_count_by_family(struct interface *, int family);
extern struct nbr_connected *nbr_connected_new(void);
extern void nbr_connected_free(struct nbr_connected *);