📄 net-common-support.html
字号:
<!-- Copyright (C) 2003 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/). --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission is obtained from the copyright holder. --><HTML><HEAD><TITLE>Support Features</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="TCP/IP Stack Support for eCos"HREF="net-common-tcpip.html"><LINKREL="PREVIOUS"TITLE="Maintenance Tools "HREF="net-common-maintenance-tools.html"><LINKREL="NEXT"TITLE="DHCP"HREF="net-common-dhcp.html"></HEAD><BODYCLASS="CHAPTER"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="net-common-maintenance-tools.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="net-common-dhcp.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="NET-COMMON-SUPPORT">Chapter 37. Support Features</H1><DIVCLASS="TOC"><DL><DT><B>Table of Contents</B></DT><DT><AHREF="net-common-support.html#NET-COMMON-TFTP">TFTP</A></DT><DT><AHREF="net-common-dhcp.html">DHCP</A></DT></DL></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="NET-COMMON-TFTP">TFTP</H1><P>The TFTP client and server are described in<TTCLASS="FILENAME">tftp_support.h</TT>;the client API is simple and can be easily understood by reading<TTCLASS="FILENAME">tftp_client_test.c</TT>.</P><P>The server is more complex. It requires a filesystem implementationto be supplied by the user, and attached to the tftp server by meansof a vector of function pointers:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">struct tftpd_fileops { int (*open)(const char *, int); int (*close)(int); int (*write)(int, const void *, int); int (*read)(int, void *, int);};</PRE></TD></TR></TABLE><P>These functions have the obvious semantics. The structuredescribing the filesystem is an argument to the <TTCLASS="FUNCTION">tftpd_start(int,struct tftpd_fileops *);</TT> call. The first argument is the port to use for the server.</P><P>As discussed in the description of the tftp_server_testabove, an example filesystem is provided in<TTCLASS="FILENAME">net/common/<TTCLASS="REPLACEABLE"><I>VERSION</I></TT>/src/tftp_dummy_file.c</TT>foruse by the tftp server test. The dummy filesystem is not a supportedpart of the network stack, it exists purely for demonstration purposes.</P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="net-common-maintenance-tools.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="net-common-dhcp.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Maintenance Tools</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="net-common-tcpip.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">DHCP</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -