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

📄 rom400_xnetstack.h

📁 这是TCP/IP协议组播的实现代码
💻 H
字号:
/*---------------------------------------------------------------------------
 *  Copyright (C) 2003-2004 Dallas Semiconductor Corporation, All Rights Reserved.
 * 
 *  Permission is hereby granted, free of charge, to any person obtaining a
 *  copy of this software and associated documentation files (the "Software"),
 *  to deal in the Software without restriction, including without limitation
 *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
 *  and/or sell copies of the Software, and to permit persons to whom the
 *  Software is furnished to do so, subject to the following conditions:
 * 
 *  The above copyright notice and this permission notice shall be included
 *  in all copies or substantial portions of the Software.
 * 
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *  MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 *  IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES
 *  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *  OTHER DEALINGS IN THE SOFTWARE.
 * 
 *  Except as contained in this notice, the name of Dallas Semiconductor
 *  shall not be used except as stated in the Dallas Semiconductor
 *  Branding Policy.
 * ---------------------------------------------------------------------------
 *
 * This file contains function definitions for the built-in ROM functions 
 * of the Dallas Semiconductor 400 processor.  This file is intended for use 
 * with the Keil MicroVision (uVision) C compiler.
 *
 * ---------------------------------------------------------------------------
 */
#ifndef __rom400_xnetstack_
#define __rom400_xnetstack_

/** \file rom400_xnetstack.h
 *  \brief Enhanced network stack for the DS80C400 ROM
 *
 *  This library contains a replacement network stack with better performance
 *  and more standards compliant functionality.  Since this library will replace
 *  the default ROM network stack, be careful of the physical location this 
 *  library.  If this library is targeted to reside in flash memory, your system
 *  will be limited by the speed of your flash.
 *
 *  To use this functionality, add xnetstack_install() to your program before
 *  calling rominit and add the library to your build process.
 *  
 *  For detailed information on the DS80C400 please see the
 *  <a href="http://pdfserv.maxim-ic.com/arpdf/Design/DS80C400UG.pdf">
 *  High-Speed Microcontroller User's Guide: DS80C400 Supplement</a>.
 *
 */

/** Version number associated with this header file.  Should be the same as
 * the version number returned by the <i>#xnetstack_version</i> function.
 * \sa #xnetstack_version */
#define ROM400_XNETSTACK_VERSION         11

/**
 * \brief     Installs the enhanced network stack.
 *
 * This function installs the enhanced network stack functionality. The function
 * has to be called before rom_init().
 *
 */
//---------------------------------------------------------------------------
void xnetstack_install(void);

/**
 * \brief     Returns the version number of this library.
 *
 * \return    Version number of this library.
 */
//---------------------------------------------------------------------------
unsigned int xnetstack_version(void);


/**
 * \brief  Sets a factor to scale all TCP timeouts
 *
 * \param factor TCP scale factor (1 to 255, default: 32)
 *
 * \sa #xnetstack_get_tcptimeoutfactor
 */
//---------------------------------------------------------------------------
void xnetstack_set_tcptimeoutfactor(int factor);


/**
 * \brief  Gets the factor to scale all TCP timeouts
 *
 * \return TCP scale factor
 *
 * \sa #xnetstack_set_tcptimeoutfactor
 */
//---------------------------------------------------------------------------
int xnetstack_get_tcptimeoutfactor(void);

/**
 * \brief Enables/disables IPv6
 *
 * \param enable 1 to enable, 0 to disable
 *
 * <b>NOTE:</b> This function disables the IPv6 receiver and transmitter.
 * An application can still send packet to IPv6 addresses without receiving
 * an error message; these packets will be discarded at the driver level.
 */
//---------------------------------------------------------------------------
void xnetstack_set_ipv6(int enable);

/**
 * \brief Enables/disables ICMP echo replies
 *
 * \param enable 1 to enable, 0 to disable
 *
 * Setting this to 0 prevents the network stack from generating ICMP echo replies
 * (i.e. the device will no longer respond to "ping").
 */
//---------------------------------------------------------------------------
void xnetstack_set_icmpechoreplies(int enable);

/**
 * \brief Enables/disables ICMP destination unreachable messages
 *
 * \param enable 1 to enable, 0 to disable
 *
 * Setting this to 0 prevents the network stack from generating ICMP destination 
 * unreachables (i.e. the device will not respond when an unused port is accessed).
 */
//---------------------------------------------------------------------------
void xnetstack_set_icmpdestinationunreachable(int enable);

/**
 * \brief Sets the IGMP membership report type.
 *
 * \param type (0x12 for version 1, 0x16 for version 2)
 *
 * <b>NOTE:</b> This does not enable IGMPv2 compatibility, it merely changes
 * the type of membership reports to work around a problem with certain
 * switches. The default is IGMPv1.
 */
//---------------------------------------------------------------------------
void xnetstack_set_igmpreporttype(int type);

#endif

⌨️ 快捷键说明

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