1: /* $Id: upnperrors.c,v 1.1.1.1 2023/09/27 11:21:37 misho Exp $ */
2: /* vim: tabstop=4 shiftwidth=4 noexpandtab
3: * Project : miniupnp
4: * Author : Thomas BERNARD
5: * copyright (c) 2007-2023 Thomas Bernard
6: * All Right reserved.
7: * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
8: * This software is subjet to the conditions detailed in the
9: * provided LICENCE file. */
10: #include <string.h>
11: #include "upnperrors.h"
12: #include "upnpcommands.h"
13: #include "miniupnpc.h"
14:
15: const char * strupnperror(int err)
16: {
17: const char * s = NULL;
18: switch(err) {
19: case UPNPCOMMAND_SUCCESS:
20: s = "Success";
21: break;
22: case UPNPCOMMAND_UNKNOWN_ERROR:
23: s = "Miniupnpc Unknown Error";
24: break;
25: case UPNPCOMMAND_INVALID_ARGS:
26: s = "Miniupnpc Invalid Arguments";
27: break;
28: case UPNPCOMMAND_INVALID_RESPONSE:
29: s = "Miniupnpc Invalid response";
30: break;
31: case UPNPCOMMAND_HTTP_ERROR:
32: s = "Miniupnpc HTTP error";
33: break;
34: case UPNPDISCOVER_SOCKET_ERROR:
35: s = "Miniupnpc Socket error";
36: break;
37: case UPNPDISCOVER_MEMORY_ERROR:
38: case UPNPCOMMAND_MEM_ALLOC_ERROR:
39: s = "Miniupnpc Memory allocation error";
40: break;
41: case 401:
42: s = "Invalid Action";
43: break;
44: case 402:
45: s = "Invalid Args";
46: break;
47: case 501:
48: s = "Action Failed";
49: break;
50: case 600:
51: s = "Argument Value Invalid";
52: break;
53: case 601:
54: s = "Argument Value Out of Range";
55: break;
56: case 602:
57: s = "Optional Action Not Implemented";
58: break;
59: case 603:
60: s = "Out of Memory";
61: break;
62: case 604:
63: s = "Human Intervention Required";
64: break;
65: case 605:
66: s = "String Argument Too Long";
67: break;
68: case 606:
69: s = "Action not authorized";
70: break;
71: case 701:
72: s = "PinholeSpaceExhausted";
73: break;
74: case 702:
75: s = "FirewallDisabled";
76: break;
77: case 703:
78: s = "InboundPinholeNotAllowed";
79: break;
80: case 704:
81: s = "NoSuchEntry";
82: break;
83: case 705:
84: s = "ProtocolNotSupported";
85: break;
86: case 706:
87: s = "InternalPortWildcardingNotAllowed";
88: break;
89: case 707:
90: s = "ProtocolWildcardingNotAllowed";
91: break;
92: case 708:
93: s = "InvalidLayer2Address";
94: break;
95: case 709:
96: s = "NoPacketSent";
97: break;
98: case 713:
99: s = "SpecifiedArrayIndexInvalid";
100: break;
101: case 714:
102: s = "NoSuchEntryInArray";
103: break;
104: case 715:
105: s = "WildCardNotPermittedInSrcIP";
106: break;
107: case 716:
108: s = "WildCardNotPermittedInExtPort";
109: break;
110: case 718:
111: s = "ConflictInMappingEntry";
112: break;
113: case 724:
114: s = "SamePortValuesRequired";
115: break;
116: case 725:
117: s = "OnlyPermanentLeasesSupported";
118: break;
119: case 726:
120: s = "RemoteHostOnlySupportsWildcard";
121: break;
122: case 727:
123: s = "ExternalPortOnlySupportsWildcard";
124: break;
125: default:
126: s = "UnknownError";
127: break;
128: }
129: return s;
130: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>