2 * Copyright (c) 2017 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef __VOM_RA_PREFIX_H__
17 #define __VOM_RA_PREFIX_H__
19 #include "vom/prefix.hpp"
21 #include <vapi/ip.api.vapi.hpp>
25 * A representation of RA prefix configuration on given interface
31 * Construct a new object matching the desried state
33 ra_prefix(const route::prefix_t& pfx,
36 uint32_t val_lifetime,
37 uint32_t pref_lifetime);
42 ra_prefix(const ra_prefix& o) = default;
47 ~ra_prefix() = default;
50 * convert to string format for debug purposes
52 std::string to_string() const;
55 * Return the prefix associated with this ra prefix
57 const route::prefix_t& prefix() const;
60 * Comparison operator - only used for UT
62 bool operator==(const ra_prefix& ra_prefix) const;
65 * Convert the ra prefix configuration to Vpp Api
67 void to_vpp(vapi_payload_sw_interface_ip6nd_ra_prefix& ra_prefix) const;
71 * The prefix to be advertised.
73 route::prefix_t m_pfx;
76 * Revert to default settings.
78 uint8_t m_use_default;
81 * Do not send full router address in prefix advertisement.
82 * Default is to advertise.
84 uint8_t m_no_advertise;
87 * Prefix is off-link. Default is on-link.
92 * Do not use prefix for autoconfiguration.
93 * Default is autoconfig.
95 uint8_t m_no_autoconfig;
98 * Do not use prefix for onlink determination.
99 * Default is on-link (this flag is off).
104 * <valid-lifetime>' is the length of time in seconds during what
105 * the prefix is valid for the purpose of on-link determination.
107 * Range is 7203 to 2592000 seconds and default is 2592000 seconds.
108 * A value of all one bits (0xffffffff) represents infinity (no
111 uint32_t m_val_lifetime;
114 * '<pref-lifetime>' is the prefered-lifetime and is the length of
115 * time in seconds during what addresses generated from the prefix
118 * Range is 0 to 604800 seconds and default is 604800 seconds.
119 * A value of all one bits (0xffffffff) represents infinity (no
122 uint32_t m_pref_lifetime;
127 * fd.io coding-style-patch-verification: ON
130 * eval: (c-set-style "mozilla")