]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zebra_srv6.h
Merge pull request #9345 from mjstapp/fix_lib_zmq_free
[mirror_frr.git] / zebra / zebra_srv6.h
CommitLineData
6e68a084
HS
1/*
2 * Zebra SRv6 definitions
3 * Copyright (C) 2020 Hiroki Shirokura, LINE Corporation
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 _ZEBRA_SRV6_H
21#define _ZEBRA_SRV6_H
22
23#include <zebra.h>
24#include <arpa/inet.h>
25#include <netinet/in.h>
26
27#include "qobj.h"
28#include "prefix.h"
29#include <pthread.h>
30#include <plist.h>
31
32/* SRv6 instance structure. */
33struct zebra_srv6 {
34 struct list *locators;
35};
36
37/* declare hooks for the basic API, so that it can be specialized or served
38 * externally. Also declare a hook when those functions have been registered,
39 * so that any external module wanting to replace those can react
40 */
41
42DECLARE_HOOK(srv6_manager_client_connect,
43 (struct zserv *client, vrf_id_t vrf_id),
44 (client, vrf_id));
45DECLARE_HOOK(srv6_manager_client_disconnect,
46 (struct zserv *client), (client));
47DECLARE_HOOK(srv6_manager_get_chunk,
48 (struct srv6_locator **loc,
49 struct zserv *client,
50 const char *locator_name,
51 vrf_id_t vrf_id),
52 (mc, client, keep, size, base, vrf_id));
53DECLARE_HOOK(srv6_manager_release_chunk,
54 (struct zserv *client,
55 const char *locator_name,
56 vrf_id_t vrf_id),
57 (client, locator_name, vrf_id));
58
59
60extern void zebra_srv6_locator_add(struct srv6_locator *locator);
61extern void zebra_srv6_locator_delete(struct srv6_locator *locator);
62extern struct srv6_locator *zebra_srv6_locator_lookup(const char *name);
63
64extern void zebra_srv6_init(void);
65extern struct zebra_srv6 *zebra_srv6_get_default(void);
66extern bool zebra_srv6_is_enable(void);
67
4df9d859
HS
68extern void srv6_manager_client_connect_call(struct zserv *client,
69 vrf_id_t vrf_id);
6e68a084
HS
70extern void srv6_manager_get_locator_chunk_call(struct srv6_locator **loc,
71 struct zserv *client,
72 const char *locator_name,
73 vrf_id_t vrf_id);
74extern void srv6_manager_release_locator_chunk_call(struct zserv *client,
75 const char *locator_name,
76 vrf_id_t vrf_id);
77extern int srv6_manager_client_disconnect_cb(struct zserv *client);
78extern int release_daemon_srv6_locator_chunks(struct zserv *client);
79
80#endif /* _ZEBRA_SRV6_H */