2
0

upnperrors.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* $Id: upnperrors.c,v 1.3 2008/04/27 17:21:51 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. const char * strupnperror(int err)
  13. {
  14. const char * s = NULL;
  15. switch(err) {
  16. case UPNPCOMMAND_SUCCESS:
  17. s = "Success";
  18. break;
  19. case UPNPCOMMAND_UNKNOWN_ERROR:
  20. s = "Miniupnpc Unknown Error";
  21. break;
  22. case UPNPCOMMAND_INVALID_ARGS:
  23. s = "Miniupnpc Invalid Arguments";
  24. break;
  25. case 401:
  26. s = "Invalid Action";
  27. break;
  28. case 402:
  29. s = "Invalid Args";
  30. break;
  31. case 501:
  32. s = "Action Failed";
  33. break;
  34. case 713:
  35. s = "SpecifiedArrayIndexInvalid";
  36. break;
  37. case 714:
  38. s = "NoSuchEntryInArray";
  39. break;
  40. case 715:
  41. s = "WildCardNotPermittedInSrcIP";
  42. break;
  43. case 716:
  44. s = "WildCardNotPermittedInExtPort";
  45. break;
  46. case 718:
  47. s = "ConflictInMappingEntry";
  48. break;
  49. case 724:
  50. s = "SamePortValuesRequired";
  51. break;
  52. case 725:
  53. s = "OnlyPermanentLeasesSupported";
  54. break;
  55. case 726:
  56. s = "RemoteHostOnlySupportsWildcard";
  57. break;
  58. case 727:
  59. s = "ExternalPortOnlySupportsWildcard";
  60. break;
  61. default:
  62. s = NULL;
  63. }
  64. return s;
  65. }