summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@hpe.com>2016-01-18 11:12:10 +0100
committerDonald Sharp <sharpd@cumulusnetwroks.com>2016-08-18 13:35:38 +0200
commitb892f1ddfe42a620d84b6c245d1997e4b560eea8 (patch)
treeacf13ca7ac43984b9215b0006d4d16fac2c281c3 /ospfd
parentMerge remote-tracking branch 'origin/cmaster' into cmaster-next (diff)
downloadfrr-b892f1ddfe42a620d84b6c245d1997e4b560eea8.tar.xz
frr-b892f1ddfe42a620d84b6c245d1997e4b560eea8.zip
*: use an ifindex_t type, defined in lib/if.h, for ifindex values
(cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_asbr.c2
-rw-r--r--ospfd/ospf_asbr.h4
-rw-r--r--ospfd/ospf_lsa.c2
-rw-r--r--ospfd/ospf_lsa.h2
-rw-r--r--ospfd/ospf_network.c12
-rw-r--r--ospfd/ospf_network.h10
-rw-r--r--ospfd/ospf_packet.c2
-rw-r--r--ospfd/ospf_route.h2
-rw-r--r--ospfd/ospf_snmp.c30
9 files changed, 32 insertions, 34 deletions
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index ddb26dd54..21f99af12 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -136,7 +136,7 @@ ospf_route_map_set_compare (struct route_map_set_values *values1,
/* Add an External info for AS-external-LSA. */
struct external_info *
ospf_external_info_add (u_char type, u_short instance, struct prefix_ipv4 p,
- unsigned int ifindex, struct in_addr nexthop,
+ ifindex_t ifindex, struct in_addr nexthop,
u_short tag)
{
struct external_info *new;
diff --git a/ospfd/ospf_asbr.h b/ospfd/ospf_asbr.h
index ade671013..25a53aad4 100644
--- a/ospfd/ospf_asbr.h
+++ b/ospfd/ospf_asbr.h
@@ -41,7 +41,7 @@ struct external_info
struct prefix_ipv4 p;
/* Interface index. */
- unsigned int ifindex;
+ ifindex_t ifindex;
/* Nexthop address. */
struct in_addr nexthop;
@@ -63,7 +63,7 @@ extern int ospf_route_map_set_compare (struct route_map_set_values *,
struct route_map_set_values *);
extern struct external_info *ospf_external_info_add (u_char, u_short,
struct prefix_ipv4,
- unsigned int,
+ ifindex_t,
struct in_addr,
u_short);
extern void ospf_external_info_delete (u_char, u_short, struct prefix_ipv4);
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 68a3946b3..b96ed452c 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -2251,7 +2251,7 @@ ospf_nssa_lsa_flush (struct ospf *ospf, struct prefix_ipv4 *p)
void
ospf_external_lsa_flush (struct ospf *ospf,
u_char type, struct prefix_ipv4 *p,
- unsigned int ifindex /*, struct in_addr nexthop */)
+ ifindex_t ifindex /*, struct in_addr nexthop */)
{
struct ospf_lsa *lsa;
diff --git a/ospfd/ospf_lsa.h b/ospfd/ospf_lsa.h
index b3d72109d..28ecc9d4d 100644
--- a/ospfd/ospf_lsa.h
+++ b/ospfd/ospf_lsa.h
@@ -277,7 +277,7 @@ extern struct ospf_lsa *ospf_lsa_install (struct ospf *,
extern void ospf_nssa_lsa_flush (struct ospf *ospf, struct prefix_ipv4 *p);
extern void ospf_external_lsa_flush (struct ospf *, u_char, struct prefix_ipv4 *,
- unsigned int /* , struct in_addr nexthop */);
+ ifindex_t /* , struct in_addr nexthop */);
extern struct in_addr ospf_get_ip_from_ifp (struct ospf_interface *);
diff --git a/ospfd/ospf_network.c b/ospfd/ospf_network.c
index 9f516d739..6caa38d68 100644
--- a/ospfd/ospf_network.c
+++ b/ospfd/ospf_network.c
@@ -48,7 +48,7 @@ extern struct zebra_privs_t ospfd_privs;
/* Join to the OSPF ALL SPF ROUTERS multicast group. */
int
ospf_if_add_allspfrouters (struct ospf *top, struct prefix *p,
- unsigned int ifindex)
+ ifindex_t ifindex)
{
int ret;
@@ -69,7 +69,7 @@ ospf_if_add_allspfrouters (struct ospf *top, struct prefix *p,
int
ospf_if_drop_allspfrouters (struct ospf *top, struct prefix *p,
- unsigned int ifindex)
+ ifindex_t ifindex)
{
int ret;
@@ -89,8 +89,7 @@ ospf_if_drop_allspfrouters (struct ospf *top, struct prefix *p,
/* Join to the OSPF ALL Designated ROUTERS multicast group. */
int
-ospf_if_add_alldrouters (struct ospf *top, struct prefix *p, unsigned int
- ifindex)
+ospf_if_add_alldrouters (struct ospf *top, struct prefix *p, ifindex_t ifindex)
{
int ret;
@@ -110,8 +109,7 @@ ospf_if_add_alldrouters (struct ospf *top, struct prefix *p, unsigned int
}
int
-ospf_if_drop_alldrouters (struct ospf *top, struct prefix *p, unsigned int
- ifindex)
+ospf_if_drop_alldrouters (struct ospf *top, struct prefix *p, ifindex_t ifindex)
{
int ret;
@@ -130,7 +128,7 @@ ospf_if_drop_alldrouters (struct ospf *top, struct prefix *p, unsigned int
}
int
-ospf_if_ipmulticast (struct ospf *top, struct prefix *p, unsigned int ifindex)
+ospf_if_ipmulticast (struct ospf *top, struct prefix *p, ifindex_t ifindex)
{
u_char val;
int ret, len;
diff --git a/ospfd/ospf_network.h b/ospfd/ospf_network.h
index e0a5c69d5..8257adb4a 100644
--- a/ospfd/ospf_network.h
+++ b/ospfd/ospf_network.h
@@ -25,14 +25,14 @@
/* Prototypes. */
extern int ospf_if_add_allspfrouters (struct ospf *, struct prefix *,
- unsigned int);
+ ifindex_t);
extern int ospf_if_drop_allspfrouters (struct ospf *, struct prefix *,
- unsigned int);
+ ifindex_t);
extern int ospf_if_add_alldrouters (struct ospf *, struct prefix *,
- unsigned int);
+ ifindex_t);
extern int ospf_if_drop_alldrouters (struct ospf *, struct prefix *,
- unsigned int);
-extern int ospf_if_ipmulticast (struct ospf *, struct prefix *, unsigned int);
+ ifindex_t);
+extern int ospf_if_ipmulticast (struct ospf *, struct prefix *, ifindex_t);
extern int ospf_sock_init (void);
extern void ospf_adjust_sndbuflen (struct ospf *, unsigned int);
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 2df1596ee..e6014a14c 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -2143,7 +2143,7 @@ ospf_recv_packet (int fd, struct interface **ifp, struct stream *ibuf)
int ret;
struct ip *iph;
u_int16_t ip_len;
- unsigned int ifindex = 0;
+ ifindex_t ifindex = 0;
struct iovec iov;
/* Header and data both require alignment. */
char buff [CMSG_SPACE(SOPT_SIZE_CMSG_IFINDEX_IPV4())];
diff --git a/ospfd/ospf_route.h b/ospfd/ospf_route.h
index d0b121db3..6b6d9f1fa 100644
--- a/ospfd/ospf_route.h
+++ b/ospfd/ospf_route.h
@@ -39,7 +39,7 @@ struct ospf_path
{
struct in_addr nexthop;
struct in_addr adv_router;
- unsigned int ifindex;
+ ifindex_t ifindex;
unsigned char unnumbered;
};
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index bedcb559b..676756d6d 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -1413,7 +1413,7 @@ static struct list *ospf_snmp_iflist;
struct ospf_snmp_if
{
struct in_addr addr;
- unsigned int ifindex;
+ ifindex_t ifindex;
struct interface *ifp;
};
@@ -1455,7 +1455,7 @@ ospf_snmp_if_update (struct interface *ifp)
struct prefix *p;
struct ospf_snmp_if *osif;
struct in_addr *addr;
- unsigned int ifindex;
+ ifindex_t ifindex;
ospf_snmp_if_delete (ifp);
@@ -1530,7 +1530,7 @@ ospf_snmp_is_if_have_addr (struct interface *ifp)
}
static struct ospf_interface *
-ospf_snmp_if_lookup (struct in_addr *ifaddr, unsigned int *ifindex)
+ospf_snmp_if_lookup (struct in_addr *ifaddr, ifindex_t *ifindex)
{
struct listnode *node;
struct ospf_snmp_if *osif;
@@ -1554,8 +1554,8 @@ ospf_snmp_if_lookup (struct in_addr *ifaddr, unsigned int *ifindex)
}
static struct ospf_interface *
-ospf_snmp_if_lookup_next (struct in_addr *ifaddr, unsigned int *ifindex,
- int ifaddr_next, int ifindex_next)
+ospf_snmp_if_lookup_next (struct in_addr *ifaddr, ifindex_t *ifindex,
+ int ifaddr_next, ifindex_t ifindex_next)
{
struct ospf_snmp_if *osif;
struct listnode *nn;
@@ -1638,11 +1638,11 @@ ospf_snmp_iftype (struct interface *ifp)
static struct ospf_interface *
ospfIfLookup (struct variable *v, oid *name, size_t *length,
- struct in_addr *ifaddr, unsigned int *ifindex, int exact)
+ struct in_addr *ifaddr, ifindex_t *ifindex, int exact)
{
unsigned int len;
int ifaddr_next = 0;
- int ifindex_next = 0;
+ ifindex_t ifindex_next = 0;
struct ospf_interface *oi;
oid *offset;
@@ -1694,7 +1694,7 @@ static u_char *
ospfIfEntry (struct variable *v, oid *name, size_t *length, int exact,
size_t *var_len, WriteMethod **write_method)
{
- unsigned int ifindex;
+ ifindex_t ifindex;
struct in_addr ifaddr;
struct ospf_interface *oi;
struct ospf *ospf;
@@ -1802,11 +1802,11 @@ ospfIfEntry (struct variable *v, oid *name, size_t *length, int exact,
static struct ospf_interface *
ospfIfMetricLookup (struct variable *v, oid *name, size_t *length,
- struct in_addr *ifaddr, unsigned int *ifindex, int exact)
+ struct in_addr *ifaddr, ifindex_t *ifindex, int exact)
{
unsigned int len;
int ifaddr_next = 0;
- int ifindex_next = 0;
+ ifindex_t ifindex_next = 0;
struct ospf_interface *oi;
oid *offset;
int metric;
@@ -1866,7 +1866,7 @@ ospfIfMetricEntry (struct variable *v, oid *name, size_t *length, int exact,
size_t *var_len, WriteMethod **write_method)
{
/* Currently we support metric 1 only. */
- unsigned int ifindex;
+ ifindex_t ifindex;
struct in_addr ifaddr;
struct ospf_interface *oi;
struct ospf *ospf;
@@ -2133,7 +2133,7 @@ ospfVirtIfEntry (struct variable *v, oid *name, size_t *length, int exact,
static struct ospf_neighbor *
ospf_snmp_nbr_lookup (struct ospf *ospf, struct in_addr *nbr_addr,
- unsigned int *ifindex)
+ ifindex_t *ifindex)
{
struct listnode *node, *nnode;
struct ospf_interface *oi;
@@ -2161,7 +2161,7 @@ ospf_snmp_nbr_lookup (struct ospf *ospf, struct in_addr *nbr_addr,
}
static struct ospf_neighbor *
-ospf_snmp_nbr_lookup_next (struct in_addr *nbr_addr, unsigned int *ifindex,
+ospf_snmp_nbr_lookup_next (struct in_addr *nbr_addr, ifindex_t *ifindex,
int first)
{
struct listnode *nn;
@@ -2208,7 +2208,7 @@ ospf_snmp_nbr_lookup_next (struct in_addr *nbr_addr, unsigned int *ifindex,
static struct ospf_neighbor *
ospfNbrLookup (struct variable *v, oid *name, size_t *length,
- struct in_addr *nbr_addr, unsigned int *ifindex, int exact)
+ struct in_addr *nbr_addr, ifindex_t *ifindex, int exact)
{
unsigned int len;
int first;
@@ -2303,7 +2303,7 @@ ospfNbrEntry (struct variable *v, oid *name, size_t *length, int exact,
size_t *var_len, WriteMethod **write_method)
{
struct in_addr nbr_addr;
- unsigned int ifindex;
+ ifindex_t ifindex;
struct ospf_neighbor *nbr;
struct ospf_interface *oi;