main.c (216294) | main.c (216594) |
---|---|
1/* 2 * Copyright (c) 2001-2003 3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus). 4 * All rights reserved. 5 * 6 * Author: Harti Brandt <harti@freebsd.org> 7 * | 1/* 2 * Copyright (c) 2001-2003 3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus). 4 * All rights reserved. 5 * 6 * Author: Harti Brandt <harti@freebsd.org> 7 * |
8 * Copyright (c) 2010 The FreeBSD Foundation 9 * All rights reserved. 10 * 11 * Portions of this software were developed by Shteryana Sotirova Shopova 12 * under sponsorship from the FreeBSD Foundation. 13 * |
|
8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. --- 77 unchanged lines hidden (view full) --- 93struct snmpd_usmstat snmpd_usmstats; 94 95/* snmpEngine */ 96struct snmp_engine snmpd_engine; 97 98/* snmpSerialNo */ 99int32_t snmp_serial_no; 100 | 14 * Redistribution and use in source and binary forms, with or without 15 * modification, are permitted provided that the following conditions 16 * are met: 17 * 1. Redistributions of source code must retain the above copyright 18 * notice, this list of conditions and the following disclaimer. 19 * 2. Redistributions in binary form must reproduce the above copyright 20 * notice, this list of conditions and the following disclaimer in the 21 * documentation and/or other materials provided with the distribution. --- 77 unchanged lines hidden (view full) --- 99struct snmpd_usmstat snmpd_usmstats; 100 101/* snmpEngine */ 102struct snmp_engine snmpd_engine; 103 104/* snmpSerialNo */ 105int32_t snmp_serial_no; 106 |
107struct snmpd_target_stats snmpd_target_stats; 108 |
|
101/* search path for config files */ 102const char *syspath = PATH_SYSCONFIG; 103 104/* list of all loaded modules */ 105struct lmodules lmodules = TAILQ_HEAD_INITIALIZER(lmodules); 106 107/* list of loaded modules during start-up in the order they were loaded */ 108static struct lmodules modules_start = TAILQ_HEAD_INITIALIZER(modules_start); --- 247 unchanged lines hidden (view full) --- 356 357 return (SNMP_CODE_OK); 358} 359 360/* 361 * Check whether access to each of var bindings in the PDU is allowed based 362 * on the user credentials against the configured User groups & VACM views. 363 */ | 109/* search path for config files */ 110const char *syspath = PATH_SYSCONFIG; 111 112/* list of all loaded modules */ 113struct lmodules lmodules = TAILQ_HEAD_INITIALIZER(lmodules); 114 115/* list of loaded modules during start-up in the order they were loaded */ 116static struct lmodules modules_start = TAILQ_HEAD_INITIALIZER(modules_start); --- 247 unchanged lines hidden (view full) --- 364 365 return (SNMP_CODE_OK); 366} 367 368/* 369 * Check whether access to each of var bindings in the PDU is allowed based 370 * on the user credentials against the configured User groups & VACM views. 371 */ |
364static enum snmp_code | 372enum snmp_code |
365snmp_pdu_auth_access(struct snmp_pdu *pdu, int32_t *ip) 366{ 367 const char *uname; 368 int32_t suboid, smodel; 369 uint32_t i; 370 struct vacm_user *vuser; 371 struct vacm_access *acl; 372 struct vacm_context *vacmctx; --- 1460 unchanged lines hidden (view full) --- 1833 exit(1); 1834 } 1835 if (or_register(&oid_begemotSnmpd, "The MIB module for the Begemot SNMPd.", 1836 NULL) == 0) { 1837 syslog(LOG_ERR, "cannot register begemotSnmpd MIB"); 1838 exit(1); 1839 } 1840 | 373snmp_pdu_auth_access(struct snmp_pdu *pdu, int32_t *ip) 374{ 375 const char *uname; 376 int32_t suboid, smodel; 377 uint32_t i; 378 struct vacm_user *vuser; 379 struct vacm_access *acl; 380 struct vacm_context *vacmctx; --- 1460 unchanged lines hidden (view full) --- 1841 exit(1); 1842 } 1843 if (or_register(&oid_begemotSnmpd, "The MIB module for the Begemot SNMPd.", 1844 NULL) == 0) { 1845 syslog(LOG_ERR, "cannot register begemotSnmpd MIB"); 1846 exit(1); 1847 } 1848 |
1841 snmp_send_trap(&oid_coldStart, (struct snmp_value *)NULL); 1842 | |
1843 while ((m = TAILQ_FIRST(&modules_start)) != NULL) { 1844 m->flags &= ~LM_ONSTARTLIST; 1845 TAILQ_REMOVE(&modules_start, m, start); 1846 lm_start(m); 1847 } 1848 | 1849 while ((m = TAILQ_FIRST(&modules_start)) != NULL) { 1850 m->flags &= ~LM_ONSTARTLIST; 1851 TAILQ_REMOVE(&modules_start, m, start); 1852 lm_start(m); 1853 } 1854 |
1855 snmp_send_trap(&oid_coldStart, (struct snmp_value *)NULL); 1856 |
|
1849 for (;;) { 1850#ifndef USE_LIBBEGEMOT 1851 evEvent event; 1852#endif 1853 struct lmodule *mod; 1854 1855 TAILQ_FOREACH(mod, &lmodules, link) 1856 if (mod->config->idle != NULL) --- 1389 unchanged lines hidden --- | 1857 for (;;) { 1858#ifndef USE_LIBBEGEMOT 1859 evEvent event; 1860#endif 1861 struct lmodule *mod; 1862 1863 TAILQ_FOREACH(mod, &lmodules, link) 1864 if (mod->config->idle != NULL) --- 1389 unchanged lines hidden --- |