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

📄 stack.h

📁 阿根廷教授编写的嵌入式internet的实验教程的高质量代码
💻 H
字号:
/******************************************************************************************
   Stack.h (v1.0)
-------------------------------------------------------------------------------------
This code is from the book:
"Embedded Internet: TCP/IP Basics, Implementation and Applications" by Sergio Scaglia
[Pearson Education, 2006 - ISBN: 0-32-130638-4]

This code is copyright (c) 2006 by Sergio Scaglia, and it may only be used for educational
purposes.  For commercial use, please contact me at sscaglia@intramarket.com.ar
For more information and updates, please visit www.embeddedinternet.org
******************************************************************************************/

#ifndef __stack_H
#define __stack_H

#include "hardware.h"
#include "stackcfg.h"
#ifdef ETHERNET
  #define PACKET_BUF_SIZE	    1514
  #define DATALINK_HDR_SIZE         14
#endif
#ifdef PPP_LINK
  #define PACKET_BUF_SIZE	    1504	// we don't consider the FCS (last two bytes)
  #define DATALINK_HDR_SIZE         4
#endif

#include "debug.h"

extern char rx_buf[];
extern char tx_buf[];

#ifdef PPP_LINK

#define PPP_CLOSED	            0x00
#define PPP_OPENED	            0x01
#define PPP_WAIT	            0x02    // the PPP is connecting/disconnecting...
#define PPP_ERROR_MODEM		    0x04
#define PPP_ERROR_DIAL_BUSY	    0x08
#define PPP_ERROR_DIAL_NO_CARRIER   0x09
#define PPP_ERROR_DIAL_NO_DIALTONE  0x0A
#define PPP_ERROR_DIAL_NO_ANSWER    0x0B
#define PPP_ERROR_NEGOTIATION       0x10
#define PPP_ERROR_AUTH		    0x20
#define PPP_ERROR_PHY_LINK	    0x40
#define PPP_ERROR_SERVER_CLOSE 	    0x80

#define PPP_STATUS_NO_ERROR         ppp_status <= 0x02
#define PPP_STATUS_ERROR            ppp_status > 0x02
extern char ppp_status;
extern char server[];
#endif


void stack_init(void);
void stack_process(void);

#ifdef ETHERNET
void arp_show_table(void);
#endif

#ifdef PPP_LINK
void ppp_open(char *,char *,char *);
void ppp_close(void);
#endif

#endif

⌨️ 快捷键说明

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