⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcp_errs.h

📁 mcf5307实验源代码
💻 H
字号:
/****************************************************************************/
/*                                                                          */
/*      Copyright (c) 1993 - 1996 by Accelerated Technology, Inc.           */
/*                                                                          */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in             */
/* the subject matter of this material.  All manufacturing, reproduction,   */
/* use, and sales rights pertaining to this subject matter are governed     */
/* by the license agreement.  The recipient of this software inplicitly     */
/* accepts the terms of the license.                                        */
/*                                                                          */
/****************************************************************************/
/****************************************************************************/
/* FILE NAME                                        VERSION                 */
/*                                                                          */
/*              TCP_ERRS.H                            3.2                   */
/*                                                                          */
/* COMPONENT                                                                */
/*                                                                          */
/*                                                                          */
/*                                                                          */
/* DESCRIPTION                                                              */
/*                                                                          */
/* This file will hold all the global error codes, structures, and funtion  */
/* prototypeing needed for all errors.  The error codes and functions here  */
/* are used by the TCP/IP code only.                                        */
/*                                                                          */
/* AUTHOR                                                                   */
/*                                                                          */
/* Craig L. Meredith                                                        */
/*                                                                          */
/* DATA STRUCTURES                                                          */
/*                                                                          */
/*      struct TCP_IP_ERR       : Holds the error information.              */
/*      struct TCP_MSG_STR      : Holds the error number and a pointer to the str. */
/*                                                                          */
/* FUNCTIONS                                                                */
/*                                                                          */
/* Prototypeing only:                                                       */
/*      void NU_Tcp_Log_Error (uint16 error_number);                        */
/*      void NU_Tcp_Clear_All_Errors ();                                    */
/*      void NU_Tcp_Clear_Error (uint16 error_number);                      */
/*      unit8 *NU_Tcp_Error_String (uint16 error_number);                   */
/*                                                                          */
/* DEPENDENCIES                                                             */
/*                                                                          */
/* None.                                                                    */
/*                                                                          */
/* HISTORY                                                                  */
/*                                                                          */
/*     NAME             DATE        REMARKS                                 */
/*                                                                          */
/*                                                                          */
/****************************************************************************/

#ifndef TCP_ERRS_H
#define TCP_ERRS_H

/* include the config.h file for the right data sizes */
#include "target.h"

/*
 * This area will be used for the prototypeing of all the TCP/IP error
 * routines and functions.
 */
void NU_Tcp_Log_Error (uint16 err_num, uint8 stat, int8 *file, uint16 line);
void NU_Tcp_Clear_All_Errors ();
void NU_Tcp_Clear_Error (uint16 error_number);

/*
 * This define will be used to specifie the maximum number of error allowed
 * in the system before they roll over.
 */
#define MAX_TCP_ERRORS		50

/* Max number of chars allowed for filename storage */
#define MAX_TCP_FILENAME	50

/*
 * This structure is used to hold all the needed error information that will
 * be generated by any of the TCP/IP code.	Errors will be stored into any
 * unused location, in the array.  The first field in the structure tells us
 * if that location is currently being used, and if not set will then be set
 * and store the information into that location.
 */
struct TCP_IP_ERR
{
#ifdef PLUS
        NU_TASK *tie_task_id;
        UNSIGNED tie_err_time;          /* current time which the error happend */
#else
        sint tie_task_id;               /* number of the task where the error was generated */
        sint tie_err_time;              /* current time which the error happend */
#endif
        int16 tie_port_num;             /* port number of the connect for the host */
        int16 tie_sock_num;             /* number of the socket which may have been used */
        uint16 tie_err_num;             /* number of the error, used for access, and prints */
        uint16 tie_line_num;            /* number of the line in the file */
        uint8 tie_file [MAX_TCP_FILENAME];/* filename in which the error was generated */
        uint8 tie_err_stat;             /* current status of the error, fatal, recoverable */
        uint8 pad;
};

/*
 * This variable will hold all the actual errors which are generated.
 * The size of this array is declared in the file 'tcp_errs.c' and is of
 * MAX_TCP_ERRORS.
 */
extern struct TCP_IP_ERR NU_Tcp_Err_List [];

/*
 * This variable will be the index to the NU_Tcp_Err_List array, and will
 * tell the next available location that may be used for storing errors.
 * This index will handle the wrap around of the array based on the current
 * define value in MAX_TCP_ERRORS.
 */
extern int16 TCP_Avail_Index;

#ifdef TCP_ERR_STRS
	/*
	 * This structure will hold the error number and the error string that should
	 * be either displayed or referenced for processing.  This sturcture and the
	 * accompanying strings are only placed into the code and referanecd if the
	 * TCP_ERR_STRS is defined.
	 */
	struct TCP_MSG_STR
	{
		uint16 tms_err_num; 	/* holds the actual error number for search */
		uint8 *tms_err_str; 	/* holds the pointer to the error string */
        uint8 pad;
    };

	/*
	 * This structure array is used to hold the prdefined error number, and
	 * the character string which explains the error.  The array is actually
	 * defined in the file 'tcp_errs.c'.
	 */
    uint8 *NU_Tcp_Error_String (uint16 error_number);
#endif	/* TCP_ERR_STRS */

/* These defines are used to define the error codes.  The general ranges for
 * errors are as follows:
 *      General                   1 - 199
 *      UDP Type                200 - 299
 *	IP Type 		300 - 399
 *	TCP Type		400 - 499
 *	TCP Mem, Port	500 - 599
 *	ICMP Type		600 - 699
 *	UDP 			700 - 799
 *	Domain			800 - 899
 *	Session 		900 - 999
 *  Driver         1000 - 1099
 *  Unused         1100 -> 65536
 */
#define TCP_ERR_UNKNOWN                0
#define TCP_NET_JAM                    100
#define TCP_HRDWR_INIT                 101
#define TCP_SAME_IP                    102
#define TCP_RARP_FAIL                  103
#define TCP_NO_MEMORY                  104

#define UDP_NO_UDP_PORTS               200
#define UDP_INVALID_PORT               201
#define TCP_BAD_IP_CKSUM               300
#define TCP_IP_NOT_MINE                301
#define TCP_IP_WITH_OPTS               302
#define TCP_IP_HIGH_LAYER              303
#define TCP_IP_FRAG                    304

#define TCP_BAD_CKSUM                  400
#define TCP_ACK_INV                    401
#define TCP_UNKOWN_STATE               403
#define TCP_INV_PORT                   404
#define TCP_RESET_HOST                 405
#define TCP_NULL_POST_ACK              406
#define TCP_BAD_PACKET_PORT            407

#define TCP_NO_TCP_PORTS               500
#define TCP_EQUEUE_FULL                501
#define TCP_NO_LOC_HOST                504
#define TCP_MEM_ERROR                  505
#define TCP_NO_BOARD_ADDRS             506
#define TCP_NO_HOST_RESET              507
#define TCP_PARTITION_ERROR            508

#define TCP_ICMP_ECHO                  600
#define TCP_ICMP_DEST_NOT              603
#define TCP_ICMP_SRC_QENCH             604
#define TCP_ICMP_REDIRECT              605
#define TCP_ICMP_PING                  608
#define TCP_ICMP_PACK_TIME             611
#define TCP_ICMP_IP_PARAM              612
#define TCP_ICMP_TIME_REQS             613
#define TCP_ICMP_TIME_REPL             614
#define TCP_ICMP_INFO_REQS             615
#define TCP_ICMP_INFO_REPL             616
#define TCP_ICMP_CKSUM                 699

#define TCP_UDP_CKSUM                  700

#define TCP_DOM_REQS_FAIL              800
#define TCP_DOM_DEFLT                  801
#define TCP_DOM_NAM_NOT                802
#define TCP_DOM_UDP_NAM                803
#define TCP_DOM_NAM_FAIL               804
#define TCP_HOST_NO_CONFG              805
#define TCP_MISS_IP_NUM                806

#define TCP_SESS_CONFG                 900
#define TCP_SESS_MEM                   901
#define TCP_SESS_INV_KEYW              902
#define TCP_SESS_EL_LONG               903
#define TCP_SESS_MIS_QOTE              904
#define TCP_SESS_NAME                  905
#define TCP_SESS_BAD_IP                906
#define TCP_SESS_MASK_BAD              907
#define TCP_SESS_IP_ADDRS              908

#define DRV_RESOURCE_ALLOCATION_ERROR  1000

/* These defines are used by the error stuff for severity */
#define TCP_RECOVERABLE         0               /* error is recoverable */
#define UDP_RECOVERABLE         0               /* error is recoverable */
#define TCP_TRIVIAL             1               /* error may cause some
                                                   trivial problems */
#define TCP_SEVERE              2               /* error will cause
                                                   severe problems */
#define TCP_FATAL               3               /* error is fatal and
                                                   not recoverable */
#endif	/* TCPERRS_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -