From 8cc4198f9fabe5f10f5a773de1503d82f33a01fb Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 6 May 2005 21:25:49 +0000 Subject: 2005-05-06 Paul Jakma * (general) extern and static'ification of functions in code and header. Cleanup any definitions with unspecified arguments. Add casts for callback assignments where the callback is defined, typically, as passing void *, but the function being assigned has some other pointer type defined as its argument, as gcc complains about casts from void * to X* via function arguments. Fix some old K&R style function argument definitions. Add noreturn gcc attribute to some functions, as appropriate. Add unused gcc attribute to some functions (eg ones meant to help while debugging) Add guard defines to headers which were missing them. * command.c: (install_node) add const qualifier, still doesnt shut up the warning though, because of the double pointer. (cmp_node) ditto * keychain.c: (key_str2time) Add GET_LONG_RANGE() macro, derived fromn vty.h ones to fix some of the (long) < 0 warnings. * thread.c: (various) use thread_empty (cpu_record_hash_key) should cast to uintptr_t, a stdint.h type * vty.h: Add VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX so they removed from ospfd/ospf_vty.h * zebra.h: Move definition of ZEBRA_PORT to here, to remove dependence of lib on zebra/zserv.h --- lib/if.h | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'lib/if.h') diff --git a/lib/if.h b/lib/if.h index 6946865c..8126ea9c 100644 --- a/lib/if.h +++ b/lib/if.h @@ -211,16 +211,16 @@ struct connected #endif /* IFF_VIRTUAL */ /* Prototypes. */ -int if_cmp_func (struct interface *, struct interface *); -struct interface *if_create (const char *name, int namelen); -struct interface *if_lookup_by_index (unsigned int); -struct interface *if_lookup_exact_address (struct in_addr); -struct interface *if_lookup_address (struct in_addr); +extern int if_cmp_func (struct interface *, struct interface *); +extern struct interface *if_create (const char *name, int namelen); +extern struct interface *if_lookup_by_index (unsigned int); +extern struct interface *if_lookup_exact_address (struct in_addr); +extern struct interface *if_lookup_address (struct in_addr); /* These 2 functions are to be used when the ifname argument is terminated by a '\0' character: */ -struct interface *if_lookup_by_name (const char *ifname); -struct interface *if_get_by_name (const char *ifname); +extern struct interface *if_lookup_by_name (const char *ifname); +extern struct interface *if_get_by_name (const char *ifname); /* For these 2 functions, the namelen argument should be the precise length of the ifname string (not counting any optional trailing '\0' character). @@ -239,22 +239,22 @@ extern void if_delete_retain (struct interface *); deletes it from the interface list and frees the structure. */ extern void if_delete (struct interface *); -int if_is_up (struct interface *); -int if_is_running (struct interface *); -int if_is_operative (struct interface *); -int if_is_loopback (struct interface *); -int if_is_broadcast (struct interface *); -int if_is_pointopoint (struct interface *); -int if_is_multicast (struct interface *); -void if_add_hook (int, int (*)(struct interface *)); -void if_init (); -void if_dump_all (); +extern int if_is_up (struct interface *); +extern int if_is_running (struct interface *); +extern int if_is_operative (struct interface *); +extern int if_is_loopback (struct interface *); +extern int if_is_broadcast (struct interface *); +extern int if_is_pointopoint (struct interface *); +extern int if_is_multicast (struct interface *); +extern void if_add_hook (int, int (*)(struct interface *)); +extern void if_init (void); +extern void if_dump_all (void); extern const char *if_flag_dump(unsigned long); /* Please use ifindex2ifname instead of if_indextoname where possible; ifindex2ifname uses internal interface info, whereas if_indextoname must make a system call. */ -extern char *ifindex2ifname (unsigned int); +extern const char *ifindex2ifname (unsigned int); /* Please use ifname2ifindex instead of if_nametoindex where possible; ifname2ifindex uses internal interface info, whereas if_nametoindex must @@ -262,22 +262,22 @@ extern char *ifindex2ifname (unsigned int); extern unsigned int ifname2ifindex(const char *ifname); /* Connected address functions. */ -struct connected *connected_new (); -void connected_free (struct connected *); -void connected_add (struct interface *, struct connected *); -struct connected *connected_add_by_prefix (struct interface *, +extern struct connected *connected_new (void); +extern void connected_free (struct connected *); +extern void connected_add (struct interface *, struct connected *); +extern struct connected *connected_add_by_prefix (struct interface *, struct prefix *, struct prefix *); -struct connected *connected_delete_by_prefix (struct interface *, +extern struct connected *connected_delete_by_prefix (struct interface *, struct prefix *); -struct connected *connected_lookup_address (struct interface *, +extern struct connected *connected_lookup_address (struct interface *, struct in_addr); #ifndef HAVE_IF_NAMETOINDEX -unsigned int if_nametoindex (const char *); +extern unsigned int if_nametoindex (const char *); #endif #ifndef HAVE_IF_INDEXTONAME -char *if_indextoname (unsigned int, char *); +extern char *if_indextoname (unsigned int, char *); #endif /* Exported variables. */ -- cgit v1.2.1