IPv6Utility.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*_############################################################################
  2. _##
  3. _## IPv6Utility.h
  4. _##
  5. _## SNMP++v3.2.23
  6. _## -----------------------------------------------
  7. _## Copyright (c) 2001-2007 Jochen Katz, Frank Fock
  8. _##
  9. _## This software is based on SNMP++2.6 from Hewlett Packard:
  10. _##
  11. _## Copyright (c) 1996
  12. _## Hewlett-Packard Company
  13. _##
  14. _## ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
  15. _## Permission to use, copy, modify, distribute and/or sell this software
  16. _## and/or its documentation is hereby granted without fee. User agrees
  17. _## to display the above copyright notice and this license notice in all
  18. _## copies of the software and any documentation of the software. User
  19. _## agrees to assume all liability for the use of the software;
  20. _## Hewlett-Packard and Jochen Katz make no representations about the
  21. _## suitability of this software for any purpose. It is provided
  22. _## "AS-IS" without warranty of any kind, either express or implied. User
  23. _## hereby grants a royalty-free license to any and all derivatives based
  24. _## upon this software code base.
  25. _##
  26. _## Stuttgart, Germany, Sun Nov 11 15:10:59 CET 2007
  27. _##
  28. _##########################################################################*/
  29. /*
  30. * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
  31. * Copyright (C) 1996-2001 Internet Software Consortium.
  32. *
  33. * Permission to use, copy, modify, and distribute this software for any
  34. * purpose with or without fee is hereby granted, provided that the above
  35. * copyright notice and this permission notice appear in all copies.
  36. *
  37. * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  38. * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  39. * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  40. * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  41. * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  42. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  43. * PERFORMANCE OF THIS SOFTWARE.
  44. */
  45. /*===================================================================
  46. SNMP++ IPV6Utility.h
  47. DESCRIPTION:
  48. This module contains the Utility functions for IPV6 support functions
  49. required for WIN32 environment
  50. Adapted and integrated into snmp++ by Ragavan Tetchinamourty
  51. =====================================================================*/
  52. // $Id: $
  53. #ifndef _IPV6UTILITY_H
  54. #define _IPV6UTILITY_H
  55. #include "snmp_pp/config_snmp_pp.h"
  56. #if defined(_MSC_VER) && defined(SNMP_PP_IPv6)
  57. #define NS_INT16SZ 2
  58. #define NS_IN6ADDRSZ 16
  59. #define EAFNOSUPPORT WSAEAFNOSUPPORT
  60. #define ENOSPC 28
  61. /*
  62. * WARNING: Don't even consider trying to compile this on a system where
  63. * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
  64. */
  65. static const char *inet_ntop4(const unsigned char *src, char *dst,
  66. size_t size);
  67. #ifdef AF_INET6
  68. static const char *inet_ntop6(const unsigned char *src, char *dst,
  69. size_t size);
  70. #endif
  71. const char *
  72. inet_ntop(int af, const void *src, char *dst, size_t size);
  73. static int
  74. snprintf (char *str, int n, char *fmt, ...);
  75. //extern const char *inet_pton(int, const char*, void*);
  76. #define NS_INT16SZ 2
  77. #define NS_INADDRSZ 4
  78. #define NS_IN6ADDRSZ 16
  79. /*
  80. * WARNING: Don't even consider trying to compile this on a system where
  81. * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
  82. */
  83. static int inet_pton4(const char *src, unsigned char *dst);
  84. #ifdef AF_INET6
  85. static int inet_pton6(const char *src, unsigned char *dst);
  86. #endif
  87. int inet_pton(int af, const char *src, void *dst);
  88. #endif // defined(_MSC_VER) && defined(SNMP_PP_IPv6)
  89. #endif // IPV6UTILITY_H