/thirdparty/libportfwd/third-party/miniupnpc-1.6/upnperrors.c

http://github.com/tomahawk-player/tomahawk · C · 103 lines · 94 code · 1 blank · 8 comment · 1 complexity · 5cab4201cffddd4a343eb5c6cde39d11 MD5 · raw file

  1. /* $Id: upnperrors.c,v 1.5 2011/04/10 11:19:36 nanard Exp $ */
  2. /* Project : miniupnp
  3. * Author : Thomas BERNARD
  4. * copyright (c) 2007 Thomas Bernard
  5. * All Right reserved.
  6. * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
  7. * This software is subjet to the conditions detailed in the
  8. * provided LICENCE file. */
  9. #include <string.h>
  10. #include "upnperrors.h"
  11. #include "upnpcommands.h"
  12. #include "miniupnpc.h"
  13. const char * strupnperror(int err)
  14. {
  15. const char * s = NULL;
  16. switch(err) {
  17. case UPNPCOMMAND_SUCCESS:
  18. s = "Success";
  19. break;
  20. case UPNPCOMMAND_UNKNOWN_ERROR:
  21. s = "Miniupnpc Unknown Error";
  22. break;
  23. case UPNPCOMMAND_INVALID_ARGS:
  24. s = "Miniupnpc Invalid Arguments";
  25. break;
  26. case UPNPDISCOVER_SOCKET_ERROR:
  27. s = "Miniupnpc Socket error";
  28. break;
  29. case UPNPDISCOVER_MEMORY_ERROR:
  30. s = "Miniupnpc Memory allocation error";
  31. break;
  32. case 401:
  33. s = "Invalid Action";
  34. break;
  35. case 402:
  36. s = "Invalid Args";
  37. break;
  38. case 501:
  39. s = "Action Failed";
  40. break;
  41. case 606:
  42. s = "Action not authorized";
  43. break;
  44. case 701:
  45. s = "PinholeSpaceExhausted";
  46. break;
  47. case 702:
  48. s = "FirewallDisabled";
  49. break;
  50. case 703:
  51. s = "InboundPinholeNotAllowed";
  52. break;
  53. case 704:
  54. s = "NoSuchEntry";
  55. break;
  56. case 705:
  57. s = "ProtocolNotSupported";
  58. break;
  59. case 706:
  60. s = "InternalPortWildcardingNotAllowed";
  61. break;
  62. case 707:
  63. s = "ProtocolWildcardingNotAllowed";
  64. break;
  65. case 708:
  66. s = "WildcardNotPermittedInSrcIP";
  67. break;
  68. case 709:
  69. s = "NoPacketSent";
  70. break;
  71. case 713:
  72. s = "SpecifiedArrayIndexInvalid";
  73. break;
  74. case 714:
  75. s = "NoSuchEntryInArray";
  76. break;
  77. case 715:
  78. s = "WildCardNotPermittedInSrcIP";
  79. break;
  80. case 716:
  81. s = "WildCardNotPermittedInExtPort";
  82. break;
  83. case 718:
  84. s = "ConflictInMappingEntry";
  85. break;
  86. case 724:
  87. s = "SamePortValuesRequired";
  88. break;
  89. case 725:
  90. s = "OnlyPermanentLeasesSupported";
  91. break;
  92. case 726:
  93. s = "RemoteHostOnlySupportsWildcard";
  94. break;
  95. case 727:
  96. s = "ExternalPortOnlySupportsWildcard";
  97. break;
  98. default:
  99. s = NULL;
  100. }
  101. return s;
  102. }