summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2010-08-11 20:18:19 +0000
committerwill <will@FreeBSD.org>2010-08-11 20:18:19 +0000
commitd548943ae909fff2cc91f964186d557895e14bab (patch)
tree04a9bbb85e9f7f4a28b5bef19bf56f932ebf0ea4
parent9198b19835979cee1b431f818f01d9859c25f48f (diff)
downloadFreeBSD-src-d548943ae909fff2cc91f964186d557895e14bab.zip
FreeBSD-src-d548943ae909fff2cc91f964186d557895e14bab.tar.gz
Unbreak LINT by moving all carp hooks to net/if.c / netinet/ip_carp.h, with
the appropriate ifdefs. Reviewed by: bz Approved by: ken (mentor)
-rw-r--r--sys/net/if.c16
-rw-r--r--sys/net/if_bridge.c8
-rw-r--r--sys/net/if_ethersubr.c5
-rw-r--r--sys/netinet/if_ether.c7
-rw-r--r--sys/netinet/ip_carp.c20
-rw-r--r--sys/netinet/ip_carp.h20
-rw-r--r--sys/netinet6/nd6_nbr.c5
7 files changed, 42 insertions, 39 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 3c4ad16..c1c6ee9 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -80,6 +80,7 @@
/*XXX*/
#include <netinet/in.h>
#include <netinet/in_var.h>
+#include <netinet/ip_carp.h>
#ifdef INET6
#include <netinet6/in6_var.h>
#include <netinet6/in6_ifattach.h>
@@ -124,7 +125,22 @@ SX_SYSINIT(ifdescr_sx, &ifdescr_sx, "ifnet descr");
void (*bstp_linkstate_p)(struct ifnet *ifp, int state);
void (*ng_ether_link_state_p)(struct ifnet *ifp, int state);
void (*lagg_linkstate_p)(struct ifnet *ifp, int state);
+/* These are external hooks for CARP. */
void (*carp_linkstate_p)(struct ifnet *ifp);
+#if defined(INET) || defined(INET6)
+struct ifnet *(*carp_forus_p)(struct ifnet *ifp, u_char *dhost);
+int (*carp_output_p)(struct ifnet *ifp, struct mbuf *m,
+ struct sockaddr *sa, struct rtentry *rt);
+#endif
+#ifdef INET
+int (*carp_iamatch_p)(struct ifnet *, struct in_ifaddr *, struct in_addr *,
+ u_int8_t **);
+#endif
+#ifdef INET6
+struct ifaddr *(*carp_iamatch6_p)(struct ifnet *ifp, struct in6_addr *taddr6);
+caddr_t (*carp_macmatch6_p)(struct ifnet *ifp, struct mbuf *m,
+ const struct in6_addr *taddr);
+#endif
struct mbuf *(*tbr_dequeue_ptr)(struct ifaltq *, int) = NULL;
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index fb04731..5ac4ef0 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -2141,10 +2141,6 @@ drop:
m_freem(m);
}
-#if defined(INET) || defined(INET6)
-int (*carp_forus_p)(struct carp_if *, u_char *);
-#endif
-
/*
* bridge_input:
*
@@ -2256,10 +2252,10 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
#if (defined(INET) || defined(INET6))
# define OR_CARP_CHECK_WE_ARE_DST(iface) \
|| ((iface)->if_carp \
- && (*carp_forus_p)((iface)->if_carp, eh->ether_dhost))
+ && (*carp_forus_p)((iface), eh->ether_dhost))
# define OR_CARP_CHECK_WE_ARE_SRC(iface) \
|| ((iface)->if_carp \
- && (*carp_forus_p)((iface)->if_carp, eh->ether_shost))
+ && (*carp_forus_p)((iface), eh->ether_shost))
#else
# define OR_CARP_CHECK_WE_ARE_DST(iface)
# define OR_CARP_CHECK_WE_ARE_SRC(iface)
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 984d0bb..d284d11 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -114,11 +114,6 @@ void (*ng_ether_attach_p)(struct ifnet *ifp);
void (*ng_ether_detach_p)(struct ifnet *ifp);
void (*vlan_input_p)(struct ifnet *, struct mbuf *);
-#if defined(INET) || defined(INET6)
-int (*carp_forus_p)(struct ifnet *, u_char *);
-int (*carp_output_p)(struct ifnet *, struct mbuf *, struct sockaddr *,
- struct rtentry *);
-#endif
/* if_bridge(4) support */
struct mbuf *(*bridge_input_p)(struct ifnet *, struct mbuf *);
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index bdc981a..a6ea36e 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$");
#include <netinet/in_var.h>
#include <net/if_llatbl.h>
#include <netinet/if_ether.h>
+#if defined(INET) || defined(INET6)
+#include <netinet/ip_carp.h>
+#endif
#include <net/if_arc.h>
#include <net/iso88025.h>
@@ -118,10 +121,6 @@ static void arptimer(void *);
#ifdef INET
static void in_arpinput(struct mbuf *);
#endif
-#if defined(INET) || defined(INET6)
-int (*carp_iamatch_p)(struct ifnet *, struct in_ifaddr *, struct in_addr *,
- u_int8_t **);
-#endif
static const struct netisr_handler arp_nh = {
.nh_name = "arp",
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 1820ae0..8de1684 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -135,26 +135,6 @@ struct carp_softc {
};
#define SC2IFP(sc) ((sc)->sc_ifp)
-/* These are external networking stack hooks for CARP */
-/* net/if.c */
-extern void (*carp_linkstate_p)(struct ifnet *);
-/* net/if_bridge.c net/if_ethersubr.c */
-extern struct ifnet *(*carp_forus_p)(struct ifnet *, u_char *);
-/* net/if_ethersubr.c */
-extern int (*carp_output_p)(struct ifnet *, struct mbuf *,
- struct sockaddr *, struct rtentry *);
-#ifdef INET
-/* netinet/if_ether.c */
-extern int (*carp_iamatch_p)(struct ifnet *, struct in_ifaddr *,
- struct in_addr *, u_int8_t **);
-#endif
-#ifdef INET6
-/* netinet6/nd6_nbr.c */
-extern struct ifaddr *(*carp_iamatch6_p)(struct ifnet *, struct in6_addr *);
-extern caddr_t (*carp_macmatch6_p)(struct ifnet *, struct mbuf *,
- const struct in6_addr *);
-#endif
-
int carp_suppress_preempt = 0;
int carp_opts[CARPCTL_MAXID] = { 0, 1, 0, 1, 0, 0 }; /* XXX for now */
SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW, 0, "CARP");
diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h
index 1e06806..2f2b4f2 100644
--- a/sys/netinet/ip_carp.h
+++ b/sys/netinet/ip_carp.h
@@ -167,5 +167,25 @@ int carp_iamatch (struct ifnet *, struct in_ifaddr *, struct in_addr *,
struct ifaddr *carp_iamatch6(struct ifnet *, struct in6_addr *);
caddr_t carp_macmatch6(struct ifnet *, struct mbuf *, const struct in6_addr *);
struct ifnet *carp_forus (struct ifnet *, u_char *);
+
+/* These are external networking stack hooks for CARP */
+/* net/if.c */
+extern void (*carp_linkstate_p)(struct ifnet *);
+/* net/if_bridge.c net/if_ethersubr.c */
+extern struct ifnet *(*carp_forus_p)(struct ifnet *, u_char *);
+/* net/if_ethersubr.c */
+extern int (*carp_output_p)(struct ifnet *, struct mbuf *,
+ struct sockaddr *, struct rtentry *);
+#ifdef INET
+/* netinet/if_ether.c */
+extern int (*carp_iamatch_p)(struct ifnet *, struct in_ifaddr *,
+ struct in_addr *, u_int8_t **);
+#endif
+#ifdef INET6
+/* netinet6/nd6_nbr.c */
+extern struct ifaddr *(*carp_iamatch6_p)(struct ifnet *, struct in6_addr *);
+extern caddr_t (*carp_macmatch6_p)(struct ifnet *, struct mbuf *,
+ const struct in6_addr *);
+#endif
#endif
#endif /* _IP_CARP_H */
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index eca85eb..130189d 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
#include <netinet6/scope6_var.h>
#include <netinet6/nd6.h>
#include <netinet/icmp6.h>
+#include <netinet/ip_carp.h>
#define SDL(s) ((struct sockaddr_dl *)s)
@@ -84,10 +85,6 @@ static void nd6_dad_ns_output(struct dadq *, struct ifaddr *);
static void nd6_dad_ns_input(struct ifaddr *);
static void nd6_dad_na_input(struct ifaddr *);
-struct ifaddr *(*carp_iamatch6_p)(struct ifnet *, struct in6_addr *);
-caddr_t (*carp_macmatch6_p)(struct ifnet *, struct mbuf *,
- const struct in6_addr *);
-
VNET_DEFINE(int, dad_ignore_ns) = 0; /* ignore NS in DAD - specwise incorrect*/
VNET_DEFINE(int, dad_maxtry) = 15; /* max # of *tries* to transmit DAD packet */
#define V_dad_ignore_ns VNET(dad_ignore_ns)
OpenPOWER on IntegriCloud