ip_mroute: Try to make function pointer declarations more consistent

The ip_mroute and ip6_mroute modules hook into the network stack via
several function pointers.  Declarations for these pointers are
scattered around several headers.  Put them all in the same place,
ip(6)_mroute.h.

No functional change intended.

Reviewed by:	glebius
MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55058
This commit is contained in:
Mark Johnston
2026-02-09 22:52:08 +00:00
parent 0a757ef9a7
commit 9df6a7f9a6
11 changed files with 39 additions and 15 deletions
+1
View File
@@ -79,6 +79,7 @@
#include <netinet/ip_options.h>
#include <netinet/igmp.h>
#include <netinet/igmp_var.h>
#include <netinet/ip_mroute.h>
#include <machine/in_cksum.h>
+1
View File
@@ -66,6 +66,7 @@
#include <net/if_private.h>
#include <netinet/ip_var.h>
#include <netinet/igmp_var.h>
#include <netinet/ip_mroute.h>
#ifndef KTR_IGMPV3
#define KTR_IGMPV3 KTR_INET
+1
View File
@@ -82,6 +82,7 @@
#include <machine/in_cksum.h>
#include <netinet/ip_carp.h>
#include <netinet/in_rss.h>
#include <netinet/ip_mroute.h>
#ifdef SCTP
#include <netinet/sctp_var.h>
#endif
+18 -3
View File
@@ -356,14 +356,29 @@ struct bw_meter {
};
#ifdef _KERNEL
VNET_DECLARE(struct socket *, ip_mrouter); /* multicast routing daemon */
#define V_ip_mrouter VNET(ip_mrouter)
struct ifnet;
struct ip;
struct ip_moptions;
struct mbuf;
struct socket;
struct sockopt;
extern int (*ip_mrouter_set)(struct socket *, struct sockopt *);
extern int (*ip_mrouter_get)(struct socket *, struct sockopt *);
extern u_long (*ip_mcast_src)(int);
extern int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
struct ip_moptions *);
extern int (*ip_mrouter_done)(void);
extern int (*mrt_ioctl)(u_long, caddr_t, int);
extern int (*ip_mrouter_get)(struct socket *, struct sockopt *);
extern int (*ip_mrouter_set)(struct socket *, struct sockopt *);
extern void (*ip_rsvp_force_done)(struct socket *);
extern int (*ip_rsvp_vif)(struct socket *, struct sockopt *);
extern int (*legal_vif_num)(int);
extern int (*mrt_ioctl)(u_long, caddr_t, int);
extern int (*rsvp_input_p)(struct mbuf **, int *, int);
#endif /* _KERNEL */
#endif /* _NETINET_IP_MROUTE_H_ */
+1
View File
@@ -78,6 +78,7 @@
#include <netinet/in_var.h>
#include <netinet/ip_var.h>
#include <netinet/ip_options.h>
#include <netinet/ip_mroute.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
-10
View File
@@ -199,9 +199,6 @@ VNET_DECLARE(int, ipsendredirects);
VNET_DECLARE(int, ipstealth); /* stealth forwarding */
#endif
VNET_DECLARE(struct socket *, ip_rsvpd); /* reservation protocol daemon*/
VNET_DECLARE(struct socket *, ip_mrouter); /* multicast routing daemon */
extern int (*legal_vif_num)(int);
extern u_long (*ip_mcast_src)(int);
VNET_DECLARE(int, rsvp_on);
VNET_DECLARE(int, drop_redirect);
VNET_DECLARE(int, ip_random_id);
@@ -214,7 +211,6 @@ VNET_DECLARE(int, ip_random_id);
#define V_ipstealth VNET(ipstealth)
#endif
#define V_ip_rsvpd VNET(ip_rsvpd)
#define V_ip_mrouter VNET(ip_mrouter)
#define V_rsvp_on VNET(rsvp_on)
#define V_drop_redirect VNET(drop_redirect)
#define V_ip_random_id VNET(ip_random_id)
@@ -227,9 +223,6 @@ int ip_ctloutput(struct socket *, struct sockopt *sopt);
int ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu,
u_long if_hwassist_flags);
void ip_forward(struct mbuf *m, int srcrt);
extern int
(*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
struct ip_moptions *);
int ip_output(struct mbuf *,
struct mbuf *, struct route *, int, struct ip_moptions *,
struct inpcb *);
@@ -244,9 +237,6 @@ int rsvp_input(struct mbuf **, int *, int);
int ip_rsvp_init(struct socket *);
int ip_rsvp_done(void);
extern int (*ip_rsvp_vif)(struct socket *, struct sockopt *);
extern void (*ip_rsvp_force_done)(struct socket *);
extern int (*rsvp_input_p)(struct mbuf **, int *, int);
typedef int ipproto_input_t(struct mbuf **, int *, int);
struct icmp;
+1
View File
@@ -118,6 +118,7 @@
#include <netinet6/mld6_var.h>
#include <netinet6/nd6.h>
#include <netinet6/in6_rss.h>
#include <netinet6/ip6_mroute.h>
#ifdef SCTP
#include <netinet/sctp_pcb.h>
#include <netinet6/sctp6_var.h>
+14
View File
@@ -270,10 +270,24 @@ struct rtdetq { /* XXX: rtdetq is also defined in ip_mroute.h */
#endif
#define MAX_UPQ6 4 /* max. no of pkts in upcall Q */
#endif /* _KERNEL || KERNEL */
#ifdef _KERNEL
VNET_DECLARE(struct socket *, ip6_mrouter); /* multicast routing daemon */
#define V_ip6_mrouter VNET(ip6_mrouter)
struct ifnet;
struct ip6_hdr;
struct mbuf;
struct socket;
struct sockopt;
extern int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *,
struct mbuf *);
extern int (*ip6_mrouter_set)(struct socket *so, struct sockopt *sopt);
extern int (*ip6_mrouter_get)(struct socket *so, struct sockopt *sopt);
extern int (*ip6_mrouter_done)(void);
extern int (*mrt6_ioctl)(u_long, caddr_t);
#endif /* _KERNEL */
+1
View File
@@ -110,6 +110,7 @@
#include <netinet/tcp_var.h>
#include <netinet6/nd6.h>
#include <netinet6/in6_rss.h>
#include <netinet6/ip6_mroute.h>
#include <netipsec/ipsec_support.h>
#if defined(SCTP) || defined(SCTP_SUPPORT)
-2
View File
@@ -309,7 +309,6 @@ VNET_DECLARE(int, ip6_v6only);
#define V_ip6_mcast_pmtu VNET(ip6_mcast_pmtu)
#define V_ip6_v6only VNET(ip6_v6only)
VNET_DECLARE(struct socket *, ip6_mrouter); /* multicast routing daemon */
VNET_DECLARE(int, ip6_sendredirects); /* send IP redirects when forwarding? */
VNET_DECLARE(int, ip6_accept_rtadv); /* Acts as a host not a router */
VNET_DECLARE(int, ip6_no_radr); /* No defroute from RA */
@@ -320,7 +319,6 @@ VNET_DECLARE(int, ip6_rfc6204w3); /* Accept defroute from RA even when
VNET_DECLARE(int, ip6_hdrnestlimit); /* upper limit of # of extension
* headers */
VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionTransmits */
#define V_ip6_mrouter VNET(ip6_mrouter)
#define V_ip6_sendredirects VNET(ip6_sendredirects)
#define V_ip6_accept_rtadv VNET(ip6_accept_rtadv)
#define V_ip6_no_radr VNET(ip6_no_radr)
+1
View File
@@ -90,6 +90,7 @@
#include <netinet6/ip6_var.h>
#include <netinet6/scope6_var.h>
#include <netinet/icmp6.h>
#include <netinet6/ip6_mroute.h>
#include <netinet6/mld6.h>
#include <netinet6/mld6_var.h>