upnperrors.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 UPNPCOMMAND_INVALID_RESPONSE:
  27. s = "Miniupnpc Invalid response";
  28. break;
  29. case UPNPDISCOVER_SOCKET_ERROR:
  30. s = "Miniupnpc Socket error";
  31. break;
  32. case UPNPDISCOVER_MEMORY_ERROR:
  33. s = "Miniupnpc Memory allocation error";
  34. break;
  35. case 401:
  36. s = "Invalid Action";
  37. break;
  38. case 402:
  39. s = "Invalid Args";
  40. break;
  41. case 501:
  42. s = "Action Failed";
  43. break;
  44. case 606:
  45. s = "Action not authorized";
  46. break;
  47. case 701:
  48. s = "PinholeSpaceExhausted";
  49. break;
  50. case 702:
  51. s = "FirewallDisabled";
  52. break;
  53. case 703:
  54. s = "InboundPinholeNotAllowed";
  55. break;
  56. case 704:
  57. s = "NoSuchEntry";
  58. break;
  59. case 705:
  60. s = "ProtocolNotSupported";
  61. break;
  62. case 706:
  63. s = "InternalPortWildcardingNotAllowed";
  64. break;
  65. case 707:
  66. s = "ProtocolWildcardingNotAllowed";
  67. break;
  68. case 708:
  69. s = "WildcardNotPermittedInSrcIP";
  70. break;
  71. case 709:
  72. s = "NoPacketSent";
  73. break;
  74. case 713:
  75. s = "SpecifiedArrayIndexInvalid";
  76. break;
  77. case 714:
  78. s = "NoSuchEntryInArray";
  79. break;
  80. case 715:
  81. s = "WildCardNotPermittedInSrcIP";
  82. break;
  83. case 716:
  84. s = "WildCardNotPermittedInExtPort";
  85. break;
  86. case 718:
  87. s = "ConflictInMappingEntry";
  88. break;
  89. case 724:
  90. s = "SamePortValuesRequired";
  91. break;
  92. case 725:
  93. s = "OnlyPermanentLeasesSupported";
  94. break;
  95. case 726:
  96. s = "RemoteHostOnlySupportsWildcard";
  97. break;
  98. case 727:
  99. s = "ExternalPortOnlySupportsWildcard";
  100. break;
  101. default:
  102. s = "UnknownError";
  103. break;
  104. }
  105. return s;
  106. }