]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zebra_pw.h
*: auto-convert to SPDX License IDs
[mirror_frr.git] / zebra / zebra_pw.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
6833ae01 2/* Zebra PW code
3 * Copyright (C) 2016 Volta Networks, Inc.
6833ae01 4 */
5
6#ifndef ZEBRA_PW_H_
7#define ZEBRA_PW_H_
8
9#include <net/if.h>
10#include <netinet/in.h>
11
bf094f69
QY
12#include "lib/hook.h"
13#include "lib/qobj.h"
14#include "lib/pw.h"
15
16#include "zebra/zebra_vrf.h"
6833ae01 17
51e94aa7
EDP
18#ifdef __cplusplus
19extern "C" {
20#endif
21
6833ae01 22#define PW_INSTALL_RETRY_INTERVAL 30
23
24struct zebra_pw {
2dd0d726 25 RB_ENTRY(zebra_pw) pw_entry, static_pw_entry;
6833ae01 26 vrf_id_t vrf_id;
3682bd90 27 char ifname[INTERFACE_NAMSIZ];
6833ae01 28 ifindex_t ifindex;
29 int type;
30 int af;
31 union g_addr nexthop;
32 uint32_t local_label;
33 uint32_t remote_label;
34 uint8_t flags;
35 union pw_protocol_fields data;
36 int enabled;
37 int status;
38 uint8_t protocol;
39 struct zserv *client;
731a75fe 40 struct rnh *rnh;
6833ae01 41 struct thread *install_retry_timer;
96244aca 42 QOBJ_FIELDS;
6833ae01 43};
96244aca 44DECLARE_QOBJ_TYPE(zebra_pw);
6833ae01 45
46RB_HEAD(zebra_pw_head, zebra_pw);
2dd0d726
RW
47RB_PROTOTYPE(zebra_pw_head, zebra_pw, pw_entry, zebra_pw_compare);
48
49RB_HEAD(zebra_static_pw_head, zebra_pw);
50RB_PROTOTYPE(zebra_static_pw_head, zebra_pw, static_pw_entry, zebra_pw_compare);
6833ae01 51
8451921b
DL
52DECLARE_HOOK(pw_install, (struct zebra_pw * pw), (pw));
53DECLARE_HOOK(pw_uninstall, (struct zebra_pw * pw), (pw));
6833ae01 54
97d8d05a
MS
55struct zebra_pw *zebra_pw_add(struct zebra_vrf *zvrf, const char *ifname,
56 uint8_t protocol, struct zserv *client);
6833ae01 57void zebra_pw_del(struct zebra_vrf *, struct zebra_pw *);
58void zebra_pw_change(struct zebra_pw *, ifindex_t, int, int, union g_addr *,
59 uint32_t, uint32_t, uint8_t, union pw_protocol_fields *);
60struct zebra_pw *zebra_pw_find(struct zebra_vrf *, const char *);
61void zebra_pw_update(struct zebra_pw *);
fd563cc7 62void zebra_pw_install_failure(struct zebra_pw *pw, int pwstatus);
6833ae01 63void zebra_pw_init(struct zebra_vrf *);
64void zebra_pw_exit(struct zebra_vrf *);
2dd0d726 65void zebra_pw_vty_init(void);
6833ae01 66
51e94aa7
EDP
67#ifdef __cplusplus
68}
69#endif
70
6833ae01 71#endif /* ZEBRA_PW_H_ */