1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Defines and structures common to LDP-Sync for OSPFv2 and OSPFv3 and ISIS
4 * Copyright (C) 2020 Volta Networks, Inc.
14 /* LDP-IGP Sync values */
15 #define LDP_SYNC_FLAG_ENABLE (1 << 0) /* LDP-SYNC enabled */
16 #define LDP_SYNC_FLAG_HOLDDOWN (1 << 1) /* Holddown timer enabled */
17 #define LDP_SYNC_FLAG_IF_CONFIG (1 << 2) /* LDP-SYNC enabled on interface */
18 #define LDP_SYNC_FLAG_SET_METRIC (1 << 3) /* Metric has been set on ISIS intf */
20 #define LDP_IGP_SYNC_DEFAULT 0
21 #define LDP_IGP_SYNC_ENABLED 1
23 #define LDP_IGP_SYNC_STATE_NOT_REQUIRED 0
24 #define LDP_IGP_SYNC_STATE_REQUIRED_NOT_UP 1
25 #define LDP_IGP_SYNC_STATE_REQUIRED_UP 2
27 #define LDP_IGP_SYNC_HOLDDOWN_DEFAULT 0
29 /* LDP-IGP Sync structures */
30 struct ldp_sync_info_cmd
{
32 uint16_t holddown
; /* timer value */
35 struct ldp_sync_info
{
36 uint16_t flags
; /* indicate if set on interface or globally */
37 uint8_t enabled
; /* enabled */
38 uint8_t state
; /* running state */
39 uint16_t holddown
; /* timer value */
40 struct thread
*t_holddown
; /* holddown timer*/
41 uint32_t metric
[2]; /* isis interface metric */
45 extern struct ldp_sync_info
*ldp_sync_info_create(void);
46 extern bool ldp_sync_if_is_enabled(struct ldp_sync_info
*ldp_sync_info
);
47 extern bool ldp_sync_if_down(struct ldp_sync_info
*ldp_sync_info
);
48 extern void ldp_sync_info_free(struct ldp_sync_info
**ldp_sync_info
);
50 struct ldp_igp_sync_announce
{
54 struct ldp_igp_sync_if_state
{
59 struct ldp_igp_sync_if_state_req
{
62 char name
[INTERFACE_NAMSIZ
];
69 #endif /* _LIBLDPSYNC_H */