de-static ip_mroute.c and fix ip6_mroute.c since it used the same function
names.

-- 
:wq Claudio

Index: netinet/ip_mroute.c
===================================================================
RCS file: /cvs/src/sys/netinet/ip_mroute.c,v
retrieving revision 1.75
diff -u -p -r1.75 ip_mroute.c
--- netinet/ip_mroute.c 7 Feb 2015 07:56:41 -0000       1.75
+++ netinet/ip_mroute.c 8 Feb 2015 03:01:08 -0000
@@ -136,38 +136,39 @@ u_int             mrtdebug = 0;     /* debug level        
*
 #define                UPCALL_EXPIRE   6               /* number of timeouts */
 struct timeout expire_upcalls_ch;
 
-static int get_sg_cnt(struct sioc_sg_req *);
-static int get_vif_cnt(struct sioc_vif_req *);
-static int ip_mrouter_init(struct socket *, struct mbuf *);
-static int get_version(struct mbuf *);
-static int set_assert(struct mbuf *);
-static int get_assert(struct mbuf *);
-static int add_vif(struct mbuf *);
-static int del_vif(struct mbuf *);
-static void update_mfc_params(struct mfc *, struct mfcctl2 *);
-static void init_mfc_params(struct mfc *, struct mfcctl2 *);
-static void expire_mfc(struct mfc *);
-static int add_mfc(struct mbuf *);
-static int del_mfc(struct mbuf *);
-static int set_api_config(struct mbuf *); /* chose API capabilities */
-static int get_api_support(struct mbuf *);
-static int get_api_config(struct mbuf *);
-static int socket_send(struct socket *, struct mbuf *,
+int get_sg_cnt(struct sioc_sg_req *);
+int get_vif_cnt(struct sioc_vif_req *);
+int get_vif_ctl(struct vifctl *);
+int ip_mrouter_init(struct socket *, struct mbuf *);
+int get_version(struct mbuf *);
+int set_assert(struct mbuf *);
+int get_assert(struct mbuf *);
+int add_vif(struct mbuf *);
+int del_vif(struct mbuf *);
+void update_mfc_params(struct mfc *, struct mfcctl2 *);
+void init_mfc_params(struct mfc *, struct mfcctl2 *);
+void expire_mfc(struct mfc *);
+int add_mfc(struct mbuf *);
+int del_mfc(struct mbuf *);
+int set_api_config(struct mbuf *); /* chose API capabilities */
+int get_api_support(struct mbuf *);
+int get_api_config(struct mbuf *);
+int socket_send(struct socket *, struct mbuf *,
                            struct sockaddr_in *);
-static void expire_upcalls(void *);
-static int ip_mdq(struct mbuf *, struct ifnet *, struct mfc *);
-static void phyint_send(struct ip *, struct vif *, struct mbuf *);
-static void encap_send(struct ip *, struct vif *, struct mbuf *);
-static void send_packet(struct vif *, struct mbuf *);
+void expire_upcalls(void *);
+int ip_mdq(struct mbuf *, struct ifnet *, struct mfc *);
+void phyint_send(struct ip *, struct vif *, struct mbuf *);
+void encap_send(struct ip *, struct vif *, struct mbuf *);
+void send_packet(struct vif *, struct mbuf *);
 
 #ifdef PIM
-static int pim_register_send(struct ip *, struct vif *,
+int pim_register_send(struct ip *, struct vif *,
                struct mbuf *, struct mfc *);
-static int pim_register_send_rp(struct ip *, struct vif *,
+int pim_register_send_rp(struct ip *, struct vif *,
                struct mbuf *, struct mfc *);
-static int pim_register_send_upcall(struct ip *, struct vif *,
+int pim_register_send_upcall(struct ip *, struct vif *,
                struct mbuf *, struct mfc *);
-static struct mbuf *pim_register_prepare(struct ip *, struct mbuf *);
+struct mbuf *pim_register_prepare(struct ip *, struct mbuf *);
 #endif
 
 /*
@@ -434,7 +435,7 @@ mrt_ioctl(struct socket *so, u_long cmd,
 /*
  * returns the packet, byte, rpf-failure count for the source group provided
  */
-static int
+int
 get_sg_cnt(struct sioc_sg_req *req)
 {
        int s;
@@ -458,7 +459,7 @@ get_sg_cnt(struct sioc_sg_req *req)
 /*
  * returns the input and output packet and byte counts on the vif provided
  */
-static int
+int
 get_vif_cnt(struct sioc_vif_req *req)
 {
        vifi_t vifi = req->vifi;
@@ -477,7 +478,7 @@ get_vif_cnt(struct sioc_vif_req *req)
 /*
  * Enable multicast routing
  */
-static int
+int
 ip_mrouter_init(struct socket *so, struct mbuf *m)
 {
        int *v;
@@ -612,7 +613,7 @@ ip_mrouter_detach(struct ifnet *ifp)
        }
 }
 
-static int
+int
 get_version(struct mbuf *m)
 {
        int *v = mtod(m, int *);
@@ -625,7 +626,7 @@ get_version(struct mbuf *m)
 /*
  * Set PIM assert processing global
  */
-static int
+int
 set_assert(struct mbuf *m)
 {
        int *i;
@@ -641,7 +642,7 @@ set_assert(struct mbuf *m)
 /*
  * Get PIM assert processing global
  */
-static int
+int
 get_assert(struct mbuf *m)
 {
        int *i = mtod(m, int *);
@@ -654,7 +655,7 @@ get_assert(struct mbuf *m)
 /*
  * Configure API capabilities
  */
-static int
+int
 set_api_config(struct mbuf *m)
 {
        int i;
@@ -696,7 +697,7 @@ set_api_config(struct mbuf *m)
 /*
  * Get API capabilities
  */
-static int
+int
 get_api_support(struct mbuf *m)
 {
        u_int32_t *apival;
@@ -714,7 +715,7 @@ get_api_support(struct mbuf *m)
 /*
  * Get API configured capabilities
  */
-static int
+int
 get_api_config(struct mbuf *m)
 {
        u_int32_t *apival;
@@ -734,7 +735,7 @@ static struct sockaddr_in sin = { sizeof
 /*
  * Add a vif to the vif table
  */
-static int
+int
 add_vif(struct mbuf *m)
 {
        struct vifctl *vifcp;
@@ -867,7 +868,7 @@ reset_vif(struct vif *vifp)
 /*
  * Delete a vif from the vif table
  */
-static int
+int
 del_vif(struct mbuf *m)
 {
        vifi_t *vifip;
@@ -938,7 +939,7 @@ vif_delete(struct ifnet *ifp)
 /*
  * update an mfc entry without resetting counters and S,G addresses.
  */
-static void
+void
 update_mfc_params(struct mfc *rt, struct mfcctl2 *mfccp)
 {
        int i;
@@ -959,7 +960,7 @@ update_mfc_params(struct mfc *rt, struct
 /*
  * fully initialize an mfc entry from the parameter.
  */
-static void
+void
 init_mfc_params(struct mfc *rt, struct mfcctl2 *mfccp)
 {
        rt->mfc_origin     = mfccp->mfcc_origin;
@@ -974,7 +975,7 @@ init_mfc_params(struct mfc *rt, struct m
        timerclear(&rt->mfc_last_assert);
 }
 
-static void
+void
 expire_mfc(struct mfc *rt)
 {
        struct rtdetq *rte, *nrte;
@@ -992,7 +993,7 @@ expire_mfc(struct mfc *rt)
 /*
  * Add an mfc entry
  */
-static int
+int
 add_mfc(struct mbuf *m)
 {
        struct mfcctl2 mfcctl2;
@@ -1131,7 +1132,7 @@ add_mfc(struct mbuf *m)
 /*
  * Delete an mfc entry
  */
-static int
+int
 del_mfc(struct mbuf *m)
 {
        struct mfcctl2 mfcctl2;
@@ -1175,7 +1176,7 @@ del_mfc(struct mbuf *m)
        return (0);
 }
 
-static int
+int
 socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in *src)
 {
        if (s != NULL) {
@@ -1411,7 +1412,7 @@ ip_mforward(struct mbuf *m, struct ifnet
 
 
 /*ARGSUSED*/
-static void
+void
 expire_upcalls(void *v)
 {
        int i;
@@ -1450,7 +1451,7 @@ expire_upcalls(void *v)
 /*
  * Packet forwarding routine once entry in the cache is made
  */
-static int
+int
 ip_mdq(struct mbuf *m, struct ifnet *ifp, struct mfc *rt)
 {
        struct ip  *ip = mtod(m, struct ip *);
@@ -1580,7 +1581,7 @@ ip_mdq(struct mbuf *m, struct ifnet *ifp
        return (0);
 }
 
-static void
+void
 phyint_send(struct ip *ip, struct vif *vifp, struct mbuf *m)
 {
        struct mbuf *mb_copy;
@@ -1599,7 +1600,7 @@ phyint_send(struct ip *ip, struct vif *v
        send_packet(vifp, mb_copy);
 }
 
-static void
+void
 encap_send(struct ip *ip, struct vif *vifp, struct mbuf *m)
 {
        struct mbuf *mb_copy;
@@ -1654,7 +1655,7 @@ encap_send(struct ip *ip, struct vif *vi
        send_packet(vifp, mb_copy);
 }
 
-static void
+void
 send_packet(struct vif *vifp, struct mbuf *m)
 {
        int error;
@@ -1689,7 +1690,7 @@ send_packet(struct vif *vifp, struct mbu
 /*
  * Send the packet up to the user daemon, or eventually do kernel encapsulation
  */
-static int
+int
 pim_register_send(struct ip *ip, struct vif *vifp,
        struct mbuf *m, struct mfc *rt)
 {
@@ -1729,7 +1730,7 @@ pim_register_send(struct ip *ip, struct 
  * encapsulation.
  * XXX: Note that in the returned copy the IP header is a valid one.
  */
-static struct mbuf *
+struct mbuf *
 pim_register_prepare(struct ip *ip, struct mbuf *m)
 {
        struct mbuf *mb_copy = NULL;
@@ -1772,7 +1773,7 @@ pim_register_prepare(struct ip *ip, stru
 /*
  * Send an upcall with the data packet to the user-level process.
  */
-static int
+int
 pim_register_send_upcall(struct ip *ip, struct vif *vifp,
        struct mbuf *mb_copy, struct mfc *rt)
 {
@@ -1822,7 +1823,7 @@ pim_register_send_upcall(struct ip *ip, 
 /*
  * Encapsulate the data packet in PIM Register message and send it to the RP.
  */
-static int
+int
 pim_register_send_rp(struct ip *ip, struct vif *vifp,
        struct mbuf *mb_copy, struct mfc *rt)
 {
Index: netinet6/ip6_mroute.c
===================================================================
RCS file: /cvs/src/sys/netinet6/ip6_mroute.c,v
retrieving revision 1.77
diff -u -p -r1.77 ip6_mroute.c
--- netinet6/ip6_mroute.c       19 Dec 2014 17:14:40 -0000      1.77
+++ netinet6/ip6_mroute.c       8 Feb 2015 02:58:29 -0000
@@ -111,11 +111,11 @@
 #include <netinet6/nd6.h>
 
 int ip6_mdq(struct mbuf *, struct ifnet *, struct mf6c *);
-void phyint_send(struct ip6_hdr *, struct mif6 *, struct mbuf *);
+void phyint_send6(struct ip6_hdr *, struct mif6 *, struct mbuf *);
 
 int set_pim6(int *);
 int get_pim6(struct mbuf *);
-int socket_send(struct socket *, struct mbuf *, struct sockaddr_in6 *);
+int socket6_send(struct socket *, struct mbuf *, struct sockaddr_in6 *);
 int register_send(struct ip6_hdr *, struct mif6 *, struct mbuf *);
 
 /*
@@ -143,7 +143,7 @@ u_int               mrt6debug = 0;    /* debug level        
 #define         DEBUG_PIM       0x40
 #endif
 
-void expire_upcalls(void *);
+void expire_upcalls6(void *);
 #define                EXPIRE_TIMEOUT  (hz / 4)        /* 4x / second */
 #define                UPCALL_EXPIRE   6               /* number of timeouts */
 
@@ -228,7 +228,7 @@ static int pim6;
 #define TV_LT(a, b) (((a).tv_usec < (b).tv_usec && \
              (a).tv_sec <= (b).tv_sec) || (a).tv_sec < (b).tv_sec)
 
-int get_sg_cnt(struct sioc_sg_req6 *);
+int get_sg6_cnt(struct sioc_sg_req6 *);
 int get_mif6_cnt(struct sioc_mif_req6 *);
 int ip6_mrouter_init(struct socket *, int, int);
 int add_m6if(struct mif6ctl *);
@@ -236,7 +236,7 @@ int del_m6if(mifi_t *);
 int add_m6fc(struct mf6cctl *);
 int del_m6fc(struct mf6cctl *);
 
-static struct timeout expire_upcalls_ch;
+static struct timeout expire_upcalls6_ch;
 
 /*
  * Handle MRT setsockopt commands to modify the multicast routing tables.
@@ -307,7 +307,7 @@ mrt6_ioctl(u_long cmd, caddr_t data)
 
        switch (cmd) {
        case SIOCGETSGCNT_IN6:
-               return (get_sg_cnt((struct sioc_sg_req6 *)data));
+               return (get_sg6_cnt((struct sioc_sg_req6 *)data));
        case SIOCGETMIFCNT_IN6:
                return (get_mif6_cnt((struct sioc_mif_req6 *)data));
        default:
@@ -319,7 +319,7 @@ mrt6_ioctl(u_long cmd, caddr_t data)
  * returns the packet, byte, rpf-failure count for the source group provided
  */
 int
-get_sg_cnt(struct sioc_sg_req6 *req)
+get_sg6_cnt(struct sioc_sg_req6 *req)
 {
        struct mf6c *rt;
        int s;
@@ -417,8 +417,8 @@ ip6_mrouter_init(struct socket *so, int 
 
        pim6 = 0;/* used for stubbing out/in pim stuff */
 
-       timeout_set(&expire_upcalls_ch, expire_upcalls, NULL);
-       timeout_add(&expire_upcalls_ch, EXPIRE_TIMEOUT);
+       timeout_set(&expire_upcalls6_ch, expire_upcalls6, NULL);
+       timeout_add(&expire_upcalls6_ch, EXPIRE_TIMEOUT);
 
 #ifdef MRT6DEBUG
        if (mrt6debug)
@@ -478,7 +478,7 @@ ip6_mrouter_done(void)
 
        pim6 = 0; /* used to stub out/in pim specific code */
 
-       timeout_del(&expire_upcalls_ch);
+       timeout_del(&expire_upcalls6_ch);
 
        /*
         * Free all multicast forwarding cache entries.
@@ -918,7 +918,7 @@ del_m6fc(struct mf6cctl *mfccp)
 }
 
 int
-socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in6 *src)
+socket6_send(struct socket *s, struct mbuf *mm, struct sockaddr_in6 *src)
 {
        if (s) {
                if (sbappendaddr(&s->so_rcv, sin6tosa(src), mm, NULL) != 0) {
@@ -1119,7 +1119,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct
                                break;
                        }
 
-                       if (socket_send(ip6_mrouter, mm, &sin6) < 0) {
+                       if (socket6_send(ip6_mrouter, mm, &sin6) < 0) {
                                log(LOG_WARNING, "ip6_mforward: ip6_mrouter "
                                    "socket queue full\n");
                                mrt6stat.mrt6s_upq_sockfull++;
@@ -1181,7 +1181,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct
  * Call from the Slow Timeout mechanism, every half second.
  */
 void
-expire_upcalls(void *unused)
+expire_upcalls6(void *unused)
 {
        struct rtdetq *rte;
        struct mf6c *mfc, **nptr;
@@ -1209,7 +1209,7 @@ expire_upcalls(void *unused)
                                char mcast[INET6_ADDRSTRLEN];
 
                                if (mrt6debug & DEBUG_EXPIRE)
-                                       log(LOG_DEBUG, "expire_upcalls: 
expiring (%s %s)\n",
+                                       log(LOG_DEBUG, "expire_upcalls6: 
expiring (%s %s)\n",
                                            inet_ntop(AF_INET6,
                                                &mfc->mf6c_origin.sin6_addr,
                                                orig, sizeof(orig)),
@@ -1238,8 +1238,8 @@ expire_upcalls(void *unused)
                }
        }
        splx(s);
-       timeout_set(&expire_upcalls_ch, expire_upcalls, NULL);
-       timeout_add(&expire_upcalls_ch, EXPIRE_TIMEOUT);
+       timeout_set(&expire_upcalls6_ch, expire_upcalls6, NULL);
+       timeout_add(&expire_upcalls6_ch, EXPIRE_TIMEOUT);
 }
 
 /*
@@ -1260,7 +1260,7 @@ ip6_mdq(struct mbuf *m, struct ifnet *if
                if ((mifp)->m6_flags & MIFF_REGISTER)           \
                    register_send((ip6), (mifp), (m));          \
                else                                            \
-                   phyint_send((ip6), (mifp), (m));            \
+                   phyint_send6((ip6), (mifp), (m));           \
 } while (0)
 
        /*
@@ -1336,7 +1336,7 @@ ip6_mdq(struct mbuf *m, struct ifnet *if
 
                                mrt6stat.mrt6s_upcalls++;
 
-                               if (socket_send(ip6_mrouter, mm, &sin6) < 0) {
+                               if (socket6_send(ip6_mrouter, mm, &sin6) < 0) {
 #ifdef MRT6DEBUG
                                        if (mrt6debug)
                                                log(LOG_WARNING, "mdq, 
ip6_mrouter socket queue full\n");
@@ -1396,7 +1396,7 @@ ip6_mdq(struct mbuf *m, struct ifnet *if
 }
 
 void
-phyint_send(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m)
+phyint_send6(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m)
 {
        struct mbuf *mb_copy;
        struct ifnet *ifp = mifp->m6_ifp;
@@ -1442,7 +1442,7 @@ phyint_send(struct ip6_hdr *ip6, struct 
 
 #ifdef MRT6DEBUG
                if (mrt6debug & DEBUG_XMIT)
-                       log(LOG_DEBUG, "phyint_send on mif %d err %d\n",
+                       log(LOG_DEBUG, "phyint_send6 on mif %d err %d\n",
                            mifp - mif6table, error);
 #endif
                splx(s);
@@ -1478,7 +1478,7 @@ phyint_send(struct ip6_hdr *ip6, struct 
                    sin6tosa(&ro.ro_dst), NULL);
 #ifdef MRT6DEBUG
                if (mrt6debug & DEBUG_XMIT)
-                       log(LOG_DEBUG, "phyint_send on mif %d err %d\n",
+                       log(LOG_DEBUG, "phyint_send6 on mif %d err %d\n",
                            mifp - mif6table, error);
 #endif
        } else {
@@ -1490,7 +1490,7 @@ phyint_send(struct ip6_hdr *ip6, struct 
 
                        if (mrt6debug & DEBUG_XMIT)
                                log(LOG_DEBUG,
-                                   "phyint_send: packet too big on %s o %s g 
%s"
+                                   "phyint_send6: packet too big on %s o %s g 
%s"
                                    " size %d(discarded)\n",
                                    ifp->if_xname,
                                    inet_ntop(AF_INET6, &ip6->ip6_src,
@@ -1562,7 +1562,7 @@ register_send(struct ip6_hdr *ip6, struc
        /* iif info is not given for reg. encap.n */
        mrt6stat.mrt6s_upcalls++;
 
-       if (socket_send(ip6_mrouter, mm, &sin6) < 0) {
+       if (socket6_send(ip6_mrouter, mm, &sin6) < 0) {
 #ifdef MRT6DEBUG
                if (mrt6debug)
                        log(LOG_WARNING,

Reply via email to