Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers topo_trace.h Source File

topo_trace.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2014-2017, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 #ifndef TOPO_TRACE_H
00018 #define TOPO_TRACE_H
00019 
00020 #include "ns_types.h"
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 /**
00027  * \file topo_trace.h
00028  * \brief test API to trace the network topology
00029  */
00030 
00031 #ifndef HAVE_TOPO_TRACE
00032 /* Use DUMMY functions if not required. */
00033 /** \cond DOXYGEN_IGNORE */
00034 #define topo_trace(type, address, update_type) ((void) 0)
00035 /** \endcond */
00036 
00037 #else /* HAVE_TOPO_TRACE */
00038 
00039 enum topo_type {
00040     TOPOLOGY_RPL,
00041     TOPOLOGY_MLE,
00042     TOPOLOGY_THREAD,
00043 };
00044 
00045 enum topo_update {
00046     TOPO_CLEAR = 2, // Clear all links of specified type to any address.
00047     TOPO_ADD = 1,   // Add a link of specified type to specified address.
00048     TOPO_REMOVE = 0 // Remove a link of specified type to specified address.
00049 };
00050 
00051 /** Modify topology tables.
00052  *
00053  * Add or remove entries to external topology tracer.
00054  *
00055  * \param topo_type Topology link type.
00056  * \param address EUI-64 address.
00057  * \param update_type Add or remove address.
00058  */
00059 void topo_trace(enum topo_type type, const uint8_t address[static 8], enum topo_update update_type);
00060 
00061 #endif
00062 
00063 #ifdef __cplusplus
00064 }
00065 #endif
00066 
00067 #endif /* TOPO_TRACE_H */