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

📄 tftp.h

📁 vt6528芯片交换机API函数和文档运行程序
💻 H
字号:
/*
 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
 * All rights reserved.
 *
 * This software is copyrighted by and is the sole property of
 * VIA Networking Technologies, Inc. This software may only be used
 * in accordance with the corresponding license agreement. Any unauthorized
 * use, duplication, transmission, distribution, or disclosure of this
 * software is expressly forbidden.
 *
 * This software is provided by VIA Networking Technologies, Inc. "as is"
 * and any express or implied warranties, including, but not limited to, the
 * implied warranties of merchantability and fitness for a particular purpose
 * are disclaimed. In no event shall VIA Networking Technologies, Inc.
 * be liable for any direct, indirect, incidental, special, exemplary, or
 * consequential damages.
 *
 *
 * File:    tftp.h
 *
 * Purpose: TFTP server
 *
 * Author:  Tevin Chen
 *
 * Date:    Jan 08, 2002
 *
 */


#ifndef __TFTP_H__
#define __TFTP_H__

#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
#if !defined(__STRTYPE_H__)
#include "strtype.h"
#endif
#if !defined(__STR_H__)
#include "str.h"
#endif
#if !defined(__SWPKT_H__)
#include "swpkt.h"
#endif




/*---------------------  Export Definitions  ------------------------*/
#define TFTP_SRV_PORT       69
#define TFTP_LOCAL_PORT     TFTP_SRV_PORT

#define TFTP_OPC_READ_REQ   1
#define TFTP_OPC_WRITE_REQ  2
#define TFTP_OPC_DATA       3
#define TFTP_OPC_ACK        4
#define TFTP_OPC_ERROR      5

enum {
    TFTP_STA_END,
    TFTP_STA_START,
    TFTP_STA_REQ,
    TFTP_STA_DATA,
    TFTP_STA_UPDATE,
    TFTP_STA_REBOOT,
    TFTP_STA_ERROR
};

/*---------------------  Export Types  ------------------------------*/
struct tagSTftpState {
    volatile UINT    uState;
    PUINT8  pu8TftpBuffer;
    UINT32  u32MaxBufSize;
    UINT32  u32SvrIpAddr;
    CHAR    acFileName[MAX_FILENAME_LEN];
    UINT    uStateToStop;
    INT32   i32RcvCount;
    UINT16  u16BlockNo;
};

typedef struct tagSTftpState    STftpState;

/*---------------------  Export Macros  -----------------------------*/
#define NPTFTP_vSendReadRequest(pPktBuf)   NPTFTP_vSendRequest(pPktBuf, TFTP_OPC_READ_REQ)
#define NPTFTP_vSendWriteRequest(pPktBuf)  NPTFTP_vSendRequest(pPktBuf, TFTP_OPC_WRITE_REQ)

/*---------------------  Export Classes  ----------------------------*/

/*---------------------  Export Variables  --------------------------*/
extern STftpState   g_TftpState;

/*---------------------  Export Functions  --------------------------*/
#ifdef __cplusplus
extern "C" {                            /* Assume C declarations for C++ */
#endif /* __cplusplus */


void NPTFTP_vInit(void);

void NPTFTP_vInput(SRBuf* pPktBuf);
void NPTFTP_vSendRequest(SRBuf* pPktBuf, UINT16 u16Opcode);


#ifdef __cplusplus
}                                       /* End of extern "C" { */
#endif /* __cplusplus */




#endif /* __TFTP_H__ */


⌨️ 快捷键说明

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