Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: net/base/net_util.cc

Issue 231973003: Adding network interface type param to net::NetworkInterface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/net_util.h ('k') | net/base/net_util_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/net_util.h" 5 #include "net/base/net_util.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 } 1777 }
1778 1778
1779 default: 1779 default:
1780 NOTREACHED(); 1780 NOTREACHED();
1781 } 1781 }
1782 } 1782 }
1783 1783
1784 return false; 1784 return false;
1785 } 1785 }
1786 1786
1787 NetworkInterface::NetworkInterface() : network_prefix(0) { 1787 NetworkInterface::NetworkInterface()
1788 : type(NETWORK_INTERFACE_UNKNOWN),
1789 network_prefix(0) {
1788 } 1790 }
1789 1791
1790 NetworkInterface::NetworkInterface(const std::string& name, 1792 NetworkInterface::NetworkInterface(const std::string& name,
1791 const std::string& friendly_name, 1793 const std::string& friendly_name,
1792 uint32 interface_index, 1794 uint32 interface_index,
1795 NetworkInterfaceType type,
1793 const IPAddressNumber& address, 1796 const IPAddressNumber& address,
1794 size_t network_prefix) 1797 size_t network_prefix)
1795 : name(name), 1798 : name(name),
1796 friendly_name(friendly_name), 1799 friendly_name(friendly_name),
1797 interface_index(interface_index), 1800 interface_index(interface_index),
1801 type(type),
1798 address(address), 1802 address(address),
1799 network_prefix(network_prefix) { 1803 network_prefix(network_prefix) {
1800 } 1804 }
1801 1805
1802 NetworkInterface::~NetworkInterface() { 1806 NetworkInterface::~NetworkInterface() {
1803 } 1807 }
1804 1808
1805 unsigned CommonPrefixLength(const IPAddressNumber& a1, 1809 unsigned CommonPrefixLength(const IPAddressNumber& a1,
1806 const IPAddressNumber& a2) { 1810 const IPAddressNumber& a2) {
1807 DCHECK_EQ(a1.size(), a2.size()); 1811 DCHECK_EQ(a1.size(), a2.size());
(...skipping 10 matching lines...) Expand all
1818 } 1822 }
1819 return a1.size() * CHAR_BIT; 1823 return a1.size() * CHAR_BIT;
1820 } 1824 }
1821 1825
1822 unsigned MaskPrefixLength(const IPAddressNumber& mask) { 1826 unsigned MaskPrefixLength(const IPAddressNumber& mask) {
1823 IPAddressNumber all_ones(mask.size(), 0xFF); 1827 IPAddressNumber all_ones(mask.size(), 0xFF);
1824 return CommonPrefixLength(mask, all_ones); 1828 return CommonPrefixLength(mask, all_ones);
1825 } 1829 }
1826 1830
1827 } // namespace net 1831 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util.h ('k') | net/base/net_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698