Home | History | Annotate | Line # | Download | only in ServiceRegistration
      1  1.1  christos /* route-tracker.h
      2  1.1  christos  *
      3  1.1  christos  * Copyright (c) 2023 Apple Inc. All rights reserved.
      4  1.1  christos  *
      5  1.1  christos  * Licensed under the Apache License, Version 2.0 (the "License");
      6  1.1  christos  * you may not use this file except in compliance with the License.
      7  1.1  christos  * You may obtain a copy of the License at
      8  1.1  christos  *
      9  1.1  christos  *     https://www.apache.org/licenses/LICENSE-2.0
     10  1.1  christos  *
     11  1.1  christos  * Unless required by applicable law or agreed to in writing, software
     12  1.1  christos  * distributed under the License is distributed on an "AS IS" BASIS,
     13  1.1  christos  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  1.1  christos  * See the License for the specific language governing permissions and
     15  1.1  christos  * limitations under the License.
     16  1.1  christos  *
     17  1.1  christos  * This file contains interface definitions for a route tracker for tracking prefixes and routes on infrastructure so
     18  1.1  christos  * that they can be published on the Thread network.
     19  1.1  christos  */
     20  1.1  christos 
     21  1.1  christos #ifndef __ROUTE_TRACKER_H__
     22  1.1  christos #define __ROUTE_TRACKER_H__ 1
     23  1.1  christos 
     24  1.1  christos typedef struct route_tracker route_tracker_t;
     25  1.1  christos 
     26  1.1  christos #ifndef BUILD_TEST_ENTRY_POINTS
     27  1.1  christos RELEASE_RETAIN_DECLS(route_tracker);
     28  1.1  christos #define route_tracker_retain(watcher) route_tracker_retain_(watcher, __FILE__, __LINE__)
     29  1.1  christos #define route_tracker_release(watcher) route_tracker_release_(watcher, __FILE__, __LINE__)
     30  1.1  christos #else
     31  1.1  christos typedef struct route_state route_state_t;
     32  1.1  christos typedef struct interface interface_t;
     33  1.1  christos #endif // BUILD_TEST_ENTRY_POINTS
     34  1.1  christos 
     35  1.1  christos // Cancel the tracker.
     36  1.1  christos void route_tracker_cancel(route_tracker_t *NONNULL tracker);
     37  1.1  christos 
     38  1.1  christos // Create a route tracker.
     39  1.1  christos route_tracker_t *NULLABLE route_tracker_create(route_state_t *NONNULL route_state, const char *NONNULL name);
     40  1.1  christos void route_tracker_set_reconnect_callback(route_tracker_t *NONNULL route_tracker,
     41  1.1  christos                                           void (*NULLABLE reconnect_callback)(void *NULLABLE context));
     42  1.1  christos void route_tracker_start(route_tracker_t *NONNULL tracker);
     43  1.1  christos void route_tracker_shutdown(route_state_t *NULLABLE route_state);
     44  1.1  christos bool route_tracker_check_for_gua_prefixes_on_infrastructure(route_tracker_t *NULLABLE tracker);
     45  1.1  christos #ifndef BUILD_TEST_ENTRY_POINTS
     46  1.1  christos void route_tracker_route_state_changed(route_tracker_t *NONNULL tracker, interface_t *NULLABLE interface);
     47  1.1  christos void route_tracker_interface_configuration_changed(route_tracker_t *NONNULL tracker);
     48  1.1  christos void route_tracker_monitor_mesh_routes(route_tracker_t *NONNULL tracker, cti_route_vec_t *NONNULL routes);
     49  1.1  christos bool route_tracker_local_routes_seen(route_tracker_t *NULLABLE tracker);
     50  1.1  christos #else //  BUILD_TEST_ENTRY_POINTS
     51  1.1  christos void route_tracker_test_start(int iterations);
     52  1.1  christos #endif //  BUILD_TEST_ENTRY_POINTS
     53  1.1  christos #endif // __ROUTE_TRACKER_H__
     54  1.1  christos 
     55  1.1  christos // Local Variables:
     56  1.1  christos // mode: C
     57  1.1  christos // tab-width: 4
     58  1.1  christos // c-file-style: "bsd"
     59  1.1  christos // c-basic-offset: 4
     60  1.1  christos // fill-column: 120
     61  1.1  christos // indent-tabs-mode: nil
     62  1.1  christos // End:
     63