module for bsnmp to interface to sysctl
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

67 lines
2.1 KiB

  1. /*
  2. * Copyright (c) 2006, Stefan Walter
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. *
  9. * * Redistributions of source code must retain the above
  10. * copyright notice, this list of conditions and the
  11. * following disclaimer.
  12. * * Redistributions in binary form must reproduce the
  13. * above copyright notice, this list of conditions and
  14. * the following disclaimer in the documentation and/or
  15. * other materials provided with the distribution.
  16. * * The names of contributors to this software may not be
  17. * used to endorse or promote products derived from this
  18. * software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  23. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  24. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  25. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  26. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  27. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  28. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  29. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  30. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  31. * DAMAGE.
  32. *
  33. *
  34. * CONTRIBUTORS
  35. * Stef Walter <stef@memberwebs.com>
  36. */
  37. #ifndef __USUALS_H__
  38. #define __USUALS_H__
  39. #include <sys/types.h>
  40. #include <errno.h>
  41. #include <stdint.h>
  42. #include <stdio.h>
  43. #include <stdlib.h>
  44. #include <string.h>
  45. #ifndef max
  46. #define max(a,b) (((a) > (b)) ? (a) : (b))
  47. #endif
  48. #ifndef min
  49. #define min(a,b) (((a) < (b)) ? (a) : (b))
  50. #endif
  51. #define countof(x) (sizeof(x) / sizeof(x[0]))
  52. #ifdef _DEBUG
  53. #include "assert.h"
  54. #define ASSERT(x) assert(x)
  55. #else
  56. #define ASSERT(x)
  57. #endif
  58. #endif /* __USUALS_H__ */