📄 ipsock_8h-source.html
字号:
00582 Address & addr 00583 );00584 00592 <span class="keyword">static</span> <a class="code" href="classPStringArray.html">PStringArray</a> <a class="code" href="classPIPSocket.html#d9">GetHostAliases</a>(00593 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & hostname00594 <span class="comment">/* Name of host to get address for. This may be either a domain name or</span>00595 <span class="comment"> an IP number in "dot" format.</span>00596 <span class="comment"> */</span>00597 );00598 <span class="keyword">static</span> <a class="code" href="classPStringArray.html">PStringArray</a> <a class="code" href="classPIPSocket.html#d9">GetHostAliases</a>(00599 <span class="keyword">const</span> Address & addr 00600 <span class="comment">/* Name of host to get address for. This may be either a domain name or</span>00601 <span class="comment"> an IP number in "dot" format.</span>00602 <span class="comment"> */</span>00603 );00604 00612 <span class="keyword">static</span> BOOL <a class="code" href="classPIPSocket.html#d11">IsLocalHost</a>(00613 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & hostname00614 <span class="comment">/* Name of host to get address for. This may be either a domain name or</span>00615 <span class="comment"> an IP number in "dot" format.</span>00616 <span class="comment"> */</span>00617 );00618 00624 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIPSocket.html#a9">GetLocalAddress</a>(00625 Address & addr 00626 );00627 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIPSocket.html#a9">GetLocalAddress</a>(00628 Address & addr, 00629 WORD & <a class="code" href="classPSocket.html#n0">port</a> 00630 );00631 00638 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIPSocket.html#a11">GetPeerAddress</a>(00639 Address & addr 00640 );00641 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIPSocket.html#a11">GetPeerAddress</a>(00642 Address & addr, 00643 WORD & <a class="code" href="classPSocket.html#n0">port</a> 00644 );00645 00651 <a class="code" href="classPString.html">PString</a> <a class="code" href="classPIPSocket.html#a13">GetLocalHostName</a>();00652 00658 <a class="code" href="classPString.html">PString</a> <a class="code" href="classPIPSocket.html#a14">GetPeerHostName</a>();00659 00662 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classPIPSocket.html#d12">ClearNameCache</a>();00663 00675 <span class="keyword">static</span> BOOL <a class="code" href="classPIPSocket.html#d13">GetGatewayAddress</a>(00676 Address & addr 00677 );00678 00691 <span class="keyword">static</span> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPIPSocket.html#d14">GetGatewayInterface</a>();00692 <a name="l00696"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html">00696</a> <span class="keyword">class </span><a class="code" href="classPIPSocket_1_1RouteEntry.html">RouteEntry</a> : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a>00697 {00698 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPIPSocket_1_1RouteEntry.html">RouteEntry</a>, <a class="code" href="classPObject.html">PObject</a>);00699 <span class="keyword">public</span>:<a name="l00701"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#a0">00701</a> <a class="code" href="classPIPSocket_1_1RouteEntry.html#a0">RouteEntry</a>(<span class="keyword">const</span> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> & addr) : <a class="code" href="classPIPSocket_1_1RouteEntry.html#n0">network</a>(addr) { }00702 <a name="l00704"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#a1">00704</a> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> <a class="code" href="classPIPSocket_1_1RouteEntry.html#a1">GetNetwork</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPIPSocket_1_1RouteEntry.html#n0">network</a>; }00705 <a name="l00707"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#a2">00707</a> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> <a class="code" href="classPIPSocket_1_1RouteEntry.html#a2">GetNetMask</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPIPSocket_1_1RouteEntry.html#n1">net_mask</a>; }00708 <a name="l00710"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#a3">00710</a> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> <a class="code" href="classPIPSocket_1_1RouteEntry.html#a3">GetDestination</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPIPSocket_1_1RouteEntry.html#n2">destination</a>; }00711 <a name="l00713"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#a4">00713</a> <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPIPSocket_1_1RouteEntry.html#a4">GetInterface</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPIPSocket_1_1RouteEntry.html#n3">interfaceName</a>; }00714 <a name="l00716"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#a5">00716</a> <span class="keywordtype">long</span> <a class="code" href="classPIPSocket_1_1RouteEntry.html#a5">GetMetric</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPIPSocket_1_1RouteEntry.html#n4">metric</a>; }00717 00718 <span class="keyword">protected</span>:<a name="l00719"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#n0">00719</a> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> <a class="code" href="classPIPSocket_1_1RouteEntry.html#n0">network</a>;<a name="l00720"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#n1">00720</a> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> <a class="code" href="classPIPSocket_1_1RouteEntry.html#n1">net_mask</a>;<a name="l00721"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#n2">00721</a> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> <a class="code" href="classPIPSocket_1_1RouteEntry.html#n2">destination</a>;<a name="l00722"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#n3">00722</a> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPIPSocket_1_1RouteEntry.html#n3">interfaceName</a>;<a name="l00723"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#n4">00723</a> <span class="keywordtype">long</span> <a class="code" href="classPIPSocket_1_1RouteEntry.html#n4">metric</a>;00724 <a name="l00725"></a><a class="code" href="classPIPSocket_1_1RouteEntry.html#l0">00725</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classPIPSocket.html">PIPSocket</a>;00726 };00727 00728 <a class="code" href="classPIPSocket.html#a15">PLIST</a>(RouteTable, RouteEntry);00729 00735 <span class="keyword">static</span> BOOL <a class="code" href="classPIPSocket.html#d15">GetRouteTable</a>(00736 RouteTable & table 00737 );00738 00739 <a name="l00743"></a><a class="code" href="classPIPSocket_1_1InterfaceEntry.html">00743</a> <span class="keyword">class </span><a class="code" href="classPIPSocket_1_1InterfaceEntry.html">InterfaceEntry</a> : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a>00744 {00745 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPIPSocket_1_1InterfaceEntry.html">InterfaceEntry</a>, <a class="code" href="classPObject.html">PObject</a>)00746 00747 <span class="keyword">public</span>:00749 <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#a0">InterfaceEntry</a>(00750 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & _name,00751 <span class="keyword">const</span> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> & _addr,00752 <span class="keyword">const</span> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> & _mask,00753 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & _macAddr00754 );00755 00757 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#a1">PrintOn</a>(00758 ostream &strm <span class="comment">// Stream to print the object into.</span>00759 ) <span class="keyword">const</span>;00760 <a name="l00762"></a><a class="code" href="classPIPSocket_1_1InterfaceEntry.html#a2">00762</a> <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#a2">GetName</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n0">name</a>; }00763 <a name="l00765"></a><a class="code" href="classPIPSocket_1_1InterfaceEntry.html#a3">00765</a> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#a3">GetAddress</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n1">ipAddr</a>; }00766 <a name="l00768"></a><a class="code" href="classPIPSocket_1_1InterfaceEntry.html#a4">00768</a> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#a4">GetNetMask</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n2">netMask</a>; }00769 <a name="l00771"></a><a class="code" href="classPIPSocket_1_1InterfaceEntry.html#a5">00771</a> <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#a5">GetMACAddress</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n3">macAddr</a>; }00772 00773 <span class="keyword">protected</span>:<a name="l00774"></a><a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n0">00774</a> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n0">name</a>;<a name="l00775"></a><a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n1">00775</a> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n1">ipAddr</a>;<a name="l00776"></a><a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n2">00776</a> <a class="code" href="classPIPSocket_1_1Address.html">Address</a> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n2">netMask</a>;<a name="l00777"></a><a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n3">00777</a> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPIPSocket_1_1InterfaceEntry.html#n3">macAddr</a>;00778 };00779 00780 <a class="code" href="classPIPSocket.html#a15">PLIST</a>(InterfaceTable, InterfaceEntry);00781 00787 <span class="keyword">static</span> BOOL <a class="code" href="classPIPSocket.html#d16">GetInterfaceTable</a>(00788 InterfaceTable & table 00789 );00790 00791 <span class="preprocessor">#if P_HAS_RECVMSG</span>00792 <span class="preprocessor"></span>00798 BOOL <a class="code" href="classPIPSocket.html#a17">SetCaptureReceiveToAddress</a>()00799 { <span class="keywordflow">if</span> (!<a class="code" href="classPSocket.html#z371_0">SetOption</a>(IP_PKTINFO, 1, SOL_IP)) <span class="keywordflow">return</span> FALSE; catchReceiveToAddr = TRUE; <span class="keywordflow">return</span> TRUE; }00800 00804 <a class="code" href="classPIPSocket_1_1Address.html">PIPSocket::Address</a> <a class="code" href="classPIPSocket.html#a18">GetLastReceiveToAddress</a>()<span class="keyword"> const</span>00805 <span class="keyword"> </span>{ <span class="keywordflow">return</span> lastReceiveToAddr; }00806 00807 <span class="keyword">protected</span>:00808 <span class="keywordtype">void</span> SetLastReceiveAddr(<span class="keywordtype">void</span> * addr, <span class="keywordtype">int</span> addrLen)00809 { <span class="keywordflow">if</span> (addrLen == <span class="keyword">sizeof</span>(in_addr)) lastReceiveToAddr = *(in_addr *)addr; }00810 00811 <a class="code" href="classPIPSocket_1_1Address.html">PIPSocket::Address</a> lastReceiveToAddr;00812 00813 <span class="preprocessor">#else</span>00814 <span class="preprocessor"></span><a name="l00820"></a><a class="code" href="classPIPSocket.html#a17">00820</a> BOOL <a class="code" href="classPIPSocket.html#a17">SetCaptureReceiveToAddress</a>()00821 { <span class="keywordflow">return</span> FALSE; }00822 <a name="l00826"></a><a class="code" href="classPIPSocket.html#a18">00826</a> <a class="code" href="classPIPSocket_1_1Address.html">PIPSocket::Address</a> <a class="code" href="classPIPSocket.html#a18">GetLastReceiveToAddress</a>()<span class="keyword"> const</span>00827 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <a class="code" href="classPIPSocket_1_1Address.html">PIPSocket::Address</a>(); }00828 00829 <span class="preprocessor">#endif</span>00830 <span class="preprocessor"></span>00831 <span class="comment">// Include platform dependent part of class</span>00832 <span class="preprocessor">#ifdef _WIN32</span>00833 <span class="preprocessor"></span><span class="preprocessor">#include "msos/ptlib/ipsock.h"</span>00834 <span class="preprocessor">#else</span>00835 <span class="preprocessor"></span><span class="preprocessor">#include "unix/ptlib/ipsock.h"</span>00836 <span class="preprocessor">#endif</span>00837 <span class="preprocessor"></span>};00838 00839 <span class="preprocessor">#endif</span>00840 <span class="preprocessor"></span>00841 00842 <span class="comment">// End Of File ///////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:11 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 + -