Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers thread_bbr_api.h Source File

thread_bbr_api.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2017-2018, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: BSD-3-Clause
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  *
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 3. Neither the name of the copyright holder nor the
00014  *    names of its contributors may be used to endorse or promote products
00015  *    derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00018  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
00021  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00022  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00023  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00025  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00026  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00027  * POSSIBILITY OF SUCH DAMAGE.
00028  */
00029 
00030 /**
00031  * \file thread_bbr_api.h
00032  * \brief Thread backbone border router (BBR) application interface.
00033  *
00034  * This is Thread backbone Border router service.
00035  * When started the module takes care of starting the
00036  * components that enables default border router functionality in Thread mesh network.
00037  *
00038  */
00039 
00040 #ifndef THREAD_BBR_API_H_
00041 #define THREAD_BBR_API_H_
00042 
00043 #include "ns_types.h"
00044 
00045 /**
00046  * Start backbone border router service.
00047  *
00048  * Enables the mDNS responder with default service name. <rand>-ARM-<Network name>
00049  * if backbone interface is enabled and allows routing.
00050  *    Publishes Default route with DHCP addressing
00051  *    Enables ND proxy
00052  *
00053  * \param interface_id Thread network interface id.
00054  * \param backbone_interface_id backbone interface id.
00055  *
00056  * \return 0 on success
00057  * \return <0 in case of errors
00058  *
00059  */
00060 int thread_bbr_start(int8_t interface_id, int8_t backbone_interface_id);
00061 
00062 /**
00063  * Set the bbr timeout values. Default timeout values are used if not called.
00064  *
00065  * If this function is called it will trigger the modification to thread network causing'
00066  * refreshing of registrations.
00067  *
00068  * \param interface_id interface ID of the Thread network.
00069  * \param timeout_a timeout a set. 0 = do not change.
00070  * \param timeout_b timeout_b set. 0 = do not change
00071  * \param delay Jitter delay value. 0 do not change
00072  *
00073  * \return 0 on success
00074  * \return <0 in case of errors
00075  *
00076  */
00077 int thread_bbr_timeout_set(int8_t interface_id, uint32_t timeout_a, uint32_t timeout_b, uint32_t delay);
00078 
00079 /**
00080  * Set prefix to be used as combining multiple thread networks on backbone.
00081  *
00082  * update prefix value
00083  *
00084  * \param interface_id interface ID of the Thread network.
00085  * \param prefix value must be buffer at the size of 8 bytes
00086  *
00087  * \return 0 on success
00088  * \return <0 in case of errors
00089  *
00090  */
00091 int thread_bbr_prefix_set(int8_t interface_id, uint8_t *prefix);
00092 
00093 /**
00094  * Set sequence number to be used by bbr
00095  *
00096  * update sequence number value
00097  *
00098  * \param interface_id interface ID of the Thread network.
00099  * \param sequence_number value that needs to be set on bbr
00100  *
00101  * \return 0 on success
00102  * \return <0 in case of errors
00103  *
00104  */
00105 int thread_bbr_sequence_number_set(int8_t interface_id, uint8_t sequence_number);
00106 
00107 /**
00108  * Set the Thread validation interface destination address.
00109  *
00110  * \param interface_id interface ID of the Thread network.
00111  * \param addr_ptr IPv6 address.
00112  * \param port UDP port.
00113  *
00114  * \return 0 on success
00115  * \return <0 in case of errors
00116  *
00117  */
00118 int thread_bbr_validation_interface_address_set(int8_t interface_id, const uint8_t *addr_ptr, uint16_t port);
00119 
00120 /**
00121  * Stop backbone Border router.
00122  *
00123  * \param interface_id interface ID of the Thread network
00124  *
00125  * \return 0 on success
00126  * \return <0 in case of errors
00127  *
00128  */
00129 void thread_bbr_stop(int8_t interface_id);
00130 
00131 
00132 #endif /* THREAD_BBR_API_H_ */