<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-cn">
		<id>http://wiki.ywrobot.net/index.php?action=history&amp;feed=atom&amp;title=IPAddress.h</id>
		<title>IPAddress.h - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.ywrobot.net/index.php?action=history&amp;feed=atom&amp;title=IPAddress.h"/>
		<link rel="alternate" type="text/html" href="http://wiki.ywrobot.net/index.php?title=IPAddress.h&amp;action=history"/>
		<updated>2026-05-14T11:01:31Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://wiki.ywrobot.net/index.php?title=IPAddress.h&amp;diff=68&amp;oldid=prev</id>
		<title>YWrobot WM：创建页面，内容为“&lt;pre style=&quot;color:blue&quot;&gt; /*  *  * MIT License:  * Copyright (c) 2011 Adrian McEwen  * Permission is hereby granted, free of charge, to any person obtaining a copy  *...”</title>
		<link rel="alternate" type="text/html" href="http://wiki.ywrobot.net/index.php?title=IPAddress.h&amp;diff=68&amp;oldid=prev"/>
				<updated>2016-04-25T02:05:50Z</updated>
		
		<summary type="html">&lt;p&gt;创建页面，内容为“&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt; /*  *  * MIT License:  * Copyright (c) 2011 Adrian McEwen  * Permission is hereby granted, free of charge, to any person obtaining a copy  *...”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 *&lt;br /&gt;
 * MIT License:&lt;br /&gt;
 * Copyright (c) 2011 Adrian McEwen&lt;br /&gt;
 * Permission is hereby granted, free of charge, to any person obtaining a copy&lt;br /&gt;
 * of this software and associated documentation files (the &amp;quot;Software&amp;quot;), to deal&lt;br /&gt;
 * in the Software without restriction, including without limitation the rights&lt;br /&gt;
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell&lt;br /&gt;
 * copies of the Software, and to permit persons to whom the Software is&lt;br /&gt;
 * furnished to do so, subject to the following conditions:&lt;br /&gt;
 * &lt;br /&gt;
 * The above copyright notice and this permission notice shall be included in&lt;br /&gt;
 * all copies or substantial portions of the Software.&lt;br /&gt;
 * &lt;br /&gt;
 * THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&lt;br /&gt;
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&lt;br /&gt;
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE&lt;br /&gt;
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER&lt;br /&gt;
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,&lt;br /&gt;
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN&lt;br /&gt;
 * THE SOFTWARE.&lt;br /&gt;
 *&lt;br /&gt;
 * adrianm@mcqn.com 1/1/2011&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
#ifndef IPAddress_h&lt;br /&gt;
#define IPAddress_h&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;Printable.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// A class to make it easier to handle and pass around IP addresses&lt;br /&gt;
&lt;br /&gt;
class IPAddress : public Printable {&lt;br /&gt;
private:&lt;br /&gt;
    uint8_t _address[4];  // IPv4 address&lt;br /&gt;
    // Access the raw byte array containing the address.  Because this returns a pointer&lt;br /&gt;
    // to the internal structure rather than a copy of the address this function should only&lt;br /&gt;
    // be used when you know that the usage of the returned uint8_t* will be transient and not&lt;br /&gt;
    // stored.&lt;br /&gt;
    uint8_t* raw_address() { return _address; };&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
    // Constructors&lt;br /&gt;
    IPAddress();&lt;br /&gt;
    IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet);&lt;br /&gt;
    IPAddress(uint32_t address);&lt;br /&gt;
    IPAddress(const uint8_t *address);&lt;br /&gt;
&lt;br /&gt;
    // Overloaded cast operator to allow IPAddress objects to be used where a pointer&lt;br /&gt;
    // to a four-byte uint8_t array is expected&lt;br /&gt;
    operator uint32_t() { return *((uint32_t*)_address); };&lt;br /&gt;
    bool operator==(const IPAddress&amp;amp; addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };&lt;br /&gt;
    bool operator==(const uint8_t* addr);&lt;br /&gt;
&lt;br /&gt;
    // Overloaded index operator to allow getting and setting individual octets of the address&lt;br /&gt;
    uint8_t operator[](int index) const { return _address[index]; };&lt;br /&gt;
    uint8_t&amp;amp; operator[](int index) { return _address[index]; };&lt;br /&gt;
&lt;br /&gt;
    // Overloaded copy operators to allow initialisation of IPAddress objects from other types&lt;br /&gt;
    IPAddress&amp;amp; operator=(const uint8_t *address);&lt;br /&gt;
    IPAddress&amp;amp; operator=(uint32_t address);&lt;br /&gt;
&lt;br /&gt;
    virtual size_t printTo(Print&amp;amp; p) const;&lt;br /&gt;
&lt;br /&gt;
    friend class EthernetClass;&lt;br /&gt;
    friend class UDP;&lt;br /&gt;
    friend class Client;&lt;br /&gt;
    friend class Server;&lt;br /&gt;
    friend class DhcpClass;&lt;br /&gt;
    friend class DNSClient;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const IPAddress INADDR_NONE(0,0,0,0);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>YWrobot WM</name></author>	</entry>

	</feed>