author | Tom Henderson <tomh@tomh.org> |
Wed, 08 Apr 2009 16:07:34 -0700 | |
changeset 4373 | e493e80274bd |
child 4381 | 3e6c3e4b55bd |
permissions | -rw-r--r-- |
4373
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
2 |
/* |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
3 |
* Copyright (c) 2005 INRIA |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
4 |
* |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
8 |
* |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
13 |
* |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
17 |
* |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
19 |
*/ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
20 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
21 |
#include "ns3/log.h" |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
22 |
#include "ns3/assert.h" |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
23 |
#include "ipv4-interface-address.h" |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
24 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
25 |
NS_LOG_COMPONENT_DEFINE("Ipv4InterfaceAddress"); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
26 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
27 |
namespace ns3 { |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
28 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
29 |
Ipv4InterfaceAddress::Ipv4InterfaceAddress () |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
30 |
: m_scope (GLOBAL), |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
31 |
m_secondary (false) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
32 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
33 |
NS_LOG_FUNCTION (this); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
34 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
35 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
36 |
Ipv4InterfaceAddress::Ipv4InterfaceAddress (Ipv4Address local, Ipv4Mask mask) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
37 |
: m_scope (GLOBAL), |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
38 |
m_secondary (false) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
39 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
40 |
NS_LOG_FUNCTION (this); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
41 |
m_local = local; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
42 |
m_mask = mask; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
43 |
m_broadcast = Ipv4Address (local.Get () | (~mask.Get ())); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
44 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
45 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
46 |
Ipv4InterfaceAddress::Ipv4InterfaceAddress (const Ipv4InterfaceAddress &o) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
47 |
: m_local (o.m_local), |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
48 |
m_peer (o.m_peer), |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
49 |
m_mask (o.m_mask), |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
50 |
m_broadcast (o.m_broadcast), |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
51 |
m_scope (o.m_scope), |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
52 |
m_secondary (o.m_secondary) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
53 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
54 |
NS_LOG_FUNCTION (this); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
55 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
56 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
57 |
void |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
58 |
Ipv4InterfaceAddress::SetLocal (Ipv4Address local) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
59 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
60 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
61 |
m_local = local; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
62 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
63 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
64 |
Ipv4Address |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
65 |
Ipv4InterfaceAddress::GetLocal (void) const |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
66 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
67 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
68 |
return m_local; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
69 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
70 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
71 |
void |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
72 |
Ipv4InterfaceAddress::SetPeer (Ipv4Address peer) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
73 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
74 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
75 |
m_peer = peer; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
76 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
77 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
78 |
Ipv4Address |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
79 |
Ipv4InterfaceAddress::GetPeer (void) const |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
80 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
81 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
82 |
return m_peer; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
83 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
84 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
85 |
void |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
86 |
Ipv4InterfaceAddress::SetMask (Ipv4Mask mask) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
87 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
88 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
89 |
m_mask = mask; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
90 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
91 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
92 |
Ipv4Mask |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
93 |
Ipv4InterfaceAddress::GetMask (void) const |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
94 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
95 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
96 |
return m_mask; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
97 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
98 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
99 |
void |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
100 |
Ipv4InterfaceAddress::SetBroadcast (Ipv4Address broadcast) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
101 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
102 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
103 |
m_broadcast = broadcast; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
104 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
105 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
106 |
Ipv4Address |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
107 |
Ipv4InterfaceAddress::GetBroadcast (void) const |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
108 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
109 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
110 |
return m_broadcast; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
111 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
112 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
113 |
void |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
114 |
Ipv4InterfaceAddress::SetScope (Ipv4InterfaceAddress::InterfaceAddressScope_e scope) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
115 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
116 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
117 |
m_scope = scope; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
118 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
119 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
120 |
Ipv4InterfaceAddress::InterfaceAddressScope_e |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
121 |
Ipv4InterfaceAddress::GetScope (void) const |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
122 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
123 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
124 |
return m_scope; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
125 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
126 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
127 |
bool |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
128 |
Ipv4InterfaceAddress::IsSecondary (void) const |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
129 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
130 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
131 |
return m_secondary; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
132 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
133 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
134 |
void |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
135 |
Ipv4InterfaceAddress::SetSecondary (void) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
136 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
137 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
138 |
m_secondary = true; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
139 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
140 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
141 |
void |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
142 |
Ipv4InterfaceAddress::SetPrimary (void) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
143 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
144 |
NS_LOG_FUNCTION_NOARGS (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
145 |
m_secondary = false; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
146 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
147 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
148 |
std::ostream& operator<< (std::ostream& os, const Ipv4InterfaceAddress &addr) |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
149 |
{ |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
150 |
os << "m_local=" << addr.GetLocal () << "; m_peer=" << addr.GetPeer () << "; m_mask=" << |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
151 |
addr.GetMask () << "; m_broadcast=" << addr.GetBroadcast () << "; m_scope=" << addr.GetScope() << |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
152 |
"; m_secondary=" << addr.IsSecondary (); |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
153 |
return os; |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
154 |
} |
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
155 |
|
e493e80274bd
implementation and plumbing of Ipv4InterfaceAddress class
Tom Henderson <tomh@tomh.org>
parents:
diff
changeset
|
156 |
} // namespace ns3 |