📄 rabbitlwip.h
字号:
/* * Network initialization and utilization functions for lwIP for the * Softools Compiler and Rabbit 2000 * * (C) 2001 Compendium Technologies, Inc. * (C) 2001 Softools, Inc. * All rights reserved. * * This software is the proprietary information of Compendium Technologies, Inc. * and Softools, Inc. Use is subject to license terms. */#ifndef _NET2000_H_#define _NET2000_H_#include "netif/arp.h"#include "lwip/ip_addr.h"/* * What kind of connection is this? Supports ethernet and eventually ppp. */#define ETH_CONN 0#define PPP_CONN 1/* * Structure defines the configuration for an individual network connection, * This is broken up to eventually support PPP and ethernet in th)e same device */typedef struct { int connType; struct ip_addr address; struct ip_addr netmask;} NetConnectionConfig;#define DOMAINNAME_LENGTH 50#define HOSTNAME_LENGTH 50/* * Structure defines the network configuration for the device. There is only * one of these per machine. */typedef struct { char *hostName; // Can be overwritten by DHCP char *domainName; // Can be overwritten by DHCP struct ip_addr defaultGateway;} NetConfig;/* * Will change this later to support ethernet and ppp simultaneously */ #define NET_MAX_INTERFACES 1extern NetConfig configuration;/** * Look at the ID block of the board and set up the driver variables * appropriately. Returns the board type. */int netRecognize(void);/** * Configure a machine with a hostname, domain, and default gateway. */void netConfigure(NetConfig *config);/** * Specify an optional list of DNS servers (as char *) after NetConnectionConfig * The return value indicates whether or not initialization and startup * succeeded. */int ethernetStart(NetConnectionConfig *ethConfig, ...);/** * Shut down the ethernet interface (i.e. at program exit or to reconfigure). */void ethernetStop(void);/* * Put this in a timer and have it go off every so often. */extern unsigned char netProcessBusy; // True when netProcess() is workingvoid near netProcess(void); // For use with timers and interrupts to // periodically process network packets//int far netProcessSocket(sock_type *sock); // Returns 1 when the socket passed // in closes./* * Utility to format a MAC (ethernet) address */char *etherAddressToString(char *string, struct eth_addr *addr);/** * Convert the string form of an ip address into an internal ip address. */int netStringToIP(char *ipstring, struct ip_addr *ip);/** * Initialize TCP/IP subsystem. Does not actually starts networking. This * is a precursor to setting things up. */void netInit(void);/** * Macro to get the current host name in use by this system. */#define netGetHostName() (configuration.hostName)/** * Macro to get the current domain name in use by this system. */#define netGetDomainName() (configuration.domainName)/*#define netGetMAC(string) (etherAddressToString(string, ð_addr))*/#define MAX_NAMESERVERS 3 // How many name servers to allow#endif /* _NET_2000_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -