-
Notifications
You must be signed in to change notification settings - Fork 2
/
onps_errors.c
127 lines (124 loc) · 6.42 KB
/
onps_errors.c
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* Copyright 2022-2024 The Onps Project Author All Rights Reserved.
*
* Author:Neo-T
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* http://www.onps.org.cn/apache2.0.txt
*
*/
#include "port/datatype.h"
#include "port/sys_config.h"
#define SYMBOL_GLOBALS
#include "onps_errors.h"
#undef SYMBOL_GLOBALS
#include "port/os_datatype.h"
#include "port/os_adapter.h"
static const ST_ONPSERR lr_staErrorList[] = {
{ ERRNO, "no errors" },
{ ERRNOPAGENODE, "no page nodes available"},
{ ERRREQMEMTOOLARGE, "The requested memory is too large, please refer to the macro definition BUDDY_MEM_SIZE" },
{ ERRNOFREEMEM, "The mmu has no memory available" },
{ ERRMUTEXINITFAILED, "thread mutex initialization failed" },
{ ERRNOBUFLISTNODE, "the buffer list is empty" },
{ ERRSEMINITFAILED, "thread semphore initialization failed" },
{ ERROPENTTY, "tty open error" },
{ ERRATWRITE, "write AT command error" },
{ ERRATEXEC, "the at command returned an error" },
{ ERRATEXECTIMEOUT, "AT command exec timeout" },
{ ERRSIMCARD, "no sim card detected" },
{ ERRREGMOBILENET, "Unable to register to mobile network" },
{ ERRPPPIDXOVERFLOW, "ppp link index overflow" },
{ ERRPPPDELIMITER, "ppp frame delimiter not found" },
{ ERRTOOMANYTTYS, "too many ttys" },
{ ERRTTYHANDLE, "invalid tty handle" },
{ ERROSADAPTER, "os adaptation layer error" },
{ ERRUNKNOWNPROTOCOL, "Unknown protocol type" },
{ ERRPPPFCS, "ppp frame checksum error" },
{ ERRNOIDLETIMER, "no idle timer" },
{ ERRNOFREEPPWANODE, "Node unavailable for ppp negotiation wait" },
{ ERRPPPWALISTNOINIT, "ppp's waiting list for ack is not initialized" },
{ ERRNONETIFNODE, "no netif nodes available" },
{ ERRNONETIFFOUND, "No network interface found" },
{ ERRINPUTOVERFLOW, "Handle/Input overflow" },
{ ERRUNSUPPIPPROTO, "Unsupported ip upper layer protocol" },
{ ERRUNSUPPIOPT, "Unsupported control options" },
{ ERRIPROTOMATCH, "Protocol match error" },
{ ERRNOROUTENODE, "no route nodes available" },
{ ERRADDRESSING,"Addressing failure, default route does not exist" },
{ ERRADDRFAMILIES, "Unsupported address families" },
{ ERRSOCKETTYPE, "Unsupported socket type" },
{ ERRNOATTACH, "Attached data address is null" },
{ ERRTCSNONTCP, "Non-TCP can't get/set tcp link state" },
{ ERRTDSNONTCP, "Non-TCP can't get tcp send data state" },
{ ERRTCPCONNTIMEOUT, "tcp connection timeout" },
{ ERRTCPCONNRESET, "tcp connection reset by peer" },
{ ERRTCPCONNCLOSED, "TCP link closed" },
{ ERRDATAEMPTY, "tcp/udp data segment is empty" },
{ ERRTCPACKTIMEOUT, "tcp ack timeout" },
{ ERRNOTCPLINKNODE, "the tcp link list is empty" },
{ ERRTCPNOTCONNECTED, "tcp link not connected" },
{ ERRINVALIDSEM, "invalid semaphore" },
{ ERRSENDZEROBYTES, "0 bytes of data are sent" },
{ ERRPORTOCCUPIED, "Port is already occupied" },
{ ERRSENDADDR, "destination address is empty" },
{ ERRETHEXTRAEMPTY, "No eth additional info node available" },
{ ERRNETUNREACHABLE, "Network unreachable" },
{ ERRROUTEADDRMATCH, "Addressing result does not match" },
{ ERRNEWARPCTLBLOCK, "arp control block is empty" },
{ ERRUNSUPPETHIIPROTO, "unsupported ethernet ii upper layer protocol(only ipv4/arp/rarp/ipv6)" },
{ ERRPACKETTOOLARGE, "packet too large" },
{ ERRPORTEMPTY, "port number is empty" },
{ ERRWAITACKTIMEOUT, "Timeout waiting for the reply packet" },
{ ERRIPCONFLICT, "ip address conflict" },
{ ERRNOTBINDADDR, "The socket does not bind the address" },
{ ERRTCPONLY, "Only supports tcp protocol" },
{ ERRTCPSRVEMPTY, "tcp server resource is empty"},
{ ERRTCPBACKLOGEMPTY, "backlog resource for tcp server is empty" },
{ ERRTCPRCVQUEUEEMPTY, "recv queue resource for tcp server is empty" },
{ ERRTCPNOLISTEN, "tcp server does not enter the listen stage" },
{ ERRTCPBACKLOGFULL, "backlog resource for tcp server is full" },
{ ERRDNSQUERYFMT, "The format of the dns query packet is wrong" },
{ ERRDNSSRV, "dns server failure" },
{ ERRDNSNAME, "domain name does not exist" },
{ ERRDNSQUERYTYPE, "unsupported dns query type" },
{ ERRDNSREFUSED, "Refused by DNS server" },
{ ERRDNSNOTRESOLVED, "not resolved to ip address" },
{ ERRNOUDPLINKNODE, "the udp link list is empty" },
{ ERRTCPLINKCBNULL, "the tcp link control block is NULL" },
#if SUPPORT_IPV6
{ ERRNEWIPv6MACCTLBLOCK, "The control block of the ipv6 to mac address mapping table is empty" },
{ ERRNOIPv6DYNADDRNODE, "the ipv6 dynamic addr list is empty" },
{ ERRNOIPv6ROUTERNODE, "the ipv6 router list is empty" },
{ ERRIPV4FLOWLABEL, "Ipv4 does not support flow label fields" },
{ ERRNODv6CLTCBNODE, "Dhcpv6 client control block list is empty" },
{ ERRROUTERINDEX, "router index overflow" },
#endif
{ ERRFAMILYINCONSISTENT, "The address family of the target and source addresses is inconsistent" },
{ ERRUNSUPPORTEDFAMILY, "Unsupported address family" },
#if NETTOOLS_TELNETSRV
{ ERRNOTELNETCLTCBNODE, "Telnet client control block list is empty" },
{ ERRNVTSTART, "Network virtual terminal startup failed" },
#endif
{ ERRNETIFNOTFOUND, "no network interface found" },
{ ERREXTRAIPLIMIT, "exceeded maximum number of IP addresses" },
{ ERREXTRAIPSAVE, "failed to write the IP address to the system memory" },
{ ERREXTRAIPDEL, "failed to remove IP address from system memory" },
{ ERRIPUPDATED, "unable to overwrite the original value in the system memory" },
{ ERRIPNOSTATIC, "adding, deleting, or updating IP addresses is not allowed in DHCP mode" },
{ ERRROUTEENTRYNOR, "failed to write to system memory when adding or deleting routing entries" },
{ ERRROUTEDEFAULTDEL, "the default route cannot be deleted" },
{ ERRROUTEENTRYNOTEXIST, "the routing entry does not exist" },
{ ERRNETIFSEND, "The network card returns a sending failure" },
{ ERRNOSOCKET, "No socket available" },
{ ERRUNKNOWN, "unknown error" }
};
const CHAR *onps_error(EN_ONPSERR enErr)
{
UINT unIndex = (UINT)enErr;
if (unIndex < sizeof(lr_staErrorList) / sizeof(ST_ONPSERR))
return lr_staErrorList[unIndex].szDesc;
return "unrecognized error code";
}