1 /* Zebra's client header.
2 * Copyright (C) 2020 Netdef, Inc.
4 * This file is part of GNU Zebra.
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #include "zebra/zebra_mpls.h"
26 #include "lib/zclient.h"
33 enum zebra_sr_policy_update_label_mode
{
34 ZEBRA_SR_POLICY_LABEL_CREATED
= 1,
35 ZEBRA_SR_POLICY_LABEL_UPDATED
= 2,
36 ZEBRA_SR_POLICY_LABEL_REMOVED
= 3,
39 struct zebra_sr_policy
{
40 RB_ENTRY(zebra_sr_policy
) entry
;
42 struct ipaddr endpoint
;
43 char name
[SRTE_POLICY_NAME_MAX_LENGTH
];
44 enum zebra_sr_policy_status status
;
45 struct zapi_srte_tunnel segment_list
;
47 struct zebra_vrf
*zvrf
;
49 RB_HEAD(zebra_sr_policy_instance_head
, zebra_sr_policy
);
50 RB_PROTOTYPE(zebra_sr_policy_instance_head
, zebra_sr_policy
, entry
,
51 zebra_sr_policy_instance_compare
)
53 extern struct zebra_sr_policy_instance_head zebra_sr_policy_instances
;
55 struct zebra_sr_policy
*
56 zebra_sr_policy_add(uint32_t color
, struct ipaddr
*endpoint
, char *name
);
57 void zebra_sr_policy_del(struct zebra_sr_policy
*policy
);
58 struct zebra_sr_policy
*zebra_sr_policy_find(uint32_t color
,
59 struct ipaddr
*endpoint
);
60 struct zebra_sr_policy
*zebra_sr_policy_find_by_name(char *name
);
61 int zebra_sr_policy_validate(struct zebra_sr_policy
*policy
,
62 struct zapi_srte_tunnel
*new_tunnel
);
63 int zebra_sr_policy_bsid_install(struct zebra_sr_policy
*policy
);
64 void zebra_sr_policy_bsid_uninstall(struct zebra_sr_policy
*policy
,
65 mpls_label_t old_bsid
);
66 void zebra_srte_init(void);
67 int zebra_sr_policy_label_update(mpls_label_t label
,
68 enum zebra_sr_policy_update_label_mode mode
);
74 #endif /* _ZEBRA_SRTE_H */