Deleted Added
full compact
if_mib.c (154023) if_mib.c (181803)
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 154023 2006-01-04 12:57:09Z harti $
29 * $FreeBSD: head/sys/net/if_mib.c 181803 2008-08-17 23:27:27Z bz $
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>
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#include <sys/vimage.h>
37
38#include <net/if.h>
39#include <net/if_mib.h>
40
41/*
42 * A sysctl(3) MIB for generic interface information. This information
43 * is exported in the net.link.generic branch, which has the following
44 * structure:

--- 31 unchanged lines hidden (view full) ---

76 struct ifnet *ifp;
77 struct ifmibdata ifmd;
78 size_t dlen;
79 char *dbuf;
80
81 if (namelen != 2)
82 return EINVAL;
83
38
39#include <net/if.h>
40#include <net/if_mib.h>
41
42/*
43 * A sysctl(3) MIB for generic interface information. This information
44 * is exported in the net.link.generic branch, which has the following
45 * structure:

--- 31 unchanged lines hidden (view full) ---

77 struct ifnet *ifp;
78 struct ifmibdata ifmd;
79 size_t dlen;
80 char *dbuf;
81
82 if (namelen != 2)
83 return EINVAL;
84
84 if (name[0] <= 0 || name[0] > if_index ||
85 if (name[0] <= 0 || name[0] > V_if_index ||
85 ifnet_byindex(name[0]) == NULL)
86 return ENOENT;
87
88 ifp = ifnet_byindex(name[0]);
89
90 switch(name[1]) {
91 default:
92 return ENOENT;

--- 69 unchanged lines hidden ---
86 ifnet_byindex(name[0]) == NULL)
87 return ENOENT;
88
89 ifp = ifnet_byindex(name[0]);
90
91 switch(name[1]) {
92 default:
93 return ENOENT;

--- 69 unchanged lines hidden ---