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.
18 #include "vom/ra_config.hpp"
20 DEFINE_VAPI_MSG_IDS_IP6_ND_API_JSON;
25 * Construct a new object matching the desried state
27 ra_config::ra_config(uint8_t suppress,
29 uint8_t default_router,
30 uint32_t max_interval)
31 : m_suppress(suppress)
35 , m_send_unicast(send_unicast)
37 , m_default_router(default_router)
38 , m_max_interval(max_interval)
39 , m_min_interval((max_interval * 3) / 4)
42 , m_initial_interval(16)
46 ra_config::to_vpp(vapi_payload_sw_interface_ip6nd_ra_config& ra_config) const
48 ra_config.suppress = m_suppress;
49 ra_config.managed = m_managed;
50 ra_config.other = m_other;
51 ra_config.ll_option = m_ll_option;
52 ra_config.send_unicast = m_send_unicast;
53 ra_config.cease = m_cease;
54 ra_config.max_interval = m_max_interval;
55 ra_config.min_interval = m_min_interval;
56 ra_config.lifetime = m_lifetime;
57 ra_config.initial_count = m_initial_count;
58 ra_config.initial_interval = m_initial_interval;
62 ra_config::operator==(const ra_config& other) const
64 return ((m_suppress == other.m_suppress) &&
65 (m_send_unicast == other.m_send_unicast) &&
66 (m_default_router == other.m_default_router) &&
67 (m_max_interval == other.m_max_interval));
71 ra_config::to_string() const
76 << " suppress:" << m_suppress << " send-unicast:" << m_send_unicast
77 << " default-router:" << m_default_router
78 << " max_interval:" << m_max_interval << "]";
84 * fd.io coding-style-patch-verification: ON
87 * eval: (c-set-style "mozilla")