*: use an ifindex_t type, defined in lib/if.h, for ifindex values
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index 8bef175..122e70b 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -135,7 +135,7 @@
 /* Add an External info for AS-external-LSA. */
 struct external_info *
 ospf_external_info_add (u_char type, struct prefix_ipv4 p,
-			unsigned int ifindex, struct in_addr nexthop)
+			ifindex_t ifindex, struct in_addr nexthop)
 {
   struct external_info *new;
   struct route_node *rn;
diff --git a/ospfd/ospf_asbr.h b/ospfd/ospf_asbr.h
index 724acf4..d151cb1 100644
--- a/ospfd/ospf_asbr.h
+++ b/ospfd/ospf_asbr.h
@@ -39,7 +39,7 @@
   struct prefix_ipv4 p;
 
   /* Interface index. */
-  unsigned int ifindex;
+  ifindex_t ifindex;
 
   /* Nexthop address. */
   struct in_addr nexthop;
@@ -61,7 +61,7 @@
 				struct route_map_set_values *);
 extern struct external_info *ospf_external_info_add (u_char, 
                                               struct prefix_ipv4,
-					      unsigned int, 
+					      ifindex_t, 
 					      struct in_addr);
 extern void ospf_external_info_delete (u_char, struct prefix_ipv4);
 extern struct external_info *ospf_external_info_lookup (u_char, 
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index e62a4e7..6bd8c3e 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -2206,7 +2206,7 @@
 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 dd3b91a..c940724 100644
--- a/ospfd/ospf_lsa.h
+++ b/ospfd/ospf_lsa.h
@@ -283,7 +283,7 @@
 
 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 900a566..02ddf92 100644
--- a/ospfd/ospf_network.c
+++ b/ospfd/ospf_network.c
@@ -48,7 +48,7 @@
 /* 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 @@
 
 int
 ospf_if_drop_allspfrouters (struct ospf *top, struct prefix *p,
-			    unsigned int ifindex)
+			    ifindex_t ifindex)
 {
   int ret;
 
@@ -89,8 +89,7 @@
 
 /* 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 @@
 }
 
 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 @@
 }
 
 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 e0a5c69..8257adb 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 9a8f1d6..117401c 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -2125,7 +2125,7 @@
   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 6c202b0..d509e4a 100644
--- a/ospfd/ospf_route.h
+++ b/ospfd/ospf_route.h
@@ -39,7 +39,7 @@
 {
   struct in_addr nexthop;
   struct in_addr adv_router;
-  unsigned int ifindex;
+  ifindex_t ifindex;
 };
 
 /* Below is the structure linked to every
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index 1636153..ebeffa8 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -1413,7 +1413,7 @@
 struct ospf_snmp_if
 {
   struct in_addr addr;
-  unsigned int ifindex;
+  ifindex_t ifindex;
   struct interface *ifp;
 };
 
@@ -1455,7 +1455,7 @@
   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 @@
 }
 
 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 @@
 }
 
 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 @@
 
 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 @@
 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 @@
 
 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 @@
 		   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 @@
 
 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 @@
 }
 
 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 @@
 
 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 @@
 	      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;