2 * Defines and structures common to LDP-Sync for OSPFv2 and OSPFv3 and ISIS
3 * Copyright (C) 2020 Volta Networks, Inc.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 /* LDP-IGP Sync values */
28 #define LDP_SYNC_FLAG_ENABLE (1 << 0) /* LDP-SYNC enabled */
29 #define LDP_SYNC_FLAG_HOLDDOWN (1 << 1) /* Holddown timer enabled */
30 #define LDP_SYNC_FLAG_IF_CONFIG (1 << 2) /* LDP-SYNC enabled on interface */
31 #define LDP_SYNC_FLAG_SET_METRIC (1 << 3) /* Metric has been set on ISIS intf */
33 #define LDP_IGP_SYNC_DEFAULT 0
34 #define LDP_IGP_SYNC_ENABLED 1
36 #define LDP_IGP_SYNC_STATE_NOT_REQUIRED 0
37 #define LDP_IGP_SYNC_STATE_REQUIRED_NOT_UP 1
38 #define LDP_IGP_SYNC_STATE_REQUIRED_UP 2
40 #define LDP_IGP_SYNC_HOLDDOWN_DEFAULT 0
42 /* LDP-IGP Sync structures */
43 struct ldp_sync_info_cmd
{
45 uint16_t holddown
; /* timer value */
48 struct ldp_sync_info
{
49 uint16_t flags
; /* indicate if set on interface or globally */
50 uint8_t enabled
; /* enabled */
51 uint8_t state
; /* running state */
52 uint16_t holddown
; /* timer value */
53 struct thread
*t_holddown
; /* holddown timer*/
54 uint32_t metric
[2]; /* isis interface metric */
58 extern struct ldp_sync_info
*ldp_sync_info_create(void);
59 extern bool ldp_sync_if_is_enabled(struct ldp_sync_info
*ldp_sync_info
);
60 extern bool ldp_sync_if_down(struct ldp_sync_info
*ldp_sync_info
);
61 extern void ldp_sync_info_free(struct ldp_sync_info
**ldp_sync_info
);
63 struct ldp_igp_sync_announce
{
67 struct ldp_igp_sync_if_state
{
72 struct ldp_igp_sync_if_state_req
{
75 char name
[INTERFACE_NAMSIZ
];
82 #endif /* _LIBLDPSYNC_H */