snmp_mib2.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /**
  2. * @file
  3. * SNMP MIB2 API
  4. */
  5. /*
  6. * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
  7. * All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without modification,
  10. * are permitted provided that the following conditions are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright notice,
  15. * this list of conditions and the following disclaimer in the documentation
  16. * and/or other materials provided with the distribution.
  17. * 3. The name of the author may not be used to endorse or promote products
  18. * derived from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  21. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  22. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
  23. * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  24. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
  25. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  27. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  28. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  29. * OF SUCH DAMAGE.
  30. *
  31. * This file is part of the lwIP TCP/IP stack.
  32. *
  33. * Author: Dirk Ziegelmeier <dziegel@gmx.de>
  34. *
  35. */
  36. #ifndef LWIP_HDR_APPS_SNMP_MIB2_H
  37. #define LWIP_HDR_APPS_SNMP_MIB2_H
  38. #include "lwip/apps/snmp_opts.h"
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
  43. #if SNMP_LWIP_MIB2
  44. #include "lwip/apps/snmp_core.h"
  45. extern const struct snmp_mib mib2;
  46. #if SNMP_USE_NETCONN
  47. #include "lwip/apps/snmp_threadsync.h"
  48. void snmp_mib2_lwip_synchronizer(snmp_threadsync_called_fn fn, void* arg);
  49. extern struct snmp_threadsync_instance snmp_mib2_lwip_locks;
  50. #endif
  51. #ifndef SNMP_SYSSERVICES
  52. #define SNMP_SYSSERVICES ((1 << 6) | (1 << 3) | ((IP_FORWARD) << 2))
  53. #endif
  54. void snmp_mib2_set_sysdescr(const u8_t* str, const u16_t* len); /* read-only be definition */
  55. void snmp_mib2_set_syscontact(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize);
  56. void snmp_mib2_set_syscontact_readonly(const u8_t *ocstr, const u16_t *ocstrlen);
  57. void snmp_mib2_set_sysname(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize);
  58. void snmp_mib2_set_sysname_readonly(const u8_t *ocstr, const u16_t *ocstrlen);
  59. void snmp_mib2_set_syslocation(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize);
  60. void snmp_mib2_set_syslocation_readonly(const u8_t *ocstr, const u16_t *ocstrlen);
  61. #endif /* SNMP_LWIP_MIB2 */
  62. #endif /* LWIP_SNMP */
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66. #endif /* LWIP_HDR_APPS_SNMP_MIB2_H */