A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
radvd-prefix.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 Strasbourg University
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
7 */
8
9#ifndef RADVD_PREFIX_H
10#define RADVD_PREFIX_H
11
12#include "ns3/ipv6-address.h"
13#include "ns3/simple-ref-count.h"
14
15#include <stdint.h>
16
17namespace ns3
18{
19
20/**
21 * @ingroup radvd
22 * @brief Router prefix for radvd application.
23 */
24class RadvdPrefix : public SimpleRefCount<RadvdPrefix>
25{
26 public:
27 /**
28 * @brief Constructor.
29 * @param network network prefix advertised
30 * @param prefixLength prefix length ( 0 < x <= 128)
31 * @param preferredLifeTime preferred life time in seconds (default 7 days)
32 * @param validLifeTime valid life time in seconds (default 30 days)
33 * @param onLinkFlag on link flag
34 * @param autonomousFlag autonomous link flag
35 * @param routerAddrFlag router address flag (for Mobile IPv6)
36 */
38 uint8_t prefixLength,
39 uint32_t preferredLifeTime = 604800,
40 uint32_t validLifeTime = 2592000,
41 bool onLinkFlag = true,
42 bool autonomousFlag = true,
43 bool routerAddrFlag = false);
44
45 /**
46 * @brief Destructor.
47 */
49
50 /**
51 * @brief Get network prefix.
52 * @return network prefix
53 */
54 Ipv6Address GetNetwork() const;
55
56 /**
57 * @brief Set network prefix.
58 * @param network network prefix
59 */
60 void SetNetwork(Ipv6Address network);
61
62 /**
63 * @brief Get prefix length.
64 * @return prefix length
65 */
66 uint8_t GetPrefixLength() const;
67
68 /**
69 * @brief Set prefix length.
70 * @param prefixLength prefix length
71 */
72 void SetPrefixLength(uint8_t prefixLength);
73
74 /**
75 * @brief Get preferred lifetime.
76 * @return lifetime
77 */
79
80 /**
81 * @brief Set preferred lifetime.
82 * @param preferredLifeTime lifetime
83 */
84 void SetPreferredLifeTime(uint32_t preferredLifeTime);
85
86 /**
87 * @brief Get valid lifetime.
88 * @return lifetime
89 */
91
92 /**
93 * @brief Set valid lifetime.
94 * @param validLifeTime lifetime
95 */
96 void SetValidLifeTime(uint32_t validLifeTime);
97
98 /**
99 * @brief Is on-link flag ?
100 * @return true if on-link is activated, false otherwise
101 */
102 bool IsOnLinkFlag() const;
103
104 /**
105 * @brief Set on-link flag.
106 * @param onLinkFlag value
107 */
108 void SetOnLinkFlag(bool onLinkFlag);
109
110 /**
111 * @brief Is autonomous flag ?
112 * @return true if autonomous is activated, false otherwise
113 */
114 bool IsAutonomousFlag() const;
115
116 /**
117 * @brief Set autonomous flag.
118 * @param autonomousFlag value
119 */
120 void SetAutonomousFlag(bool autonomousFlag);
121
122 /**
123 * @brief Is router address flag ?
124 * @return true if router address is activated, false otherwise
125 */
126 bool IsRouterAddrFlag() const;
127
128 /**
129 * @brief Set router address flag.
130 * @param routerAddrFlag value
131 */
132 void SetRouterAddrFlag(bool routerAddrFlag);
133
134 private:
135 /**
136 * @brief Network prefix.
137 */
139
140 /**
141 * @brief Prefix length.
142 */
144
145 /**
146 * @brief Preferred time.
147 */
149
150 /**
151 * @brief Valid time.
152 */
154
155 /**
156 * @brief On link flag, indicates that this prefix can be used for on-link determination.
157 */
159
160 /**
161 * @brief Autonomous flag, it is used for autonomous address configuration (\RFC{2462}).
162 */
164
165 /**
166 * @brief Router address flag, indicates that router address is sent instead
167 * of network prefix as is required by Mobile IPv6.
168 */
170};
171
172} /* namespace ns3 */
173
174#endif /* RADVD_PREFIX_H */
Describes an IPv6 address.
Router prefix for radvd application.
void SetAutonomousFlag(bool autonomousFlag)
Set autonomous flag.
bool m_routerAddrFlag
Router address flag, indicates that router address is sent instead of network prefix as is required b...
void SetOnLinkFlag(bool onLinkFlag)
Set on-link flag.
void SetNetwork(Ipv6Address network)
Set network prefix.
uint32_t m_preferredLifeTime
Preferred time.
void SetPreferredLifeTime(uint32_t preferredLifeTime)
Set preferred lifetime.
uint32_t GetPreferredLifeTime() const
Get preferred lifetime.
void SetValidLifeTime(uint32_t validLifeTime)
Set valid lifetime.
uint32_t GetValidLifeTime() const
Get valid lifetime.
uint8_t GetPrefixLength() const
Get prefix length.
uint8_t m_prefixLength
Prefix length.
bool m_onLinkFlag
On link flag, indicates that this prefix can be used for on-link determination.
void SetRouterAddrFlag(bool routerAddrFlag)
Set router address flag.
bool m_autonomousFlag
Autonomous flag, it is used for autonomous address configuration (RFC 2462 ).
Ipv6Address GetNetwork() const
Get network prefix.
Ipv6Address m_network
Network prefix.
bool IsRouterAddrFlag() const
Is router address flag ?
RadvdPrefix(Ipv6Address network, uint8_t prefixLength, uint32_t preferredLifeTime=604800, uint32_t validLifeTime=2592000, bool onLinkFlag=true, bool autonomousFlag=true, bool routerAddrFlag=false)
Constructor.
~RadvdPrefix()
Destructor.
uint32_t m_validLifeTime
Valid time.
bool IsAutonomousFlag() const
Is autonomous flag ?
bool IsOnLinkFlag() const
Is on-link flag ?
void SetPrefixLength(uint8_t prefixLength)
Set prefix length.
A template-based reference counting class.
Every class exported by the ns3 library is enclosed in the ns3 namespace.