if_mib.c (62573) | if_mib.c (83130) |
---|---|
1/* 2 * Copyright 1996 Massachusetts Institute of Technology 3 * 4 * Permission to use, copy, modify, and distribute this software and 5 * its documentation for any purpose and without fee is hereby 6 * granted, provided that both the above copyright notice and this 7 * permission notice appear in all copies, that both the above 8 * copyright notice and this permission notice appear in all --- 12 unchanged lines hidden (view full) --- 21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/* 2 * Copyright 1996 Massachusetts Institute of Technology 3 * 4 * Permission to use, copy, modify, and distribute this software and 5 * its documentation for any purpose and without fee is hereby 6 * granted, provided that both the above copyright notice and this 7 * permission notice appear in all copies, that both the above 8 * copyright notice and this permission notice appear in all --- 12 unchanged lines hidden (view full) --- 21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/sys/net/if_mib.c 62573 2000-07-04 11:25:35Z phk $ | 29 * $FreeBSD: head/sys/net/if_mib.c 83130 2001-09-06 02:40:43Z jlemon $ |
30 */ 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/socket.h> 36#include <sys/sysctl.h> 37 --- 40 unchanged lines hidden (view full) --- 78 struct ifmibdata ifmd; 79 80 if (namelen != 2) 81 return EINVAL; 82 83 if (name[0] <= 0 || name[0] > if_index) 84 return ENOENT; 85 | 30 */ 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/socket.h> 36#include <sys/sysctl.h> 37 --- 40 unchanged lines hidden (view full) --- 78 struct ifmibdata ifmd; 79 80 if (namelen != 2) 81 return EINVAL; 82 83 if (name[0] <= 0 || name[0] > if_index) 84 return ENOENT; 85 |
86 ifp = ifnet_addrs[name[0] - 1]->ifa_ifp; | 86 ifp = ifaddr_byindex(name[0])->ifa_ifp; |
87 88 switch(name[1]) { 89 default: 90 return ENOENT; 91 92 case IFDATA_GENERAL: 93 ifnlen = snprintf(workbuf, sizeof(workbuf), 94 "%s%d", ifp->if_name, ifp->if_unit); --- 55 unchanged lines hidden --- | 87 88 switch(name[1]) { 89 default: 90 return ENOENT; 91 92 case IFDATA_GENERAL: 93 ifnlen = snprintf(workbuf, sizeof(workbuf), 94 "%s%d", ifp->if_name, ifp->if_unit); --- 55 unchanged lines hidden --- |