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_CONFIG_H__
17 #define __VOM_RA_CONFIG_H__
19 #include <vapi/ip.api.vapi.hpp>
23 * A representation of Router Advertisement configuration
29 * Construct a new object matching the desried state
31 ra_config(uint8_t suppress,
33 uint8_t default_router,
34 uint32_t max_interval);
39 ra_config(const ra_config& o) = default;
44 ~ra_config() = default;
47 * convert to string format for debug purposes
49 std::string to_string() const;
52 * Comparison operator - only used for UT
54 bool operator==(const ra_config& ra_config) const;
57 * convert the ra config to VPP API
59 void to_vpp(vapi_payload_sw_interface_ip6nd_ra_config& ra_config) const;
63 * Disables sending ICMPv6 router-advertisement messages.
68 * Advertises in ICMPv6 router-advertisement messages to use
69 * stateful address auto-configuration to obtain address information.
74 * Indicates in ICMPv6 router-advertisement messages that
75 * hosts use stateful auto configuration to obtain nonaddress
76 * related information.
81 * Indicates not to include the optional source link-layer
82 * address in the ICMPv6 router-advertisement messages.
87 * Use the source address of the router-solicitation message if
90 uint8_t m_send_unicast;
93 * Cease sending ICMPv6 router-advertisement messages.
100 uint8_t m_default_router;
103 * Configures the interval between sending ICMPv6 router-advertisement
104 * messages. The range for max-interval is from 4 to 200 seconds.
106 uint32_t m_max_interval;
109 * min-interval can not be more than 75% of max-interval.
110 * If not set, min-interval will be set to 75% of max-interval.
111 * The range for min-interval is from 3 to 150 seconds.
113 uint32_t m_min_interval;
116 * Advertises the lifetime of a default router in ICMPv6
117 * router-advertisement messages. The range is from 0 to 9000 seconds.
118 * '<lifetime>' must be greater than '<max-interval>'.
119 * The default value is 600 seconds
124 * Number of initial ICMPv6 router-advertisement messages sent.
125 * Range for count is 1 - 3 and default is 3.
127 uint32_t m_initial_count;
130 * The interval between each initial messages.
131 * Range for interval is 1 to 16 seconds, and default is 16 seconds.
133 uint32_t m_initial_interval;
138 * fd.io coding-style-patch-verification: ON
141 * eval: (c-set-style "mozilla")