summaryrefslogtreecommitdiffstats
blob: 7ab8ee96f3f4111ff8ba4a7d69d9e0c4df732a70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/* $Id: upnperrors.c,v 1.8 2014/06/10 09:41:48 nanard Exp $ */
/* Project : miniupnp
 * Author : Thomas BERNARD
 * copyright (c) 2007 Thomas Bernard
 * All Right reserved.
 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
 * This software is subjet to the conditions detailed in the
 * provided LICENCE file. */
#include <string.h>
#include "upnperrors.h"
#include "upnpcommands.h"
#include "miniupnpc.h"

const char * strupnperror(int err)
{
	const char * s = NULL;
	switch(err) {
	case UPNPCOMMAND_SUCCESS:
		s = "Success";
		break;
	case UPNPCOMMAND_UNKNOWN_ERROR:
		s = "Miniupnpc Unknown Error";
		break;
	case UPNPCOMMAND_INVALID_ARGS:
		s = "Miniupnpc Invalid Arguments";
		break;
	case UPNPCOMMAND_INVALID_RESPONSE:
		s = "Miniupnpc Invalid response";
		break;
	case UPNPDISCOVER_SOCKET_ERROR:
		s = "Miniupnpc Socket error";
		break;
	case UPNPDISCOVER_MEMORY_ERROR:
		s = "Miniupnpc Memory allocation error";
		break;
	case 401:
		s = "Invalid Action";
		break;
	case 402:
		s = "Invalid Args";
		break;
	case 501:
		s = "Action Failed";
		break;
	case 606:
		s = "Action not authorized";
		break;
	case 701:
		s = "PinholeSpaceExhausted";
		break;
	case 702:
		s = "FirewallDisabled";
		break;
	case 703:
		s = "InboundPinholeNotAllowed";
		break;
	case 704:
		s = "NoSuchEntry";
		break;
	case 705:
		s = "ProtocolNotSupported";
		break;
	case 706:
		s = "InternalPortWildcardingNotAllowed";
		break;
	case 707:
		s = "ProtocolWildcardingNotAllowed";
		break;
	case 708:
		s = "WildcardNotPermittedInSrcIP";
		break;
	case 709:
		s = "NoPacketSent";
		break;
	case 713:
		s = "SpecifiedArrayIndexInvalid";
		break;
	case 714:
		s = "NoSuchEntryInArray";
		break;
	case 715:
		s = "WildCardNotPermittedInSrcIP";
		break;
	case 716:
		s = "WildCardNotPermittedInExtPort";
		break;
	case 718:
		s = "ConflictInMappingEntry";
		break;
	case 724:
		s = "SamePortValuesRequired";
		break;
	case 725:
		s = "OnlyPermanentLeasesSupported";
		break;
	case 726:
		s = "RemoteHostOnlySupportsWildcard";
		break;
	case 727:
		s = "ExternalPortOnlySupportsWildcard";
		break;
	default:
		s = "UnknownError";
		break;
	}
	return s;
}