1 Star 0 Fork 41

王潇涵 / Open-NPStack

forked from Neo-T / Open-NPStack 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
onps_errors.c 4.42 KB
一键复制 编辑 原始数据 按行查看 历史
Neo-T 提交于 2022-10-17 11:02 . Added copyright notice
/*
* 版权属于onps栈开发团队,遵循Apache License 2.0开源许可协议
*
*/
#include "port/datatype.h"
#define SYMBOL_GLOBALS
#include "onps_errors.h"
#undef SYMBOL_GLOBALS
#include "port/sys_config.h"
#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" },
{ ERRDNSNOTRESOLVED, "not resolved to ip address" },
{ 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";
}
C/C++
1
https://gitee.com/han-xiao_xh/open-npstack.git
git@gitee.com:han-xiao_xh/open-npstack.git
han-xiao_xh
open-npstack
Open-NPStack
master

搜索帮助