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"
23 * Construct a new object matching the desried state
25 ra_config::ra_config(uint8_t suppress,
27 uint8_t default_router,
28 uint32_t max_interval)
29 : m_suppress(suppress)
33 , m_send_unicast(send_unicast)
35 , m_default_router(default_router)
36 , m_max_interval(max_interval)
37 , m_min_interval((max_interval * 3) / 4)
40 , m_initial_interval(16)
45 ra_config::to_vpp(vapi_payload_sw_interface_ip6nd_ra_config& ra_config) const
47 ra_config.suppress = m_suppress;
48 ra_config.managed = m_managed;
49 ra_config.other = m_other;
50 ra_config.ll_option = m_ll_option;
51 ra_config.send_unicast = m_send_unicast;
52 ra_config.cease = m_cease;
53 ra_config.max_interval = m_max_interval;
54 ra_config.min_interval = m_min_interval;
55 ra_config.lifetime = m_lifetime;
56 ra_config.initial_count = m_initial_count;
57 ra_config.initial_interval = m_initial_interval;
61 ra_config::operator==(const ra_config& other) const
63 return ((m_suppress == other.m_suppress) &&
64 (m_send_unicast == other.m_send_unicast) &&
65 (m_default_router == other.m_default_router) &&
66 (m_max_interval == other.m_max_interval));
70 ra_config::to_string() const
75 << " suppress:" << m_suppress << " send-unicast:" << m_send_unicast
76 << " default-router:" << m_default_router
77 << " max_interval:" << m_max_interval << "]";
83 * fd.io coding-style-patch-verification: ON
86 * eval: (c-set-style "mozilla")