]> git.proxmox.com Git - mirror_frr.git/blame - lib/ldp_sync.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / lib / ldp_sync.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
24e7c5c8
KS
2/*
3 * Defines and structures common to LDP-Sync for OSPFv2 and OSPFv3 and ISIS
4 * Copyright (C) 2020 Volta Networks, Inc.
24e7c5c8
KS
5 */
6
7#ifndef _LIBLDPSYNC_H
8#define _LIBLDPSYNC_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
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 */
19
20#define LDP_IGP_SYNC_DEFAULT 0
21#define LDP_IGP_SYNC_ENABLED 1
22
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
26
27#define LDP_IGP_SYNC_HOLDDOWN_DEFAULT 0
28
24e7c5c8
KS
29/* LDP-IGP Sync structures */
30struct ldp_sync_info_cmd {
31 uint16_t flags;
32 uint16_t holddown; /* timer value */
24e7c5c8
KS
33};
34
35struct 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 */
42};
43
44/* Prototypes. */
45extern struct ldp_sync_info *ldp_sync_info_create(void);
46extern bool ldp_sync_if_is_enabled(struct ldp_sync_info *ldp_sync_info);
47extern bool ldp_sync_if_down(struct ldp_sync_info *ldp_sync_info);
48extern void ldp_sync_info_free(struct ldp_sync_info **ldp_sync_info);
49
50struct ldp_igp_sync_announce {
51 int proto;
52};
53
54struct ldp_igp_sync_if_state {
55 ifindex_t ifindex;
56 bool sync_start;
57};
58
59struct ldp_igp_sync_if_state_req {
60 int proto;
61 ifindex_t ifindex;
62 char name[INTERFACE_NAMSIZ];
63};
64
24e7c5c8
KS
65#ifdef __cplusplus
66}
67#endif
68
69#endif /* _LIBLDPSYNC_H */