Deleted Added
full compact
hostres_fs_tbl.c (302408) hostres_fs_tbl.c (310899)
1/*-
2 * Copyright (c) 2005-2006 The FreeBSD Project
3 * All rights reserved.
4 *
5 * Author: Victor Cruceru <soc-victor@freebsd.org>
6 *
7 * Redistribution of this software and documentation and use in source and
8 * binary forms, with or without modification, are permitted provided that

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2005-2006 The FreeBSD Project
3 * All rights reserved.
4 *
5 * Author: Victor Cruceru <soc-victor@freebsd.org>
6 *
7 * Redistribution of this software and documentation and use in source and
8 * binary forms, with or without modification, are permitted provided that

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c 192243 2009-05-17 05:54:25Z kmacy $
29 * $FreeBSD: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c 310899 2016-12-31 10:28:59Z ngie $
30 */
31
32/*
33 * Host Resources MIB for SNMPd. Implementation for hrFSTable
34 */
35
36#include <sys/types.h>
37#include <sys/param.h>

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

126static const struct asn_oid OIDX_hrFSUnknown_c = OIDX_hrFSUnknown;
127
128/* file system type map */
129static const struct {
130 const char *str; /* the type string */
131 const struct asn_oid *oid; /* the OID to return */
132} fs_type_map[] = {
133 { "ufs", &OIDX_hrFSBerkeleyFFS_c },
30 */
31
32/*
33 * Host Resources MIB for SNMPd. Implementation for hrFSTable
34 */
35
36#include <sys/types.h>
37#include <sys/param.h>

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

126static const struct asn_oid OIDX_hrFSUnknown_c = OIDX_hrFSUnknown;
127
128/* file system type map */
129static const struct {
130 const char *str; /* the type string */
131 const struct asn_oid *oid; /* the OID to return */
132} fs_type_map[] = {
133 { "ufs", &OIDX_hrFSBerkeleyFFS_c },
134 { "zfs", &OIDX_hrFSOther_c },
134 { "zfs", &OIDX_hrFSOther_c },
135 { "cd9660", &OIDX_hrFSiso9660_c },
136 { "nfs", &OIDX_hrFSNFS_c },
137 { "ext2fs", &OIDX_hrFSLinuxExt2_c },
138 { "procfs", &OIDX_hrFSOther_c },
139 { "devfs", &OIDX_hrFSOther_c },
140 { "msdosfs", &OIDX_hrFSFAT32_c },
141 { "ntfs", &OIDX_hrFSNTFS_c },
142 { "nwfs", &OIDX_hrFSNetware_c },

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

162 break;
163
164 if (map == NULL) {
165 size_t mount_point_len;
166
167 /* new object - get a new index */
168 if (next_fs_index > INT_MAX) {
169 /* Unrecoverable error - die clean and quicly*/
135 { "cd9660", &OIDX_hrFSiso9660_c },
136 { "nfs", &OIDX_hrFSNFS_c },
137 { "ext2fs", &OIDX_hrFSLinuxExt2_c },
138 { "procfs", &OIDX_hrFSOther_c },
139 { "devfs", &OIDX_hrFSOther_c },
140 { "msdosfs", &OIDX_hrFSFAT32_c },
141 { "ntfs", &OIDX_hrFSNTFS_c },
142 { "nwfs", &OIDX_hrFSNetware_c },

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

162 break;
163
164 if (map == NULL) {
165 size_t mount_point_len;
166
167 /* new object - get a new index */
168 if (next_fs_index > INT_MAX) {
169 /* Unrecoverable error - die clean and quicly*/
170 syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__);
170 syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__);
171 errx(EX_SOFTWARE, "hrFSTable index wrap");
172 }
173
174 if ((map = malloc(sizeof(*map))) == NULL) {
175 syslog(LOG_ERR, "%s: %m", __func__);
176 return (NULL);
177 }
178

--- 295 unchanged lines hidden ---
171 errx(EX_SOFTWARE, "hrFSTable index wrap");
172 }
173
174 if ((map = malloc(sizeof(*map))) == NULL) {
175 syslog(LOG_ERR, "%s: %m", __func__);
176 return (NULL);
177 }
178

--- 295 unchanged lines hidden ---