ip6_mroute.c (171259) | ip6_mroute.c (171260) |
---|---|
1/* $FreeBSD: head/sys/netinet6/ip6_mroute.c 171259 2007-07-05 16:23:49Z delphij $ */ | 1/* $FreeBSD: head/sys/netinet6/ip6_mroute.c 171260 2007-07-05 16:29:40Z delphij $ */ |
2/* $KAME: ip6_mroute.c,v 1.58 2001/12/18 02:36:31 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 143 unchanged lines hidden (view full) --- 153SYSCTL_DECL(_net_inet6_ip6); 154SYSCTL_NODE(_net_inet6, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM"); 155 156static struct mrt6stat mrt6stat; 157SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, mrt6stat, CTLFLAG_RW, 158 &mrt6stat, mrt6stat, 159 "Multicast Routing Statistics (struct mrt6stat, netinet6/ip6_mroute.h)"); 160 | 2/* $KAME: ip6_mroute.c,v 1.58 2001/12/18 02:36:31 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 143 unchanged lines hidden (view full) --- 153SYSCTL_DECL(_net_inet6_ip6); 154SYSCTL_NODE(_net_inet6, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM"); 155 156static struct mrt6stat mrt6stat; 157SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, mrt6stat, CTLFLAG_RW, 158 &mrt6stat, mrt6stat, 159 "Multicast Routing Statistics (struct mrt6stat, netinet6/ip6_mroute.h)"); 160 |
161#define NO_RTE_FOUND 0x1 | 161#define NO_RTE_FOUND 0x1 |
162#define RTE_FOUND 0x2 163 164static struct mf6c *mf6ctable[MF6CTBLSIZ]; 165SYSCTL_OPAQUE(_net_inet6_ip6, OID_AUTO, mf6ctable, CTLFLAG_RD, 166 &mf6ctable, sizeof(mf6ctable), "S,*mf6ctable[MF6CTBLSIZ]", 167 "Multicast Forwarding Table (struct *mf6ctable[MF6CTBLSIZ], " 168 "netinet6/ip6_mroute.h)"); 169 --- 25 unchanged lines hidden (view full) --- 195#endif 196 197/* 198 * 'Interfaces' associated with decapsulator (so we can tell 199 * packets that went through it from ones that get reflected 200 * by a broken gateway). Different from IPv4 register_if, 201 * these interfaces are linked into the system ifnet list, 202 * because per-interface IPv6 statistics are maintained in | 162#define RTE_FOUND 0x2 163 164static struct mf6c *mf6ctable[MF6CTBLSIZ]; 165SYSCTL_OPAQUE(_net_inet6_ip6, OID_AUTO, mf6ctable, CTLFLAG_RD, 166 &mf6ctable, sizeof(mf6ctable), "S,*mf6ctable[MF6CTBLSIZ]", 167 "Multicast Forwarding Table (struct *mf6ctable[MF6CTBLSIZ], " 168 "netinet6/ip6_mroute.h)"); 169 --- 25 unchanged lines hidden (view full) --- 195#endif 196 197/* 198 * 'Interfaces' associated with decapsulator (so we can tell 199 * packets that went through it from ones that get reflected 200 * by a broken gateway). Different from IPv4 register_if, 201 * these interfaces are linked into the system ifnet list, 202 * because per-interface IPv6 statistics are maintained in |
203 * ifp->if_afdata. But it does not have any routes point | 203 * ifp->if_afdata. But it does not have any routes point |
204 * to them. I.e., packets can't be sent this way. They | 204 * to them. I.e., packets can't be sent this way. They |
205 * only exist as a placeholder for multicast source | 205 * only exist as a placeholder for multicast source |
206 * verification. 207 */ 208static struct ifnet *multicast_register_if6; 209 210#define ENCAP_HOPS 64 211 212/* 213 * Private variables. --- 402 unchanged lines hidden (view full) --- 616 if (reg_mif_num == (mifi_t)-1) { 617 ifp = if_alloc(IFT_OTHER); 618 619 if_initname(ifp, "register_mif", 0); 620 ifp->if_flags |= IFF_LOOPBACK; 621 if_attach(ifp); 622 multicast_register_if6 = ifp; 623 reg_mif_num = mifcp->mif6c_mifi; | 206 * verification. 207 */ 208static struct ifnet *multicast_register_if6; 209 210#define ENCAP_HOPS 64 211 212/* 213 * Private variables. --- 402 unchanged lines hidden (view full) --- 616 if (reg_mif_num == (mifi_t)-1) { 617 ifp = if_alloc(IFT_OTHER); 618 619 if_initname(ifp, "register_mif", 0); 620 ifp->if_flags |= IFF_LOOPBACK; 621 if_attach(ifp); 622 multicast_register_if6 = ifp; 623 reg_mif_num = mifcp->mif6c_mifi; |
624 /* 625 * it is impossible to guess the ifindex of the | 624 /* 625 * it is impossible to guess the ifindex of the |
626 * register interface. So mif6c_pifi is automatically 627 * calculated. 628 */ 629 mifcp->mif6c_pifi = ifp->if_index; 630 } else { 631 ifp = multicast_register_if6; 632 } 633 --- 278 unchanged lines hidden (view full) --- 912#endif /* UPCALL_TIMING */ 913 914/* 915 * Delete an mfc entry 916 */ 917static int 918del_m6fc(struct mf6cctl *mfccp) 919{ | 626 * register interface. So mif6c_pifi is automatically 627 * calculated. 628 */ 629 mifcp->mif6c_pifi = ifp->if_index; 630 } else { 631 ifp = multicast_register_if6; 632 } 633 --- 278 unchanged lines hidden (view full) --- 912#endif /* UPCALL_TIMING */ 913 914/* 915 * Delete an mfc entry 916 */ 917static int 918del_m6fc(struct mf6cctl *mfccp) 919{ |
920 struct sockaddr_in6 origin; 921 struct sockaddr_in6 mcastgrp; 922 struct mf6c *rt; 923 struct mf6c **nptr; 924 u_long hash; | 920 struct sockaddr_in6 origin; 921 struct sockaddr_in6 mcastgrp; 922 struct mf6c *rt; 923 struct mf6c **nptr; 924 u_long hash; |
925 int s; 926 927 origin = mfccp->mf6cc_origin; 928 mcastgrp = mfccp->mf6cc_mcastgrp; 929 hash = MF6CHASH(origin.sin6_addr, mcastgrp.sin6_addr); 930 931#ifdef MRT6DEBUG 932 if (mrt6debug & DEBUG_MFC) { --- 986 unchanged lines hidden --- | 925 int s; 926 927 origin = mfccp->mf6cc_origin; 928 mcastgrp = mfccp->mf6cc_mcastgrp; 929 hash = MF6CHASH(origin.sin6_addr, mcastgrp.sin6_addr); 930 931#ifdef MRT6DEBUG 932 if (mrt6debug & DEBUG_MFC) { --- 986 unchanged lines hidden --- |