Deleted Added
full compact
hostres_printer_tbl.c (154133) hostres_printer_tbl.c (160341)
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: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c 154133 2006-01-09 12:33:45Z harti $
29 * $FreeBSD: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c 160341 2006-07-14 09:07:56Z harti $
30 */
31
32/*
33 * Host Resources MIB implementation for SNMPd: instrumentation for
34 * hrPrinterTable
35 */
36
37#include <sys/param.h>

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

68 * This structure is used to hold a SNMP table entry
69 * for HOST-RESOURCES-MIB's hrPrinterTable.
70 */
71struct printer_entry {
72 int32_t index;
73 int32_t status; /* values from PrinterStatus enum above */
74 u_char detectedErrorState[2];
75 TAILQ_ENTRY(printer_entry) link;
30 */
31
32/*
33 * Host Resources MIB implementation for SNMPd: instrumentation for
34 * hrPrinterTable
35 */
36
37#include <sys/param.h>

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

68 * This structure is used to hold a SNMP table entry
69 * for HOST-RESOURCES-MIB's hrPrinterTable.
70 */
71struct printer_entry {
72 int32_t index;
73 int32_t status; /* values from PrinterStatus enum above */
74 u_char detectedErrorState[2];
75 TAILQ_ENTRY(printer_entry) link;
76#define HR_PRINTER_FOUND 0x001
76#define HR_PRINTER_FOUND 0x001
77 uint32_t flags;
78
79};
80TAILQ_HEAD(printer_tbl, printer_entry);
81
82/* the hrPrinterTable */
83static struct printer_tbl printer_tbl = TAILQ_HEAD_INITIALIZER(printer_tbl);
84

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

235 }
236 }
237
238 if ((dev_entry = device_find_by_name(dev_only)) == NULL) {
239 HRDBG("%s not in hrDeviceTable", pp->lp);
240 return;
241 }
242 HRDBG("%s found in hrDeviceTable", pp->lp);
77 uint32_t flags;
78
79};
80TAILQ_HEAD(printer_tbl, printer_entry);
81
82/* the hrPrinterTable */
83static struct printer_tbl printer_tbl = TAILQ_HEAD_INITIALIZER(printer_tbl);
84

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

235 }
236 }
237
238 if ((dev_entry = device_find_by_name(dev_only)) == NULL) {
239 HRDBG("%s not in hrDeviceTable", pp->lp);
240 return;
241 }
242 HRDBG("%s found in hrDeviceTable", pp->lp);
243 dev_entry->type = &OIDX_hrDevicePrinter_c;
243
244
244 dev_entry->type = OIDX_hrDevicePrinter_c;
245 dev_entry->flags |= HR_DEVICE_IMMUTABLE;
246
247 /* Then check hrPrinterTable for this device */
248 if ((printer_entry = printer_find_by_index(dev_entry->index)) == NULL &&
249 (printer_entry = printer_entry_create(dev_entry)) == NULL)
250 return;
251
252 printer_entry->flags |= HR_PRINTER_FOUND;

--- 146 unchanged lines hidden ---
245 dev_entry->flags |= HR_DEVICE_IMMUTABLE;
246
247 /* Then check hrPrinterTable for this device */
248 if ((printer_entry = printer_find_by_index(dev_entry->index)) == NULL &&
249 (printer_entry = printer_entry_create(dev_entry)) == NULL)
250 return;
251
252 printer_entry->flags |= HR_PRINTER_FOUND;

--- 146 unchanged lines hidden ---