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

📄 icmpsock_8h-source.html

📁 pwlib开发文档
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>icmpsock.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>icmpsock.h</h1><a href="icmpsock_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * icmpsock.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Internet Control Message Protocol socket I/O channel class.</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (c) 1993-1998 Equivalence Pty. Ltd.</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is Equivalence Pty. Ltd.</span>00023 <span class="comment"> *</span>00024 <span class="comment"> * Portions are Copyright (C) 1993 Free Software Foundation, Inc.</span>00025 <span class="comment"> * All Rights Reserved.</span>00026 <span class="comment"> *</span>00027 <span class="comment"> * Contributor(s): ______________________________________.</span>00028 <span class="comment"> *</span>00029 <span class="comment"> * $Log: icmpsock.h,v $</span>00030 <span class="comment"> * Revision 1.15  2003/09/17 05:41:58  csoutheren</span>00031 <span class="comment"> * Removed recursive includes</span>00032 <span class="comment"> *</span>00033 <span class="comment"> * Revision 1.14  2003/09/17 01:18:02  csoutheren</span>00034 <span class="comment"> * Removed recursive include file system and removed all references</span>00035 <span class="comment"> * to deprecated coooperative threading support</span>00036 <span class="comment"> *</span>00037 <span class="comment"> * Revision 1.13  2003/02/11 06:47:19  craigs</span>00038 <span class="comment"> * Added missing OpenSocket function</span>00039 <span class="comment"> *</span>00040 <span class="comment"> * Revision 1.12  2002/09/16 01:08:59  robertj</span>00041 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00042 <span class="comment"> *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00043 <span class="comment"> *</span>00044 <span class="comment"> * Revision 1.11  2001/05/22 12:49:32  robertj</span>00045 <span class="comment"> * Did some seriously wierd rewrite of platform headers to eliminate the</span>00046 <span class="comment"> *   stupid GNU compiler warning about braces not matching.</span>00047 <span class="comment"> *</span>00048 <span class="comment"> * Revision 1.10  1999/08/07 15:22:20  craigs</span>00049 <span class="comment"> * Changed Success to PingSuccess to avoid namespace collision with X define of the same name</span>00050 <span class="comment"> *</span>00051 <span class="comment"> * Revision 1.9  1999/03/09 02:59:49  robertj</span>00052 <span class="comment"> * Changed comments to doc++ compatible documentation.</span>00053 <span class="comment"> *</span>00054 <span class="comment"> * Revision 1.8  1999/02/16 08:20:48  robertj</span>00055 <span class="comment"> * MSVC 6.0 compatibility changes.</span>00056 <span class="comment"> *</span>00057 <span class="comment"> * Revision 1.7  1998/09/23 06:20:39  robertj</span>00058 <span class="comment"> * Added open source copyright license.</span>00059 <span class="comment"> *</span>00060 <span class="comment"> * Revision 1.6  1998/01/26 00:30:41  robertj</span>00061 <span class="comment"> * Added error codes, TTL and data buffer to Ping.</span>00062 <span class="comment"> *</span>00063 <span class="comment"> * Revision 1.5  1997/02/05 11:52:07  robertj</span>00064 <span class="comment"> * Changed current process function to return reference and validate objects descendancy.</span>00065 <span class="comment"> *</span>00066 <span class="comment"> * Revision 1.4  1996/11/04 03:57:16  robertj</span>00067 <span class="comment"> * Rewrite of ping for Win32 support.</span>00068 <span class="comment"> *</span>00069 <span class="comment"> * Revision 1.3  1996/09/14 13:09:19  robertj</span>00070 <span class="comment"> * Major upgrade:</span>00071 <span class="comment"> *   rearranged sockets to help support IPX.</span>00072 <span class="comment"> *   added indirect channel class and moved all protocols to descend from it,</span>00073 <span class="comment"> *   separating the protocol from the low level byte transport.</span>00074 <span class="comment"> *</span>00075 <span class="comment"> * Revision 1.2  1996/06/03 10:03:22  robertj</span>00076 <span class="comment"> * Changed ping to return more parameters.</span>00077 <span class="comment"> *</span>00078 <span class="comment"> * Revision 1.1  1996/05/15 21:11:16  robertj</span>00079 <span class="comment"> * Initial revision</span>00080 <span class="comment"> *</span>00081 <span class="comment"> */</span>00082 00083 <span class="preprocessor">#ifndef _PICMPSOCKET</span>00084 <span class="preprocessor"></span><span class="preprocessor">#define _PICMPSOCKET</span>00085 <span class="preprocessor"></span>00086 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00087 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00088 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00089 <span class="preprocessor"></span>00090 <a name="l00094"></a><a class="code" href="classPICMPSocket.html">00094</a> <span class="keyword">class </span><a class="code" href="classPICMPSocket.html">PICMPSocket</a> : <span class="keyword">public</span> <a class="code" href="classPIPDatagramSocket.html">PIPDatagramSocket</a>00095 {00096   <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPICMPSocket.html">PICMPSocket</a>, <a class="code" href="classPIPDatagramSocket.html">PIPDatagramSocket</a>);00097 00098   <span class="keyword">public</span>:00104     <a class="code" href="classPICMPSocket.html#z143_0">PICMPSocket</a>();00106 00109 <a name="l00110"></a><a class="code" href="classPICMPSocket.html#z145_0">00110</a>     <span class="keyword">enum</span> <a class="code" href="classPICMPSocket.html#z145_0">PingStatus</a> {00111       <a class="code" href="classPICMPSocket.html#z145_0s0">PingSuccess</a>,         <span class="comment">// don't use Success - X11 defines this!</span>00112       <a class="code" href="classPICMPSocket.html#z145_0s1">NetworkUnreachable</a>,00113       <a class="code" href="classPICMPSocket.html#z145_0s2">HostUnreachable</a>,00114       <a class="code" href="classPICMPSocket.html#z145_0s3">PacketTooBig</a>,00115       <a class="code" href="classPICMPSocket.html#z145_0s4">RequestTimedOut</a>,00116       <a class="code" href="classPICMPSocket.html#z145_0s5">BadRoute</a>,00117       <a class="code" href="classPICMPSocket.html#z145_0s6">TtlExpiredTransmit</a>,00118       <a class="code" href="classPICMPSocket.html#z145_0s7">TtlExpiredReassembly</a>,00119       <a class="code" href="classPICMPSocket.html#z145_0s8">SourceQuench</a>,00120       <a class="code" href="classPICMPSocket.html#z145_0s9">MtuChange</a>,00121       <a class="code" href="classPICMPSocket.html#z145_0s10">GeneralError</a>,00122       <a class="code" href="classPICMPSocket.html#z145_0s11">NumStatuses</a>00123     };00124 <a name="l00126"></a><a class="code" href="classPICMPSocket_1_1PingInfo.html">00126</a>     <span class="keyword">class </span><a class="code" href="classPICMPSocket_1_1PingInfo.html">PingInfo</a> {00127       <span class="keyword">public</span>:00129         <a class="code" href="classPICMPSocket_1_1PingInfo.html#a0">PingInfo</a>(WORD id = (WORD)<a class="code" href="classPProcess.html#z227_16">PProcess::Current</a>().GetProcessID());00130 00133 <a name="l00134"></a><a class="code" href="classPICMPSocket_1_1PingInfo.html#z149_0">00134</a>         WORD <a class="code" href="classPICMPSocket_1_1PingInfo.html#z149_0">identifier</a>;         <a name="l00136"></a><a class="code" href="classPICMPSocket_1_1PingInfo.html#z149_1">00136</a>         WORD <a class="code" href="classPICMPSocket_1_1PingInfo.html#z149_1">sequenceNum</a>;        <a name="l00138"></a><a class="code" href="classPICMPSocket_1_1PingInfo.html#z149_2">00138</a>         BYTE <a class="code" href="classPICMPSocket_1_1PingInfo.html#z149_2">ttl</a>;                <a name="l00140"></a><a class="code" href="classPICMPSocket_1_1PingInfo.html#z149_3">00140</a>         <span class="keyword">const</span> BYTE * <a class="code" href="classPICMPSocket_1_1PingInfo.html#z149_3">buffer</a>;     <a name="l00142"></a><a class="code" href="classPICMPSocket_1_1PingInfo.html#z149_4">00142</a>         PINDEX <a class="code" href="classPICMPSocket_1_1PingInfo.html#z149_4">bufferSize</a>;       00144 00147 <a name="l00148"></a><a class="code" href="classPICMPSocket_1_1PingInfo.html#z151_0">00148</a>         <a class="code" href="classPTimeInterval.html">PTimeInterval</a> <a class="code" href="classPICMPSocket_1_1PingInfo.html#z151_0">delay</a>;     <a name="l00150"></a><a class="code" href="classPICMPSocket_1_1PingInfo.html#z151_1">00150</a>         Address <a class="code" href="classPICMPSocket_1_1PingInfo.html#z151_1">remoteAddr</a>;      <a name="l00152"></a><a class="code" href="classPICMPSocket_1_1PingInfo.html#z151_2">00152</a>         Address <a class="code" href="classPICMPSocket_1_1PingInfo.html#z151_2">localAddr</a>;       <a name="l00154"></a><a class="code" href="classPICMPSocket_1_1PingInfo.html#z151_3">00154</a>         PingStatus <a class="code" href="classPICMPSocket_1_1PingInfo.html#z151_3">status</a>;       00156     };00158 00167     BOOL <a class="code" href="classPICMPSocket.html#z147_0">Ping</a>(00168       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; host   00169     );00176     BOOL <a class="code" href="classPICMPSocket.html#z147_0">Ping</a>(00177       <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; host,   00178       PingInfo &amp; info         00179     );00181 00182   <span class="keyword">protected</span>:00183     <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="classPICMPSocket.html#b0">GetProtocolName</a>() <span class="keyword">const</span>;00184     <span class="keyword">virtual</span> BOOL <a class="code" href="classPICMPSocket.html#b1">OpenSocket</a>();00185     <span class="keyword">virtual</span> BOOL <a class="code" href="classPICMPSocket.html#b1">OpenSocket</a>(<span class="keywordtype">int</span> ipAdressFamily);00186 00187 00188 <span class="comment">// Include platform dependent part of class</span>00189 <span class="preprocessor">#ifdef _WIN32</span>00190 <span class="preprocessor"></span><span class="preprocessor">#include "msos/ptlib/icmpsock.h"</span>00191 <span class="preprocessor">#else</span>00192 <span class="preprocessor"></span><span class="preprocessor">#include "unix/ptlib/icmpsock.h"</span>00193 <span class="preprocessor">#endif</span>00194 <span class="preprocessor"></span>};00195 00196 <span class="preprocessor">#endif</span>00197 <span class="preprocessor"></span>00198 <span class="comment">// End Of File ///////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:10 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>

⌨️ 快捷键说明

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