📄 ipport.h_h
字号:
/* ipport.h
*
* Copyright 1990-2001 by InterNiche Technologies, Inc.
*
* All the platform specific defines for each port go here.
* All these should be re-examined with each new port of the code.
*
* 10/12/90 - Created for use in SNMP TSR. John Bartas
*/
#ifndef _IPPORT_H_
#define _IPPORT_H_ 1
/* TTYIO.C has redefintions of printf, sprintf. So to resolve declarations,
* we don't include stdio.h for compiling this file
*/
#ifndef _IN_TTYIO_
#include "stdio.h" /* C compiler files */
#endif
/* options to trade off features for size. Do not enable options
* for modules you don't have or your link will get unresolved
* externals.
*/
#define MINI_IP 1 /* Use Nichelite mini-IP layer */
#define MINI_TCP 1 /* Use Nichelite mini-TCP layer */
#define INICHE_TASKS 1 /* map tasking to InterNiche multitasking */
#define INCLUDE_TCP 1 /* this link will include NetPort TCP w/MIB */
#define TCP_ZEROCOPY 1 /* use Sockets zero-copy extensions */
#define NB_CONNECT 1 /* support Non-Blocking connects (TCP, PPP, et al) */
#define INCLUDE_ICMP 1 /* Include ICMP with NicheLite */
#define FULL_ICMP 1 /* use all ICMP || ping only */
#define INCLUDE_ARP 1 /* use Ethernet ARP */
#define DHCP_CLIENT 1 /* include DHCP client code */
#define IEEE_802_3 1 /* Support IEEE 802.3 (RFC-1042) */
#define USE_PPP 1 /* support PPP MAC iface(s) */
#define PPP_VJC 1 /* VJ header compression */
#define PPP_MENU 1 /* include the PPP debug menu */
#define PAP_SUPPORT 1 /* Password authentication */
#define CHAP_SUPPORT 1 /* CHAP authentication */
#define PPP_CHARIO 1 /* support character read/write routine */
#define PPP_DHCP_CLIENT 1 /* get IP address via dhcp after IPCP is up */
#define PPP_LOGFILE 1 /* ConPrintf() log to file option */
#define PPP_DNS 1 /* domain nameserver address negotiation */
#define USE_MODEM 1 /* support PPP/SLIP on modems */
#define USE_COMPORT 1 /* Include UART driver support with PPP */
#define MEM_BLOCKS 1 /* old memory debug system */
#define INCLUDE_NVPARMS 1 /* Include Non-volatile parameters system */
#define LOSSY_IO 1 /* Do lossy packet IO for testing */
#define INICHE_TIMERS 1 /* Provide Interval timers */
#define PRINTF_STDARG 1 /* build ...printf() using stdarg.h */
#define NPDEBUG 1 /* turn on debugging dprintf()s */
#define MUTE_WARNS 1 /* gen extra code to suppress compiler warnings */
#define IN_MENUS 1 /* support for InterNiche menu system */
#define NET_STATS 1 /* include statistics printfs */
#define VFS_FILES 1 /* include Virtual File System */
#define HT_LOCALFS 1 /* TRUE if there's a another file system */
#define VFS_UNITTEST 1 /* Include in VFS test menu */
#define VFS_VERBOSE 1 /* Compile VFS in verbose debug mode */
#define TFTP_CLIENT 1 /* include TFTP client code */
#define TFTP_SERVER 1 /* include TFTP server code */
#define DNS_CLIENT 1 /* include DNS client code */
#define UDP_ECHO_SVR 1 /* built-in UDP Echo server */
#ifdef NOT_USED
#error NOT_USED is defined
#define TESTMENU 1 /* Include special tests in menu */
#define UDPSTEST 1 /* UDP Echo Sockets test app */
#define CHRONOS 1 /* Use CHRONOS as RTOS */
#define THREADX 1 /* map tasking to ThreadX RTOS */
#define SUPERLOOP 1 /* Use InterNiche superloop */
#define VRTXSA 1 /* map tasking to VRTXsa RTOS */
#define VXWORKS 1 /* map tasking to VxWorks RTOS */
#define BSDISH_RECV 1 /* Include a BSD recv()-like routine with mini_tcp */
#define BSDISH_SEND 1 /* Include a BSD send()-like routine with mini_tcp */
#define TCP_SACK 1 /* Selective ACK per rfc2018 */
#define TCP_WIN_SCALE 1 /* Tcp window scale (large window, RFC-1323) */
#define TCP_TIMESTAMP 1 /* TCP seg timestamping (RFC-1323) */
#define DO_DELAY_ACKS 1 /* TCP ACK piggybacking */
#define SUPPORT_SO_FULLMSS 1 /* Socket option for MAXS sized tcp segments */
#define INCLUDE_UDP 1 /* Include UDP with NicheLite */
#define IP_FRAGMENTS 1 /* IP fragment reassembly */
#define IP_ROUTING 1 /* do real IP routing, not imbedded agent fake route */
#define MULTI_HOMED 1 /* more than one net interface */
#define NO_UDP_CKSUM 1 /* omit code for UDP checksums */
#define IP_PMTU 1 /* path MTU discovery */
#define BTREE_ROUTES 1 /* Use binary tree IP route lookup */
#define DYNAMIC_IFACES 1 /* Support runtime creation of interfaces */
#define IP_MULTICAST 1 /* support IP multicast capability in stack */
#define DNS_CLIENT_UPDT 1 /* Dynamic DNS client */
#define SHARED_IPADDRS 1 /* Add code for one IP address on two ifaces */
#define IP_RAW 1 /* build raw sockets support */
#define USE_IPFILTER 1 /* IP Filtering (RFC-2669) */
#define USE_SLIP 1 /* support SLIP driver iface(s) */
#define LB_XOVER 1 /* cross 2 loopback lines (units 1 & 2) for test */
#define PPP_PACKET 1 /* support packet-oriented read/write */
#define PPP_MULTILINK 1 /* PPP Multilink (RFC1990) support */
#define USE_PPPOE 1 /* Support PPP over ethernet */
#define USE_PROFILER 1 /* profile selected code modules */
#define ROUTE_TEST 1 /* Add menu & pseudo device for route metrics */
#define NATIVE_PRINTF 1 /* use target build environment's printf function */
#define MEM_WRAPPERS 1 /* include debug wrappers on heap calls */
#define HEAP_STATS 1 /* include the heap statistics menu */
#define BLOCKING_APPS 1 /* applications block rather than poll */
#define MAC_LOOPBACK 1 /* use MAC layer pseudo-Ethernet loopback driver */
#define USE_MEMDEV 1 /* Psuedo VFS files mem and null */
#define PKT_CYCLES 1 /* */
#define LOCKNET_CHECKING 1 /* Check protection of net resources */
#define IP_RAW_ACCESS 1 /* allow direct-receive of IP datagrams */
#define QUEUE_CHECKING 1 /* include code to check critical queues */
#define RF_SIMULATION 1 /* simulate wireless networks */
#define RAWIPTEST 1 /* Test for raw sockets */
#define HT_SYNCDEV 1 /* support VFS backup to flash device */
#define HT_RWVFS 1 /* support writable VFS */
#define INCLUDE_FLASHFS 1 /* read/write NV parms flash */
#define WEBPORT 1 /* will be linked with WebPort Web (HTTP) Server */
#define TELNET_SVR 1 /* then include this source file */
#define FTP_SERVER 1 /* include FTP server code */
#define FTP_CLIENT 1 /* include FTP client code */
#define NICHVIEW 1 /* include NicheView browser */
#define TCP_ECHOTEST 1 /* include a TCP Echo test */
#define DNS_SERVER 1 /* Include DNS server */
#define RIP_SUPPORT 1 /* enable RIP routing feature */
#define DHCP_SERVER 1 /* bring in DHCP server */
#define NATRT 1 /* enable NAT routing feature */
#define BOOTPTAB 1 /* DHCP supports a UNIX-ish bootptab file */
#define INCLUDE_SNMP 1 /* enable common SNMP code */
#define INCLUDE_SNMPV1 1 /* SNMPv1 library, agent & hook */
#define INCLUDE_SNMPV2C 1 /* Include SNMPv2c over SNMPv1 */
#define INCLUDE_SNMPV3 1 /* Include SNMPv3 code in build */
#define USE_GENLIST 1 /* SNMPv3 list utility */
#define PING_APP 1 /* application provides a pingUpcall */
#define SNMP_SOCKETS 1 /* SNMP over Sockets, not lightweight API */
#define POP3_CLIENT 1 /* include POP3 client API code */
#define P3C_APOP 1 /* include POP3 client APOP supporting code */
#define SMTP_ALERTS 1 /* send email trouble alerts */
#define HT_USERAUTH 1 /* include user authorization code */
#define HTML_COMPRESSION 1 /* include HTML tags compression logic */
#define HT_MD5AUTH 1 /* webserver - include MD5 code */
#define HT_FILEUPLOAD 1 /* support HTTP uploads */
#define FOREIGN_LANG_SUPPORT 1 /* webserver - support high bit chars */
#define SERVER_PUSH 1 /* Web server */
#endif /* NOT_USED */
/**** end of option list ***/
#ifndef INICHE_TASKS
#define SUPERLOOP 1 /* All modules serviced via tk_yield() */
#endif
void* MEMCPY(void * dest, void * src, unsigned length);
void* MEMSET(void * dest, unsigned char setc, unsigned length);
void* MEMMOVE(void * dest, void * src, unsigned length);
#define MEMCMP(dest, src, length) memcmp(dest, src, length)
#ifndef INICHE_LIBS /* use Standard libs strlib (strcat, strcpy, etc) */
#include <stdlib.h> /* for atoi(), exit() */
#include <string.h>
#endif
#include "nptypes.h" /* NetPort data types */
/* default setups of some sub-options */
#ifdef VFS_FILES
#define HT_EXTDEV 1 /* allow custom file devices (memdev, null, etc.) */
#define HT_RWVFS 1 /* support read/write VFS */
#define VFS_STRIPPATH 1 /* used to strip path for filenames in vfsfiles.c */
#ifdef NOTDEF /* unused VFS options */
#define UNIX_VFS 1 /* make VFS look UNIX-like */
#define HT_SYNCDEV 1 /* support sync to flash device */
#endif /* NOTDEF */
#define vfs_lock() /* define pesky macros away */
#define vfs_unlock()
#endif /* VFS_FILES */
/* if any SNMP agent is used, then INCLUDE_SNMP should be enabled */
#if (defined(INCLUDE_SNMPV1)||defined(INCLUDE_SNMPV2C)||defined(INCLUDE_SNMPV3))
#define INCLUDE_SNMP 1 /* update SNMP counters in TCPIP stack */
#endif
#ifdef INCLUDE_SNMP
#ifndef SNMP_SOCKETS
#define PREBIND_AGENT 1 /* hardcode SNMP port into UDP */
#endif
#endif
#ifdef MULTI_HOMED
#define IP_ROUTING 1 /* force IP routing on multi-homed compiles */
#endif
#ifdef INCLUDE_TCP
#define FULL_ICMP 1 /* force full ICMP for TCP support */
#endif
#ifdef IP_TTL /* defined in a Microsoft C Compiler file */
#undef IP_TTL /* will be redefined */
#endif
#define IP_TTL 64 /* define IP hop count for this port */
#ifndef MINI_IP
#define MAXNETS 8 /* max ifaces to support at one time */
#define STATIC_NETS 3 /* static nets to allow for... */
#else
#define MAXNETS 1 /* NicheLite only supports one network interface */
#endif /* MINI_IP */
#define NAT_SUPPRESS_WARNINGS 1
/* some PC UART & hardware support */
extern unshort _inp(unshort reg);
extern unshort _outp(unshort reg, u_char value);
/* We must make inp() and outp() available to drivers */
#define inp(r) (u_char)_inp(r)
#define outp(r,v) _outp(r,v)
#define WIN32_UART 1 /* for ../modem/mdmport.c */
#define WIN2K 1 /* Use packet.dll driver for windows */
/* UART include file for mdmport.h */
#define UART_INCLUDE "..\win32\winuart.h"
#ifdef NOTDEF
#define MDM_DTRRESET 1 /* use PC's DTR line to reset modem */
#endif
#ifdef IP_FRAGMENTS
#ifndef MAX_FRAG_PKTS
#define MAX_FRAG_PKTS 5 /* max IP pkts we can simultaneously reassemble */
#endif /* MAX_FRAG_PKTS */
#endif /* IP_FRAGMENTS */
/* number of entries in IP routing table */
#define RT_TABS 16
#define STK_TOPDOWN 1 /* Intel x86 "top down" stack */
#ifndef TRUE
#define TRUE -1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#define NULL ((void*)0)
#endif /* NULL */
extern unsigned long cticks; /* clock ticks since startup */
void clock_init(void); /* start clock tick counting; called at init time */
void clock_c(void); /* undo effects of clock_init (i.e. restore ISR vector */
#define TPS 18 /* cticks per second */
#ifdef MINI_IP
/* permit shutdown of the NicheLite console-mode Win32 application */
extern void exit_win32(int);
#define netexit exit_win32
#endif /* MINI_IP */
/* define away 16-bit x86 hooks (this is 32 bit) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -