📄 bootp.h
字号:
/**
* \addtogroup bootp
* @{
*/
/**
* \file
* \brief BOOTP client implementation header file
* \author glyin <glyin@fameg.com>
*/
/*
******************************************************************************
*
Copyright (c) 2006 FameG Shanghai, Inc. All rights reserved.
*
This is unpublished proprietary source code of FameG Shanghai, Inc.
*
The copyright notice above does not evidence any actual or intended
*
publication of such source code.
******************************************************************************
*/
/*
******************************************************************************
*
Project: T4 L4MCU FPGA verification
*
Filename: bootp.h
*
Date: 27/03/06
*
Purpose: BOOTP functions for L4MCU (Keil C Compiler)
*
Author: Guanglei Yin
******************************************************************************
*/
#ifndef __BOOTP_H__
#define __BOOTP_H__
#include "kernel/system.h"
/*****************************************************************************
* CONSTANT DEFINES *
*****************************************************************************/
/*!\brief bootp packet length.
*/
#define BOOTP_PKTLEN 300
/*!\brief bootp client port.
*/
#define BOOTP_CLIENTPORT 68
/*!\brief bootp server port.
*/
#define BOOTP_SERVERPORT 67
/// \cond DOXYGEN_SKIP
#define BOOTP_REPLY 2
#define BOOTP_REQUEST 1
#define BOOTP_HTYPE_ETHERNET 1
#define BOOTP_HWLEN_ETHERNET 6
#define BOOTP_OPTION_SUBNETMASK 1 /**< Subnet mask option BOOTP client
* is waiting for in the reply
* from the BOOTP server
*/
#define BOOTP_OPTION_DEFGW 3 /**< Default gateway option BOOTP client
* is waiting for in the reply
* from the BOOTP server
*/
/// \endcond
/*!\brief How many seconds to pass before retrying.
*/
#define BOOTP_RETRY_TOUT 5
/*****************************************************************************
* MACROS *
*****************************************************************************/
/*****************************************************************************
* DATA TYPES *
*****************************************************************************/
/*!\brief Record some information about bootp client.
*/
struct bootp_t
{
INT8 sochandle; //!< bootp client handle.
UINT16 tmrhandle; //!< bootp client timer handle.
};
/*!\brief Record bootp packet field information.
*/
typedef struct
{
/* bootp packet. */
UINT8 op;
UINT8 htype;
UINT8 hlen;
UINT8 hops;
UINT32 xid;
UINT16 secs;
UINT16 unused;
UINT32 ciaddr;
UINT32 yiaddr;
UINT32 siaddr;
UINT32 giaddr;
UINT8 chaddr[16];
UINT8 sname[64];
UINT8 file[128];
UINT8 vend[64];
} bootp_pkt;
/*****************************************************************************
* FUNCTIONS DECLARATION *
*****************************************************************************/
extern INT8 bootp_init (void); /* Initializes BOOTP client */
extern INT8 bootpc_run (void); /* BOOTP client main function */
/*****************************************************************************
* GLOBAL VARIABLES DECLARATION *
*****************************************************************************/
#endif /*__BOOTP_H__*/
/** @} */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -