]> git.proxmox.com Git - mirror_frr.git/blob - lib/ldp_sync.h
Merge pull request #8078 from idryzhov/fix-zebra-vni
[mirror_frr.git] / lib / ldp_sync.h
1 /*
2 * Defines and structures common to LDP-Sync for OSPFv2 and OSPFv3 and ISIS
3 * Copyright (C) 2020 Volta Networks, Inc.
4 *
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)
8 * any later version.
9 *
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
13 * more details.
14 *
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
18 */
19
20 #ifndef _LIBLDPSYNC_H
21 #define _LIBLDPSYNC_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
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 */
32
33 #define LDP_IGP_SYNC_DEFAULT 0
34 #define LDP_IGP_SYNC_ENABLED 1
35
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
39
40 #define LDP_IGP_SYNC_HOLDDOWN_DEFAULT 0
41
42 /* LDP-IGP Sync structures */
43 struct ldp_sync_info_cmd {
44 uint16_t flags;
45 uint16_t holddown; /* timer value */
46 };
47
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 */
55 };
56
57 /* Prototypes. */
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);
62
63 struct ldp_igp_sync_announce {
64 int proto;
65 };
66
67 struct ldp_igp_sync_if_state {
68 ifindex_t ifindex;
69 bool sync_start;
70 };
71
72 struct ldp_igp_sync_if_state_req {
73 int proto;
74 ifindex_t ifindex;
75 char name[INTERFACE_NAMSIZ];
76 };
77
78 #ifdef __cplusplus
79 }
80 #endif
81
82 #endif /* _LIBLDPSYNC_H */